@zyzgroup/core-web 0.1.58 → 0.1.60
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 +15 -15
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +1564 -1557
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +15 -15
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/Context.d.ts +8 -2
- package/types/Context.d.ts.map +1 -1
- package/types/axios.d.ts +17 -24
- package/types/axios.d.ts.map +1 -1
- package/types/file.d.ts.map +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(m,P){"use strict";function ia(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ra={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(w,g){var v=w[0],_=w[1],M=w[2],E=w[3];v+=(_&M|~_&E)+g[0]-680876936|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[1]-389564586|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[2]+606105819|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[3]-1044525330|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[4]-176418897|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[5]+1200080426|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[6]-1473231341|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[7]-45705983|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[8]+1770035416|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[9]-1958414417|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[10]-42063|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[11]-1990404162|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[12]+1804603682|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[13]-40341101|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[14]-1502002290|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[15]+1236535329|0,_=(_<<22|_>>>10)+M|0,v+=(_&E|M&~E)+g[1]-165796510|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[6]-1069501632|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[11]+643717713|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[0]-373897302|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[5]-701558691|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[10]+38016083|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[15]-660478335|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[4]-405537848|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[9]+568446438|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[14]-1019803690|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[3]-187363961|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[8]+1163531501|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[13]-1444681467|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[2]-51403784|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[7]+1735328473|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[12]-1926607734|0,_=(_<<20|_>>>12)+M|0,v+=(_^M^E)+g[5]-378558|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[8]-2022574463|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[11]+1839030562|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[14]-35309556|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[1]-1530992060|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[4]+1272893353|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[7]-155497632|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[10]-1094730640|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[13]+681279174|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[0]-358537222|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[3]-722521979|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[6]+76029189|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[9]-640364487|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[12]-421815835|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[15]+530742520|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[2]-995338651|0,_=(_<<23|_>>>9)+M|0,v+=(M^(_|~E))+g[0]-198630844|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[7]+1126891415|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[14]-1416354905|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[5]-57434055|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[12]+1700485571|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[3]-1894986606|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[10]-1051523|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[1]-2054922799|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[8]+1873313359|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[15]-30611744|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[6]-1560198380|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[13]+1309151649|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[4]-145523070|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[11]-1120210379|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[2]+718787259|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[9]-343485551|0,_=(_<<21|_>>>11)+M|0,w[0]=v+w[0]|0,w[1]=_+w[1]|0,w[2]=M+w[2]|0,w[3]=E+w[3]|0}function r(w){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=w.charCodeAt(v)+(w.charCodeAt(v+1)<<8)+(w.charCodeAt(v+2)<<16)+(w.charCodeAt(v+3)<<24);return g}function a(w){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=w[v]+(w[v+1]<<8)+(w[v+2]<<16)+(w[v+3]<<24);return g}function o(w){var g=w.length,v=[1732584193,-271733879,-1732584194,271733878],_,M,E,D,B,Y;for(_=64;_<=g;_+=64)i(v,r(w.substring(_-64,_)));for(w=w.substring(_-64),M=w.length,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<M;_+=1)E[_>>2]|=w.charCodeAt(_)<<(_%4<<3);if(E[_>>2]|=128<<(_%4<<3),_>55)for(i(v,E),_=0;_<16;_+=1)E[_]=0;return D=g*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,E[14]=B,E[15]=Y,i(v,E),v}function h(w){var g=w.length,v=[1732584193,-271733879,-1732584194,271733878],_,M,E,D,B,Y;for(_=64;_<=g;_+=64)i(v,a(w.subarray(_-64,_)));for(w=_-64<g?w.subarray(_-64):new Uint8Array(0),M=w.length,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<M;_+=1)E[_>>2]|=w[_]<<(_%4<<3);if(E[_>>2]|=128<<(_%4<<3),_>55)for(i(v,E),_=0;_<16;_+=1)E[_]=0;return D=g*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,E[14]=B,E[15]=Y,i(v,E),v}function c(w){var g="",v;for(v=0;v<4;v+=1)g+=s[w>>v*8+4&15]+s[w>>v*8&15];return g}function l(w){var g;for(g=0;g<w.length;g+=1)w[g]=c(w[g]);return w.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(g,v){return g=g|0||0,g<0?Math.max(g+v,0):Math.min(g,v)}ArrayBuffer.prototype.slice=function(g,v){var _=this.byteLength,M=w(g,_),E=_,D,B,Y,V;return v!==e&&(E=w(v,_)),M>E?new ArrayBuffer(0):(D=E-M,B=new ArrayBuffer(D),Y=new Uint8Array(B),V=new Uint8Array(this,M,D),Y.set(V),B)}}();function u(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function d(w,g){var v=w.length,_=new ArrayBuffer(v),M=new Uint8Array(_),E;for(E=0;E<v;E+=1)M[E]=w.charCodeAt(E);return g?M:_}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,g,v){var _=new Uint8Array(w.byteLength+g.byteLength);return _.set(new Uint8Array(w)),_.set(new Uint8Array(g),w.byteLength),v?_:_.buffer}function x(w){var g=[],v=w.length,_;for(_=0;_<v-1;_+=2)g.push(parseInt(w.substr(_,2),16));return String.fromCharCode.apply(String,g)}function b(){this.reset()}return b.prototype.append=function(w){return this.appendBinary(u(w)),this},b.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var g=this._buff.length,v;for(v=64;v<=g;v+=64)i(this._hash,r(this._buff.substring(v-64,v)));return this._buff=this._buff.substring(v-64),this},b.prototype.end=function(w){var g=this._buff,v=g.length,_,M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E;for(_=0;_<v;_+=1)M[_>>2]|=g.charCodeAt(_)<<(_%4<<3);return this._finish(M,v),E=l(this._hash),w&&(E=x(E)),this.reset(),E},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(w,g){var v=g,_,M,E;if(w[v>>2]|=128<<(v%4<<3),v>55)for(i(this._hash,w),v=0;v<16;v+=1)w[v]=0;_=this._length*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),M=parseInt(_[2],16),E=parseInt(_[1],16)||0,w[14]=M,w[15]=E,i(this._hash,w)},b.hash=function(w,g){return b.hashBinary(u(w),g)},b.hashBinary=function(w,g){var v=o(w),_=l(v);return g?x(_):_},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(w){var g=p(this._buff.buffer,w,!0),v=g.length,_;for(this._length+=w.byteLength,_=64;_<=v;_+=64)i(this._hash,a(g.subarray(_-64,_)));return this._buff=_-64<v?new Uint8Array(g.buffer.slice(_-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(w){var g=this._buff,v=g.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M,E;for(M=0;M<v;M+=1)_[M>>2]|=g[M]<<(M%4<<3);return this._finish(_,v),E=l(this._hash),w&&(E=x(E)),this.reset(),E},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var w=b.prototype.getState.call(this);return w.buff=f(w.buff),w},b.ArrayBuffer.prototype.setState=function(w){return w.buff=d(w.buff,!0),b.prototype.setState.call(this,w)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(w,g){var v=h(new Uint8Array(w)),_=l(v);return g?x(_):_},b})})(ra);var Kc=ra.exports;const Qc=ia(Kc);function aa(n,t){return function(){return n.apply(t,arguments)}}const{toString:tl}=Object.prototype,{getPrototypeOf:Yn}=Object,Bs=(n=>t=>{const e=tl.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Ut=n=>(n=n.toLowerCase(),t=>Bs(t)===n),Ys=n=>t=>typeof t===n,{isArray:Ve}=Array,is=Ys("undefined");function el(n){return n!==null&&!is(n)&&n.constructor!==null&&!is(n.constructor)&&kt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const oa=Ut("ArrayBuffer");function sl(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&oa(n.buffer),t}const nl=Ys("string"),kt=Ys("function"),ha=Ys("number"),Fs=n=>n!==null&&typeof n=="object",il=n=>n===!0||n===!1,Xs=n=>{if(Bs(n)!=="object")return!1;const t=Yn(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},rl=Ut("Date"),al=Ut("File"),ol=Ut("Blob"),hl=Ut("FileList"),cl=n=>Fs(n)&&kt(n.pipe),ll=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||kt(n.append)&&((t=Bs(n))==="formdata"||t==="object"&&kt(n.toString)&&n.toString()==="[object FormData]"))},ul=Ut("URLSearchParams"),[fl,dl,ml,pl]=["ReadableStream","Request","Response","Headers"].map(Ut),gl=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rs(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),Ve(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 ca(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 Se=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),la=n=>!is(n)&&n!==Se;function Fn(){const{caseless:n}=la(this)&&this||{},t={},e=(s,i)=>{const r=n&&ca(t,i)||i;Xs(t[r])&&Xs(s)?t[r]=Fn(t[r],s):Xs(s)?t[r]=Fn({},s):Ve(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&rs(arguments[s],e);return t}const yl=(n,t,e,{allOwnKeys:s}={})=>(rs(t,(i,r)=>{e&&kt(i)?n[r]=aa(i,e):n[r]=i},{allOwnKeys:s}),n),wl=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),xl=(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)},bl=(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&&Yn(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},vl=(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},_l=n=>{if(!n)return null;if(Ve(n))return n;let t=n.length;if(!ha(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Sl=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Yn(Uint8Array)),Tl=(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])}},El=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Pl=Ut("HTMLFormElement"),Ml=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),ua=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Cl=Ut("RegExp"),fa=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};rs(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Al=n=>{fa(n,(t,e)=>{if(kt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(kt(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+"'")})}})},Il=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return Ve(n)?s(n):s(String(n).split(t)),e},kl=()=>{},Dl=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Rl(n){return!!(n&&kt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Ll=n=>{const t=new Array(10),e=(s,i)=>{if(Fs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=Ve(s)?[]:{};return rs(s,(a,o)=>{const h=e(a,i+1);!is(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Ol=Ut("AsyncFunction"),zl=n=>n&&(Fs(n)||kt(n))&&kt(n.then)&&kt(n.catch),da=((n,t)=>n?setImmediate:t?((e,s)=>(Se.addEventListener("message",({source:i,data:r})=>{i===Se&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),Se.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",kt(Se.postMessage)),Nl=typeof queueMicrotask<"u"?queueMicrotask.bind(Se):typeof process<"u"&&process.nextTick||da,I={isArray:Ve,isArrayBuffer:oa,isBuffer:el,isFormData:ll,isArrayBufferView:sl,isString:nl,isNumber:ha,isBoolean:il,isObject:Fs,isPlainObject:Xs,isReadableStream:fl,isRequest:dl,isResponse:ml,isHeaders:pl,isUndefined:is,isDate:rl,isFile:al,isBlob:ol,isRegExp:Cl,isFunction:kt,isStream:cl,isURLSearchParams:ul,isTypedArray:Sl,isFileList:hl,forEach:rs,merge:Fn,extend:yl,trim:gl,stripBOM:wl,inherits:xl,toFlatObject:bl,kindOf:Bs,kindOfTest:Ut,endsWith:vl,toArray:_l,forEachEntry:Tl,matchAll:El,isHTMLForm:Pl,hasOwnProperty:ua,hasOwnProp:ua,reduceDescriptors:fa,freezeMethods:Al,toObjectSet:Il,toCamelCase:Ml,noop:kl,toFiniteNumber:Dl,findKey:ca,global:Se,isContextDefined:la,isSpecCompliantForm:Rl,toJSONObject:Ll,isAsyncFn:Ol,isThenable:zl,setImmediate:da,asap:Nl};function F(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,this.status=i.status?i.status:null)}I.inherits(F,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:I.toJSONObject(this.config),code:this.code,status:this.status}}});const ma=F.prototype,pa={};["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=>{pa[n]={value:n}}),Object.defineProperties(F,pa),Object.defineProperty(ma,"isAxiosError",{value:!0}),F.from=(n,t,e,s,i,r)=>{const a=Object.create(ma);return I.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),F.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const Bl=null;function Xn(n){return I.isPlainObject(n)||I.isArray(n)}function ga(n){return I.endsWith(n,"[]")?n.slice(0,-2):n}function ya(n,t,e){return n?n.concat(t).map(function(i,r){return i=ga(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Yl(n){return I.isArray(n)&&!n.some(Xn)}const Fl=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Us(n,t,e){if(!I.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=I.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!I.isUndefined(b[x])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(I.isDate(p))return p.toISOString();if(!h&&I.isBlob(p))throw new F("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(p)||I.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,x,b){let w=p;if(p&&!b&&typeof p=="object"){if(I.endsWith(x,"{}"))x=s?x:x.slice(0,-2),p=JSON.stringify(p);else if(I.isArray(p)&&Yl(p)||(I.isFileList(p)||I.endsWith(x,"[]"))&&(w=I.toArray(p)))return x=ga(x),w.forEach(function(v,_){!(I.isUndefined(v)||v===null)&&t.append(a===!0?ya([x],_,r):a===null?x:x+"[]",c(v))}),!1}return Xn(p)?!0:(t.append(ya(b,x,r),c(p)),!1)}const u=[],d=Object.assign(Fl,{defaultVisitor:l,convertValue:c,isVisitable:Xn});function f(p,x){if(!I.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(p),I.forEach(p,function(w,g){(!(I.isUndefined(w)||w===null)&&i.call(t,w,I.isString(g)?g.trim():g,x,d))===!0&&f(w,x?x.concat(g):[g])}),u.pop()}}if(!I.isObject(n))throw new TypeError("data must be an object");return f(n),t}function wa(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Un(n,t){this._pairs=[],n&&Us(n,this,t)}const xa=Un.prototype;xa.append=function(t,e){this._pairs.push([t,e])},xa.toString=function(t){const e=t?function(s){return t.call(this,s,wa)}:wa;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Xl(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ba(n,t,e){if(!t)return n;const s=e&&e.encode||Xl;I.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=I.isURLSearchParams(t)?t.toString():new Un(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Ul{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){I.forEach(this.handlers,function(s){s!==null&&t(s)})}}const va=Ul,_a={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vl={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Un,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Vn=typeof window<"u"&&typeof document<"u",$n=typeof navigator=="object"&&navigator||void 0,$l=Vn&&(!$n||["ReactNative","NativeScript","NS"].indexOf($n.product)<0),Gl=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ql=Vn&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Vn,hasStandardBrowserEnv:$l,hasStandardBrowserWebWorkerEnv:Gl,navigator:$n,origin:ql},Symbol.toStringTag,{value:"Module"})),...Vl};function jl(n,t){return Us(n,new yt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return yt.isNode&&I.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Hl(n){return I.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wl(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 Sa(n){function t(e,s,i,r){let a=e[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&I.isArray(i)?i.length:a,h?(I.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!I.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&I.isArray(i[a])&&(i[a]=Wl(i[a])),!o)}if(I.isFormData(n)&&I.isFunction(n.entries)){const e={};return I.forEachEntry(n,(s,i)=>{t(Hl(s),i,e,0)}),e}return null}function Jl(n,t,e){if(I.isString(n))try{return(t||JSON.parse)(n),I.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Gn={transitional:_a,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=I.isObject(t);if(r&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(Sa(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.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 jl(t,this.formSerializer).toString();if((o=I.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Us(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Jl(t)):t}],transformResponse:[function(t){const e=this.transitional||Gn.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.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"?F.from(o,F.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:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],n=>{Gn.headers[n]={}});const qn=Gn,Zl=I.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"]),Kl=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
2
|
-
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&
|
|
3
|
-
`)}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[Ta]=this[Ta]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=as(a);s[o]||(su(i,a),s[o]=!0)}return I.isArray(t)?t.forEach(r):r(t),this}}$s.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors($s.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),I.freezeMethods($s);const Vt=$s;function Hn(n,t){const e=this||qn,s=t||e,i=Vt.from(s.headers);let r=s.data;return I.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Ea(n){return!!(n&&n.__CANCEL__)}function $e(n,t,e){F.call(this,n??"canceled",F.ERR_CANCELED,t,e),this.name="CanceledError"}I.inherits($e,F,{__CANCEL__:!0});function Pa(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new F("Request failed with status code "+e.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function nu(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function iu(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 u=r,d=0;for(;u!==i;)d+=e[u++],u=u%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function ru(n,t){let e=0,s=1e3/t,i,r;const a=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),u=l-e;u>=s?a(c,l):(i=c,r||(r=setTimeout(()=>{r=null,a(i)},s-u)))},()=>i&&a(i)]}const Gs=(n,t,e=3)=>{let s=0;const i=iu(50,250);return ru(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,h=a-s,c=i(h),l=a<=o;s=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:h,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};n(u)},e)},Ma=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},Ca=n=>(...t)=>I.asap(()=>n(...t)),au=yt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,yt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,ou=yt.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const a=[n+"="+encodeURIComponent(t)];I.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),I.isString(s)&&a.push("path="+s),I.isString(i)&&a.push("domain="+i),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hu(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function cu(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function Aa(n,t,e){let s=!hu(t);return n&&(s||e==!1)?cu(n,t):t}const Ia=n=>n instanceof Vt?{...n}:n;function Te(n,t){t=t||{};const e={};function s(c,l,u,d){return I.isPlainObject(c)&&I.isPlainObject(l)?I.merge.call({caseless:d},c,l):I.isPlainObject(l)?I.merge({},l):I.isArray(l)?l.slice():l}function i(c,l,u,d){if(I.isUndefined(l)){if(!I.isUndefined(c))return s(void 0,c,u,d)}else return s(c,l,u,d)}function r(c,l){if(!I.isUndefined(l))return s(void 0,l)}function a(c,l){if(I.isUndefined(l)){if(!I.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,u){if(u in t)return s(c,l);if(u 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,withXSRFToken: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,u)=>i(Ia(c),Ia(l),u,!0)};return I.forEach(Object.keys(Object.assign({},n,t)),function(l){const u=h[l]||i,d=u(n[l],t[l],l);I.isUndefined(d)&&u!==o||(e[l]=d)}),e}const ka=n=>{const t=Te({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=Vt.from(a),t.url=ba(Aa(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let h;if(I.isFormData(e)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...l].join("; "))}}if(yt.hasStandardBrowserEnv&&(s&&I.isFunction(s)&&(s=s(t)),s||s!==!1&&au(t.url))){const c=i&&r&&ou.read(r);c&&a.set(i,c)}return t},lu=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=ka(n);let r=i.data;const a=Vt.from(i.headers).normalize();let{responseType:o,onUploadProgress:h,onDownloadProgress:c}=i,l,u,d,f,p;function x(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function w(){if(!b)return;const v=Vt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:v,config:n,request:b};Pa(function(D){e(D),x()},function(D){s(D),x()},M),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(s(new F("Request aborted",F.ECONNABORTED,n,b)),b=null)},b.onerror=function(){s(new F("Network Error",F.ERR_NETWORK,n,b)),b=null},b.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const M=i.transitional||_a;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),s(new F(_,M.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,n,b)),b=null},r===void 0&&a.setContentType(null),"setRequestHeader"in b&&I.forEach(a.toJSON(),function(_,M){b.setRequestHeader(M,_)}),I.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),o&&o!=="json"&&(b.responseType=i.responseType),c&&([d,p]=Gs(c,!0),b.addEventListener("progress",d)),h&&b.upload&&([u,f]=Gs(h),b.upload.addEventListener("progress",u),b.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(l=v=>{b&&(s(!v||v.type?new $e(null,n,b):v),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const g=nu(i.url);if(g&&yt.protocols.indexOf(g)===-1){s(new F("Unsupported protocol "+g+":",F.ERR_BAD_REQUEST,n));return}b.send(r||null)})},uu=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,o();const l=c instanceof Error?c:this.reason;s.abort(l instanceof F?l:new $e(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,r(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const o=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>I.asap(o),h}},fu=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},du=async function*(n,t){for await(const e of mu(n))yield*fu(e,t)},mu=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},Da=(n,t,e,s)=>{const i=du(n,t);let r=0,a,o=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){o(),h.close();return}let u=l.byteLength;if(e){let d=r+=u;e(d)}h.enqueue(new Uint8Array(l))}catch(c){throw o(c),c}},cancel(h){return o(h),i.return()}},{highWaterMark:2})},qs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ra=qs&&typeof ReadableStream=="function",pu=qs&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),La=(n,...t)=>{try{return!!n(...t)}catch{return!1}},gu=Ra&&La(()=>{let n=!1;const t=new Request(yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Oa=64*1024,Wn=Ra&&La(()=>I.isReadableStream(new Response("").body)),js={stream:Wn&&(n=>n.body)};qs&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!js[t]&&(js[t]=I.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,s)})})})(new Response);const yu=async n=>{if(n==null)return 0;if(I.isBlob(n))return n.size;if(I.isSpecCompliantForm(n))return(await new Request(yt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(I.isArrayBufferView(n)||I.isArrayBuffer(n))return n.byteLength;if(I.isURLSearchParams(n)&&(n=n+""),I.isString(n))return(await pu(n)).byteLength},wu=async(n,t)=>{const e=I.toFiniteNumber(n.getContentLength());return e??yu(t)},Jn={http:Bl,xhr:lu,fetch:qs&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:d}=ka(n);c=c?(c+"").toLowerCase():"text";let f=uu([i,r&&r.toAbortSignal()],a),p;const x=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let b;try{if(h&&gu&&e!=="get"&&e!=="head"&&(b=await wu(l,s))!==0){let M=new Request(t,{method:"POST",body:s,duplex:"half"}),E;if(I.isFormData(s)&&(E=M.headers.get("content-type"))&&l.setContentType(E),M.body){const[D,B]=Ma(b,Gs(Ca(h)));s=Da(M.body,Oa,D,B)}}I.isString(u)||(u=u?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...d,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:w?u:void 0});let g=await fetch(p);const v=Wn&&(c==="stream"||c==="response");if(Wn&&(o||v&&x)){const M={};["status","statusText","headers"].forEach(Y=>{M[Y]=g[Y]});const E=I.toFiniteNumber(g.headers.get("content-length")),[D,B]=o&&Ma(E,Gs(Ca(o),!0))||[];g=new Response(Da(g.body,Oa,D,()=>{B&&B(),x&&x()}),M)}c=c||"text";let _=await js[I.findKey(js,c)||"text"](g,n);return!v&&x&&x(),await new Promise((M,E)=>{Pa(M,E,{data:_,headers:Vt.from(g.headers),status:g.status,statusText:g.statusText,config:n,request:p})})}catch(w){throw x&&x(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,n,p),{cause:w.cause||w}):F.from(w,w&&w.code,n,p)}})};I.forEach(Jn,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const za=n=>`- ${n}`,xu=n=>I.isFunction(n)||n===null||n===!1,Na={getAdapter:n=>{n=I.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,!xu(e)&&(s=Jn[(a=String(e)).toLowerCase()],s===void 0))throw new F(`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 :
|
|
4
|
-
`+r.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Te(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Ws.assertOptions(s,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1),i!=null&&(I.isFunction(i)?e.paramsSerializer={serialize:i}:Ws.assertOptions(i,{encode:Wt.function,serialize:Wt.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ws.assertOptions(e,{baseUrl:Wt.spelling("baseURL"),withXsrfToken:Wt.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&I.merge(r.common,r[e.method]);r&&I.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Vt.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,u=0,d;if(!h){const p=[Ba.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),d=p.length,l=Promise.resolve(e);u<d;)l=l.then(p[u++],p[u++]);return l}d=o.length;let f=e;for(u=0;u<d;){const p=o[u++],x=o[u++];try{f=p(f)}catch(b){x.call(this,b);break}}try{l=Ba.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=Te(this.defaults,t);const e=Aa(t.baseURL,t.url,t.allowAbsoluteUrls);return ba(e,t.params,t.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(t){Js.prototype[t]=function(e,s){return this.request(Te(s||{},{method:t,url:e,data:(s||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(Te(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Js.prototype[t]=e(),Js.prototype[t+"Form"]=e(!0)});const Zs=Js;class Kn{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 $e(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)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Kn(function(i){t=i}),cancel:t}}}const vu=Kn;function _u(n){return function(e){return n.apply(null,e)}}function Su(n){return I.isObject(n)&&n.isAxiosError===!0}const Qn={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(Qn).forEach(([n,t])=>{Qn[t]=n});const Tu=Qn;function Xa(n){const t=new Zs(n),e=aa(Zs.prototype.request,t);return I.extend(e,Zs.prototype,t,{allOwnKeys:!0}),I.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Xa(Te(n,i))},e}const at=Xa(qn);at.Axios=Zs,at.CanceledError=$e,at.CancelToken=vu,at.isCancel=Ea,at.VERSION=Ya,at.toFormData=Us,at.AxiosError=F,at.Cancel=at.CanceledError,at.all=function(t){return Promise.all(t)},at.spread=_u,at.isAxiosError=Su,at.mergeConfig=Te,at.AxiosHeaders=Vt,at.formToJSON=n=>Sa(I.isHTMLForm(n)?new FormData(n):n),at.getAdapter=Na.getAdapter,at.HttpStatusCode=Tu,at.default=at;const Eu=at,Ua=window.crypto.subtle;Ua||console.warn("Crypto API not supported");async function Va(n,t="SHA-256"){const e=await Ua.digest(t,P.getUint8ArrayFromString(n));return P.getStringFromArrayBuffer(e)}async function $a(n,t="SHA-256"){const e=JSON.stringify(P.getSortedObjectString(n));return Va(e,t)}class Ga{instance;constructor(t){this.instance=Eu.create(t);const e=new qa;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=>s?s.status==200?(await e.confirmRequest(s.config),s):Promise.reject(s):Promise.reject("axios response is undefined! maybe config.interceptor is NOT set return value!"),async s=>Promise.reject(s))}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 postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}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 qa{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await $a({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()}}const ti=n=>new XMLSerializer().serializeToString(n),Pu=(n,t="text/html")=>new DOMParser().parseFromString(n,t),ei=(n,t=P.MIMEEnum.SVG,e=P.EncodeEnum.utf8)=>P.toBlob(ti(n),t,e);async function si(n=["*"],t){let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function os(n,t=P.ReadInBrowserEnum.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 P.ReadInBrowserEnum.dataURL:r.readAsDataURL(n);break;case P.ReadInBrowserEnum.binaryString:r.readAsBinaryString(n);break;case P.ReadInBrowserEnum.arraybuffer:r.readAsArrayBuffer(n);break;case P.ReadInBrowserEnum.text:default:r.readAsText(n)}})}async function Mu(n){const t=await os(n,P.ReadInBrowserEnum.arraybuffer);return P.getFileTypeFromArrayBuffer(t)}const Cu=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function Au(n){switch(n.toLowerCase()){case"jpg":case"jpeg":return P.MIMEEnum.JPEG;case"gif":return P.MIMEEnum.GIF;case"svg":return P.MIMEEnum.SVG;case"pdf":return P.MIMEEnum.PDF;case"png":default:return P.MIMEEnum.PNG}}function ja(n,t,e,s,i,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)ja(n,t,e,s,i,a,Math.min(a+i,s.size));else return n(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function Ha(n,t=1048576){return await new Promise((e,s)=>ja(e,s,new Qc.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class Iu{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Ga({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Ha(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{P.increaseTime(this.time,1),this.onTime?.(P.formatTimeOverflow(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var Wa={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
1
|
+
var ZYZGroupCoreWeb=function(m,P){"use strict";function ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var aa={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(w,g){var v=w[0],_=w[1],M=w[2],E=w[3];v+=(_&M|~_&E)+g[0]-680876936|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[1]-389564586|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[2]+606105819|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[3]-1044525330|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[4]-176418897|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[5]+1200080426|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[6]-1473231341|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[7]-45705983|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[8]+1770035416|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[9]-1958414417|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[10]-42063|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[11]-1990404162|0,_=(_<<22|_>>>10)+M|0,v+=(_&M|~_&E)+g[12]+1804603682|0,v=(v<<7|v>>>25)+_|0,E+=(v&_|~v&M)+g[13]-40341101|0,E=(E<<12|E>>>20)+v|0,M+=(E&v|~E&_)+g[14]-1502002290|0,M=(M<<17|M>>>15)+E|0,_+=(M&E|~M&v)+g[15]+1236535329|0,_=(_<<22|_>>>10)+M|0,v+=(_&E|M&~E)+g[1]-165796510|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[6]-1069501632|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[11]+643717713|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[0]-373897302|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[5]-701558691|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[10]+38016083|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[15]-660478335|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[4]-405537848|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[9]+568446438|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[14]-1019803690|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[3]-187363961|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[8]+1163531501|0,_=(_<<20|_>>>12)+M|0,v+=(_&E|M&~E)+g[13]-1444681467|0,v=(v<<5|v>>>27)+_|0,E+=(v&M|_&~M)+g[2]-51403784|0,E=(E<<9|E>>>23)+v|0,M+=(E&_|v&~_)+g[7]+1735328473|0,M=(M<<14|M>>>18)+E|0,_+=(M&v|E&~v)+g[12]-1926607734|0,_=(_<<20|_>>>12)+M|0,v+=(_^M^E)+g[5]-378558|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[8]-2022574463|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[11]+1839030562|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[14]-35309556|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[1]-1530992060|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[4]+1272893353|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[7]-155497632|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[10]-1094730640|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[13]+681279174|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[0]-358537222|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[3]-722521979|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[6]+76029189|0,_=(_<<23|_>>>9)+M|0,v+=(_^M^E)+g[9]-640364487|0,v=(v<<4|v>>>28)+_|0,E+=(v^_^M)+g[12]-421815835|0,E=(E<<11|E>>>21)+v|0,M+=(E^v^_)+g[15]+530742520|0,M=(M<<16|M>>>16)+E|0,_+=(M^E^v)+g[2]-995338651|0,_=(_<<23|_>>>9)+M|0,v+=(M^(_|~E))+g[0]-198630844|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[7]+1126891415|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[14]-1416354905|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[5]-57434055|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[12]+1700485571|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[3]-1894986606|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[10]-1051523|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[1]-2054922799|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[8]+1873313359|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[15]-30611744|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[6]-1560198380|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[13]+1309151649|0,_=(_<<21|_>>>11)+M|0,v+=(M^(_|~E))+g[4]-145523070|0,v=(v<<6|v>>>26)+_|0,E+=(_^(v|~M))+g[11]-1120210379|0,E=(E<<10|E>>>22)+v|0,M+=(v^(E|~_))+g[2]+718787259|0,M=(M<<15|M>>>17)+E|0,_+=(E^(M|~v))+g[9]-343485551|0,_=(_<<21|_>>>11)+M|0,w[0]=v+w[0]|0,w[1]=_+w[1]|0,w[2]=M+w[2]|0,w[3]=E+w[3]|0}function r(w){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=w.charCodeAt(v)+(w.charCodeAt(v+1)<<8)+(w.charCodeAt(v+2)<<16)+(w.charCodeAt(v+3)<<24);return g}function a(w){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=w[v]+(w[v+1]<<8)+(w[v+2]<<16)+(w[v+3]<<24);return g}function o(w){var g=w.length,v=[1732584193,-271733879,-1732584194,271733878],_,M,E,D,B,Y;for(_=64;_<=g;_+=64)i(v,r(w.substring(_-64,_)));for(w=w.substring(_-64),M=w.length,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<M;_+=1)E[_>>2]|=w.charCodeAt(_)<<(_%4<<3);if(E[_>>2]|=128<<(_%4<<3),_>55)for(i(v,E),_=0;_<16;_+=1)E[_]=0;return D=g*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,E[14]=B,E[15]=Y,i(v,E),v}function h(w){var g=w.length,v=[1732584193,-271733879,-1732584194,271733878],_,M,E,D,B,Y;for(_=64;_<=g;_+=64)i(v,a(w.subarray(_-64,_)));for(w=_-64<g?w.subarray(_-64):new Uint8Array(0),M=w.length,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<M;_+=1)E[_>>2]|=w[_]<<(_%4<<3);if(E[_>>2]|=128<<(_%4<<3),_>55)for(i(v,E),_=0;_<16;_+=1)E[_]=0;return D=g*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,E[14]=B,E[15]=Y,i(v,E),v}function c(w){var g="",v;for(v=0;v<4;v+=1)g+=s[w>>v*8+4&15]+s[w>>v*8&15];return g}function l(w){var g;for(g=0;g<w.length;g+=1)w[g]=c(w[g]);return w.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(g,v){return g=g|0||0,g<0?Math.max(g+v,0):Math.min(g,v)}ArrayBuffer.prototype.slice=function(g,v){var _=this.byteLength,M=w(g,_),E=_,D,B,Y,V;return v!==e&&(E=w(v,_)),M>E?new ArrayBuffer(0):(D=E-M,B=new ArrayBuffer(D),Y=new Uint8Array(B),V=new Uint8Array(this,M,D),Y.set(V),B)}}();function u(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function d(w,g){var v=w.length,_=new ArrayBuffer(v),M=new Uint8Array(_),E;for(E=0;E<v;E+=1)M[E]=w.charCodeAt(E);return g?M:_}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,g,v){var _=new Uint8Array(w.byteLength+g.byteLength);return _.set(new Uint8Array(w)),_.set(new Uint8Array(g),w.byteLength),v?_:_.buffer}function x(w){var g=[],v=w.length,_;for(_=0;_<v-1;_+=2)g.push(parseInt(w.substr(_,2),16));return String.fromCharCode.apply(String,g)}function b(){this.reset()}return b.prototype.append=function(w){return this.appendBinary(u(w)),this},b.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var g=this._buff.length,v;for(v=64;v<=g;v+=64)i(this._hash,r(this._buff.substring(v-64,v)));return this._buff=this._buff.substring(v-64),this},b.prototype.end=function(w){var g=this._buff,v=g.length,_,M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E;for(_=0;_<v;_+=1)M[_>>2]|=g.charCodeAt(_)<<(_%4<<3);return this._finish(M,v),E=l(this._hash),w&&(E=x(E)),this.reset(),E},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(w,g){var v=g,_,M,E;if(w[v>>2]|=128<<(v%4<<3),v>55)for(i(this._hash,w),v=0;v<16;v+=1)w[v]=0;_=this._length*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),M=parseInt(_[2],16),E=parseInt(_[1],16)||0,w[14]=M,w[15]=E,i(this._hash,w)},b.hash=function(w,g){return b.hashBinary(u(w),g)},b.hashBinary=function(w,g){var v=o(w),_=l(v);return g?x(_):_},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(w){var g=p(this._buff.buffer,w,!0),v=g.length,_;for(this._length+=w.byteLength,_=64;_<=v;_+=64)i(this._hash,a(g.subarray(_-64,_)));return this._buff=_-64<v?new Uint8Array(g.buffer.slice(_-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(w){var g=this._buff,v=g.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M,E;for(M=0;M<v;M+=1)_[M>>2]|=g[M]<<(M%4<<3);return this._finish(_,v),E=l(this._hash),w&&(E=x(E)),this.reset(),E},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var w=b.prototype.getState.call(this);return w.buff=f(w.buff),w},b.ArrayBuffer.prototype.setState=function(w){return w.buff=d(w.buff,!0),b.prototype.setState.call(this,w)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(w,g){var v=h(new Uint8Array(w)),_=l(v);return g?x(_):_},b})})(aa);var Jc=aa.exports;const Zc=ra(Jc);function oa(n,t){return function(){return n.apply(t,arguments)}}const{toString:Kc}=Object.prototype,{getPrototypeOf:Yn}=Object,Bs=(n=>t=>{const e=Kc.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Ut=n=>(n=n.toLowerCase(),t=>Bs(t)===n),Ys=n=>t=>typeof t===n,{isArray:Ve}=Array,is=Ys("undefined");function Qc(n){return n!==null&&!is(n)&&n.constructor!==null&&!is(n.constructor)&&kt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const ha=Ut("ArrayBuffer");function tl(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&ha(n.buffer),t}const el=Ys("string"),kt=Ys("function"),ca=Ys("number"),Fs=n=>n!==null&&typeof n=="object",sl=n=>n===!0||n===!1,Xs=n=>{if(Bs(n)!=="object")return!1;const t=Yn(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},nl=Ut("Date"),il=Ut("File"),rl=Ut("Blob"),al=Ut("FileList"),ol=n=>Fs(n)&&kt(n.pipe),hl=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||kt(n.append)&&((t=Bs(n))==="formdata"||t==="object"&&kt(n.toString)&&n.toString()==="[object FormData]"))},cl=Ut("URLSearchParams"),[ll,ul,fl,dl]=["ReadableStream","Request","Response","Headers"].map(Ut),ml=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rs(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),Ve(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 la(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 Se=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ua=n=>!is(n)&&n!==Se;function Fn(){const{caseless:n}=ua(this)&&this||{},t={},e=(s,i)=>{const r=n&&la(t,i)||i;Xs(t[r])&&Xs(s)?t[r]=Fn(t[r],s):Xs(s)?t[r]=Fn({},s):Ve(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&rs(arguments[s],e);return t}const pl=(n,t,e,{allOwnKeys:s}={})=>(rs(t,(i,r)=>{e&&kt(i)?n[r]=oa(i,e):n[r]=i},{allOwnKeys:s}),n),gl=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),yl=(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)},wl=(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&&Yn(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},xl=(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},bl=n=>{if(!n)return null;if(Ve(n))return n;let t=n.length;if(!ca(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},vl=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Yn(Uint8Array)),_l=(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])}},Sl=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Tl=Ut("HTMLFormElement"),El=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),fa=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Pl=Ut("RegExp"),da=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};rs(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Ml=n=>{da(n,(t,e)=>{if(kt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(kt(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+"'")})}})},Cl=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return Ve(n)?s(n):s(String(n).split(t)),e},Al=()=>{},Il=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function kl(n){return!!(n&&kt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Dl=n=>{const t=new Array(10),e=(s,i)=>{if(Fs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=Ve(s)?[]:{};return rs(s,(a,o)=>{const h=e(a,i+1);!is(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Rl=Ut("AsyncFunction"),Ll=n=>n&&(Fs(n)||kt(n))&&kt(n.then)&&kt(n.catch),ma=((n,t)=>n?setImmediate:t?((e,s)=>(Se.addEventListener("message",({source:i,data:r})=>{i===Se&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),Se.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",kt(Se.postMessage)),Ol=typeof queueMicrotask<"u"?queueMicrotask.bind(Se):typeof process<"u"&&process.nextTick||ma,I={isArray:Ve,isArrayBuffer:ha,isBuffer:Qc,isFormData:hl,isArrayBufferView:tl,isString:el,isNumber:ca,isBoolean:sl,isObject:Fs,isPlainObject:Xs,isReadableStream:ll,isRequest:ul,isResponse:fl,isHeaders:dl,isUndefined:is,isDate:nl,isFile:il,isBlob:rl,isRegExp:Pl,isFunction:kt,isStream:ol,isURLSearchParams:cl,isTypedArray:vl,isFileList:al,forEach:rs,merge:Fn,extend:pl,trim:ml,stripBOM:gl,inherits:yl,toFlatObject:wl,kindOf:Bs,kindOfTest:Ut,endsWith:xl,toArray:bl,forEachEntry:_l,matchAll:Sl,isHTMLForm:Tl,hasOwnProperty:fa,hasOwnProp:fa,reduceDescriptors:da,freezeMethods:Ml,toObjectSet:Cl,toCamelCase:El,noop:Al,toFiniteNumber:Il,findKey:la,global:Se,isContextDefined:ua,isSpecCompliantForm:kl,toJSONObject:Dl,isAsyncFn:Rl,isThenable:Ll,setImmediate:ma,asap:Ol};function F(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,this.status=i.status?i.status:null)}I.inherits(F,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:I.toJSONObject(this.config),code:this.code,status:this.status}}});const pa=F.prototype,ga={};["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=>{ga[n]={value:n}}),Object.defineProperties(F,ga),Object.defineProperty(pa,"isAxiosError",{value:!0}),F.from=(n,t,e,s,i,r)=>{const a=Object.create(pa);return I.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),F.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const zl=null;function Xn(n){return I.isPlainObject(n)||I.isArray(n)}function ya(n){return I.endsWith(n,"[]")?n.slice(0,-2):n}function wa(n,t,e){return n?n.concat(t).map(function(i,r){return i=ya(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Nl(n){return I.isArray(n)&&!n.some(Xn)}const Bl=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Us(n,t,e){if(!I.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=I.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!I.isUndefined(b[x])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(I.isDate(p))return p.toISOString();if(!h&&I.isBlob(p))throw new F("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(p)||I.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,x,b){let w=p;if(p&&!b&&typeof p=="object"){if(I.endsWith(x,"{}"))x=s?x:x.slice(0,-2),p=JSON.stringify(p);else if(I.isArray(p)&&Nl(p)||(I.isFileList(p)||I.endsWith(x,"[]"))&&(w=I.toArray(p)))return x=ya(x),w.forEach(function(v,_){!(I.isUndefined(v)||v===null)&&t.append(a===!0?wa([x],_,r):a===null?x:x+"[]",c(v))}),!1}return Xn(p)?!0:(t.append(wa(b,x,r),c(p)),!1)}const u=[],d=Object.assign(Bl,{defaultVisitor:l,convertValue:c,isVisitable:Xn});function f(p,x){if(!I.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(p),I.forEach(p,function(w,g){(!(I.isUndefined(w)||w===null)&&i.call(t,w,I.isString(g)?g.trim():g,x,d))===!0&&f(w,x?x.concat(g):[g])}),u.pop()}}if(!I.isObject(n))throw new TypeError("data must be an object");return f(n),t}function xa(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Un(n,t){this._pairs=[],n&&Us(n,this,t)}const ba=Un.prototype;ba.append=function(t,e){this._pairs.push([t,e])},ba.toString=function(t){const e=t?function(s){return t.call(this,s,xa)}:xa;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Yl(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function va(n,t,e){if(!t)return n;const s=e&&e.encode||Yl;I.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=I.isURLSearchParams(t)?t.toString():new Un(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Fl{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){I.forEach(this.handlers,function(s){s!==null&&t(s)})}}const _a=Fl,Sa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xl={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Un,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Vn=typeof window<"u"&&typeof document<"u",$n=typeof navigator=="object"&&navigator||void 0,Ul=Vn&&(!$n||["ReactNative","NativeScript","NS"].indexOf($n.product)<0),Vl=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),$l=Vn&&window.location.href||"http://localhost",yt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Vn,hasStandardBrowserEnv:Ul,hasStandardBrowserWebWorkerEnv:Vl,navigator:$n,origin:$l},Symbol.toStringTag,{value:"Module"})),...Xl};function Gl(n,t){return Us(n,new yt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return yt.isNode&&I.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function ql(n){return I.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function jl(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 Ta(n){function t(e,s,i,r){let a=e[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&I.isArray(i)?i.length:a,h?(I.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!I.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&I.isArray(i[a])&&(i[a]=jl(i[a])),!o)}if(I.isFormData(n)&&I.isFunction(n.entries)){const e={};return I.forEachEntry(n,(s,i)=>{t(ql(s),i,e,0)}),e}return null}function Hl(n,t,e){if(I.isString(n))try{return(t||JSON.parse)(n),I.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Gn={transitional:Sa,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=I.isObject(t);if(r&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(Ta(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.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 Gl(t,this.formSerializer).toString();if((o=I.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Us(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Hl(t)):t}],transformResponse:[function(t){const e=this.transitional||Gn.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.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"?F.from(o,F.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:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],n=>{Gn.headers[n]={}});const qn=Gn,Wl=I.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"]),Jl=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
2
|
+
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&Wl[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},Ea=Symbol("internals");function as(n){return n&&String(n).trim().toLowerCase()}function Vs(n){return n===!1||n==null?n:I.isArray(n)?n.map(Vs):String(n)}function Zl(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 Kl=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function jn(n,t,e,s,i){if(I.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!I.isString(t)){if(I.isString(s))return t.indexOf(s)!==-1;if(I.isRegExp(s))return s.test(t)}}function Ql(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function tu(n,t){const e=I.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 $s{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,h,c){const l=as(h);if(!l)throw new Error("header name must be a non-empty string");const u=I.findKey(i,l);(!u||i[u]===void 0||c===!0||c===void 0&&i[u]!==!1)&&(i[u||h]=Vs(o))}const a=(o,h)=>I.forEach(o,(c,l)=>r(c,l,h));if(I.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(I.isString(t)&&(t=t.trim())&&!Kl(t))a(Jl(t),e);else if(I.isHeaders(t))for(const[o,h]of t.entries())r(h,o,s);else t!=null&&r(e,t,s);return this}get(t,e){if(t=as(t),t){const s=I.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return Zl(i);if(I.isFunction(e))return e.call(this,i,s);if(I.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=as(t),t){const s=I.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||jn(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=as(a),a){const o=I.findKey(s,a);o&&(!e||jn(s,s[o],o,e))&&(delete s[o],i=!0)}}return I.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||jn(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return I.forEach(this,(i,r)=>{const a=I.findKey(s,r);if(a){e[a]=Vs(i),delete e[r];return}const o=t?Ql(r):String(r).trim();o!==r&&delete e[r],e[o]=Vs(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return I.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&I.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(`
|
|
3
|
+
`)}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[Ea]=this[Ea]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=as(a);s[o]||(tu(i,a),s[o]=!0)}return I.isArray(t)?t.forEach(r):r(t),this}}$s.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors($s.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),I.freezeMethods($s);const Vt=$s;function Hn(n,t){const e=this||qn,s=t||e,i=Vt.from(s.headers);let r=s.data;return I.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Pa(n){return!!(n&&n.__CANCEL__)}function $e(n,t,e){F.call(this,n??"canceled",F.ERR_CANCELED,t,e),this.name="CanceledError"}I.inherits($e,F,{__CANCEL__:!0});function Ma(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new F("Request failed with status code "+e.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function eu(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function su(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 u=r,d=0;for(;u!==i;)d+=e[u++],u=u%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function nu(n,t){let e=0,s=1e3/t,i,r;const a=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),u=l-e;u>=s?a(c,l):(i=c,r||(r=setTimeout(()=>{r=null,a(i)},s-u)))},()=>i&&a(i)]}const Gs=(n,t,e=3)=>{let s=0;const i=su(50,250);return nu(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,h=a-s,c=i(h),l=a<=o;s=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:h,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};n(u)},e)},Ca=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},Aa=n=>(...t)=>I.asap(()=>n(...t)),iu=yt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,yt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,ru=yt.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const a=[n+"="+encodeURIComponent(t)];I.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),I.isString(s)&&a.push("path="+s),I.isString(i)&&a.push("domain="+i),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function au(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function ou(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function Ia(n,t,e){let s=!au(t);return n&&(s||e==!1)?ou(n,t):t}const ka=n=>n instanceof Vt?{...n}:n;function Te(n,t){t=t||{};const e={};function s(c,l,u,d){return I.isPlainObject(c)&&I.isPlainObject(l)?I.merge.call({caseless:d},c,l):I.isPlainObject(l)?I.merge({},l):I.isArray(l)?l.slice():l}function i(c,l,u,d){if(I.isUndefined(l)){if(!I.isUndefined(c))return s(void 0,c,u,d)}else return s(c,l,u,d)}function r(c,l){if(!I.isUndefined(l))return s(void 0,l)}function a(c,l){if(I.isUndefined(l)){if(!I.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,u){if(u in t)return s(c,l);if(u 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,withXSRFToken: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,u)=>i(ka(c),ka(l),u,!0)};return I.forEach(Object.keys(Object.assign({},n,t)),function(l){const u=h[l]||i,d=u(n[l],t[l],l);I.isUndefined(d)&&u!==o||(e[l]=d)}),e}const Da=n=>{const t=Te({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=Vt.from(a),t.url=va(Ia(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let h;if(I.isFormData(e)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...l].join("; "))}}if(yt.hasStandardBrowserEnv&&(s&&I.isFunction(s)&&(s=s(t)),s||s!==!1&&iu(t.url))){const c=i&&r&&ru.read(r);c&&a.set(i,c)}return t},hu=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=Da(n);let r=i.data;const a=Vt.from(i.headers).normalize();let{responseType:o,onUploadProgress:h,onDownloadProgress:c}=i,l,u,d,f,p;function x(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function w(){if(!b)return;const v=Vt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),M={data:!o||o==="text"||o==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:v,config:n,request:b};Ma(function(D){e(D),x()},function(D){s(D),x()},M),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(s(new F("Request aborted",F.ECONNABORTED,n,b)),b=null)},b.onerror=function(){s(new F("Network Error",F.ERR_NETWORK,n,b)),b=null},b.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const M=i.transitional||Sa;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),s(new F(_,M.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,n,b)),b=null},r===void 0&&a.setContentType(null),"setRequestHeader"in b&&I.forEach(a.toJSON(),function(_,M){b.setRequestHeader(M,_)}),I.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),o&&o!=="json"&&(b.responseType=i.responseType),c&&([d,p]=Gs(c,!0),b.addEventListener("progress",d)),h&&b.upload&&([u,f]=Gs(h),b.upload.addEventListener("progress",u),b.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(l=v=>{b&&(s(!v||v.type?new $e(null,n,b):v),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const g=eu(i.url);if(g&&yt.protocols.indexOf(g)===-1){s(new F("Unsupported protocol "+g+":",F.ERR_BAD_REQUEST,n));return}b.send(r||null)})},cu=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,o();const l=c instanceof Error?c:this.reason;s.abort(l instanceof F?l:new $e(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,r(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const o=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>I.asap(o),h}},lu=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},uu=async function*(n,t){for await(const e of fu(n))yield*lu(e,t)},fu=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},Ra=(n,t,e,s)=>{const i=uu(n,t);let r=0,a,o=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){o(),h.close();return}let u=l.byteLength;if(e){let d=r+=u;e(d)}h.enqueue(new Uint8Array(l))}catch(c){throw o(c),c}},cancel(h){return o(h),i.return()}},{highWaterMark:2})},qs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",La=qs&&typeof ReadableStream=="function",du=qs&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Oa=(n,...t)=>{try{return!!n(...t)}catch{return!1}},mu=La&&Oa(()=>{let n=!1;const t=new Request(yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),za=64*1024,Wn=La&&Oa(()=>I.isReadableStream(new Response("").body)),js={stream:Wn&&(n=>n.body)};qs&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!js[t]&&(js[t]=I.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,s)})})})(new Response);const pu=async n=>{if(n==null)return 0;if(I.isBlob(n))return n.size;if(I.isSpecCompliantForm(n))return(await new Request(yt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(I.isArrayBufferView(n)||I.isArrayBuffer(n))return n.byteLength;if(I.isURLSearchParams(n)&&(n=n+""),I.isString(n))return(await du(n)).byteLength},gu=async(n,t)=>{const e=I.toFiniteNumber(n.getContentLength());return e??pu(t)},Jn={http:zl,xhr:hu,fetch:qs&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:d}=Da(n);c=c?(c+"").toLowerCase():"text";let f=cu([i,r&&r.toAbortSignal()],a),p;const x=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let b;try{if(h&&mu&&e!=="get"&&e!=="head"&&(b=await gu(l,s))!==0){let M=new Request(t,{method:"POST",body:s,duplex:"half"}),E;if(I.isFormData(s)&&(E=M.headers.get("content-type"))&&l.setContentType(E),M.body){const[D,B]=Ca(b,Gs(Aa(h)));s=Ra(M.body,za,D,B)}}I.isString(u)||(u=u?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...d,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:w?u:void 0});let g=await fetch(p);const v=Wn&&(c==="stream"||c==="response");if(Wn&&(o||v&&x)){const M={};["status","statusText","headers"].forEach(Y=>{M[Y]=g[Y]});const E=I.toFiniteNumber(g.headers.get("content-length")),[D,B]=o&&Ca(E,Gs(Aa(o),!0))||[];g=new Response(Ra(g.body,za,D,()=>{B&&B(),x&&x()}),M)}c=c||"text";let _=await js[I.findKey(js,c)||"text"](g,n);return!v&&x&&x(),await new Promise((M,E)=>{Ma(M,E,{data:_,headers:Vt.from(g.headers),status:g.status,statusText:g.statusText,config:n,request:p})})}catch(w){throw x&&x(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,n,p),{cause:w.cause||w}):F.from(w,w&&w.code,n,p)}})};I.forEach(Jn,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Na=n=>`- ${n}`,yu=n=>I.isFunction(n)||n===null||n===!1,Ba={getAdapter:n=>{n=I.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,!yu(e)&&(s=Jn[(a=String(e)).toLowerCase()],s===void 0))throw new F(`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 :
|
|
4
|
+
`+r.map(Na).join(`
|
|
5
|
+
`):" "+Na(r[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Jn};function Zn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new $e(null,n)}function Ya(n){return Zn(n),n.headers=Vt.from(n.headers),n.data=Hn.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Ba.getAdapter(n.adapter||qn.adapter)(n).then(function(s){return Zn(n),s.data=Hn.call(n,n.transformResponse,s),s.headers=Vt.from(s.headers),s},function(s){return Pa(s)||(Zn(n),s&&s.response&&(s.response.data=Hn.call(n,n.transformResponse,s.response),s.response.headers=Vt.from(s.response.headers))),Promise.reject(s)})}const Fa="1.8.4",Hs={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Hs[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Xa={};Hs.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Fa+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new F(i(a," has been removed"+(e?" in "+e:"")),F.ERR_DEPRECATED);return e&&!Xa[a]&&(Xa[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}},Hs.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function wu(n,t,e){if(typeof n!="object")throw new F("options must be an object",F.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 F("option "+r+" must be "+h,F.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new F("Unknown option "+r,F.ERR_BAD_OPTION)}}const Ws={assertOptions:wu,validators:Hs},Wt=Ws.validators;class Js{constructor(t){this.defaults=t,this.interceptors={request:new _a,response:new _a}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
+
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Te(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Ws.assertOptions(s,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1),i!=null&&(I.isFunction(i)?e.paramsSerializer={serialize:i}:Ws.assertOptions(i,{encode:Wt.function,serialize:Wt.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ws.assertOptions(e,{baseUrl:Wt.spelling("baseURL"),withXsrfToken:Wt.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&I.merge(r.common,r[e.method]);r&&I.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Vt.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,u=0,d;if(!h){const p=[Ya.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),d=p.length,l=Promise.resolve(e);u<d;)l=l.then(p[u++],p[u++]);return l}d=o.length;let f=e;for(u=0;u<d;){const p=o[u++],x=o[u++];try{f=p(f)}catch(b){x.call(this,b);break}}try{l=Ya.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=Te(this.defaults,t);const e=Ia(t.baseURL,t.url,t.allowAbsoluteUrls);return va(e,t.params,t.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(t){Js.prototype[t]=function(e,s){return this.request(Te(s||{},{method:t,url:e,data:(s||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(Te(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Js.prototype[t]=e(),Js.prototype[t+"Form"]=e(!0)});const Zs=Js;class Kn{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 $e(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)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Kn(function(i){t=i}),cancel:t}}}const xu=Kn;function bu(n){return function(e){return n.apply(null,e)}}function vu(n){return I.isObject(n)&&n.isAxiosError===!0}const Qn={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(Qn).forEach(([n,t])=>{Qn[t]=n});const _u=Qn;function Ua(n){const t=new Zs(n),e=oa(Zs.prototype.request,t);return I.extend(e,Zs.prototype,t,{allOwnKeys:!0}),I.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Ua(Te(n,i))},e}const at=Ua(qn);at.Axios=Zs,at.CanceledError=$e,at.CancelToken=xu,at.isCancel=Pa,at.VERSION=Fa,at.toFormData=Us,at.AxiosError=F,at.Cancel=at.CanceledError,at.all=function(t){return Promise.all(t)},at.spread=bu,at.isAxiosError=vu,at.mergeConfig=Te,at.AxiosHeaders=Vt,at.formToJSON=n=>Ta(I.isHTMLForm(n)?new FormData(n):n),at.getAdapter=Ba.getAdapter,at.HttpStatusCode=_u,at.default=at;const Su=at;class ti{instance;canceler;constructor(t){this.instance=Su.create(t),this.canceler=new Tu,this.instance.interceptors.request.use(e=>(this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e),e=>(t?.interceptor?.responseError?.(e),e))}request(t){return this.instance.request(t)}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})}postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}postForm(t,e,s){return this.instance.postForm(t,e,{...s})}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 Tu{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{url:e,method:s,params:i}=t;return P.objectSignature({url:e,method:s,params:i})}pendingRequest(t){const e=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)}}confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const ei=n=>new XMLSerializer().serializeToString(n),Eu=(n,t="text/html")=>new DOMParser().parseFromString(n,t),si=(n,t=P.MIMEEnum.SVG,e=P.EncodeEnum.utf8)=>P.toBlob(ei(n),t,e);async function ni(n=["*"],t){let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function os(n,t=P.ReadInBrowserEnum.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 P.ReadInBrowserEnum.dataURL:r.readAsDataURL(n);break;case P.ReadInBrowserEnum.binaryString:r.readAsBinaryString(n);break;case P.ReadInBrowserEnum.arraybuffer:r.readAsArrayBuffer(n);break;case P.ReadInBrowserEnum.text:default:r.readAsText(n)}})}async function Pu(n){const t=await os(n,P.ReadInBrowserEnum.arraybuffer);return P.getFileTypeFromArrayBuffer(t)}const Mu=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function Cu(n){switch(n.toLowerCase()){case"jpg":case"jpeg":return P.MIMEEnum.JPEG;case"gif":return P.MIMEEnum.GIF;case"svg":return P.MIMEEnum.SVG;case"pdf":return P.MIMEEnum.PDF;case"png":default:return P.MIMEEnum.PNG}}function Va(n,t,e,s,i,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Va(n,t,e,s,i,a,Math.min(a+i,s.size));else return n(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function $a(n,t=1048576){return await new Promise((e,s)=>Va(e,s,new Zc.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class Au{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new ti({baseURL:t.baseURL,interceptor:{response:e=>{e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk())}}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await $a(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).data.isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{P.increaseTime(this.time,1),this.onTime?.(P.formatTimeOverflow(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var Ga={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
7
7
|
* http://hammerjs.github.io/
|
|
8
8
|
*
|
|
9
9
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
10
10
|
* 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 u(y,S,C){return setTimeout(v(y,C),S)}function d(y,S,C){return Array.isArray(y)?(f(y,C[S],C),!0):!1}function f(y,S,C){var A;if(y)if(y.forEach)y.forEach(S,C);else if(y.length!==i)for(A=0;A<y.length;)S.call(C,y[A],A,y),A++;else for(A in y)y.hasOwnProperty(A)&&S.call(C,y[A],A,y)}function p(y,S,C){var A="DEPRECATED METHOD: "+S+`
|
|
11
11
|
`+C+` AT
|
|
12
|
-
`;return function(){var R=new Error("get-stack-trace"),N=R&&R.stack?R.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",G=t.console&&(t.console.warn||t.console.log);return G&&G.call(t.console,A,N),y.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var C=Object(S),A=1;A<arguments.length;A++){var R=arguments[A];if(R!==i&&R!==null)for(var N in R)R.hasOwnProperty(N)&&(C[N]=R[N])}return C}:x=Object.assign;var b=p(function(S,C,A){for(var R=Object.keys(C),N=0;N<R.length;)(!A||A&&S[R[N]]===i)&&(S[R[N]]=C[R[N]]),N++;return S},"extend","Use `assign`."),w=p(function(S,C){return b(S,C,!0)},"merge","Use `assign`.");function g(y,S,C){var A=S.prototype,R;R=y.prototype=Object.create(A),R.constructor=y,R._super=A,C&&x(R,C)}function v(y,S){return function(){return y.apply(S,arguments)}}function _(y,S){return typeof y==o?y.apply(S&&S[0]||i,S):y}function M(y,S){return y===i?S:y}function E(y,S,C){f(V(S),function(A){y.addEventListener(A,C,!1)})}function D(y,S,C){f(V(S),function(A){y.removeEventListener(A,C,!1)})}function B(y,S){for(;y;){if(y==S)return!0;y=y.parentNode}return!1}function Y(y,S){return y.indexOf(S)>-1}function V(y){return y.trim().split(/\s+/g)}function $(y,S,C){if(y.indexOf&&!C)return y.indexOf(S);for(var A=0;A<y.length;){if(C&&y[A][C]==S||!C&&y[A]===S)return A;A++}return-1}function W(y){return Array.prototype.slice.call(y,0)}function Q(y,S,C){for(var A=[],R=[],N=0;N<y.length;){var G=S?y[N][S]:y[N];$(R,G)<0&&A.push(y[N]),R[N]=G,N++}return C&&(S?A=A.sort(function(gt,Mt){return gt[S]>Mt[S]}):A=A.sort()),A}function Z(y,S){for(var C,A,R=S[0].toUpperCase()+S.slice(1),N=0;N<r.length;){if(C=r[N],A=C?C+R:S,A in y)return A;N++}return i}var Yt=1;function ft(){return Yt++}function Et(y){var S=y.ownerDocument||y;return S.defaultView||S.parentWindow||t}var It=/mobile|tablet|ip(ad|hone|od)|android/i,O="ontouchstart"in t,L=Z(t,"PointerEvent")!==i,X=O&&It.test(navigator.userAgent),H="touch",Pt="pen",jt="mouse",Cn="kinect",An=25,dt=1,Jt=2,nt=4,vt=8,ss=1,Ye=2,Fe=4,ve=8,k=16,rt=Ye|Fe,Xe=ve|k,Rc=rt|Xe,Lc=["x","y"],In=["clientX","clientY"];function Ft(y,S){var C=this;this.manager=y,this.callback=S,this.element=y.element,this.target=y.options.inputTarget,this.domHandler=function(A){_(y.options.enable,[y])&&C.handler(A)},this.init()}Ft.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(Et(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(Et(this.element),this.evWin,this.domHandler)}};function V1(y){var S,C=y.options.inputClass;return C?S=C:L?S=Hr:X?S=Rn:O?S=Wr:S=Dn,new S(y,$1)}function $1(y,S,C){var A=C.pointers.length,R=C.changedPointers.length,N=S&dt&&A-R===0,G=S&(nt|vt)&&A-R===0;C.isFirst=!!N,C.isFinal=!!G,N&&(y.session={}),C.eventType=S,G1(y,C),y.emit("hammer.input",C),y.recognize(C),y.session.prevInput=C}function G1(y,S){var C=y.session,A=S.pointers,R=A.length;C.firstInput||(C.firstInput=Oc(S)),R>1&&!C.firstMultiple?C.firstMultiple=Oc(S):R===1&&(C.firstMultiple=!1);var N=C.firstInput,G=C.firstMultiple,mt=G?G.center:N.center,gt=S.center=zc(A);S.timeStamp=l(),S.deltaTime=S.timeStamp-N.timeStamp,S.angle=jr(mt,gt),S.distance=kn(mt,gt),q1(C,S),S.offsetDirection=Bc(S.deltaX,S.deltaY);var Mt=Nc(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=Mt.x,S.overallVelocityY=Mt.y,S.overallVelocity=c(Mt.x)>c(Mt.y)?Mt.x:Mt.y,S.scale=G?W1(G.pointers,A):1,S.rotation=G?H1(G.pointers,A):0,S.maxPointers=C.prevInput?S.pointers.length>C.prevInput.maxPointers?S.pointers.length:C.prevInput.maxPointers:S.pointers.length,j1(C,S);var Kt=y.element;B(S.srcEvent.target,Kt)&&(Kt=S.srcEvent.target),S.target=Kt}function q1(y,S){var C=S.center,A=y.offsetDelta||{},R=y.prevDelta||{},N=y.prevInput||{};(S.eventType===dt||N.eventType===nt)&&(R=y.prevDelta={x:N.deltaX||0,y:N.deltaY||0},A=y.offsetDelta={x:C.x,y:C.y}),S.deltaX=R.x+(C.x-A.x),S.deltaY=R.y+(C.y-A.y)}function j1(y,S){var C=y.lastInterval||S,A=S.timeStamp-C.timeStamp,R,N,G,mt;if(S.eventType!=vt&&(A>An||C.velocity===i)){var gt=S.deltaX-C.deltaX,Mt=S.deltaY-C.deltaY,Kt=Nc(A,gt,Mt);N=Kt.x,G=Kt.y,R=c(Kt.x)>c(Kt.y)?Kt.x:Kt.y,mt=Bc(gt,Mt),y.lastInterval=S}else R=C.velocity,N=C.velocityX,G=C.velocityY,mt=C.direction;S.velocity=R,S.velocityX=N,S.velocityY=G,S.direction=mt}function Oc(y){for(var S=[],C=0;C<y.pointers.length;)S[C]={clientX:h(y.pointers[C].clientX),clientY:h(y.pointers[C].clientY)},C++;return{timeStamp:l(),pointers:S,center:zc(S),deltaX:y.deltaX,deltaY:y.deltaY}}function zc(y){var S=y.length;if(S===1)return{x:h(y[0].clientX),y:h(y[0].clientY)};for(var C=0,A=0,R=0;R<S;)C+=y[R].clientX,A+=y[R].clientY,R++;return{x:h(C/S),y:h(A/S)}}function Nc(y,S,C){return{x:S/y||0,y:C/y||0}}function Bc(y,S){return y===S?ss:c(y)>=c(S)?y<0?Ye:Fe:S<0?ve:k}function kn(y,S,C){C||(C=Lc);var A=S[C[0]]-y[C[0]],R=S[C[1]]-y[C[1]];return Math.sqrt(A*A+R*R)}function jr(y,S,C){C||(C=Lc);var A=S[C[0]]-y[C[0]],R=S[C[1]]-y[C[1]];return Math.atan2(R,A)*180/Math.PI}function H1(y,S){return jr(S[1],S[0],In)+jr(y[1],y[0],In)}function W1(y,S){return kn(S[0],S[1],In)/kn(y[0],y[1],In)}var J1={mousedown:dt,mousemove:Jt,mouseup:nt},Z1="mousedown",K1="mousemove mouseup";function Dn(){this.evEl=Z1,this.evWin=K1,this.pressed=!1,Ft.apply(this,arguments)}g(Dn,Ft,{handler:function(S){var C=J1[S.type];C&dt&&S.button===0&&(this.pressed=!0),C&Jt&&S.which!==1&&(C=nt),this.pressed&&(C&nt&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[S],changedPointers:[S],pointerType:jt,srcEvent:S}))}});var Q1={pointerdown:dt,pointermove:Jt,pointerup:nt,pointercancel:vt,pointerout:vt},ty={2:H,3:Pt,4:jt,5:Cn},Yc="pointerdown",Fc="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Yc="MSPointerDown",Fc="MSPointerMove MSPointerUp MSPointerCancel");function Hr(){this.evEl=Yc,this.evWin=Fc,Ft.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}g(Hr,Ft,{handler:function(S){var C=this.store,A=!1,R=S.type.toLowerCase().replace("ms",""),N=Q1[R],G=ty[S.pointerType]||S.pointerType,mt=G==H,gt=$(C,S.pointerId,"pointerId");N&dt&&(S.button===0||mt)?gt<0&&(C.push(S),gt=C.length-1):N&(nt|vt)&&(A=!0),!(gt<0)&&(C[gt]=S,this.callback(this.manager,N,{pointers:C,changedPointers:[S],pointerType:G,srcEvent:S}),A&&C.splice(gt,1))}});var ey={touchstart:dt,touchmove:Jt,touchend:nt,touchcancel:vt},sy="touchstart",ny="touchstart touchmove touchend touchcancel";function Xc(){this.evTarget=sy,this.evWin=ny,this.started=!1,Ft.apply(this,arguments)}g(Xc,Ft,{handler:function(S){var C=ey[S.type];if(C===dt&&(this.started=!0),!!this.started){var A=iy.call(this,S,C);C&(nt|vt)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:A[0],changedPointers:A[1],pointerType:H,srcEvent:S})}}});function iy(y,S){var C=W(y.touches),A=W(y.changedTouches);return S&(nt|vt)&&(C=Q(C.concat(A),"identifier",!0)),[C,A]}var ry={touchstart:dt,touchmove:Jt,touchend:nt,touchcancel:vt},ay="touchstart touchmove touchend touchcancel";function Rn(){this.evTarget=ay,this.targetIds={},Ft.apply(this,arguments)}g(Rn,Ft,{handler:function(S){var C=ry[S.type],A=oy.call(this,S,C);A&&this.callback(this.manager,C,{pointers:A[0],changedPointers:A[1],pointerType:H,srcEvent:S})}});function oy(y,S){var C=W(y.touches),A=this.targetIds;if(S&(dt|Jt)&&C.length===1)return A[C[0].identifier]=!0,[C,C];var R,N,G=W(y.changedTouches),mt=[],gt=this.target;if(N=C.filter(function(Mt){return B(Mt.target,gt)}),S===dt)for(R=0;R<N.length;)A[N[R].identifier]=!0,R++;for(R=0;R<G.length;)A[G[R].identifier]&&mt.push(G[R]),S&(nt|vt)&&delete A[G[R].identifier],R++;if(mt.length)return[Q(N.concat(mt),"identifier",!0),mt]}var hy=2500,Uc=25;function Wr(){Ft.apply(this,arguments);var y=v(this.handler,this);this.touch=new Rn(this.manager,y),this.mouse=new Dn(this.manager,y),this.primaryTouch=null,this.lastTouches=[]}g(Wr,Ft,{handler:function(S,C,A){var R=A.pointerType==H,N=A.pointerType==jt;if(!(N&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(R)cy.call(this,C,A);else if(N&&ly.call(this,A))return;this.callback(S,C,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function cy(y,S){y&dt?(this.primaryTouch=S.changedPointers[0].identifier,Vc.call(this,S)):y&(nt|vt)&&Vc.call(this,S)}function Vc(y){var S=y.changedPointers[0];if(S.identifier===this.primaryTouch){var C={x:S.clientX,y:S.clientY};this.lastTouches.push(C);var A=this.lastTouches,R=function(){var N=A.indexOf(C);N>-1&&A.splice(N,1)};setTimeout(R,hy)}}function ly(y){for(var S=y.srcEvent.clientX,C=y.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var R=this.lastTouches[A],N=Math.abs(S-R.x),G=Math.abs(C-R.y);if(N<=Uc&&G<=Uc)return!0}return!1}var $c=Z(a.style,"touchAction"),Gc=$c!==i,qc="compute",jc="auto",Jr="manipulation",Ue="none",Ls="pan-x",Os="pan-y",Ln=fy();function Zr(y,S){this.manager=y,this.set(S)}Zr.prototype={set:function(y){y==qc&&(y=this.compute()),Gc&&this.manager.element.style&&Ln[y]&&(this.manager.element.style[$c]=y),this.actions=y.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var y=[];return f(this.manager.recognizers,function(S){_(S.options.enable,[S])&&(y=y.concat(S.getTouchAction()))}),uy(y.join(" "))},preventDefaults:function(y){var S=y.srcEvent,C=y.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var A=this.actions,R=Y(A,Ue)&&!Ln[Ue],N=Y(A,Os)&&!Ln[Os],G=Y(A,Ls)&&!Ln[Ls];if(R){var mt=y.pointers.length===1,gt=y.distance<2,Mt=y.deltaTime<250;if(mt&>&&Mt)return}if(!(G&&N)&&(R||N&&C&rt||G&&C&Xe))return this.preventSrc(S)},preventSrc:function(y){this.manager.session.prevented=!0,y.preventDefault()}};function uy(y){if(Y(y,Ue))return Ue;var S=Y(y,Ls),C=Y(y,Os);return S&&C?Ue:S||C?S?Ls:Os:Y(y,Jr)?Jr:jc}function fy(){if(!Gc)return!1;var y={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(C){y[C]=S?t.CSS.supports("touch-action",C):!0}),y}var On=1,Xt=2,ns=4,_e=8,re=_e,zs=16,Zt=32;function ae(y){this.options=x({},this.defaults,y||{}),this.id=ft(),this.manager=null,this.options.enable=M(this.options.enable,!0),this.state=On,this.simultaneous={},this.requireFail=[]}ae.prototype={defaults:{},set:function(y){return x(this.options,y),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(y){if(d(y,"recognizeWith",this))return this;var S=this.simultaneous;return y=zn(y,this),S[y.id]||(S[y.id]=y,y.recognizeWith(this)),this},dropRecognizeWith:function(y){return d(y,"dropRecognizeWith",this)?this:(y=zn(y,this),delete this.simultaneous[y.id],this)},requireFailure:function(y){if(d(y,"requireFailure",this))return this;var S=this.requireFail;return y=zn(y,this),$(S,y)===-1&&(S.push(y),y.requireFailure(this)),this},dropRequireFailure:function(y){if(d(y,"dropRequireFailure",this))return this;y=zn(y,this);var S=$(this.requireFail,y);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(y){return!!this.simultaneous[y.id]},emit:function(y){var S=this,C=this.state;function A(R){S.manager.emit(R,y)}C<_e&&A(S.options.event+Hc(C)),A(S.options.event),y.additionalEvent&&A(y.additionalEvent),C>=_e&&A(S.options.event+Hc(C))},tryEmit:function(y){if(this.canEmit())return this.emit(y);this.state=Zt},canEmit:function(){for(var y=0;y<this.requireFail.length;){if(!(this.requireFail[y].state&(Zt|On)))return!1;y++}return!0},recognize:function(y){var S=x({},y);if(!_(this.options.enable,[this,S])){this.reset(),this.state=Zt;return}this.state&(re|zs|Zt)&&(this.state=On),this.state=this.process(S),this.state&(Xt|ns|_e|zs)&&this.tryEmit(S)},process:function(y){},getTouchAction:function(){},reset:function(){}};function Hc(y){return y&zs?"cancel":y&_e?"end":y&ns?"move":y&Xt?"start":""}function Wc(y){return y==k?"down":y==ve?"up":y==Ye?"left":y==Fe?"right":""}function zn(y,S){var C=S.manager;return C?C.get(y):y}function Ht(){ae.apply(this,arguments)}g(Ht,ae,{defaults:{pointers:1},attrTest:function(y){var S=this.options.pointers;return S===0||y.pointers.length===S},process:function(y){var S=this.state,C=y.eventType,A=S&(Xt|ns),R=this.attrTest(y);return A&&(C&vt||!R)?S|zs:A||R?C&nt?S|_e:S&Xt?S|ns:Xt:Zt}});function Nn(){Ht.apply(this,arguments),this.pX=null,this.pY=null}g(Nn,Ht,{defaults:{event:"pan",threshold:10,pointers:1,direction:Rc},getTouchAction:function(){var y=this.options.direction,S=[];return y&rt&&S.push(Os),y&Xe&&S.push(Ls),S},directionTest:function(y){var S=this.options,C=!0,A=y.distance,R=y.direction,N=y.deltaX,G=y.deltaY;return R&S.direction||(S.direction&rt?(R=N===0?ss:N<0?Ye:Fe,C=N!=this.pX,A=Math.abs(y.deltaX)):(R=G===0?ss:G<0?ve:k,C=G!=this.pY,A=Math.abs(y.deltaY))),y.direction=R,C&&A>S.threshold&&R&S.direction},attrTest:function(y){return Ht.prototype.attrTest.call(this,y)&&(this.state&Xt||!(this.state&Xt)&&this.directionTest(y))},emit:function(y){this.pX=y.deltaX,this.pY=y.deltaY;var S=Wc(y.direction);S&&(y.additionalEvent=this.options.event+S),this._super.emit.call(this,y)}});function Kr(){Ht.apply(this,arguments)}g(Kr,Ht,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ue]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.scale-1)>this.options.threshold||this.state&Xt)},emit:function(y){if(y.scale!==1){var S=y.scale<1?"in":"out";y.additionalEvent=this.options.event+S}this._super.emit.call(this,y)}});function Qr(){ae.apply(this,arguments),this._timer=null,this._input=null}g(Qr,ae,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[jc]},process:function(y){var S=this.options,C=y.pointers.length===S.pointers,A=y.distance<S.threshold,R=y.deltaTime>S.time;if(this._input=y,!A||!C||y.eventType&(nt|vt)&&!R)this.reset();else if(y.eventType&dt)this.reset(),this._timer=u(function(){this.state=re,this.tryEmit()},S.time,this);else if(y.eventType&nt)return re;return Zt},reset:function(){clearTimeout(this._timer)},emit:function(y){this.state===re&&(y&&y.eventType&nt?this.manager.emit(this.options.event+"up",y):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function ta(){Ht.apply(this,arguments)}g(ta,Ht,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ue]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.rotation)>this.options.threshold||this.state&Xt)}});function ea(){Ht.apply(this,arguments)}g(ea,Ht,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:rt|Xe,pointers:1},getTouchAction:function(){return Nn.prototype.getTouchAction.call(this)},attrTest:function(y){var S=this.options.direction,C;return S&(rt|Xe)?C=y.overallVelocity:S&rt?C=y.overallVelocityX:S&Xe&&(C=y.overallVelocityY),this._super.attrTest.call(this,y)&&S&y.offsetDirection&&y.distance>this.options.threshold&&y.maxPointers==this.options.pointers&&c(C)>this.options.velocity&&y.eventType&nt},emit:function(y){var S=Wc(y.offsetDirection);S&&this.manager.emit(this.options.event+S,y),this.manager.emit(this.options.event,y)}});function Bn(){ae.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}g(Bn,ae,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Jr]},process:function(y){var S=this.options,C=y.pointers.length===S.pointers,A=y.distance<S.threshold,R=y.deltaTime<S.time;if(this.reset(),y.eventType&dt&&this.count===0)return this.failTimeout();if(A&&R&&C){if(y.eventType!=nt)return this.failTimeout();var N=this.pTime?y.timeStamp-this.pTime<S.interval:!0,G=!this.pCenter||kn(this.pCenter,y.center)<S.posThreshold;this.pTime=y.timeStamp,this.pCenter=y.center,!G||!N?this.count=1:this.count+=1,this._input=y;var mt=this.count%S.taps;if(mt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=re,this.tryEmit()},S.interval,this),Xt):re}return Zt},failTimeout:function(){return this._timer=u(function(){this.state=Zt},this.options.interval,this),Zt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==re&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function oe(y,S){return S=S||{},S.recognizers=M(S.recognizers,oe.defaults.preset),new sa(y,S)}oe.VERSION="2.0.7",oe.defaults={domEvents:!1,touchAction:qc,enable:!0,inputTarget:null,inputClass:null,preset:[[ta,{enable:!1}],[Kr,{enable:!1},["rotate"]],[ea,{direction:rt}],[Nn,{direction:rt},["swipe"]],[Bn],[Bn,{event:"doubletap",taps:2},["tap"]],[Qr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var dy=1,Jc=2;function sa(y,S){this.options=x({},oe.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||y,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=y,this.input=V1(this),this.touchAction=new Zr(this,this.options.touchAction),Zc(this,!0),f(this.options.recognizers,function(C){var A=this.add(new C[0](C[1]));C[2]&&A.recognizeWith(C[2]),C[3]&&A.requireFailure(C[3])},this)}sa.prototype={set:function(y){return x(this.options,y),y.touchAction&&this.touchAction.update(),y.inputTarget&&(this.input.destroy(),this.input.target=y.inputTarget,this.input.init()),this},stop:function(y){this.session.stopped=y?Jc:dy},recognize:function(y){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(y);var C,A=this.recognizers,R=S.curRecognizer;(!R||R&&R.state&re)&&(R=S.curRecognizer=null);for(var N=0;N<A.length;)C=A[N],S.stopped!==Jc&&(!R||C==R||C.canRecognizeWith(R))?C.recognize(y):C.reset(),!R&&C.state&(Xt|ns|_e)&&(R=S.curRecognizer=C),N++}},get:function(y){if(y instanceof ae)return y;for(var S=this.recognizers,C=0;C<S.length;C++)if(S[C].options.event==y)return S[C];return null},add:function(y){if(d(y,"add",this))return this;var S=this.get(y.options.event);return S&&this.remove(S),this.recognizers.push(y),y.manager=this,this.touchAction.update(),y},remove:function(y){if(d(y,"remove",this))return this;if(y=this.get(y),y){var S=this.recognizers,C=$(S,y);C!==-1&&(S.splice(C,1),this.touchAction.update())}return this},on:function(y,S){if(y!==i&&S!==i){var C=this.handlers;return f(V(y),function(A){C[A]=C[A]||[],C[A].push(S)}),this}},off:function(y,S){if(y!==i){var C=this.handlers;return f(V(y),function(A){S?C[A]&&C[A].splice($(C[A],S),1):delete C[A]}),this}},emit:function(y,S){this.options.domEvents&&my(y,S);var C=this.handlers[y]&&this.handlers[y].slice();if(!(!C||!C.length)){S.type=y,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var A=0;A<C.length;)C[A](S),A++}},destroy:function(){this.element&&Zc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Zc(y,S){var C=y.element;if(C.style){var A;f(y.options.cssProps,function(R,N){A=Z(C.style,N),S?(y.oldCssProps[A]=C.style[A],C.style[A]=R):C.style[A]=y.oldCssProps[A]||""}),S||(y.oldCssProps={})}}function my(y,S){var C=e.createEvent("Event");C.initEvent(y,!0,!0),C.gesture=S,S.target.dispatchEvent(C)}x(oe,{INPUT_START:dt,INPUT_MOVE:Jt,INPUT_END:nt,INPUT_CANCEL:vt,STATE_POSSIBLE:On,STATE_BEGAN:Xt,STATE_CHANGED:ns,STATE_ENDED:_e,STATE_RECOGNIZED:re,STATE_CANCELLED:zs,STATE_FAILED:Zt,DIRECTION_NONE:ss,DIRECTION_LEFT:Ye,DIRECTION_RIGHT:Fe,DIRECTION_UP:ve,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:rt,DIRECTION_VERTICAL:Xe,DIRECTION_ALL:Rc,Manager:sa,Input:Ft,TouchAction:Zr,TouchInput:Rn,MouseInput:Dn,PointerEventInput:Hr,TouchMouseInput:Wr,SingleTouchInput:Xc,Recognizer:ae,AttrRecognizer:Ht,Tap:Bn,Pan:Nn,Swipe:ea,Pinch:Kr,Rotate:ta,Press:Qr,on:E,off:D,each:f,merge:w,extend:b,assign:x,inherit:g,bindFn:v,prefixed:Z});var py=typeof t<"u"?t:typeof self<"u"?self:{};py.Hammer=oe,typeof i=="function"&&i.amd?i(function(){return oe}):n.exports?n.exports=oe:t[s]=oe})(window,document,"Hammer")})(Wa);var ku=Wa.exports;const tt=ia(ku);var ni=function(n,t){return ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},ni(n,t)};function ce(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ni(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Du(n,t,e,s){function i(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function o(l){try{c(s.next(l))}catch(u){a(u)}}function h(l){try{c(s.throw(l))}catch(u){a(u)}}function c(l){l.done?r(l.value):i(l.value).then(o,h)}c((s=s.apply(n,t||[])).next())})}function Ja(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,i,r,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(l){return h([c,l])}}function h(c){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(e=0)),e;)try{if(s=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(l){c=[6,l],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ee(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function le(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],a;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(a)throw a.error}}return r}function Pe(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function Ge(n){return this instanceof Ge?(this.v=n,this):new Ge(n)}function Ru(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=e.apply(n,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(f){return function(p){return Promise.resolve(p).then(f,u)}}function o(f,p){s[f]&&(i[f]=function(x){return new Promise(function(b,w){r.push([f,x,b,w])>1||h(f,x)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(s[f](p))}catch(x){d(r[0][3],x)}}function c(f){f.value instanceof Ge?Promise.resolve(f.value.v).then(l,u):d(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function d(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function Lu(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Ee=="function"?Ee(n):n[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(r){e[r]=n[r]&&function(a){return new Promise(function(o,h){a=n[r](a),i(o,h,a.done,a.value)})}}function i(r,a,o,h){Promise.resolve(h).then(function(c){r({value:c,done:o})},a)}}typeof SuppressedError=="function"&&SuppressedError;function q(n){return typeof n=="function"}function ii(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ri=ii(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
12
|
+
`;return function(){var R=new Error("get-stack-trace"),N=R&&R.stack?R.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",G=t.console&&(t.console.warn||t.console.log);return G&&G.call(t.console,A,N),y.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var C=Object(S),A=1;A<arguments.length;A++){var R=arguments[A];if(R!==i&&R!==null)for(var N in R)R.hasOwnProperty(N)&&(C[N]=R[N])}return C}:x=Object.assign;var b=p(function(S,C,A){for(var R=Object.keys(C),N=0;N<R.length;)(!A||A&&S[R[N]]===i)&&(S[R[N]]=C[R[N]]),N++;return S},"extend","Use `assign`."),w=p(function(S,C){return b(S,C,!0)},"merge","Use `assign`.");function g(y,S,C){var A=S.prototype,R;R=y.prototype=Object.create(A),R.constructor=y,R._super=A,C&&x(R,C)}function v(y,S){return function(){return y.apply(S,arguments)}}function _(y,S){return typeof y==o?y.apply(S&&S[0]||i,S):y}function M(y,S){return y===i?S:y}function E(y,S,C){f(V(S),function(A){y.addEventListener(A,C,!1)})}function D(y,S,C){f(V(S),function(A){y.removeEventListener(A,C,!1)})}function B(y,S){for(;y;){if(y==S)return!0;y=y.parentNode}return!1}function Y(y,S){return y.indexOf(S)>-1}function V(y){return y.trim().split(/\s+/g)}function $(y,S,C){if(y.indexOf&&!C)return y.indexOf(S);for(var A=0;A<y.length;){if(C&&y[A][C]==S||!C&&y[A]===S)return A;A++}return-1}function W(y){return Array.prototype.slice.call(y,0)}function Q(y,S,C){for(var A=[],R=[],N=0;N<y.length;){var G=S?y[N][S]:y[N];$(R,G)<0&&A.push(y[N]),R[N]=G,N++}return C&&(S?A=A.sort(function(gt,Mt){return gt[S]>Mt[S]}):A=A.sort()),A}function Z(y,S){for(var C,A,R=S[0].toUpperCase()+S.slice(1),N=0;N<r.length;){if(C=r[N],A=C?C+R:S,A in y)return A;N++}return i}var Yt=1;function ft(){return Yt++}function Et(y){var S=y.ownerDocument||y;return S.defaultView||S.parentWindow||t}var It=/mobile|tablet|ip(ad|hone|od)|android/i,O="ontouchstart"in t,L=Z(t,"PointerEvent")!==i,X=O&&It.test(navigator.userAgent),H="touch",Pt="pen",jt="mouse",Cn="kinect",An=25,dt=1,Jt=2,nt=4,vt=8,ss=1,Ye=2,Fe=4,ve=8,k=16,rt=Ye|Fe,Xe=ve|k,kc=rt|Xe,Dc=["x","y"],In=["clientX","clientY"];function Ft(y,S){var C=this;this.manager=y,this.callback=S,this.element=y.element,this.target=y.options.inputTarget,this.domHandler=function(A){_(y.options.enable,[y])&&C.handler(A)},this.init()}Ft.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(Et(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(Et(this.element),this.evWin,this.domHandler)}};function $1(y){var S,C=y.options.inputClass;return C?S=C:L?S=Wr:X?S=Rn:O?S=Jr:S=Dn,new S(y,G1)}function G1(y,S,C){var A=C.pointers.length,R=C.changedPointers.length,N=S&dt&&A-R===0,G=S&(nt|vt)&&A-R===0;C.isFirst=!!N,C.isFinal=!!G,N&&(y.session={}),C.eventType=S,q1(y,C),y.emit("hammer.input",C),y.recognize(C),y.session.prevInput=C}function q1(y,S){var C=y.session,A=S.pointers,R=A.length;C.firstInput||(C.firstInput=Rc(S)),R>1&&!C.firstMultiple?C.firstMultiple=Rc(S):R===1&&(C.firstMultiple=!1);var N=C.firstInput,G=C.firstMultiple,mt=G?G.center:N.center,gt=S.center=Lc(A);S.timeStamp=l(),S.deltaTime=S.timeStamp-N.timeStamp,S.angle=Hr(mt,gt),S.distance=kn(mt,gt),j1(C,S),S.offsetDirection=zc(S.deltaX,S.deltaY);var Mt=Oc(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=Mt.x,S.overallVelocityY=Mt.y,S.overallVelocity=c(Mt.x)>c(Mt.y)?Mt.x:Mt.y,S.scale=G?J1(G.pointers,A):1,S.rotation=G?W1(G.pointers,A):0,S.maxPointers=C.prevInput?S.pointers.length>C.prevInput.maxPointers?S.pointers.length:C.prevInput.maxPointers:S.pointers.length,H1(C,S);var Kt=y.element;B(S.srcEvent.target,Kt)&&(Kt=S.srcEvent.target),S.target=Kt}function j1(y,S){var C=S.center,A=y.offsetDelta||{},R=y.prevDelta||{},N=y.prevInput||{};(S.eventType===dt||N.eventType===nt)&&(R=y.prevDelta={x:N.deltaX||0,y:N.deltaY||0},A=y.offsetDelta={x:C.x,y:C.y}),S.deltaX=R.x+(C.x-A.x),S.deltaY=R.y+(C.y-A.y)}function H1(y,S){var C=y.lastInterval||S,A=S.timeStamp-C.timeStamp,R,N,G,mt;if(S.eventType!=vt&&(A>An||C.velocity===i)){var gt=S.deltaX-C.deltaX,Mt=S.deltaY-C.deltaY,Kt=Oc(A,gt,Mt);N=Kt.x,G=Kt.y,R=c(Kt.x)>c(Kt.y)?Kt.x:Kt.y,mt=zc(gt,Mt),y.lastInterval=S}else R=C.velocity,N=C.velocityX,G=C.velocityY,mt=C.direction;S.velocity=R,S.velocityX=N,S.velocityY=G,S.direction=mt}function Rc(y){for(var S=[],C=0;C<y.pointers.length;)S[C]={clientX:h(y.pointers[C].clientX),clientY:h(y.pointers[C].clientY)},C++;return{timeStamp:l(),pointers:S,center:Lc(S),deltaX:y.deltaX,deltaY:y.deltaY}}function Lc(y){var S=y.length;if(S===1)return{x:h(y[0].clientX),y:h(y[0].clientY)};for(var C=0,A=0,R=0;R<S;)C+=y[R].clientX,A+=y[R].clientY,R++;return{x:h(C/S),y:h(A/S)}}function Oc(y,S,C){return{x:S/y||0,y:C/y||0}}function zc(y,S){return y===S?ss:c(y)>=c(S)?y<0?Ye:Fe:S<0?ve:k}function kn(y,S,C){C||(C=Dc);var A=S[C[0]]-y[C[0]],R=S[C[1]]-y[C[1]];return Math.sqrt(A*A+R*R)}function Hr(y,S,C){C||(C=Dc);var A=S[C[0]]-y[C[0]],R=S[C[1]]-y[C[1]];return Math.atan2(R,A)*180/Math.PI}function W1(y,S){return Hr(S[1],S[0],In)+Hr(y[1],y[0],In)}function J1(y,S){return kn(S[0],S[1],In)/kn(y[0],y[1],In)}var Z1={mousedown:dt,mousemove:Jt,mouseup:nt},K1="mousedown",Q1="mousemove mouseup";function Dn(){this.evEl=K1,this.evWin=Q1,this.pressed=!1,Ft.apply(this,arguments)}g(Dn,Ft,{handler:function(S){var C=Z1[S.type];C&dt&&S.button===0&&(this.pressed=!0),C&Jt&&S.which!==1&&(C=nt),this.pressed&&(C&nt&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[S],changedPointers:[S],pointerType:jt,srcEvent:S}))}});var ty={pointerdown:dt,pointermove:Jt,pointerup:nt,pointercancel:vt,pointerout:vt},ey={2:H,3:Pt,4:jt,5:Cn},Nc="pointerdown",Bc="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Nc="MSPointerDown",Bc="MSPointerMove MSPointerUp MSPointerCancel");function Wr(){this.evEl=Nc,this.evWin=Bc,Ft.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}g(Wr,Ft,{handler:function(S){var C=this.store,A=!1,R=S.type.toLowerCase().replace("ms",""),N=ty[R],G=ey[S.pointerType]||S.pointerType,mt=G==H,gt=$(C,S.pointerId,"pointerId");N&dt&&(S.button===0||mt)?gt<0&&(C.push(S),gt=C.length-1):N&(nt|vt)&&(A=!0),!(gt<0)&&(C[gt]=S,this.callback(this.manager,N,{pointers:C,changedPointers:[S],pointerType:G,srcEvent:S}),A&&C.splice(gt,1))}});var sy={touchstart:dt,touchmove:Jt,touchend:nt,touchcancel:vt},ny="touchstart",iy="touchstart touchmove touchend touchcancel";function Yc(){this.evTarget=ny,this.evWin=iy,this.started=!1,Ft.apply(this,arguments)}g(Yc,Ft,{handler:function(S){var C=sy[S.type];if(C===dt&&(this.started=!0),!!this.started){var A=ry.call(this,S,C);C&(nt|vt)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:A[0],changedPointers:A[1],pointerType:H,srcEvent:S})}}});function ry(y,S){var C=W(y.touches),A=W(y.changedTouches);return S&(nt|vt)&&(C=Q(C.concat(A),"identifier",!0)),[C,A]}var ay={touchstart:dt,touchmove:Jt,touchend:nt,touchcancel:vt},oy="touchstart touchmove touchend touchcancel";function Rn(){this.evTarget=oy,this.targetIds={},Ft.apply(this,arguments)}g(Rn,Ft,{handler:function(S){var C=ay[S.type],A=hy.call(this,S,C);A&&this.callback(this.manager,C,{pointers:A[0],changedPointers:A[1],pointerType:H,srcEvent:S})}});function hy(y,S){var C=W(y.touches),A=this.targetIds;if(S&(dt|Jt)&&C.length===1)return A[C[0].identifier]=!0,[C,C];var R,N,G=W(y.changedTouches),mt=[],gt=this.target;if(N=C.filter(function(Mt){return B(Mt.target,gt)}),S===dt)for(R=0;R<N.length;)A[N[R].identifier]=!0,R++;for(R=0;R<G.length;)A[G[R].identifier]&&mt.push(G[R]),S&(nt|vt)&&delete A[G[R].identifier],R++;if(mt.length)return[Q(N.concat(mt),"identifier",!0),mt]}var cy=2500,Fc=25;function Jr(){Ft.apply(this,arguments);var y=v(this.handler,this);this.touch=new Rn(this.manager,y),this.mouse=new Dn(this.manager,y),this.primaryTouch=null,this.lastTouches=[]}g(Jr,Ft,{handler:function(S,C,A){var R=A.pointerType==H,N=A.pointerType==jt;if(!(N&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(R)ly.call(this,C,A);else if(N&&uy.call(this,A))return;this.callback(S,C,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ly(y,S){y&dt?(this.primaryTouch=S.changedPointers[0].identifier,Xc.call(this,S)):y&(nt|vt)&&Xc.call(this,S)}function Xc(y){var S=y.changedPointers[0];if(S.identifier===this.primaryTouch){var C={x:S.clientX,y:S.clientY};this.lastTouches.push(C);var A=this.lastTouches,R=function(){var N=A.indexOf(C);N>-1&&A.splice(N,1)};setTimeout(R,cy)}}function uy(y){for(var S=y.srcEvent.clientX,C=y.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var R=this.lastTouches[A],N=Math.abs(S-R.x),G=Math.abs(C-R.y);if(N<=Fc&&G<=Fc)return!0}return!1}var Uc=Z(a.style,"touchAction"),Vc=Uc!==i,$c="compute",Gc="auto",Zr="manipulation",Ue="none",Ls="pan-x",Os="pan-y",Ln=dy();function Kr(y,S){this.manager=y,this.set(S)}Kr.prototype={set:function(y){y==$c&&(y=this.compute()),Vc&&this.manager.element.style&&Ln[y]&&(this.manager.element.style[Uc]=y),this.actions=y.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var y=[];return f(this.manager.recognizers,function(S){_(S.options.enable,[S])&&(y=y.concat(S.getTouchAction()))}),fy(y.join(" "))},preventDefaults:function(y){var S=y.srcEvent,C=y.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var A=this.actions,R=Y(A,Ue)&&!Ln[Ue],N=Y(A,Os)&&!Ln[Os],G=Y(A,Ls)&&!Ln[Ls];if(R){var mt=y.pointers.length===1,gt=y.distance<2,Mt=y.deltaTime<250;if(mt&>&&Mt)return}if(!(G&&N)&&(R||N&&C&rt||G&&C&Xe))return this.preventSrc(S)},preventSrc:function(y){this.manager.session.prevented=!0,y.preventDefault()}};function fy(y){if(Y(y,Ue))return Ue;var S=Y(y,Ls),C=Y(y,Os);return S&&C?Ue:S||C?S?Ls:Os:Y(y,Zr)?Zr:Gc}function dy(){if(!Vc)return!1;var y={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(C){y[C]=S?t.CSS.supports("touch-action",C):!0}),y}var On=1,Xt=2,ns=4,_e=8,re=_e,zs=16,Zt=32;function ae(y){this.options=x({},this.defaults,y||{}),this.id=ft(),this.manager=null,this.options.enable=M(this.options.enable,!0),this.state=On,this.simultaneous={},this.requireFail=[]}ae.prototype={defaults:{},set:function(y){return x(this.options,y),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(y){if(d(y,"recognizeWith",this))return this;var S=this.simultaneous;return y=zn(y,this),S[y.id]||(S[y.id]=y,y.recognizeWith(this)),this},dropRecognizeWith:function(y){return d(y,"dropRecognizeWith",this)?this:(y=zn(y,this),delete this.simultaneous[y.id],this)},requireFailure:function(y){if(d(y,"requireFailure",this))return this;var S=this.requireFail;return y=zn(y,this),$(S,y)===-1&&(S.push(y),y.requireFailure(this)),this},dropRequireFailure:function(y){if(d(y,"dropRequireFailure",this))return this;y=zn(y,this);var S=$(this.requireFail,y);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(y){return!!this.simultaneous[y.id]},emit:function(y){var S=this,C=this.state;function A(R){S.manager.emit(R,y)}C<_e&&A(S.options.event+qc(C)),A(S.options.event),y.additionalEvent&&A(y.additionalEvent),C>=_e&&A(S.options.event+qc(C))},tryEmit:function(y){if(this.canEmit())return this.emit(y);this.state=Zt},canEmit:function(){for(var y=0;y<this.requireFail.length;){if(!(this.requireFail[y].state&(Zt|On)))return!1;y++}return!0},recognize:function(y){var S=x({},y);if(!_(this.options.enable,[this,S])){this.reset(),this.state=Zt;return}this.state&(re|zs|Zt)&&(this.state=On),this.state=this.process(S),this.state&(Xt|ns|_e|zs)&&this.tryEmit(S)},process:function(y){},getTouchAction:function(){},reset:function(){}};function qc(y){return y&zs?"cancel":y&_e?"end":y&ns?"move":y&Xt?"start":""}function jc(y){return y==k?"down":y==ve?"up":y==Ye?"left":y==Fe?"right":""}function zn(y,S){var C=S.manager;return C?C.get(y):y}function Ht(){ae.apply(this,arguments)}g(Ht,ae,{defaults:{pointers:1},attrTest:function(y){var S=this.options.pointers;return S===0||y.pointers.length===S},process:function(y){var S=this.state,C=y.eventType,A=S&(Xt|ns),R=this.attrTest(y);return A&&(C&vt||!R)?S|zs:A||R?C&nt?S|_e:S&Xt?S|ns:Xt:Zt}});function Nn(){Ht.apply(this,arguments),this.pX=null,this.pY=null}g(Nn,Ht,{defaults:{event:"pan",threshold:10,pointers:1,direction:kc},getTouchAction:function(){var y=this.options.direction,S=[];return y&rt&&S.push(Os),y&Xe&&S.push(Ls),S},directionTest:function(y){var S=this.options,C=!0,A=y.distance,R=y.direction,N=y.deltaX,G=y.deltaY;return R&S.direction||(S.direction&rt?(R=N===0?ss:N<0?Ye:Fe,C=N!=this.pX,A=Math.abs(y.deltaX)):(R=G===0?ss:G<0?ve:k,C=G!=this.pY,A=Math.abs(y.deltaY))),y.direction=R,C&&A>S.threshold&&R&S.direction},attrTest:function(y){return Ht.prototype.attrTest.call(this,y)&&(this.state&Xt||!(this.state&Xt)&&this.directionTest(y))},emit:function(y){this.pX=y.deltaX,this.pY=y.deltaY;var S=jc(y.direction);S&&(y.additionalEvent=this.options.event+S),this._super.emit.call(this,y)}});function Qr(){Ht.apply(this,arguments)}g(Qr,Ht,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ue]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.scale-1)>this.options.threshold||this.state&Xt)},emit:function(y){if(y.scale!==1){var S=y.scale<1?"in":"out";y.additionalEvent=this.options.event+S}this._super.emit.call(this,y)}});function ta(){ae.apply(this,arguments),this._timer=null,this._input=null}g(ta,ae,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gc]},process:function(y){var S=this.options,C=y.pointers.length===S.pointers,A=y.distance<S.threshold,R=y.deltaTime>S.time;if(this._input=y,!A||!C||y.eventType&(nt|vt)&&!R)this.reset();else if(y.eventType&dt)this.reset(),this._timer=u(function(){this.state=re,this.tryEmit()},S.time,this);else if(y.eventType&nt)return re;return Zt},reset:function(){clearTimeout(this._timer)},emit:function(y){this.state===re&&(y&&y.eventType&nt?this.manager.emit(this.options.event+"up",y):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function ea(){Ht.apply(this,arguments)}g(ea,Ht,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ue]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.rotation)>this.options.threshold||this.state&Xt)}});function sa(){Ht.apply(this,arguments)}g(sa,Ht,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:rt|Xe,pointers:1},getTouchAction:function(){return Nn.prototype.getTouchAction.call(this)},attrTest:function(y){var S=this.options.direction,C;return S&(rt|Xe)?C=y.overallVelocity:S&rt?C=y.overallVelocityX:S&Xe&&(C=y.overallVelocityY),this._super.attrTest.call(this,y)&&S&y.offsetDirection&&y.distance>this.options.threshold&&y.maxPointers==this.options.pointers&&c(C)>this.options.velocity&&y.eventType&nt},emit:function(y){var S=jc(y.offsetDirection);S&&this.manager.emit(this.options.event+S,y),this.manager.emit(this.options.event,y)}});function Bn(){ae.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}g(Bn,ae,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Zr]},process:function(y){var S=this.options,C=y.pointers.length===S.pointers,A=y.distance<S.threshold,R=y.deltaTime<S.time;if(this.reset(),y.eventType&dt&&this.count===0)return this.failTimeout();if(A&&R&&C){if(y.eventType!=nt)return this.failTimeout();var N=this.pTime?y.timeStamp-this.pTime<S.interval:!0,G=!this.pCenter||kn(this.pCenter,y.center)<S.posThreshold;this.pTime=y.timeStamp,this.pCenter=y.center,!G||!N?this.count=1:this.count+=1,this._input=y;var mt=this.count%S.taps;if(mt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=re,this.tryEmit()},S.interval,this),Xt):re}return Zt},failTimeout:function(){return this._timer=u(function(){this.state=Zt},this.options.interval,this),Zt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==re&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function oe(y,S){return S=S||{},S.recognizers=M(S.recognizers,oe.defaults.preset),new na(y,S)}oe.VERSION="2.0.7",oe.defaults={domEvents:!1,touchAction:$c,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[Qr,{enable:!1},["rotate"]],[sa,{direction:rt}],[Nn,{direction:rt},["swipe"]],[Bn],[Bn,{event:"doubletap",taps:2},["tap"]],[ta]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var my=1,Hc=2;function na(y,S){this.options=x({},oe.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||y,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=y,this.input=$1(this),this.touchAction=new Kr(this,this.options.touchAction),Wc(this,!0),f(this.options.recognizers,function(C){var A=this.add(new C[0](C[1]));C[2]&&A.recognizeWith(C[2]),C[3]&&A.requireFailure(C[3])},this)}na.prototype={set:function(y){return x(this.options,y),y.touchAction&&this.touchAction.update(),y.inputTarget&&(this.input.destroy(),this.input.target=y.inputTarget,this.input.init()),this},stop:function(y){this.session.stopped=y?Hc:my},recognize:function(y){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(y);var C,A=this.recognizers,R=S.curRecognizer;(!R||R&&R.state&re)&&(R=S.curRecognizer=null);for(var N=0;N<A.length;)C=A[N],S.stopped!==Hc&&(!R||C==R||C.canRecognizeWith(R))?C.recognize(y):C.reset(),!R&&C.state&(Xt|ns|_e)&&(R=S.curRecognizer=C),N++}},get:function(y){if(y instanceof ae)return y;for(var S=this.recognizers,C=0;C<S.length;C++)if(S[C].options.event==y)return S[C];return null},add:function(y){if(d(y,"add",this))return this;var S=this.get(y.options.event);return S&&this.remove(S),this.recognizers.push(y),y.manager=this,this.touchAction.update(),y},remove:function(y){if(d(y,"remove",this))return this;if(y=this.get(y),y){var S=this.recognizers,C=$(S,y);C!==-1&&(S.splice(C,1),this.touchAction.update())}return this},on:function(y,S){if(y!==i&&S!==i){var C=this.handlers;return f(V(y),function(A){C[A]=C[A]||[],C[A].push(S)}),this}},off:function(y,S){if(y!==i){var C=this.handlers;return f(V(y),function(A){S?C[A]&&C[A].splice($(C[A],S),1):delete C[A]}),this}},emit:function(y,S){this.options.domEvents&&py(y,S);var C=this.handlers[y]&&this.handlers[y].slice();if(!(!C||!C.length)){S.type=y,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var A=0;A<C.length;)C[A](S),A++}},destroy:function(){this.element&&Wc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Wc(y,S){var C=y.element;if(C.style){var A;f(y.options.cssProps,function(R,N){A=Z(C.style,N),S?(y.oldCssProps[A]=C.style[A],C.style[A]=R):C.style[A]=y.oldCssProps[A]||""}),S||(y.oldCssProps={})}}function py(y,S){var C=e.createEvent("Event");C.initEvent(y,!0,!0),C.gesture=S,S.target.dispatchEvent(C)}x(oe,{INPUT_START:dt,INPUT_MOVE:Jt,INPUT_END:nt,INPUT_CANCEL:vt,STATE_POSSIBLE:On,STATE_BEGAN:Xt,STATE_CHANGED:ns,STATE_ENDED:_e,STATE_RECOGNIZED:re,STATE_CANCELLED:zs,STATE_FAILED:Zt,DIRECTION_NONE:ss,DIRECTION_LEFT:Ye,DIRECTION_RIGHT:Fe,DIRECTION_UP:ve,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:rt,DIRECTION_VERTICAL:Xe,DIRECTION_ALL:kc,Manager:na,Input:Ft,TouchAction:Kr,TouchInput:Rn,MouseInput:Dn,PointerEventInput:Wr,TouchMouseInput:Jr,SingleTouchInput:Yc,Recognizer:ae,AttrRecognizer:Ht,Tap:Bn,Pan:Nn,Swipe:sa,Pinch:Qr,Rotate:ea,Press:ta,on:E,off:D,each:f,merge:w,extend:b,assign:x,inherit:g,bindFn:v,prefixed:Z});var gy=typeof t<"u"?t:typeof self<"u"?self:{};gy.Hammer=oe,typeof i=="function"&&i.amd?i(function(){return oe}):n.exports?n.exports=oe:t[s]=oe})(window,document,"Hammer")})(Ga);var Iu=Ga.exports;const tt=ra(Iu);var ii=function(n,t){return ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},ii(n,t)};function ce(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ii(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ku(n,t,e,s){function i(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function o(l){try{c(s.next(l))}catch(u){a(u)}}function h(l){try{c(s.throw(l))}catch(u){a(u)}}function c(l){l.done?r(l.value):i(l.value).then(o,h)}c((s=s.apply(n,t||[])).next())})}function qa(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,i,r,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(l){return h([c,l])}}function h(c){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(e=0)),e;)try{if(s=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(l){c=[6,l],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ee(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function le(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],a;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(a)throw a.error}}return r}function Pe(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function Ge(n){return this instanceof Ge?(this.v=n,this):new Ge(n)}function Du(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=e.apply(n,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(f){return function(p){return Promise.resolve(p).then(f,u)}}function o(f,p){s[f]&&(i[f]=function(x){return new Promise(function(b,w){r.push([f,x,b,w])>1||h(f,x)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(s[f](p))}catch(x){d(r[0][3],x)}}function c(f){f.value instanceof Ge?Promise.resolve(f.value.v).then(l,u):d(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function d(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function Ru(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Ee=="function"?Ee(n):n[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(r){e[r]=n[r]&&function(a){return new Promise(function(o,h){a=n[r](a),i(o,h,a.done,a.value)})}}function i(r,a,o,h){Promise.resolve(h).then(function(c){r({value:c,done:o})},a)}}typeof SuppressedError=="function"&&SuppressedError;function q(n){return typeof n=="function"}function ri(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ai=ri(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
13
13
|
`+e.map(function(s,i){return i+1+") "+s.toString()}).join(`
|
|
14
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function hs(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var qe=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,i,r;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Ee(a),h=o.next();!h.done;h=o.next()){var c=h.value;c.remove(this)}}catch(x){t={error:x}}finally{try{h&&!h.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(q(l))try{l()}catch(x){r=x instanceof ri?x.errors:[x]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Ee(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{Qa(p)}catch(x){r=r??[],x instanceof ri?r=Pe(Pe([],le(r)),le(x.errors)):r.push(x)}}}catch(x){s={error:x}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}}if(r)throw new ri(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Qa(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&hs(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&hs(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),Za=qe.EMPTY;function Ka(n){return n instanceof qe||n&&"closed"in n&&q(n.remove)&&q(n.add)&&q(n.unsubscribe)}function Qa(n){q(n)?n():n.unsubscribe()}var to={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ai={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=ai.delegate;return i?.setTimeout?i.setTimeout.apply(i,Pe([n,t],le(e))):setTimeout.apply(void 0,Pe([n,t],le(e)))},clearTimeout:function(n){var t=ai.delegate;return(t?.clearTimeout||clearTimeout)(n)},delegate:void 0};function eo(n){ai.setTimeout(function(){throw n})}function cs(){}function Ks(n){n()}var oi=function(n){ce(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Ka(e)&&e.add(s)):s.destination=Bu,s}return t.create=function(e,s,i){return new Qs(e,s,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(qe),Ou=Function.prototype.bind;function hi(n,t){return Ou.call(n,t)}var zu=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){tn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){tn(s)}else tn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){tn(e)}},n}(),Qs=function(n){ce(t,n);function t(e,s,i){var r=n.call(this)||this,a;if(q(e)||!e)a={next:e??void 0,error:s??void 0,complete:i??void 0};else{var o;r&&to.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=function(){return r.unsubscribe()},a={next:e.next&&hi(e.next,o),error:e.error&&hi(e.error,o),complete:e.complete&&hi(e.complete,o)}):a=e}return r.destination=new zu(a),r}return t}(oi);function tn(n){eo(n)}function Nu(n){throw n}var Bu={closed:!0,next:cs,error:Nu,complete:cs},ci=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Me(n){return n}function Yu(n){return n.length===0?Me:n.length===1?n[0]:function(e){return n.reduce(function(s,i){return i(s)},e)}}var et=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Xu(t)?t:new Qs(t,e,s);return Ks(function(){var a=i,o=a.operator,h=a.source;r.add(o?o.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=so(e),new e(function(i,r){var a=new Qs({next:function(o){try{t(o)}catch(h){r(h),a.unsubscribe()}},error:r,complete:i});s.subscribe(a)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[ci]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yu(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=so(t),new t(function(s,i){var r;e.subscribe(function(a){return r=a},function(a){return i(a)},function(){return s(r)})})},n.create=function(t){return new n(t)},n}();function so(n){var t;return(t=n??to.Promise)!==null&&t!==void 0?t:Promise}function Fu(n){return n&&q(n.next)&&q(n.error)&&q(n.complete)}function Xu(n){return n&&n instanceof oi||Fu(n)&&Ka(n)}function Uu(n){return q(n?.lift)}function Dt(n){return function(t){if(Uu(t))return t.lift(function(e){try{return n(e,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function ht(n,t,e,s,i){return new Vu(n,t,e,s,i)}var Vu=function(n){ce(t,n);function t(e,s,i,r,a,o){var h=n.call(this,e)||this;return h.onFinalize=a,h.shouldUnsubscribe=o,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(oi),$u=ii(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ls=function(n){ce(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var s=new no(this,this);return s.operator=e,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new $u},t.prototype.next=function(e){var s=this;Ks(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var a=Ee(s.currentObservers),o=a.next();!o.done;o=a.next()){var h=o.value;h.next(e)}}catch(c){i={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var s=this;Ks(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=e;for(var i=s.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ks(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var s=e.observers;s.length;)s.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var s=this,i=this,r=i.hasError,a=i.isStopped,o=i.observers;return r||a?Za:(this.currentObservers=null,o.push(e),new qe(function(){s.currentObservers=null,hs(o,e)}))},t.prototype._checkFinalizedStatuses=function(e){var s=this,i=s.hasError,r=s.thrownError,a=s.isStopped;i?e.error(r):a&&e.complete()},t.prototype.asObservable=function(){var e=new et;return e.source=this,e},t.create=function(e,s){return new no(e,s)},t}(et),no=function(n){ce(t,n);function t(e,s){var i=n.call(this)||this;return i.destination=e,i.source=s,i}return t.prototype.next=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,e)},t.prototype.error=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,e)},t.prototype.complete=function(){var e,s;(s=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||s===void 0||s.call(e)},t.prototype._subscribe=function(e){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(e))!==null&&i!==void 0?i:Za},t}(ls),io={now:function(){return(io.delegate||Date).now()},delegate:void 0},Gu=function(n){ce(t,n);function t(e,s){return n.call(this)||this}return t.prototype.schedule=function(e,s){return this},t}(qe),en={setInterval:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=en.delegate;return i?.setInterval?i.setInterval.apply(i,Pe([n,t],le(e))):setInterval.apply(void 0,Pe([n,t],le(e)))},clearInterval:function(n){var t=en.delegate;return(t?.clearInterval||clearInterval)(n)},delegate:void 0},qu=function(n){ce(t,n);function t(e,s){var i=n.call(this,e,s)||this;return i.scheduler=e,i.work=s,i.pending=!1,i}return t.prototype.schedule=function(e,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=e;var r=this.id,a=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(a,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,s),this},t.prototype.requestAsyncId=function(e,s,i){return i===void 0&&(i=0),en.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&en.clearInterval(s)},t.prototype.execute=function(e,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,s){var i=!1,r;try{this.work(e)}catch(a){i=!0,r=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,s=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,hs(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t}(Gu),ro=function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,s){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(s,e)},n.now=io.now,n}(),ju=function(n){ce(t,n);function t(e,s){s===void 0&&(s=ro.now);var i=n.call(this,e,s)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var s=this.actions;if(this._active){s.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=s.shift());if(this._active=!1,i){for(;e=s.shift();)e.unsubscribe();throw i}},t}(ro),li=new ju(qu),Hu=li,ao=new et(function(n){return n.complete()});function oo(n){return n&&q(n.schedule)}function ui(n){return n[n.length-1]}function Wu(n){return q(ui(n))?n.pop():void 0}function us(n){return oo(ui(n))?n.pop():void 0}function Ju(n,t){return typeof ui(n)=="number"?n.pop():t}var fi=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function ho(n){return q(n?.then)}function co(n){return q(n[ci])}function lo(n){return Symbol.asyncIterator&&q(n?.[Symbol.asyncIterator])}function uo(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Zu(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var fo=Zu();function mo(n){return q(n?.[fo])}function po(n){return Ru(this,arguments,function(){var e,s,i,r;return Ja(this,function(a){switch(a.label){case 0:e=n.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ge(e.read())];case 3:return s=a.sent(),i=s.value,r=s.done,r?[4,Ge(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ge(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function go(n){return q(n?.getReader)}function wt(n){if(n instanceof et)return n;if(n!=null){if(co(n))return Ku(n);if(fi(n))return Qu(n);if(ho(n))return tf(n);if(lo(n))return yo(n);if(mo(n))return ef(n);if(go(n))return sf(n)}throw uo(n)}function Ku(n){return new et(function(t){var e=n[ci]();if(q(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Qu(n){return new et(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function tf(n){return new et(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,eo)})}function ef(n){return new et(function(t){var e,s;try{for(var i=Ee(n),r=i.next();!r.done;r=i.next()){var a=r.value;if(t.next(a),t.closed)return}}catch(o){e={error:o}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(e)throw e.error}}t.complete()})}function yo(n){return new et(function(t){nf(n,t).catch(function(e){return t.error(e)})})}function sf(n){return yo(po(n))}function nf(n,t){var e,s,i,r;return Du(this,void 0,void 0,function(){var a,o;return Ja(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=Lu(n),h.label=1;case 1:return[4,e.next()];case 2:if(s=h.sent(),!!s.done)return[3,4];if(a=s.value,t.next(a),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=h.sent(),i={error:o},[3,11];case 6:return h.trys.push([6,,9,10]),s&&!s.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Qt(n,t,e,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function wo(n,t){return t===void 0&&(t=0),Dt(function(e,s){e.subscribe(ht(s,function(i){return Qt(s,n,function(){return s.next(i)},t)},function(){return Qt(s,n,function(){return s.complete()},t)},function(i){return Qt(s,n,function(){return s.error(i)},t)}))})}function di(n,t){return t===void 0&&(t=0),Dt(function(e,s){s.add(n.schedule(function(){return e.subscribe(s)},t))})}function rf(n,t){return wt(n).pipe(di(t),wo(t))}function af(n,t){return wt(n).pipe(di(t),wo(t))}function of(n,t){return new et(function(e){var s=0;return t.schedule(function(){s===n.length?e.complete():(e.next(n[s++]),e.closed||this.schedule())})})}function hf(n,t){return new et(function(e){var s;return Qt(e,t,function(){s=n[fo](),Qt(e,t,function(){var i,r,a;try{i=s.next(),r=i.value,a=i.done}catch(o){e.error(o);return}a?e.complete():e.next(r)},0,!0)}),function(){return q(s?.return)&&s.return()}})}function xo(n,t){if(!n)throw new Error("Iterable cannot be null");return new et(function(e){Qt(e,t,function(){var s=n[Symbol.asyncIterator]();Qt(e,t,function(){s.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function cf(n,t){return xo(po(n),t)}function lf(n,t){if(n!=null){if(co(n))return rf(n,t);if(fi(n))return of(n,t);if(ho(n))return af(n,t);if(lo(n))return xo(n,t);if(mo(n))return hf(n,t);if(go(n))return cf(n,t)}throw uo(n)}function fs(n,t){return t?lf(n,t):wt(n)}function uf(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n);return fs(n,e)}var ff=ii(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function df(n,t){var e=typeof t=="object";return new Promise(function(s,i){var r=new Qs({next:function(a){s(a),r.unsubscribe()},error:i,complete:function(){e?s(t.defaultValue):i(new ff)}});n.subscribe(r)})}function mf(n){return n instanceof Date&&!isNaN(n)}function it(n,t){return Dt(function(e,s){var i=0;e.subscribe(ht(s,function(r){s.next(n.call(t,r,i++))}))})}var pf=Array.isArray;function gf(n,t){return pf(t)?n.apply(void 0,Pe([],le(t))):n(t)}function mi(n){return it(function(t){return gf(n,t)})}var yf=Array.isArray,wf=Object.getPrototypeOf,xf=Object.prototype,bf=Object.keys;function vf(n){if(n.length===1){var t=n[0];if(yf(t))return{args:t,keys:null};if(_f(t)){var e=bf(t);return{args:e.map(function(s){return t[s]}),keys:e}}}return{args:n,keys:null}}function _f(n){return n&&typeof n=="object"&&wf(n)===xf}function Sf(n,t){return n.reduce(function(e,s,i){return e[s]=t[i],e},{})}function Tf(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n),s=Wu(n),i=vf(n),r=i.args,a=i.keys;if(r.length===0)return fs([],e);var o=new et(Ef(r,e,a?function(h){return Sf(a,h)}:Me));return s?o.pipe(mi(s)):o}function Ef(n,t,e){return e===void 0&&(e=Me),function(s){bo(t,function(){for(var i=n.length,r=new Array(i),a=i,o=i,h=function(l){bo(t,function(){var u=fs(n[l],t),d=!1;u.subscribe(ht(s,function(f){r[l]=f,d||(d=!0,o--),o||s.next(e(r.slice()))},function(){--a||s.complete()}))},s)},c=0;c<i;c++)h(c)},s)}}function bo(n,t,e){n?Qt(e,n,t):t()}function Pf(n,t,e,s,i,r,a,o){var h=[],c=0,l=0,u=!1,d=function(){u&&!h.length&&!c&&t.complete()},f=function(x){return c<s?p(x):h.push(x)},p=function(x){r&&t.next(x),c++;var b=!1;wt(e(x,l++)).subscribe(ht(t,function(w){i?.(w),r?f(w):t.next(w)},function(){b=!0},void 0,function(){if(b)try{c--;for(var w=function(){var g=h.shift();a?Qt(t,a,function(){return p(g)}):p(g)};h.length&&c<s;)w();d()}catch(g){t.error(g)}}))};return n.subscribe(ht(t,f,function(){u=!0,d()})),function(){o?.()}}function pi(n,t,e){return e===void 0&&(e=1/0),q(t)?pi(function(s,i){return it(function(r,a){return t(s,r,i,a)})(wt(n(s,i)))},e):(typeof t=="number"&&(e=t),Dt(function(s,i){return Pf(s,i,n,e)}))}function vo(n){return n===void 0&&(n=1/0),pi(Me,n)}function Mf(){return vo(1)}function _o(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Mf()(fs(n,us(n)))}var Cf=["addListener","removeListener"],Af=["addEventListener","removeEventListener"],If=["on","off"];function gi(n,t,e,s){if(q(e)&&(s=e,e=void 0),s)return gi(n,t,e).pipe(mi(s));var i=le(Rf(n)?Af.map(function(o){return function(h){return n[o](t,h,e)}}):kf(n)?Cf.map(So(n,t)):Df(n)?If.map(So(n,t)):[],2),r=i[0],a=i[1];if(!r&&fi(n))return pi(function(o){return gi(o,t,e)})(wt(n));if(!r)throw new TypeError("Invalid event target");return new et(function(o){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return o.next(1<c.length?c:c[0])};return r(h),function(){return a(h)}})}function So(n,t){return function(e){return function(s){return n[e](t,s)}}}function kf(n){return q(n.addListener)&&q(n.removeListener)}function Df(n){return q(n.on)&&q(n.off)}function Rf(n){return q(n.addEventListener)&&q(n.removeEventListener)}function st(n,t,e){return e?st(n,t).pipe(mi(e)):new et(function(s){var i=function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return s.next(a.length===1?a[0]:a)},r=n(i);return q(t)?function(){return t(i,r)}:void 0})}function Lf(n,t,e){n===void 0&&(n=0),e===void 0&&(e=Hu);var s=-1;return t!=null&&(oo(t)?e=t:s=t),new et(function(i){var r=mf(n)?+n-e.now():n;r<0&&(r=0);var a=0;return e.schedule(function(){i.closed||(i.next(a++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function Of(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n),s=Ju(n,1/0),i=n;return i.length?i.length===1?wt(i[0]):vo(s)(fs(i,e)):ao}var zf=Array.isArray;function Nf(n){return n.length===1&&zf(n[0])?n[0]:n}function To(n,t){return Dt(function(e,s){var i=0;e.subscribe(ht(s,function(r){return n.call(t,r,i++)&&s.next(r)}))})}function yi(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n=Nf(n),n.length===1?wt(n[0]):new et(Bf(n))}function Bf(n){return function(t){for(var e=[],s=function(r){e.push(wt(n[r]).subscribe(ht(t,function(a){if(e){for(var o=0;o<e.length;o++)o!==r&&e[o].unsubscribe();e=null}t.next(a)})))},i=0;e&&!t.closed&&i<n.length;i++)s(i)}}function ue(n,t){return t===void 0&&(t=Me),n=n??Yf,Dt(function(e,s){var i,r=!0;e.subscribe(ht(s,function(a){var o=t(a);(r||!n(i,o))&&(r=!1,i=o,s.next(a))}))})}function Yf(n,t){return n===t}function Eo(n,t){return t?function(e){return e.pipe(Eo(function(s,i){return wt(n(s,i)).pipe(it(function(r,a){return t(s,r,i,a)}))}))}:Dt(function(e,s){var i=0,r=null,a=!1;e.subscribe(ht(s,function(o){r||(r=ht(s,void 0,function(){r=null,a&&s.complete()}),wt(n(o,i++)).subscribe(r))},function(){a=!0,!r&&s.complete()}))})}function fe(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n);return Dt(function(s,i){(e?_o(n,s,e):_o(n,s)).subscribe(i)})}function sn(n,t){return Dt(function(e,s){var i=null,r=0,a=!1,o=function(){return a&&!i&&s.complete()};e.subscribe(ht(s,function(h){i?.unsubscribe();var c=0,l=r++;wt(n(h,l)).subscribe(i=ht(s,function(u){return s.next(t?t(h,u,l,c++):u)},function(){i=null,o()}))},function(){a=!0,o()}))})}function Ff(){return sn(Me)}function wi(n){return Dt(function(t,e){wt(n).subscribe(ht(e,function(){return e.complete()},cs)),!e.closed&&t.subscribe(e)})}function Ce(n,t,e){var s=q(n)||t||e?{next:n,error:t,complete:e}:n;return s?Dt(function(i,r){var a;(a=s.subscribe)===null||a===void 0||a.call(s);var o=!0;i.subscribe(ht(r,function(h){var c;(c=s.next)===null||c===void 0||c.call(s,h),r.next(h)},function(){var h;o=!1,(h=s.complete)===null||h===void 0||h.call(s),r.complete()},function(h){var c;o=!1,(c=s.error)===null||c===void 0||c.call(s,h),r.error(h)},function(){var h,c;o&&((h=s.unsubscribe)===null||h===void 0||h.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Me}function Xf(n,t){return Dt(function(e,s){var i=t??{},r=i.leading,a=r===void 0?!0:r,o=i.trailing,h=o===void 0?!1:o,c=!1,l=null,u=null,d=!1,f=function(){u?.unsubscribe(),u=null,h&&(b(),d&&s.complete())},p=function(){u=null,d&&s.complete()},x=function(w){return u=wt(n(w)).subscribe(ht(s,f,p))},b=function(){if(c){c=!1;var w=l;l=null,s.next(w),!d&&x(w)}};e.subscribe(ht(s,function(w){c=!0,l=w,!(u&&!u.closed)&&(a?b():x(w))},function(){d=!0,!(h&&c&&u&&!u.closed)&&s.complete()}))})}function Uf(n,t,e){t===void 0&&(t=li);var s=Lf(n,t);return Xf(function(){return s},e)}function Vf(n,t){return Dt(function(e,s){var i=[],r=function(a){for(;0<i.length;)i.shift().error(a);s.error(a)};wt(n).subscribe(ht(s,function(a){var o=new ls;i.push(o);var h=new qe,c=function(){hs(i,o),o.complete(),h.unsubscribe()},l;try{l=wt(t(a))}catch(u){r(u);return}s.next(o.asObservable()),h.add(l.subscribe(ht(s,c,cs,r)))},cs)),e.subscribe(ht(s,function(a){var o,h,c=i.slice();try{for(var l=Ee(c),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(a)}}catch(f){o={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}finally{if(o)throw o.error}}},function(){for(;0<i.length;)i.shift().complete();s.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function j(n,t,e,s=!1){const i=async r=>{await e(r)};try{n.addEventListener(t,i,s)}catch{n.attachEvent("on"+t,i)}return()=>{try{n.removeEventListener(t,i,s)}catch{n.detachEvent("on"+t,i)}}}function U(n,t,e=!1){return gi(n,t,{capture:e})}function de(n){if(n.preventDefault){n.preventDefault();return}try{n.returnValue=!1}catch{}}function Po(n){if(n.stopPropagation){n.stopPropagation();return}try{n.cancelBubble=!0}catch{}}const $f=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Gf=["keydown","keyup","keypress"],qf=["touchstart","touchend","touchcancel","touchmove"],jf=["pointerdown","pointerup","pointercancel","pointermove"],Hf=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Wf=["change"];function Jf(n,t,e={bubbles:!0,detail:{}}){if(!n)return;let s;try{$f.includes(t)?s=new MouseEvent(t,e):Gf.includes(t)?s=new KeyboardEvent(t,e):qf.includes(t)?s=new TouchEvent(t,e):jf.includes(t)?s=new PointerEvent(t,e):Hf.includes(t)?s=new DragEvent(t,e):Wf.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(n.dispatchEvent)n.dispatchEvent(s);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function Zf(n,t){const e=n.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Kf(n,t){let e=document.createElement(n);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}const nn=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function Qf(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function td(n,t){const e=n.split("."),s=t.split(".");for(let i=0,r=e.length;i<r;i++){if(s.length==i)return 1;if(e[i]!=s[i])return e[i]>s[i]?1:-1}return e.length!=s.length?-1:0}function xi(){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()}const ed=()=>{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};function sd(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function nd(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function bi(){return nn()==="ios"}function Mo(){return nn()==="macos"}function id(){return bi()|Mo()}function Co(){return nn()==="android"}function rd(){return bi()||Co()}function Ao(){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 ad=Ao()!==-1,od=document.documentMode?document.documentMode===9:!1,hd=document.documentMode?document.documentMode===10:!1,cd=document.documentMode?document.documentMode===11:!1;function Io(){return xi()==="wechat"}function ko(){return xi()==="ali"}function ld(){return Io()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function ud(){return ko()&&navigator.userAgent.match(/miniprogram/i)}const fd=typeof document<"u",Do=typeof window<"u",dd=typeof history<"u",md=Do&&window.File&&window.FileReader&&window.FileList&&window.Blob,Ro=(()=>!!(P.root.Worker&&P.root.Blob&&P.root.Promise&&P.root.OffscreenCanvas&&P.root.OffscreenCanvasRenderingContext2D&&P.root.HTMLCanvasElement&&P.root.HTMLCanvasElement.prototype.transferControlToOffscreen&&P.root.URL&&P.root.URL.createObjectURL))(),pd=typeof Path2D=="function"&&typeof DOMMatrix=="function",Lo=function(){if(!P.root.OffscreenCanvas)return!1;const n=new OffscreenCanvas(1,1),t=n.getContext("2d");t.fillRect(0,0,1,1);const e=n.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),gd=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},yd="webkit moz ms o".split(" ");function rn(n){return typeof n=="function"&&/native code/.test(n.toString())}function wd(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}(function(){if(!window.requestAnimationFrame){let n=P.now();window.requestAnimationFrame=function(t){const e=P.now(),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)})})();function vi(n){let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function _i(n,t=0){if(t==0)return n(P.now()),()=>{};{const e=P.now();return vi(s=>s-e>=t?(n(s),!1):!0)}}function xd(n,t=0){let e=!1,s=0;const i=P.now(),r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t<=o),_i(r,Math.max(0,t-o))};return _i(r,t),()=>{e=!0}}function bd(n,t=20){const e=1e3/t;let s=0,i;return()=>(P.now()-s>=e&&(s=P.now(),i=n()),i)}window.requestIdleCallback=window.requestIdleCallback||function(n,t){const e=P.now();return setTimeout(function(){n({didTimeout:P.now()-e>50,timeRemaining:()=>Math.max(0,50-(P.now()-e))})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(n){clearTimeout(n)};function Oo(n,t){requestIdleCallback(e=>{e.timeRemaining()>0||t?n():Oo(n,t)},{timeout:t})}const Si=new P.CacheMap;let Ti=!1;function Ei(n,t,e){n&&t&&Si.set(n,{cb:t,startTime:P.now(),timeout:e}),!Ti&&(Ti=!0,_d(s=>{Ti=!1;let i=s.timeRemaining();Si.filter((r,a)=>{let o=!1;const h=P.now();(i>0||a.timeout&&P.now()-a.startTime>=a.timeout)&&(a.cb(),o=!0);const c=P.now();return i-=c-h,!o}),Si.length>0&&Ei()}))}let an=0,Ae=33,me=33,Pi;const zo=new MessageChannel,vd=zo.port2;zo.port1.onmessage=n=>{Pi!==null&&Pi({didTimeout:an<=P.now(),timeRemaining:()=>Math.max(0,an-P.now())})};function _d(n){return Pi=n,requestAnimationFrame(t=>{let e=t-an+me;e<me&&Ae<me?(e<8&&(e=8),me=e<Ae?Ae:e):e>me&&Ae>me?me=e<Ae?Ae:e:Ae=e,an=t+me,vd.postMessage(null)})}function Sd(n){if(typeof setImmediate<"u"&&rn(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(rn(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&rn(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function Td(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class ds{static _nextId=0;static nextId(){return ds._nextId++}}const z={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-z.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?z.Bounce.In(n*2)*.5:z.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 No(n){switch(n){case z.Quadratic.In:return z.Quadratic.Out;case z.Quadratic.Out:return z.Quadratic.In;case z.Quadratic.InOut:return z.Quadratic.InOut;case z.Cubic.In:return z.Cubic.Out;case z.Cubic.Out:return z.Cubic.In;case z.Cubic.InOut:return z.Cubic.InOut;case z.Quartic.In:return z.Quartic.Out;case z.Quartic.Out:return z.Quartic.In;case z.Quartic.InOut:return z.Quartic.InOut;case z.Quintic.In:return z.Quintic.Out;case z.Quintic.Out:return z.Quintic.In;case z.Quintic.InOut:return z.Quintic.InOut;case z.Sinusoidal.In:return z.Sinusoidal.Out;case z.Sinusoidal.Out:return z.Sinusoidal.In;case z.Sinusoidal.InOut:return z.Sinusoidal.InOut;case z.Exponential.In:return z.Exponential.Out;case z.Exponential.Out:return z.Exponential.In;case z.Exponential.InOut:return z.Exponential.InOut;case z.Circular.In:return z.Circular.Out;case z.Circular.Out:return z.Circular.In;case z.Circular.InOut:return z.Circular.InOut;case z.Elastic.In:return z.Elastic.Out;case z.Elastic.Out:return z.Elastic.In;case z.Elastic.InOut:return z.Elastic.InOut;case z.Back.In:return z.Back.Out;case z.Back.Out:return z.Back.In;case z.Back.InOut:return z.Back.InOut;case z.Bounce.In:return z.Bounce.Out;case z.Bounce.Out:return z.Bounce.In;case z.Bounce.InOut:return z.Bounce.InOut;default:return n}}const Ed=4,Pd=.001,Md=1e-7,Cd=10,ms=11,on=1/(ms-1),Ad=typeof Float32Array=="function";function Bo(n,t){return 1-3*t+3*n}function Yo(n,t){return 3*t-6*n}function Fo(n){return 3*n}function hn(n,t,e){return((Bo(t,e)*n+Yo(t,e))*n+Fo(t))*n}function Xo(n,t,e){return 3*Bo(t,e)*n*n+2*Yo(t,e)*n+Fo(t)}function Id(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=hn(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Md&&++o<Cd);return a}function kd(n,t,e,s){for(let i=0;i<Ed;++i){const r=Xo(t,e,s);if(r===0)return t;const a=hn(t,e,s)-n;t-=a/r}return t}function Dd(n){return n}function Mi(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 Dd;const i=Ad?new Float32Array(ms):new Array(ms);for(let a=0;a<ms;++a)i[a]=hn(a*on,n,e);function r(a){let o=0,h=1;const c=ms-1;for(;h!==c&&i[h]<=a;++h)o+=on;--h;const l=(a-i[h])/(i[h+1]-i[h]),u=o+l*on,d=Xo(u,n,e);return d>=Pd?kd(a,u,n,e):d===0?u:Id(a,o,o+on,n,e)}return a=>a===0||a===1?a:hn(r(a),t,s)}function Ci(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 Uo(n){const[t,e,s,i]=Ci(n);return[1-s,1-i,1-t,1-e]}function Rd(n){return Mi(...Ci(n))}function Ld(n){return Mi(...Uo(n))}const te={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=te.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=te.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=te.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=te.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 Vo{_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=P.now(),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 Nt=new Vo;class Ai{constructor(t,e=Nt){this._object=t,this._group=e}_id=ds.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=z.Linear.None;_interpolationFunction=te.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=P.now()){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=P.now()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=P.now()){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=Nt){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=z.Linear.None){return this._easingFunction=t,this}interpolation(t=te.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=P.now(),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 Od=ds.nextId,zd=Nt.getAll.bind(Nt),Nd=Nt.removeAll.bind(Nt),Bd=Nt.add.bind(Nt),Yd=Nt.remove.bind(Nt),Fd=Nt.update.bind(Nt),Xd={now:P.now,Sequence:ds,Easing:z,Interpolation:te,Group:Vo,Tween:Ai,nextId:Od,getAll:zd,removeAll:Nd,add:Bd,remove:Yd,update:Fd};class Ii{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=P.now(),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=P.now();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){P.ShellSort(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||z.Linear.None,interpolationFunction:s?.interpolationFunction||te.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 Ii,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=vi(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 Ai({...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(),P.deleteArrayItem(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new Ii;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=No(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}}const cn=new P.CacheMap,$o=(n=!0)=>{cn.filter((t,e)=>(e.alternate&&(En(e,e.alternate),n&&cn.set(t,e.alternate),e.alternate=void 0),n))};function ki(n){let t=cn.get(n);return t||(t=Tn(n),cn.set(n,t)),t}function Go(n){const t=ki(n);return t.alternate||(t.alternate=Tn(n)),t.alternate}function Ud(n,t,e=!0){t(Go(n)),$o(e)}function Di(n,t,e=!0){t(Go(n)),Ei("FLUSH_DOM_ACTION",()=>$o(e),50)}function J(n){return n*Math.PI/180}function _t(n){return n*180/Math.PI}function je(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function pe(n,t,e,s){return je(e-n,s-t)}function $t(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function He(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Vd(n,t,e){if(typeof e=="number"){const s=je(n,t,e);return{x:n/=s,y:t/=s,z:e/=s}}else{const s=je(n,t);return{x:n/=s,y:t/=s}}}function $d(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=_t($t(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 qo=Gd("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 Gd(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 St(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 ln(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 qd(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function jd(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const gs={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"}};let un=class{__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",St("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)}},Ri=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},jo=class na{__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(gs);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=gs[i].canvas}}__getStyleState(){const t={},e=Object.keys(gs);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(gs);for(let r=0;r<i.length;r++){const a=gs[i[r]],o=this[i[r]];if(a.apply){if(o instanceof Ri){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,St("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof un)e.setAttribute(a.apply,St("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,St("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),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(qo);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=qo[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(St("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(St("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(St("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(St("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(St("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(St("L {x} {y}",this.__currentPosition)):this.__addPathCommand(St("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(St("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(St("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],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],x=e+f*d[1],b=[-h[1],h[0]],w=[c[1],-c[0]],g=function(M){const E=M[0];return M[1]>=0?Math.acos(E):-Math.acos(E)},v=g(b),_=g(w);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,v,_)}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:ln(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new un(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:ln(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 un(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":qd(this.textAlign),"dominant-baseline":jd(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),u=a?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),a?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(St("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ln(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",St("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,u,d,f,p,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 w=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+s+", "+i+")";if(e instanceof na){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.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),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ln(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 na&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Ri(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Li=class{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 jo({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}}},Oi=class{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=$t(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),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const Hd=class extends Oi{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,u=(t-s)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,x=f*f/(r*r)+p*p/(a*a);if(x>1){const $=Math.sqrt(x);throw r=$*r,a=$*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*p*p-a*a*f*f)/(r*r*p*p+a*a*f*f)),w=h!=c?1:-1,g=w*b*r*p/a,v=w*b*-a*f/r,_=(t+s)/2,M=(e+i)/2,E=Math.cos(l)*g-Math.sin(l)*v+_,D=Math.sin(l)*g+Math.cos(l)*v+M,B=($,W,Q,Z)=>($*Z>=W*Q?1:-1)*Math.acos(($*Q+W*Z)/(Math.sqrt($*$+W*W)*Math.sqrt(Q*Q+Z*Z))),Y=B(1,0,t-E,e-D)-l,V=B(t-E,e-D,s-E,i-D);return[E,D,r,a,l,Y,Y+V]}},Wd=class extends Oi{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}}},ge=class Ns extends Oi{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}));const l=[],u=c.length;for(let p=0;p<u;p++){for(let x=p+1;x<u;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const d={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},f={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.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,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const x=l*u[p]+l,b=this.base3(x,t,s,r,o),w=this.base3(x,e,i,a,h);f+=d[p]*Math.sqrt(b*b+w*w)}return l*f}length(t=1){return Ns.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||Ns.bezlen(e,s,i,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=Ns.bezlen(e,s,i,r,a,o,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=Ns.bezlen(e,s,i,r,a,o,h,c,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),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),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,g=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:x},end:{x:b,y:w},alpha:g}}},ys=Math.PI*2;function Ho(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 Jd(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,d=a*a,f=o*o,p=l*l,x=u*u;let b=d*f-d*x-f*p;b<0&&(b=0),b/=d*x+f*p,b=Math.sqrt(b)*(i===r?-1:1);const w=b*a/o*u,g=b*-o/a*l,v=c*w-h*g+(n+e)/2,_=h*w+c*g+(t+s)/2,M=(l-w)/a,E=(u-g)/o,D=(-l-w)/a,B=(-u-g)/o,Y=Ho(1,0,M,E);let V=Ho(M,E,D,B);return r===0&&V>0&&(V-=ys),r===1&&V<0&&(V+=ys),[v,_,Y,V]}function Zd(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 Wo(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*ys/360),l=Math.cos(h*ys/360),u=l*(n-e)/2+c*(t-s)/2,d=-c*(n-e)/2+l*(t-s)/2;if(u===0&&d===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const f=u*u/(a*a)+d*d/(o*o);f>1&&(a*=Math.sqrt(f),o*=Math.sqrt(f));const p=Jd(n,t,e,s,i,r,a,o,c,l),x=[];let b=p[2],w=p[3];const g=Math.max(Math.ceil(Math.abs(w)/(ys/4)),1);w/=g;for(let v=0;v<g;v++)x.push(Zd(b,w)),b+=w;return x.map(v=>{for(let _=0;_<v.length;_+=2){let M=v[_+0],E=v[_+1];M*=a,E*=o;const D=l*M-c*E,B=c*M+l*E;v[_+0]=D+p[0],v[_+1]=B+p[1]}return v})}function zi(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 ws(n,t,e,s){return[n,t,e,s,e,s]}const xs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class Ie{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&De(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||P.generateUUID()})}static downloadFromSVGElement(t,e="shape"){return gn(ei(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return gn(P.toBlob(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return ti(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 Ie.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=P.extractAllNumbers(r);for(a=="m"&&o.length>xs[a]&&(e.push([i,...o.splice(0,xs[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<xs[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,xs[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,u;for(let d=0,f=t.length;d<f;d++){let p=t[d];const x=p[0];switch(x){case"M":s=p[1],i=p[2];break;case"A":const b=Wo(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((v,_)=>{const[M,E,D,B,Y,V,$,W]=v;p=["C",D,B,Y,V,$,W],_<b.length-1&&e.push(p)});break;case"S":let w=r,g=a;(u=="C"||u=="S")&&(w+=w-c,g+=g-l),p=["C",w,g,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...zi(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...zi(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...ws(r,a,p[1],p[2])];break;case"H":p=["C",...ws(r,a,p[1],a)];break;case"V":p=["C",...ws(r,a,r,p[1])];break;case"Z":p=["C",...ws(r,a,s,i)];break}u=x,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}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}}let Kd=class he{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(Ie.parseSVGPath(t),e):t instanceof he?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=Ie.normalizeSVGPath(Ie.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 ge({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 he;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 ge({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 he;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 Hd){Wo(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,x,b,w]=c;this.normalizedLines.push(new ge({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})),this.prevPathX=b,this.prevPathY=w});return}let e,s,i,r,a,o;t instanceof ge?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Wd?[e,s,i,r,a,o]=zi(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=ws(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new ge({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 Ie.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 xt;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,u=r.c2y,d=r.toX,f=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:u}=t.transformPoint({x:l,y:u}),{x:d,y:f}=t.transformPoint({x:d,y:f}),i.push(new ge({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:u,toX:d,toY:f}))}),{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 he;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=a.length;l<u;l++){const d=a[l],f=d.length();if(h+f>e&&!o){const p=d.getPointAtSegmentLength(e-h);if(c.appendLine(new ge({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new ge({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:d.x,toY:d.y})),h+=f;continue}h+=f,c.appendLine(d)}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){const l=this.getPointAtLength(c),u=Math.pow(pe(l.x,l.y,t,e),2);u<a&&(i=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=Math.pow(pe(l.x,l.y,t,e),2),d=r+o,f=this.getPointAtLength(d),p=Math.pow(pe(f.x,f.y,t,e),2);c>=0&&u<a?(i=l,r=c,a=u):d<=s&&p<a?(i=f,r=d,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?$t(h.x,h.y,i.x,i.y):$t(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+=pe(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++],u=e[o++],d=e[o++],f=e[o++];a.push(["C",h,c,l,u,d,f]);let p=0;for(;p<r&&i>0;)a.push(["C",d,f,d,f,d,f]),i-=6,p++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=P.maxDotNumber(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:he.fromPolymorphPoints(he.mixPoints(new he({d:t}).polymorphPoints,new he({d:e}).polymorphPoints,s)).toSVGPathData()}},Qd=class extends P.EventBus{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=P.generateUUID(),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=P.extractAllNumbers(s).reduce((i,r)=>i+r,0)}return P.reactive(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Kd,P.watchEffect(()=>{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 xt;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new xt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Li)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 Li)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 P.newConstructor(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])=>[P.toKebab(s),i]))):e&&(this.attrs[P.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[P.toKebab(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[P.toKebab(t)]}distance(t){return pe(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=_t($t(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=He(J(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=He(J(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=P.parseNumber(t?.gravity,0);this.vy+=e;const s=P.parseNumber(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=P.parseNumber(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=P.parseNumber(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=P.parseNumber(e?.springLength,100),i=P.parseNumber(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=P.maxDotNumber(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",""+P.maxDotNumber(o.offset,2)),r?.(o,h)}})),a.play()}};class tm extends Qd{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}=qt(J(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=qt(J(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=qt(J(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 je(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 fn=tm;class Ni{_x;_y;_z;_w;constructor(t=0,e=0,s=0,i=1){this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,r,a,o){let h=s[i+0],c=s[i+1],l=s[i+2],u=s[i+3];const d=r[a+0],f=r[a+1],p=r[a+2],x=r[a+3];if(o===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(o===1){t[e+0]=d,t[e+1]=f,t[e+2]=p,t[e+3]=x;return}if(u!==x||h!==d||c!==f||l!==p){let b=1-o;const w=h*d+c*f+l*p+u*x,g=w>=0?1:-1,v=1-w*w;if(v>Number.EPSILON){const M=Math.sqrt(v),E=Math.atan2(M,w*g);b=Math.sin(b*E)/M,o=Math.sin(o*E)/M}const _=o*g;if(h=h*b+d*_,c=c*b+f*_,l=l*b+p*_,u=u*b+x*_,b===1-o){const M=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=M,c*=M,l*=M,u*=M}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,i,r,a){const o=s[i],h=s[i+1],c=s[i+2],l=s[i+3],u=r[a],d=r[a+1],f=r[a+2],p=r[a+3];return t[e]=o*p+l*u+h*f-c*d,t[e+1]=h*p+l*d+c*u-o*f,t[e+2]=c*p+l*f+o*d-h*u,t[e+3]=l*p-o*u-h*d-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,s=this._z,i=this._w){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new Ni(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t.x,i=t.y,r=t.z,a=t.order,o=Math.cos,h=Math.sin,c=o(s/2),l=o(i/2),u=o(r/2),d=h(s/2),f=h(i/2),p=h(r/2);switch(a){case"XYZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"YXZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"ZXY":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"ZYX":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"YZX":this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case"XZY":this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],i=e[4],r=e[8],a=e[1],o=e[5],h=e[9],c=e[2],l=e[6],u=e[10],d=s+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(a-i)*f}else if(s>o&&s>u){const f=2*Math.sqrt(1+s-o-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-s-u);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-s-o);this._w=(a-i)/f,this._x=(r+c)/f,this._y=(h+l)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(P.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,i=t._y,r=t._z,a=t._w,o=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+a*o+i*c-r*h,this._y=i*l+a*h+r*o-s*c,this._z=r*l+a*c+s*h-i*o,this._w=a*l-s*o-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,r=this._z,a=this._w;let o=a*t._w+s*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=s,this._y=i,this._z=r,this;const h=1-o*o;if(h<=Number.EPSILON){const f=1-e;return this._w=f*a+e*this._w,this._x=f*s+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),l=Math.atan2(c,o),u=Math.sin((1-e)*l)/c,d=Math.sin(e*l)/c;return this._w=a*u+this._w*d,this._x=s*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class bs{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new bs(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Jo.copy(this).projectOnVector(t),this.sub(Jo)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(P.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*s-a*i+t.x,this.y=r*i+a*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rt{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new Rt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Zo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Zo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*i,this.y=r[1]*e+r[4]*s+r[7]*i,this.z=r[2]*e+r[5]*s+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=t.value,a=1/(r[3]*e+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*s+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*s+r[10]*i+r[14])*a,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,r=t.x,a=t.y,o=t.z,h=t.w,c=2*(a*i-o*s),l=2*(o*e-r*i),u=2*(r*s-a*e);return this.x=e+h*c+a*u-o*l,this.y=s+h*l+o*c-r*u,this.z=i+h*u+r*l-a*c,this}transformDirection(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*i,this.y=r[1]*e+r[5]*s+r[9]*i,this.z=r[2]*e+r[6]*s+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this.z=P.clamp(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this.z=P.clamp(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,i=t.y,r=t.z,a=e.x,o=e.y,h=e.z;return this.x=i*h-r*o,this.y=r*a-s*h,this.z=s*o-i*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Yi.copy(this).projectOnVector(t),this.sub(Yi)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Yi.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(P.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),s=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Bi{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,i=1){this.x=t,this.y=e,this.z=s,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,s=0,i=1){return this.x=t,this.y=e,this.z=s,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new Bi(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=this.w,a=t.value;return this.x=a[0]*e+a[4]*s+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*s+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*s+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*s+a[11]*i+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,s,i,r;const h=t.value,c=h[0],l=h[4],u=h[8],d=h[1],f=h[5],p=h[9],x=h[2],b=h[6],w=h[10];if(Math.abs(l-d)<.01&&Math.abs(u-x)<.01&&Math.abs(p-b)<.01){if(Math.abs(l+d)<.1&&Math.abs(u+x)<.1&&Math.abs(p+b)<.1&&Math.abs(c+f+w-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const v=(c+1)/2,_=(f+1)/2,M=(w+1)/2,E=(l+d)/4,D=(u+x)/4,B=(p+b)/4;return v>_&&v>M?v<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(v),i=E/s,r=D/s):_>M?_<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(_),s=E/i,r=B/i):M<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(M),s=D/r,i=B/r),this.set(s,i,r,e),this}let g=Math.sqrt((b-p)*(b-p)+(u-x)*(u-x)+(d-l)*(d-l));return Math.abs(g)<.001&&(g=1),this.x=(b-p)/g,this.y=(u-x)/g,this.z=(d-l)/g,this.w=Math.acos((c+f+w-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this.z=P.clamp(this.z,t.z,e.z),this.w=P.clamp(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this.z=P.clamp(this.z,t,e),this.w=P.clamp(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const Jo=new bs,Yi=new Rt,Zo=new Ni,vs=2e3,Fi=2001,Ko=[1,0,0,1],Qo=[1,0,0,1,0,0],th=[1,0,0,0,1,0,0,0,1],eh=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Xi{value;constructor(t=Ko){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,s=0,i=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=i,this}identity(){return this.value=Array.from(Ko),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Xi(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[2],h=s[1],c=s[3],l=i[0],u=i[2],d=i[1],f=i[3];return r[0]=a*l+o*d,r[2]=a*u+o*f,r[1]=h*l+c*d,r[3]=h*u+c*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class We{value;constructor(t=th){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,s=0,i=0,r=1,a=0,o=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=a,l[8]=c,this}identity(){return this.value=Array.from(th),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new We(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[3],h=s[6],c=s[1],l=s[4],u=s[7],d=s[2],f=s[5],p=s[8],x=i[0],b=i[3],w=i[6],g=i[1],v=i[4],_=i[7],M=i[2],E=i[5],D=i[8];return r[0]=a*x+o*g+h*M,r[3]=a*b+o*v+h*E,r[6]=a*w+o*_+h*D,r[1]=c*x+l*g+u*M,r[4]=c*b+l*v+u*E,r[7]=c*w+l*_+u*D,r[2]=d*x+f*g+p*M,r[5]=d*b+f*v+p*E,r[8]=d*w+f*_+p*D,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-s*r*l+s*o*h+i*r*c-i*a*h}invert(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=l*a-o*c,d=o*h-l*r,f=c*r-a*h,p=e*u+s*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/p;return t[0]=u*x,t[1]=(i*c-l*s)*x,t[2]=(o*s-i*a)*x,t[3]=d*x,t[4]=(l*e-i*h)*x,t[5]=(i*r-o*e)*x,t[6]=f*x,t[7]=(s*h-c*e)*x,t[8]=(a*e-s*r)*x,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,i,r,a,o){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(h*a+c*o)+a+t,-i*c,i*h,-i*(-c*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Ui.makeScale(t,e)),this}rotate(t){return this.premultiply(Ui.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ui.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class Ct{value;is3dSpecial=!1;constructor(t=eh){this.value=Array.from(t)}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}set(t=1,e=0,s=0,i=0,r=0,a=1,o=0,h=0,c=0,l=0,u=1,d=0,f=0,p=0,x=0,b=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=s,w[12]=i,w[1]=r,w[5]=a,w[9]=o,w[13]=h,w[2]=c,w[6]=l,w[10]=u,w[14]=d,w[3]=f,w[7]=p,w[11]=x,w[15]=b,this}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(eh),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new Ct(this.value)}static fromString(t){const e=new Ct,s=P.regMatchAll("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(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 xt(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=>P.maxDotNumber(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=_t(P.clamp(Math.asin(-this.m13),-1,1));let r=_t(Math.atan2(this.m23,this.m33));Math.cos(J(i))===0&&(r=_t(Math.atan2(-this.m31,this.m22)));let a=_t(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:_t(this.m14),skewY:_t(this.m24),skewZ:_t(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,i=1/Je.setFromMatrix4Column(t,0).length(),r=1/Je.setFromMatrix4Column(t,1).length(),a=1/Je.setFromMatrix4Column(t,2).length();return e[0]=s[0]*i,e[1]=s[1]*i,e[2]=s[2]*i,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*a,e[9]=s[9]*a,e[10]=s[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,i=t.y,r=t.z,a=Math.cos(s),o=Math.sin(s),h=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const d=a*l,f=a*u,p=o*l,x=o*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=f+p*c,e[5]=d-x*c,e[9]=-o*h,e[2]=x-d*c,e[6]=p+f*c,e[10]=a*h}else if(t.order==="YXZ"){const d=h*l,f=h*u,p=c*l,x=c*u;e[0]=d+x*o,e[4]=p*o-f,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=f*o-p,e[6]=x+d*o,e[10]=a*h}else if(t.order==="ZXY"){const d=h*l,f=h*u,p=c*l,x=c*u;e[0]=d-x*o,e[4]=-a*u,e[8]=p+f*o,e[1]=f+p*o,e[5]=a*l,e[9]=x-d*o,e[2]=-a*c,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const d=a*l,f=a*u,p=o*l,x=o*u;e[0]=h*l,e[4]=p*c-f,e[8]=d*c+x,e[1]=h*u,e[5]=x*c+d,e[9]=f*c-p,e[2]=-c,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const d=a*h,f=a*c,p=o*h,x=o*c;e[0]=h*l,e[4]=x-d*u,e[8]=p*u+f,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=f*u+p,e[10]=d-x*u}else if(t.order==="XZY"){const d=a*h,f=a*c,p=o*h,x=o*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=d*u+x,e[5]=a*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=o*l,e[10]=x*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(em,t,sm)}lookAt(t,e,s){const i=this.value;return Lt.subVectors(t,e),Lt.lengthSq()===0&&(Lt.z=1),Lt.normalize(),ye.crossVectors(s,Lt),ye.lengthSq()===0&&(Math.abs(s.z)===1?Lt.x+=1e-4:Lt.z+=1e-4,Lt.normalize(),ye.crossVectors(s,Lt)),ye.normalize(),dn.crossVectors(Lt,ye),i[0]=ye.x,i[4]=dn.x,i[8]=Lt.x,i[1]=ye.y,i[5]=dn.y,i[9]=Lt.y,i[2]=ye.z,i[6]=dn.z,i[10]=Lt.z,this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[4],h=s[8],c=s[12],l=s[1],u=s[5],d=s[9],f=s[13],p=s[2],x=s[6],b=s[10],w=s[14],g=s[3],v=s[7],_=s[11],M=s[15],E=i[0],D=i[4],B=i[8],Y=i[12],V=i[1],$=i[5],W=i[9],Q=i[13],Z=i[2],Yt=i[6],ft=i[10],Et=i[14],It=i[3],O=i[7],L=i[11],X=i[15];return r[0]=a*E+o*V+h*Z+c*It,r[4]=a*D+o*$+h*Yt+c*O,r[8]=a*B+o*W+h*ft+c*L,r[12]=a*Y+o*Q+h*Et+c*X,r[1]=l*E+u*V+d*Z+f*It,r[5]=l*D+u*$+d*Yt+f*O,r[9]=l*B+u*W+d*ft+f*L,r[13]=l*Y+u*Q+d*Et+f*X,r[2]=p*E+x*V+b*Z+w*It,r[6]=p*D+x*$+b*Yt+w*O,r[10]=p*B+x*W+b*ft+w*L,r[14]=p*Y+x*Q+b*Et+w*X,r[3]=g*E+v*V+_*Z+M*It,r[7]=g*D+v*$+_*Yt+M*O,r[11]=g*B+v*W+_*ft+M*L,r[15]=g*Y+v*Q+_*Et+M*X,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],s=t[4],i=t[8],r=t[12],a=t[1],o=t[5],h=t[9],c=t[13],l=t[2],u=t[6],d=t[10],f=t[14],p=t[3],x=t[7],b=t[11],w=t[15];return p*(+r*h*u-i*c*u-r*o*d+s*c*d+i*o*f-s*h*f)+x*(+e*h*f-e*c*d+r*a*d-i*a*f+i*c*l-r*h*l)+b*(+e*c*u-e*o*f-r*a*u+s*a*f+r*o*l-s*c*l)+w*(-i*o*l-e*h*u+e*o*d+i*a*u-s*a*d+s*h*l)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const i=this.value;return t instanceof Rt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&(i[12]=t,i[13]=e,i[14]=s),this}invert(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],x=t[13],b=t[14],w=t[15],g=u*b*c-x*d*c+x*h*f-o*b*f-u*h*w+o*d*w,v=p*d*c-l*b*c-p*h*f+a*b*f+l*h*w-a*d*w,_=l*x*c-p*u*c+p*o*f-a*x*f-l*o*w+a*u*w,M=p*u*h-l*x*h-p*o*d+a*x*d+l*o*b-a*u*b,E=e*g+s*v+i*_+r*M;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/E;return t[0]=g*D,t[1]=(x*d*r-u*b*r-x*i*f+s*b*f+u*i*w-s*d*w)*D,t[2]=(o*b*r-x*h*r+x*i*c-s*b*c-o*i*w+s*h*w)*D,t[3]=(u*h*r-o*d*r-u*i*c+s*d*c+o*i*f-s*h*f)*D,t[4]=v*D,t[5]=(l*b*r-p*d*r+p*i*f-e*b*f-l*i*w+e*d*w)*D,t[6]=(p*h*r-a*b*r-p*i*c+e*b*c+a*i*w-e*h*w)*D,t[7]=(a*d*r-l*h*r+l*i*c-e*d*c-a*i*f+e*h*f)*D,t[8]=_*D,t[9]=(p*u*r-l*x*r-p*s*f+e*x*f+l*s*w-e*u*w)*D,t[10]=(a*x*r-p*o*r+p*s*c-e*x*c-a*s*w+e*o*w)*D,t[11]=(l*o*r-a*u*r-l*s*c+e*u*c+a*s*f-e*o*f)*D,t[12]=M*D,t[13]=(l*x*i-p*u*i+p*s*d-e*x*d-l*s*b+e*u*b)*D,t[14]=(p*o*i-a*x*i-p*s*h+e*x*h+a*s*b-e*o*b)*D,t[15]=(a*u*i-l*o*i+l*s*h-e*u*h-a*s*d+e*o*d)*D,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,i))}makeTranslation(t,e,s){return t instanceof Rt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),i=Math.sin(e),r=1-s,a=t.x,o=t.y,h=t.z,c=r*a,l=r*o;return this.set(c*a+s,c*o-i*h,c*h+i*o,0,c*o+i*h,l*o+s,l*h-i*a,0,c*h-i*o,l*h+i*a,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,i,r,a){return this.set(1,s,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,s,i,r,a,o=vs){const h=this.value,c=2*r/(e-t),l=2*r/(s-i),u=(e+t)/(e-t),d=(s+i)/(s-i);let f,p;if(o===vs)f=-(a+r)/(a-r),p=-2*a*r/(a-r);else if(o===Fi)f=-a/(a-r),p=-a*r/(a-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=d,h[13]=0,h[2]=0,h[6]=0,h[10]=f,h[14]=p,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,s,i,r,a,o=vs){const h=this.value,c=1/(e-t),l=1/(s-i),u=1/(a-r),d=(e+t)*c,f=(s+i)*l;let p,x;if(o===vs)p=(a+r)*u,x=-2*u;else if(o===Fi)p=r*u,x=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-d,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=x,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,s){const i=this.value,r=e.x,a=e.y,o=e.z,h=e.w,c=r+r,l=a+a,u=o+o,d=r*c,f=r*l,p=r*u,x=a*l,b=a*u,w=o*u,g=h*c,v=h*l,_=h*u,M=s.x,E=s.y,D=s.z;return i[0]=(1-(x+w))*M,i[1]=(f+_)*M,i[2]=(p-v)*M,i[3]=0,i[4]=(f-_)*E,i[5]=(1-(d+w))*E,i[6]=(b+g)*E,i[7]=0,i[8]=(p+v)*D,i[9]=(b-g)*D,i[10]=(1-(d+x))*D,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,s){const i=this.value;let r=Je.set(i[0],i[1],i[2]).length();const a=Je.set(i[4],i[5],i[6]).length(),o=Je.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Gt.copy(this);const c=1/r,l=1/a,u=1/o;return Gt.value[0]*=c,Gt.value[1]*=c,Gt.value[2]*=c,Gt.value[4]*=l,Gt.value[5]*=l,Gt.value[6]*=l,Gt.value[8]*=u,Gt.value[9]*=u,Gt.value[10]*=u,e.setFromRotationMatrix4(Gt),s.x=r,s.y=a,s.z=o,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,s=0){return this.multiply(new Ct([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 Ct([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,i=t.y,r=t.z;return e[0]*=s,e[4]*=i,e[8]*=r,e[1]*=s,e[5]*=i,e[9]*=r,e[2]*=s,e[6]*=i,e[10]*=r,e[3]*=s,e[7]*=i,e[11]*=r,this}rotateX(t){const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([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 Ct([1,0,0,J(t),0,1,0,J(e),0,0,1,J(s),0,0,0,1]))}perspective(t){return this.multiply(new Ct([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 u=-i/l;return e+=u*(a-e),s+=u*(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 fn({x:t,y:e}),a=new fn({x:t+s,y:e}),o=new fn({x:t+s,y:e+i}),h=new fn({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),u=Math.max(r.x,a.x,o.x,h.x)-c,d=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:u,height:d}}}class xt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Qo){this.value=Array.from(t),this.matrix4=this.toMatrix4()}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}static fromString(t){const e=new xt,s=P.regMatchAll("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){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 Ct(e)}identity(){return this.value=Array.from(Qo),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),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}multiplyScalar(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.multiplyScalar(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 xt(this.value)}multiply(t){const e=this.clone(),s=t instanceof xt?t:new xt(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}invert(){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,u=-c*i+a*o,d=h*i-r*o;let f=t*l+e*u+s*d;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+s*h)*f,this.m13=(a*e-s*r)*f,this.m21=u*f,this.m22=(c*t-s*o)*f,this.m23=(-a*t+s*i)*f,this.m31=d*f,this.m32=(-h*t+e*o)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new xt;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=_t(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:_t(Math.atan2(-this.m21,this.m22)),skewY:_t(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],u=t.value[3],d=t.value[4],f=t.value[5],p=h*u,x=c*l,b=(l*s-e*u)/(x-p),w=(h*s-e*c)/(p-x),g=(l*r-i*u)/(x-p),v=(h*r-i*c)/(p-x),_=(l*(o-f)+u*(d-a))/(x-p),M=(h*(o-f)+c*(d-a))/(p-x),E=[b,w,g,v,_,M];return new xt(E)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>P.maxDotNumber(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),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.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const i=J(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.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:a}=this.matrix4.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.toMatrix4(),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.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:a}=this.matrix4.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(J(e)),Math.sin(J(e)),-Math.sin(J(t)),Math.cos(J(t)),0,0]),this.toMatrix4(),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.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const em=new Rt(0,0,0),sm=new Rt(1,1,1),ye=new Rt,dn=new Rt,Lt=new Rt,Je=new Rt,Ui=new We,Gt=new Ct;function Vi(n){const t=new xt;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.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new Ct(r)),t.matrix4.toMatrix(t);break}return""}),t}function qt(n,t,e){const s=new xt;return s.rotate(_t(n)),s.transformPoint({x:t,y:e})}function $i(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=J(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 nm(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,$i(t)),s}function ke(n,t,e){const s=ki(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[P.toCamel(t)]||s.props.style[P.toKebab(t)]||"":s.props.style}function Gi(n,t,e){Di(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})},!0)}function qi(n){const t={};if(getComputedStyle){const e=getComputedStyle(n);for(let s=0,i=e.length;s<i;s++)t[e[s]]=e.getPropertyValue(t[s])}else{const e=n.currentStyle;for(const s in e)t[s]=e[s]}return n.style.cssText&&n.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[s,i]=e.split(":");s&&i&&(t[s.trim()]=i.trim())}),t}function im(n,t,e){let s=n.style[t]||"";if(!s&&getComputedStyle){t=P.toKebab(t);const i=getComputedStyle(n,e),r=i.getPropertyPriority(t);s=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=n.currentStyle[t]||""),s}function mn(n,t,e){typeof t=="string"&&e?n.style.setProperty(P.toKebab(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{mn(n,s,t[s])})}function ji(n,t){typeof t=="string"?n.style.removeProperty(P.toKebab(t)):Object.keys(t).forEach(e=>{ji(n,e)})}function sh(n,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=n,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(s)}}}function rm(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:ke(n,"transform")||""});const s=Vi(e.transform),i={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=ke(n,r)),Object.assign(i,{[r]:`${a}`});break}}return Object.assign(i,{transform:s.toString()}),i}function De(n,t,e){if(t===void 0&&e===void 0)return Hi(n);if(typeof t=="string"&&e===void 0)return nh(n,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=""+e),Di(n,i=>{Object.entries(s).forEach(([r,a])=>{i.props[r]=""+a})})}const am=["-o-","-ms-","-moz-","-webkit-",""];function Hi(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=qi(n):t[r.nodeName]=r.nodeValue)}return t}function nh(n,t){return t==="style"?qi(n):n.getAttribute(P.toKebab(t))}function Ze(n,t,e){return n.setAttribute(P.toKebab(t),""+e)}function om(n,t){t.split(/[,\s]+/i).forEach(e=>{const s=P.toKebab(e.trim());s!=""&&n.removeAttribute(s)})}function ih(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}function hm(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}}function rh(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const cm=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 u=e;const d=String.fromCharCode;do{const p=l*(u-1);let x="";for(let b=0;b<t;b++){const w=b<<2;x+=d(h[p+w+2])+d(h[p+w+1])+d(h[p+w])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let x="";if(typeof p=="string")x=p;else for(let b=0;b<p.length;b++)x+=String.fromCharCode(p[b]);return btoa(x)}return f(r.concat(a))+f(c)};function lm(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")}const um=(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)};function fm(n,t){return createImageBitmap(n,t)}function dm(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=Wi(t),a=Wi(e),o=Wi(s);return"rgb("+r+","+a+","+o+")"}function Wi(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 mm=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)},pm=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)},gm=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)},ym=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)},wm=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)},xm=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)},bm=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)},vm=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)},_m=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)},Sm=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)},Tm=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)},Em=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)},Pm=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)},Mm=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)},Cm=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)},Am=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)},Im=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)},km=n=>ah(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Dm=n=>ah(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Rm=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)},Lm=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=oh([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)};function Om(n,t,e,s,i,r=!1,a){const{data:o,width:h,height:c}=n;let l=i,u=s,d=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),d<1?d=1:d>h&&(d=h),f<1?f=1:f>c&&(f=c),l+d>h&&(d=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let w=0;w<h;w++){const g=(b*h+w)*4;w>=l&&w<=l+d&&b>=u&&b<=u+f?(p[g]=o[g],p[g+1]=o[g+1],p[g+2]=o[g+2],p[g+3]=o[g+3]):(p[g]=255,p[g+1]=255,p[g+2]=255,p[g+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(d*f*4);for(let b=u;b<=u+f;b++)for(let w=l;w<=l+d;w++){const g=((b-u)*d+w-l)*4,v=(b*h+w)*4;p[g]=o[v],p[g+1]=o[v+1],p[g+2]=o[v+2],p[g+3]=o[v+3]}return new ImageData(p,d,f)}}function zm(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 u=0;u<r;u++){const d=(l*r+u)*4;let f=-1;u<o?l<o?f=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(f=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(l-(a-o),2))):u>r-o-1&&(l<o?f=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(f=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(f)>o?(h[d]=255,h[d+1]=255,h[d+2]=255,h[d+3]=s||e.toUpperCase()==="PNG"?0:255):(h[d]=i[d],h[d+1]=i[d+1],h[d+2]=i[d+2],h[d+3]=s||e.toUpperCase()==="PNG"?i[d+3]:255)}return new ImageData(h,r,a)}function Nm(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)}function Bm(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)}function Ym(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 u=s[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),a[l+3]=u}return new ImageData(a,i,r)}function Fm(n,t,e,s){const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,u=s;e+c>a&&(l=a-c),s+h>r&&(u=r-h);const d=new Uint8ClampedArray(i.length);for(let p=0;p<a;p++)for(let x=0;x<r;x++){const b=(p*r+x)*4;if(x<u||x>u+h||p<=l||p>=l+c)d[b]=i[b],d[b+1]=i[b+1],d[b+2]=i[b+2],d[b+3]=i[b+3];else{const w=(p*r+x-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,g=[o[w],o[w+1],o[w+2],o[w+3]],v=[i[b],i[b+1],i[b+2],i[b+3]],_=oh(g,v);d[b]=_[0],d[b+1]=_[1],d[b+2]=_[2],d[b+3]=_[3]}}return new ImageData(d,r,a)}function Xm(n,t,e,s,i,r=10){const{data:a,width:o,height:h}=n;let c=i,l=s,u=t,d=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),u<1?u=1:u>o&&(u=o),d<1?d=1:d>h&&(d=h),c+u>o&&(u=o-c),l+d>h&&(d=h-l);const f=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const w=(x*o+b)*4;if(b>=c&&b<=c+u&&x>=l&&x<=l+d){const g=Math.floor((b-c)/r),v=Math.floor((x-l)/r);let _=Math.floor(r*(g+1)-r/2+c),M=Math.floor(r*(v+1)-r/2+l);_>o-1&&(_=o-1),M>h-1&&(M=h-1);const E=(M*o+_)*4;f[w]=a[E],f[w+1]=a[E+1],f[w+2]=a[E+2],f[w+3]=a[E+3]}else f[w]=a[w],f[w+1]=a[w+1],f[w+2]=a[w+2],f[w+3]=a[w+3]}return new ImageData(f,o,h)}function Um(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 u=0;u<r;u++)for(let d=0;d<i;d++){const f=(u*i+d)*4,p=a[f],x=a[f+1],b=a[f+2],w=a[f+3];p===h.r&&x===h.g&&b===h.b&&w===h.a&&c.a!==0?(o[f]=c.r,o[f+1]=c.g,o[f+2]=c.b,o[f+3]=c.a):(o[f]=s[f],o[f+1]=s[f+1],o[f+2]=s[f+2],o[f+3]=s[f+3])}return new ImageData(o,i,r)}return n}function ah(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 u=c+l;h===0||h===s-1||o===0||o===i-1?r[u]=e[u]:r[u]=t[0]*e[u-s*4-4]+t[1]*e[u-s*4]+t[2]*e[u-s*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+s*4-4]+t[7]*e[u+s*4]+t[8]*e[u+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)}function oh(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]}const Ji=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}}},hh=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}}},ch=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(u,d){if(u>>>d)throw new Error("length over");for(;c+d>=8;)h.writeByte(255&(u<<c|l)),d-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+d},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const u=a();for(let b=0;b<h;b++)u.add(String.fromCharCode(b));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const d=Ji(),f=i(d);f.write(h,l);let p=0,x=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const b=String.fromCharCode(s[p]);p+=1,u.contains(x+b)?x=x+b:(f.write(u.indexOf(x),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(x+b)),x=b)}return f.write(u.indexOf(x),l),f.write(c,l),f.flush(),d.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(P.radixStringToNumber("0x"+t[1]+t[2])),o.writeByte(P.radixStringToNumber("0x"+t[3]+t[4])),o.writeByte(P.radixStringToNumber("0x"+t[5]+t[6])),o.writeByte(P.radixStringToNumber("0x"+e[1]+e[2])),o.writeByte(P.radixStringToNumber("0x"+e[3]+e[4])),o.writeByte(P.radixStringToNumber("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(";")}}},lh=function(n,t,e,s){const i=ch(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=Ji();i.write(r);const a=hh(),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},Ot={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},_s={M:0,L:1,H:2,Q:3},we={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ut={glog:function(n){if(n<1)throw new Error("glog("+n+")");return ut.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return ut.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)ut.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)ut.EXP_TABLE[n]=ut.EXP_TABLE[n-4]^ut.EXP_TABLE[n-5]^ut.EXP_TABLE[n-6]^ut.EXP_TABLE[n-8];for(let n=0;n<255;n++)ut.LOG_TABLE[ut.EXP_TABLE[n]]=n;const K={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(;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(n<<10|t)^K.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return K.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case we.PATTERN000:return(t+e)%2==0;case we.PATTERN001:return t%2==0;case we.PATTERN010:return e%3==0;case we.PATTERN011:return(t+e)%3==0;case we.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case we.PATTERN101:return t*e%2+t*e%3==0;case we.PATTERN110:return(t*e%2+t*e%3)%2==0;case we.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Ke([1],0);for(let e=0;e<n;e++)t=t.multiply(new Ke([1,ut.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Ot.MODE_NUMBER:return 10;case Ot.MODE_ALPHA_NUM:return 9;case Ot.MODE_8BIT_BYTE:return 8;case Ot.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Ot.MODE_NUMBER:return 12;case Ot.MODE_ALPHA_NUM:return 11;case Ot.MODE_8BIT_BYTE:return 16;case Ot.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Ot.MODE_NUMBER:return 14;case Ot.MODE_ALPHA_NUM:return 13;case Ot.MODE_8BIT_BYTE:return 16;case Ot.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 Ke{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]^=ut.gexp(ut.glog(this.get(s))+ut.glog(t.get(i)));return new Ke(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=ut.glog(this.get(0))-ut.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]^=ut.gexp(ut.glog(t.get(i))+e);return new Ke(s,0).mod(t)}}class ee{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=ee.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 ee(h,c))}return r}static getRsBlockTable(t,e){switch(e){case _s.L:return ee.RS_BLOCK_TABLE[(t-1)*4+0];case _s.M:return ee.RS_BLOCK_TABLE[(t-1)*4+1];case _s.Q:return ee.RS_BLOCK_TABLE[(t-1)*4+2];case _s.H:return ee.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class uh{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 Vm{mode;data;constructor(t){this.mode=Ot.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 xe{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=_s[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Vm(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=ee.getRSBlocks(t,this.errorCorrectLevel),s=new uh;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(),K.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=xe.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=K.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=K.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=K.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=K.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),K.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=ee.getRSBlocks(t,e),r=new uh;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),K.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(xe.PAD0,8),r.getLengthInBits()>=a*8));)r.put(xe.PAD1,8);return xe.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 u=0;u<e.length;u++){const d=e[u].dataCount,f=e[u].totalCount-d;i=Math.max(i,d),r=Math.max(r,f),a[u]=new Array(d);for(let w=0;w<a[u].length;w++)a[u][w]=255&t.buffer[w+s];s+=d;const p=K.getErrorCorrectPolynomial(f),b=new Ke(a[u],p.getLength()-1).mod(p);o[u]=new Array(p.getLength()-1);for(let w=0;w<o[u].length;w++){const g=w+b.getLength()-o[u].length;o[u][w]=g>=0?b.get(g):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<i;u++)for(let d=0;d<e.length;d++)u<a[d].length&&(c[l++]=a[d][u]);for(let u=0;u<r;u++)for(let d=0;d<e.length;d++)u<o[d].length&&(c[l++]=o[d][u]);return c}}const fh=Math.ceil,Ss=Math.floor,dh=Math.round;function $m(n,t){const e=P.utf16to8(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 xe(r,s);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-a*2)/l,d=a,f=i-a;return lh(i,o,h,function(p,x){if(d<=p&&p<f&&d<=x&&x<f){const b=Ss((p-d)/u),w=Ss((x-d)/u);return c.isDark(w,b)?0:1}else return 1})}function Gm(n,t){const e=t.x||0,s=t.y||0,i=P.utf16to8(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ss(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",d=new xe(c,a);d.addData(i),d.make();const f=d.getModuleCount(),p=(o-h*2)/f;r.fillStyle=u,r.fillRect(e,s,o,o);for(let x=0;x<f;x++)for(let b=0;b<f;b++){const w=fh((b+1)*p)-Ss(b*p),g=fh((x+1)*p)-Ss(x*p);r.fillStyle=d.isDark(x,b)?l:u,r.fillRect(e+dh(b*p)+h,s+dh(x*p)+h,w,g)}}const pn=new bs,ot=new Rt;function Ts(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function At(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class se{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=s,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=P.cloneTypedArray(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[s+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)pn.fromBufferAttribute(this,e),pn.applyMatrix3(t),this.setXY(e,pn.x,pn.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyMatrix3(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyMatrix4(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyNormalMatrix(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.transformDirection(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Ts(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=At(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ts(e,this.array)),e}setX(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ts(e,this.array)),e}setY(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ts(e,this.array)),e}setZ(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ts(e,this.array)),e}setW(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,i){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array),i=At(i,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this}setXYZW(t,e,s,i,r){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return P.newConstructor(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class qm extends se{constructor(t,e,s=!1){super(new Int8Array(t),e,s)}}class jm extends se{constructor(t,e,s=!1){super(new Uint8Array(t),e,s)}}class Hm extends se{constructor(t,e,s=!1){super(new Uint8ClampedArray(t),e,s)}}class Wm extends se{constructor(t,e,s=!1){super(new Int16Array(t),e,s)}}class Jm extends se{constructor(t,e,s=!1){super(new Uint16Array(t),e,s)}}class Zm extends se{constructor(t,e,s=!1){super(new Int32Array(t),e,s)}}class Km extends se{constructor(t,e,s=!1){super(new Uint32Array(t),e,s)}}class Qm extends se{constructor(t,e,s=!1){super(new Float32Array(t),e,s)}}const mh={map:new Map,transform:function(n){if(Lo)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 tp(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function ep(n,t,e){const s=n.createPattern(mh.transform(t),"no-repeat");if(s){const i=$i(e);s.setTransform(i),n.fillStyle=s}}function ph(n){return window.URL.createObjectURL(n)}function sp(n){return window.URL.revokeObjectURL(n)}function gh(n){let t=!1,e;function s(){document.readyState==="loading"||t||(n(),e?.(),t=!0)}try{e=j(document,"DOMContentLoaded",s)}catch{e=j(window,"load",s)}return s(),()=>{t||e()}}function yh(n){return j(window,"beforeunload",t=>{n(t)})}async function np(n,t=6e4){return new Promise((e,s)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=a=>{clearTimeout(r),e(a),i.onerror=i.onload=null},i.onerror=a=>{clearTimeout(r),s(a)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}function gn(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}async function ip(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=o=>{clearTimeout(a),s(o),r.onerror=r.onload=null},r.onerror=o=>{clearTimeout(a),i(o)},r.setAttribute("href",n);const a=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function rp(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}const wh=new P.CacheMap;async function xh(n,t=6e4){return new Promise((e,s)=>{const i=typeof n=="string"?n:ph(n),r=wh.get(i);if(r)return e(r);const a=document.createElement("img");a.onload=()=>{clearTimeout(o);const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:rh(a)};wh.set(i,l),e(l),a.onerror=a.onload=null},a.onerror=h=>{clearTimeout(o),s(h)},a.src=i;const o=setTimeout(()=>{s("Timeout!")},t)})}async function bh(n=P.ReadInBrowserEnum.text,t=["*"]){const s=(await si(t))[0],i=await os(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function op(n=["image/*"]){const e=(await si(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await os(e,P.ReadInBrowserEnum.arraybuffer),i=P.toBlob(s),r=await xh(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function hp(){return window.getSelection()?.toString()||""}function cp(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}function lp(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}async function up(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function fp(n,t){window.scrollTo(n,t)}function dp(){let n=P.noop,t=P.noop;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=yh(()=>{window.history.scrollRestoration="auto"}),t=gh(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function mp(n){return/(html|body)/i.test(n.tagName)||n===document.documentElement}const pp=n=>n===document.activeElement&&(n.type||n.href),Zi=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function gp(n){return n*Zi()}function yp(n){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):Zi()}const wp=n=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},xp=n=>n.parentElement,Ki=(n,t=[])=>!n||n.parentElement===null&&n.parentNode===null?t:Ki(n.parentElement,t.concat([n]));function bp(n){const t=Ki(n);for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(ke(t[e],"overflow")+ke(t[e],"overflow-y")+ke(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const vp=(n,t)=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),_p=n=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),Sp=n=>n.nextElementSibling,Tp=n=>n.previousElementSibling,Ep=(n,t)=>n.closest(t),Pp=n=>n.shadowRoot,Es=n=>n.tagName==="INPUT"||n instanceof HTMLInputElement,Qi=n=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,Mp=n=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,tr=n=>Es(n)&&n.getAttribute("type")==="checkbox",er=n=>Es(n)&&n.getAttribute("type")==="radio",Cp=n=>Es(n)&&n.getAttribute("type")==="text",Ap=n=>Es(n)&&n.getAttribute("type")==="number";function Ip(n,t){if(Qi(n)){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}}function kp(n,t){if(er(n)){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}}function Dp(n,t){tr(n)&&(n.checked=t)}const Ps=(n,t,e="append")=>{typeof t=="string"?n[e](Eh(t)):n[e](t)},vh=function(n,t){if(typeof t=="string"){n.innerHTML=t;const e=Mh(n);e!=n&&(n=e)}else Ps(t,"replaceWith")},_h=function(n){vh(n,"")},Rp=(n,t)=>{n.textContent=t},Lp=n=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},Op=n=>n.remove();function zp(n,t){ke(n,"display")=="none"&&t===void 0||t===!0?Sh(n):Th(n)}function Sh(n){Gi(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function Th(n){Gi(n,"display","none")}function sr(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(e){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&&De(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Np(n,t){sr(n,t,"add")}function Bp(n,t){sr(n,t,"remove")}function Yp(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function Eh(n,t=!1){const e=document.createElement("template");return e.innerHTML=n,t&&e.content.childNodes.forEach(s=>{const i=Mh(s);i!=s&&e.content.replaceChild(i,s)}),e.content}function Ph(n){return document.createElement.call(document,n)}function Fp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Xp(n){return document.createTextNode.call(document,n)}function Mh(n){return n.tagName=="SCRIPT"&&(n=Ch(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Ch(t),t)}),n}function Ch(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function Up(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Vp(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}function nr(){return{x:0,y:0,isDown:!1}}function Re(){const n=nr(),t=nr();return{start:n,current:t,setStart:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,s)},setCurrent:(e,s)=>{t.x=e.x,t.y=e.y,t.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1}}}function yn(n=document.documentElement,t=!1){return U(n,"mousemove",t)}function Ah(n=document.documentElement,t=!1){return U(n,"mousedown",t)}function Ih(n=document.documentElement,t=!1){return U(n,"mouseup",t)}function $p(n=document.documentElement,t=!1){return U(n,"mouseover",t)}function Gp(n=document.documentElement,t=!1){return U(n,"mouseout",t)}function qp(n=document.documentElement,t=!1){return U(n,"mouseenter",t)}function jp(n=document.documentElement,t=!1){return U(n,"mouseleave",t)}function Hp(n=document.documentElement,t=!1){return U(n,"click",t)}function Wp(n=document.documentElement,t=!1){return U(n,"dblclick",t)}function Jp(n=document.documentElement,t=!1){return U(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Zp(n=document.documentElement,t=!1){return U(n,"contextmenu",t)}function kh(n=document.documentElement,t=!1){return U(n,"touchmove",t)}function Dh(n=document.documentElement,t=!1){return U(n,"touchstart",t)}function Rh(n=document.documentElement,t=!1){return U(n,"touchend",t)}function Lh(n=document.documentElement,t=!1){return U(n,"touchcancel",t)}function ir(n=document.documentElement,t=!1){return U(n,"pointermove",t)}function rr(n=document.documentElement,t=!1){return U(n,"pointerdown",t)}function ar(n=document.documentElement,t=!1){return U(n,"pointerup",t)}function or(n=document.documentElement,t=!1){return U(n,"pointercancel",t)}function Kp(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Qp(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function tg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function eg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function sg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function ng(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function ig(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function rg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function ag(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function og(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function hg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function cg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function lg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("press",e)},e=>{t.off("press",e)})}function ug(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function fg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function dg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function mg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function pg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function gg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function yg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function wg(n=document.documentElement){const t=new tt(document.documentElement);return st(e=>{const s=i=>{!i.target||n==i.target||n.contains(i.target)||e(i)};return t.on("tap",s),s},(e,s)=>{t.off("tap",s)})}function xg(n=document.documentElement,t=!1){return U(n,"transitionstart",t)}function bg(n=document.documentElement,t=!1){return U(n,"transitionend",t)}function vg(n=document.documentElement,t=!1){return U(n,"animationstart",t)}function _g(n=document.documentElement,t=!1){return U(n,"animationend",t)}function Oh(n=document.documentElement,t=!1){return U(n,"drag",t)}function zh(n=document.documentElement,t=!1){return U(n,"dragstart",t)}function Nh(n=document.documentElement,t=!1){return U(n,"dragend",t)}function Bh(n=document.documentElement,t=!1){return U(n,"drop",t)}function Yh(n=document.documentElement,t=!1){return U(n,"dragenter",t)}function Fh(n=document.documentElement,t=!1){return U(n,"dragleave",t)}function Xh(n=document.documentElement,t=!1){return U(n,"dragover",t)}function Uh(n=document.documentElement,t=!1){return U(n,"keydown",t)}function Vh(n=document.documentElement,t=!1){return U(n,"keyup",t)}function Sg(n=document.documentElement,t=!1){return U(n,"keypress",t)}function Tg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return yn(n).pipe(it(s=>(e.setCurrent(ct(s,n)),e)))}function Eg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return yn(n).pipe(Vf(Ah(n).pipe(Ce(s=>{e.setStart(ct(s,n),!0),t?.start?.(s,e)})),()=>Ih(n).pipe(Ce(s=>{e.setCurrent(ct(s,n),!1),t?.end?.(s,e)}))),Ff(),it(s=>(e.setCurrent(ct(s,n),!0),e)))}function Pg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return Dh(n).pipe(Ce(s=>{const i=s.changedTouches[0];e.setStart(ct(i,n),!0),t?.start?.(i,e)}),sn(()=>kh(n).pipe(wi(yi(Rh(n),Lh(n)).pipe(Ce(s=>{const i=s.changedTouches[0];e.setCurrent(ct(i,n),!1),t?.end?.(i,e)}))))),it(s=>{const i=s.changedTouches[0];return e.setCurrent(ct(i,n),!0),e}))}function $h(n=document.documentElement,t){const e=t?.useMousePoint||Re();return rr(n).pipe(Ce(s=>{e.setStart(ct(s,n),!0),t?.start?.(s,e)}),sn(()=>ir(n).pipe(wi(yi(ar(n),or(n)).pipe(Ce(s=>{e.setCurrent(ct(s,n),!1),t?.end?.(s,e)}))))),it(s=>(e.setCurrent(ct(s,n),!0),e)))}function Gh(n=document.documentElement,t){const e=t?.useMousePoint||Re();return Of(yn(n),rr(n)).pipe(Eo(s=>s instanceof PointerEvent?(e.setStart(ct(s,n),!0),t?.start?.(s,e),ir(n).pipe(wi(yi(ar(n),or(n)).pipe(Ce(i=>{e.setCurrent(ct(i,n),!1),t?.end?.(i,e)}))))):s instanceof MouseEvent?uf(s):ao),it(s=>(e.setCurrent(ct(s,n),s instanceof PointerEvent),e)))}function Mg(n){return new et(t=>$h(n,{start:()=>{t.next(0)},end:(s,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(s=>{t.next(s.current.y-s.start.y)}).unsubscribe).pipe(ue())}function Cg(n,t){Ze(n,"draggable","true");const e=zh(n,!0).subscribe(r=>{de(r),Po(r);const a=r.dataTransfer;a&&(a.effectAllowed="move",a.setData("text/plain","some-data")),t?.onStart?.(r)}),s=Oh(n).subscribe(r=>{de(r),t?.onDrag?.(r)}),i=Nh(n).subscribe(r=>{de(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe()}}function Ag(n,t){const e=Yh(n).subscribe(a=>{de(a),t?.onEnter?.(a)}),s=Xh(n).subscribe(a=>{de(a);const o=a.dataTransfer;o&&(o.dropEffect="move"),t?.onOver?.(a)}),i=Fh(n).subscribe(a=>{de(a),t?.onLeave?.(a)}),r=Bh(n).subscribe(a=>{de(a);const o=a.dataTransfer;if(!o){t?.onDrop?.(a,[]);return}t?.onDrop?.(a,[...o.files])});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function qh(n=100){return U(document,"scroll",!0).pipe(Uf(n))}function Ig(){return U(window,"visibilitychange",!0).pipe(it(()=>!document.hidden),ue())}function kg(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Ms(){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 Dg(){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 jh(){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 Rg(){const{scrollWidth:n,scrollHeight:t}=Ms();return{width:n,height:t}}function hr(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ms();return{x:e+r,y:t+a,width:s,height:i}}function Lg(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 Hh(n){return n.getBoundingClientRect()}function Og(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 zg(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=Ms(),s=e-n;return s<=0?0:t/s*100}function Ng(n){if("center"in n){const t=n.center,e=Hh(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function cr(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}=Ms();return{x:n.clientX+t,y:n.clientY+e}}function ct(n,t){const e={x:0,y:0};if(t){const s=cr(n),i=hr(t);e.x=P.clamp(s.x-i.x,0,i.width),e.y=P.clamp(s.y-i.y,0,i.height)}else{let s=0,i=0;if("currentTarget"in n&&n.currentTarget&&n.target&&n.currentTarget!=n.target){const r=n.currentTarget.getBoundingClientRect(),a=n.target.getBoundingClientRect();s=a.left-r.left,i=a.top-r.top}if("offsetX"in n)e.x=n.offsetX+s,e.y=n.offsetY+i;else{const r=cr(n),a=hr(n.target);e.x=P.clamp(r.x-a.x+s,0,a.width),e.y=P.clamp(r.y-a.y+i,0,a.height)}}return e}function Bg(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const Yg={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};function Fg(n){if(n.key)return n.key;if(n.keyCode)return n.keyCode;if(n.which)return n.which}function Wh(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function Jh(n){return Uh(n.target||document||window).pipe(To(t=>Wh(t,n)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function Xg(n){return Vh(n.target||document||window).pipe(To(t=>Wh(t,n)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function Zh(n={keys:["o"]},t=P.ReadInBrowserEnum.text){return Jh(n).pipe(sn(async()=>await bh(t)))}async function Ug(n={keys:["o"]},t=P.ReadInBrowserEnum.text){return df(Zh(n,t))}async function Kh(n,t){return new Promise(e=>{const s=new ResizeObserver(i=>{const a=i[0].contentRect;t(a),e(()=>{s.unobserve(n)})});s.observe(n)})}function lr(n=document.documentElement,t){let e,s,i,r;return new et(a=>{const o=new ResizeObserver(h=>{const l=h[0].contentRect;(e!=l.x||s!=l.y||i!=l.width||r!=l.height)&&(e=l.x,s=l.y,i=l.width,r=l.height,a.next(l))});return o.observe(n,t),()=>{o.unobserve(n),o.disconnect()}})}function Vg(n){return n(window.innerWidth,window.innerHeight),j(window,"orientationchange"in window?"orientationchange":"resize",t=>{const e=t.target.innerWidth,s=t.target.innerHeight;n(e,s)})}function $g(){return U(window,"orientationchange"in window?"orientationchange":"resize").pipe(it(n=>({width:n.target.innerWidth,height:n.target.innerHeight})),fe({width:window.innerWidth,height:window.innerHeight}))}function Gg(){const n={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:!1,this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-n.x,t.dStartY=t.y-n.y,t.isDown=typeof s=="boolean"?s:!1}}}function qg(n=document.documentElement){const t=new P.EventBus,e=new tt(n);let s=[];const i=Gg(),r=i.mousePoint,a=k=>{t.emit("mouseDown",k)},o=k=>{t.emit("mouseUp",k)},h=k=>{r.isDown||i.setCurrentMousePoint(ct(k,n)),t.emit("mouseMove",k)},c=k=>{t.emit("mouseOver",k)},l=k=>{t.emit("mouseOut",k)},u=k=>{t.emit("mouseEnter",k)},d=k=>{t.emit("mouseLeave",k)},f=k=>{t.emit("mouseClick",k)},p=k=>{t.emit("mouseDoubleClick",k)},x=k=>{t.emit("mouseWheel",k)},b=k=>{t.emit("mouseContextMenu",k)},w=k=>{t.emit("touchStart",k)},g=k=>{t.emit("touchEnd",k)},v=k=>{t.emit("touchCancel",k)},_=k=>{const rt=k.changedTouches[0];r.isDown||i.setCurrentMousePoint(ct(rt,n)),t.emit("touchMove",k)},M=k=>{t.emit("pointerDown",k)},E=k=>{t.emit("pointerUp",k)},D=k=>{t.emit("pointerCancel",k)},B=k=>{t.emit("pointerMove",k)},Y=k=>{t.emit("pan",k)},V=k=>{t.emit("panStart",k)},$=k=>{t.emit("panMove",k)},W=k=>{t.emit("panEnd",k)},Q=k=>{t.emit("panCancel",k)},Z=k=>{t.emit("panLeft",k)},Yt=k=>{t.emit("panRight",k)},ft=k=>{t.emit("panUp",k)},Et=k=>{t.emit("panDown",k)},It=k=>{t.emit("pinch",k)},O=k=>{t.emit("pinchin",k)},L=k=>{t.emit("pinchout",k)},X=k=>{t.emit("press",k)},H=k=>{t.emit("rotate",k)},Pt=k=>{t.emit("swipe",k)},jt=k=>{t.emit("swipeLeft",k)},Cn=k=>{t.emit("swipeRight",k)},An=k=>{t.emit("swipeUp",k)},dt=k=>{t.emit("swipeDown",k)},Jt=k=>{t.emit("tap",k)},nt=k=>{!k.target||n==k.target||n.contains(k.target)||t.emit("tapOutSide",k)},vt=k=>{t.emit("transitionstart",k)},ss=k=>{t.emit("transitionend",k)},Ye=k=>{t.emit("animationstart",k)},Fe=k=>{t.emit("animationend",k)};let ve={...n.getBoundingClientRect(),width:n.offsetWidth,height:n.offsetHeight};return{el:n,get rect(){return ve},mousePoint:r,eb:t,start:async function(){s.push(j(n,"mousedown",a)),s.push(j(n,"mouseup",o)),s.push(j(n,"mousemove",h)),s.push(j(n,"mouseover",c)),s.push(j(n,"mouseout",l)),s.push(j(n,"mouseenter",u)),s.push(j(n,"mouseleave",d)),s.push(j(n,"click",f)),s.push(j(n,"dblclick",p)),s.push(j(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",x)),s.push(j(n,"contextmenu",b)),s.push(j(n,"touchstart",w)),s.push(j(n,"touchend",g)),s.push(j(n,"touchcancel",v)),s.push(j(n,"touchmove",_)),s.push(j(n,"pointerdown",M)),s.push(j(n,"pointerup",E)),s.push(j(n,"pointercancel",D)),s.push(j(n,"pointermove",B)),e.on("pan",Y),e.on("panstart",V),e.on("panmove",$),e.on("panend",W),e.on("pancancel",Q),e.on("panleft",Z),e.on("panright",Yt),e.on("panup",ft),e.on("pandown",Et),e.on("pinch",It),e.on("pinchin",O),e.on("pinchout",L),e.on("press",X),e.on("rotate",H),e.on("swipe",Pt),e.on("swipeleft",jt),e.on("swiperight",Cn),e.on("swipeup",An),e.on("swipedown",dt),e.on("tap",Jt),s.push(j(document,"pointerdown",nt)),s.push(j(n,"transitionstart",vt)),s.push(j(n,"transitionend",ss)),s.push(j(n,"animationstart",Ye)),s.push(j(n,"animationend",Fe));const k=await Kh(n,rt=>{ve=rt,t.emit("resize",rt)});s.push(k),s.push(Qh(this,{start:rt=>{i.setStartMousePoint(ct(rt,n),!0)},move:rt=>{i.setCurrentMousePoint(ct(rt,n))},end:rt=>{i.setCurrentMousePoint(ct(rt,n),!1)}}))},end:()=>{t.removeAllListeners(),s.forEach(k=>k()),s=[],e.off("pan",Y),e.off("panstart",V),e.off("panmove",$),e.off("panend",W),e.off("pancancel",Q),e.off("panleft",Z),e.off("panright",Yt),e.off("panup",ft),e.off("pandown",Et),e.off("pinch",It),e.off("pinchin",O),e.off("pinchout",L),e.off("press",X),e.off("rotate",H),e.off("swipe",Pt),e.off("swipeleft",jt),e.off("swiperight",Cn),e.off("swipeup",An),e.off("swipedown",dt),e.off("tap",Jt)}}}function Qh(n,t){return tc(n,t)}function tc(n,t){const e=n.eb,s=a=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(a)},i=a=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(a)},r=a=>{t?.move?.(a)};return e.on("pointerDown",s),()=>e.off("pointerDown",s)}function jg(n,t){const e=n.eb,s=a=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(a)},i=a=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(a)},r=a=>{t?.move?.(a)};return e.on("mouseDown",s),()=>e.off("mouseDown",s)}function Hg(n,t){const e=n.eb,s=a=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const o=a.changedTouches[0];t?.start?.(o)},i=a=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const o=a.changedTouches[0];t?.end?.(o)},r=a=>{const o=a.changedTouches[0];t?.move?.(o)};return e.on("touchStart",s),()=>e.off("touchStart",s)}class Wg{multicast;buffer;handlers=P.createExpandingRingQueue(10);constructor(t){this.buffer=t?.buffer||P.createExpandingRingQueue(10),this.multicast=typeof t?.multicast=="boolean"?t?.multicast:!1}put(t){if(this.multicast){this.handlers.flush().forEach(s=>s(t));return}if(this.handlers.length===0)return this.buffer.put(t);const e=this.handlers.take();e&&e(t)}take(t){if(!this.multicast){const e=this.buffer.take();if(e){t(e);return}}this.handlers.put(t)}flush(t){this.multicast||this.buffer.flush().forEach(t)}}let ur=class{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=$t(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),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class fr extends ur{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?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,u=(t-s)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,x=f*f/(r*r)+p*p/(a*a);if(x>1){const $=Math.sqrt(x);throw r=$*r,a=$*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*p*p-a*a*f*f)/(r*r*p*p+a*a*f*f)),w=h!=c?1:-1,g=w*b*r*p/a,v=w*b*-a*f/r,_=(t+s)/2,M=(e+i)/2,E=Math.cos(l)*g-Math.sin(l)*v+_,D=Math.sin(l)*g+Math.cos(l)*v+M,B=($,W,Q,Z)=>($*Z>=W*Q?1:-1)*Math.acos(($*Q+W*Z)/(Math.sqrt($*$+W*W)*Math.sqrt(Q*Q+Z*Z))),Y=B(1,0,t-E,e-D)-l,V=B(t-E,e-D,s-E,i-D);return[E,D,r,a,l,Y,Y+V]}}class Jg extends ur{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(0,...t),y:Math.min(0,...e)},h={x:Math.max(0,...t),y:Math.max(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 Zg=Jg;class pt extends ur{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}clone(){return new pt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}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}));const l=[],u=c.length;for(let p=0;p<u;p++){for(let x=p+1;x<u;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const d={x:Math.min(...o),y:Math.min(...a)},f={x:Math.max(...o),y:Math.max(...a)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.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,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const x=l*u[p]+l,b=pt.base3(x,t,s,r,o),w=pt.base3(x,e,i,a,h);f+=d[p]*Math.sqrt(b*b+w*w)}return l*f}length(t=1){return pt.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||pt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=pt.bezlen(e,s,i,r,a,o,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=pt.bezlen(e,s,i,r,a,o,h,c,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),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),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,g=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:x},end:{x:b,y:w},alpha:g}}}const Cs=Math.PI*2;function ec(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 Kg(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,d=a*a,f=o*o,p=l*l,x=u*u;let b=d*f-d*x-f*p;b<0&&(b=0),b/=d*x+f*p,b=Math.sqrt(b)*(i===r?-1:1);const w=b*a/o*u,g=b*-o/a*l,v=c*w-h*g+(n+e)/2,_=h*w+c*g+(t+s)/2,M=(l-w)/a,E=(u-g)/o,D=(-l-w)/a,B=(-u-g)/o,Y=ec(1,0,M,E);let V=ec(M,E,D,B);return r===0&&V>0&&(V-=Cs),r===1&&V<0&&(V+=Cs),[v,_,Y,V]}function Qg(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 sc(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*Cs/360),l=Math.cos(h*Cs/360),u=l*(n-e)/2+c*(t-s)/2,d=-c*(n-e)/2+l*(t-s)/2;if(u===0&&d===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const f=u*u/(a*a)+d*d/(o*o);f>1&&(a*=Math.sqrt(f),o*=Math.sqrt(f));const p=Kg(n,t,e,s,i,r,a,o,c,l),x=[];let b=p[2],w=p[3];const g=Math.max(Math.ceil(Math.abs(w)/(Cs/4)),1);w/=g;for(let v=0;v<g;v++)x.push(Qg(b,w)),b+=w;return x.map(v=>{for(let _=0;_<v.length;_+=2){let M=v[_+0],E=v[_+1];M*=a,E*=o;const D=l*M-c*E,B=c*M+l*E;v[_+0]=D+p[0],v[_+1]=B+p[1]}return v})}function dr(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 As(n,t,e,s){return[n,t,e,s,e,s]}const wn={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function nc(n="path",t){const e=document.createElementNS.call(document,"http://www.w3.org/2000/svg",n);return t&&De(e,t),e}function t0(n,t){return nc("path",{d:n,id:t||P.generateUUID()})}function e0(n,t="shape"){return gn(ei(n),`${t}.svg`)}function ic(n){return typeof n!="string"?!1:(n=n.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(n)&&/[\dz]$/i.test(n))}function s0(n){return n.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function rc(n){const t=[];return ic(n)&&n.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,s,i)=>{let r=s.toLowerCase();const a=P.extractAllNumbers(i);for(r=="m"&&a.length>wn[r]&&(t.push([s,...a.splice(0,wn[r])]),r="l",s=s=="m"?"l":"L");a.length;){if(a.length<wn[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${s} } args:{ ${a} }`);t.push([s,...a.splice(0,wn[r])])}return r=="z"&&t.push([s]),""}),t}function ac(n){let t=0,e=0,s=0,i=0;return n.map(function(r){const a=r[0],o=a.toUpperCase();if(a!=o)switch(r[0]=o,a){case"a":r[6]+=s,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=s;break;default:for(let h=1;h<r.length;)r[h++]+=s,r[h++]+=i}switch(o){case"Z":s=t,i=e;break;case"H":s=r[1];break;case"V":i=r[1];break;case"M":s=t=r[1],i=e=r[2];break;default:s=r[r.length-2],i=r[r.length-1]}return r})}function n0(n){const t=[];let e=0,s=0,i=0,r=0,a=0,o=0,h=0,c=0,l;for(let u=0,d=n.length;u<d;u++){let f=n[u];const p=f[0];switch(p){case"M":e=f[1],s=f[2];break;case"A":const x=sc(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!x.length)continue;x.forEach((g,v)=>{const[_,M,E,D,B,Y,V,$]=g;f=["C",E,D,B,Y,V,$],v<x.length-1&&t.push(f)});break;case"S":let b=i,w=r;(l=="C"||l=="S")&&(b+=b-h,w+=w-c),f=["C",b,w,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(a=i*2-a,o=r*2-o):(a=i,o=r),f=["C",...dr(i,r,a,o,f[1],f[2])];break;case"Q":a=f[1],o=f[2],f=["C",...dr(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...As(i,r,f[1],f[2])];break;case"H":f=["C",...As(i,r,f[1],r)];break;case"V":f=["C",...As(i,r,i,f[1])];break;case"Z":f=["C",...As(i,r,e,s)];break}l=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(h=f[f.length-4],c=f[f.length-3]):(h=i,c=r),t.push(f)}return t}class Is{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(()=>{Is.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 mr extends P.EventBus{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=P.stringLength(this.source);if(t===0){this.emit("finish");return}let e,s,i=P.charAt(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=P.charAt(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==`
|
|
15
|
-
`&&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":P.regTest("whitespace",t)?(this.textchunk+=
|
|
16
|
-
`);s=~X?O.length-X:s+O.length}function r(){var O={line:e,column:s};return function(L){return L.position=new a(O),p(),L}}function a(O){this.start=O,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(O){var L=new Error(t.source+":"+e+":"+s+": "+O);if(L.reason=O,L.filename=t.source,L.line=e,L.column=s,L.source=n,t.silent)o.push(L);else throw L}function c(){var O=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:O,parsingErrors:o}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var O,L=[];for(p(),x(L);n.length&&n.charAt(0)!="}"&&(O=Et()||It());)O!==!1&&(L.push(O),x(L));return L}function f(O){var L=O.exec(n);if(L){var X=L[0];return i(X),n=n.slice(X.length),L}}function p(){f(/^\s*/)}function x(O){var L;for(O=O||[];L=b();)L!==!1&&O.push(L);return O}function b(){var O=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var L=2;n.charAt(L)!=""&&(n.charAt(L)!="*"||n.charAt(L+1)!="/");)++L;if(L+=2,n.charAt(L-1)==="")return h("End of comment missing");var X=n.slice(2,L-2);return s+=2,i(X),n=n.slice(L),s+=2,O({type:"comment",comment:X})}}function w(){var O=f(/^([^{]+)/);if(O)return ne(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(L){return L.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(L){return L.replace(/\u200C/g,",")})}function g(){var O=r(),L=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(L){if(L=ne(L[0]),!f(/^:\s*/))return h("property missing ':'");var X=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),H=O({type:"declaration",property:L.replace(hc,""),value:X?ne(X[0]).replace(hc,""):""});return f(/^[;\s]*/),H}}function v(){var O=[];if(!l())return h("missing '{'");x(O);for(var L;L=g();)L!==!1&&(O.push(L),x(O));return u()?O:h("missing '}'")}function _(){for(var O,L=[],X=r();O=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)L.push(O[1]),f(/^,\s*/);if(L.length)return X({type:"keyframe",values:L,declarations:v()})}function M(){var O=r(),L=f(/^@([-\w]+)?keyframes\s*/);if(L){var X=L[1];if(L=f(/^([-\w]+)\s*/),!L)return h("@keyframes missing name");var H=L[1];if(!l())return h("@keyframes missing '{'");for(var Pt,jt=x();Pt=_();)jt.push(Pt),jt=jt.concat(x());return u()?O({type:"keyframes",name:H,vendor:X,keyframes:jt}):h("@keyframes missing '}'")}}function E(){var O=r(),L=f(/^@supports *([^{]+)/);if(L){var X=ne(L[1]);if(!l())return h("@supports missing '{'");var H=x().concat(d());return u()?O({type:"supports",supports:X,rules:H}):h("@supports missing '}'")}}function D(){var O=r(),L=f(/^@host\s*/);if(L){if(!l())return h("@host missing '{'");var X=x().concat(d());return u()?O({type:"host",rules:X}):h("@host missing '}'")}}function B(){var O=r(),L=f(/^@media *([^{]+)/);if(L){var X=ne(L[1]);if(!l())return h("@media missing '{'");var H=x().concat(d());return u()?O({type:"media",media:X,rules:H}):h("@media missing '}'")}}function Y(){var O=r(),L=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(L)return O({type:"custom-media",name:ne(L[1]),media:ne(L[2])})}function V(){var O=r(),L=f(/^@page */);if(L){var X=w()||[];if(!l())return h("@page missing '{'");for(var H=x(),Pt;Pt=g();)H.push(Pt),H=H.concat(x());return u()?O({type:"page",selectors:X,declarations:H}):h("@page missing '}'")}}function $(){var O=r(),L=f(/^@([-\w]+)?document *([^{]+)/);if(L){var X=ne(L[1]),H=ne(L[2]);if(!l())return h("@document missing '{'");var Pt=x().concat(d());return u()?O({type:"document",document:H,vendor:X,rules:Pt}):h("@document missing '}'")}}function W(){var O=r(),L=f(/^@font-face\s*/);if(L){if(!l())return h("@font-face missing '{'");for(var X=x(),H;H=g();)X.push(H),X=X.concat(x());return u()?O({type:"font-face",declarations:X}):h("@font-face missing '}'")}}var Q=ft("import"),Z=ft("charset"),Yt=ft("namespace");function ft(O){var L=new RegExp("^@"+O+"\\s*([^;]+);");return function(){var X=r(),H=f(L);if(H){var Pt={type:O};return Pt[O]=H[1].trim(),X(Pt)}}}function Et(){if(n[0]=="@")return M()||B()||Y()||E()||Q()||Z()||Yt()||$()||V()||D()||W()}function It(){var O=r(),L=w();return L?(x(),O({type:"rule",selectors:L,declarations:v()})):h("selector missing")}return gr(c())}function ne(n){return n?n.replace(/^\s+|\s+$/g,""):""}function gr(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){gr(a,s)}):r&&typeof r=="object"&&gr(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}let i0=class extends mr{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=pr(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const 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(const 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),wr(this.currentItem.style,this.currentItem,xr)}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&&wr(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+yr(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(const r in e){const a=e[r];if(xr.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"&&wr(a,this.currentItem,xr),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 yr(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 yr(n,t,i,r)-yr(e,s,i,r)}function wr(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){const 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 xr=["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 bt{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){const e=typeof t=="string"?rc(t):t||[],s=n0(ac(e));let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];o[0]=="M"?(i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new pt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(t instanceof fr){sc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,x,b,w]=c;this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})),this.prevPathX=b,this.prevPathY=w});return}if(t instanceof pt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,s,i,r,a,o;t instanceof Zg?[e,s,i,r,a,o]=dr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=As(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}static fromPolymorphPoints(t){const e=new bt;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 pt({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 bt;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}clone(){return bt.fromLines(this.normalizedLines)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,s=this.normalizedLines.length;e<s;e++)t.push(...this.normalizedLines[e].toSVGPathData());return t}toSVGPathD(){return s0(this.toSVGPathData())}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{e.toCanvasContext(t)})}getBoundingClientRect(t=2){const e=[],s=[];if(this.normalizedLines.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,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...s),a=Math.max(...e),o=Math.max(...s);return{x:P.maxDotNumber(i,t),y:P.maxDotNumber(r,t),width:P.maxDotNumber(a-i,t),height:P.maxDotNumber(o-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:P.maxDotNumber(e.x+e.width*.5,t),y:P.maxDotNumber(e.y+e.height*.5,t)}}transform(t,e,s,i,r,a,o){const h=new xt;return h.translate(t,e),h.rotate(r,s,i),h.scale(a,o,s,i),h.isIdentity?this.clone():bt.fromLines(this.normalizedLines.map(c=>{let l=c.x,u=c.y,d=c.c1x,f=c.c1y,p=c.c2x,x=c.c2y,b=c.toX,w=c.toY;return{x:l,y:u}=h.transformPoint({x:l,y:u}),{x:d,y:f}=h.transformPoint({x:d,y:f}),{x:p,y:x}=h.transformPoint({x:p,y:x}),{x:b,y:w}=h.transformPoint({x:b,y:w}),new pt({x:l,y:u,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})}))}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0,s=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const a=this.normalizedLines[r];if(s=a.length(),e+s>=t)return a.getPointAtSegmentLength(t-e);e+=s}return this.normalizedLines[i-1].getPointAtSegmentLength(s)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let s=t*e,i=this.normalizedLines[0];if(s--,s>1)for(let r=1;r<e&&(i=this.normalizedLines[r],s>1);r++)s-=1;return i.interpolate(s)}}getSubPathD(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubPathDAtLength(this,t);{const s=this.getSubPathDAtLength(this,e,1);return t?this.getSubPathDAtLength(s,t):s}}getSubPathDAtLength(t,e,s){let i=null,r=0;const a=new bt;a.prevPathX=a.startPathX=t.startPathX,a.prevPathY=a.startPathY=t.startPathY;for(let o=0,h=this.normalizedLines.length;o<h;o++){const c=this.normalizedLines[o],l=c.length();if(r+l>e&&!i){const u=c.getPointAtSegmentLength(e-r);if(a._appendLine(new pt({c1x:u.start.x,c1y:u.start.y,c2x:u.m.x,c2y:u.m.y,toX:u.x,toY:u.y})),s)return a;i=a,a._appendLine(new pt({c1x:u.n.x,c1y:u.n.y,c2x:u.end.x,c2y:u.end.y,toX:c.x,toY:c.y})),r+=l;continue}r+=l,a._appendLine(c)}return a}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){const l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<a&&(i=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),d=r+o,f=this.getPointAtLength(d),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<a?(i=l,r=c,a=u):d<=s&&p<a?(i=f,r=d,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?$t(h.x,h.y,i.x,i.y):$t(i.x,i.y,h.x,h.y),distance:Math.sqrt(a)}}getPolymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.toX,e.toY]),[]))}getPolymorphPointsPerimeter(){const t=this.getPolymorphPoints(),e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=pe(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}getExpendedPolymorphPointsPathD(t){const e=this.getPolymorphPoints(),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++],u=e[o++],d=e[o++],f=e[o++];a.push(["C",h,c,l,u,d,f]);let p=0;for(;p<r&&i>0;)a.push(["C",d,f,d,f,d,f]),i-=6,p++}return new bt(a)}static getInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?new bt(t.toSVGPathD()):Math.abs(s-1)<Number.EPSILON?new bt(e.toSVGPathD()):bt.fromPolymorphPoints(P.lerps(t.getPolymorphPoints(),e.getPolymorphPoints(),s))}}const cc=r0("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 r0(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 Tt(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 xn(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 a0(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function o0(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const ks={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 br{__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",Tt("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 lc{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class bn{__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(ks);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=ks[i].canvas}}__getStyleState(){const t={},e=Object.keys(ks);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(ks);for(let r=0;r<i.length;r++){const a=ks[i[r]],o=this[i[r]];if(a.apply){if(o instanceof lc){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,Tt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof br)e.setAttribute(a.apply,Tt("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,Tt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),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(cc);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=cc[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(Tt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Tt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Tt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(Tt("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(Tt("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(Tt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Tt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(Tt("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(Tt("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],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],x=e+f*d[1],b=[-h[1],h[0]],w=[c[1],-c[0]],g=function(M){const E=M[0];return M[1]>=0?Math.acos(E):-Math.acos(E)},v=g(b),_=g(w);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,v,_)}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:xn(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new br(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:xn(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 br(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":a0(this.textAlign),"dominant-baseline":o0(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),u=a?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),a?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Tt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=xn(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",Tt("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,u,d,f,p,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 w=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+s+", "+i+")";if(e instanceof bn){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.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),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=xn(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 bn&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new lc(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class vr{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 bn({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}}}const Ds={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Bt{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let s;if(s=/^(\w+)\(([^)]*)\)/.exec(t)){const i=s[2];let r;switch(s[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=P.clamp(parseFloat(r[1]),0,100)*255/100,this.g=P.clamp(parseFloat(r[2]),0,100)*255/100,this.b=P.clamp(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(s=/#([A-Fa-f0-9]+)/.exec(t)){const i=s[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Bt?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=P.clamp(P.parseNumber(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*s+r[6]*i,this.g=r[1]*e+r[4]*s+r[7]*i,this.b=r[2]*e+r[5]*s+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${P.maxDotNumber(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=ze){Tr.fromWorkingColorSpace(ie.copy(this),t);const e=ie.r,s=ie.g,i=ie.b;return t!==ze?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Bt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Le(t.r),this.g=Le(t.g),this.b=Le(t.b),this}copyLinearToSRGB(t){return this.r=Oe(t.r),this.g=Oe(t.g),this.b=Oe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",s="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const{r:i,g:r,b:a}=this.color;return this.r=255-i,this.g=255-r,this.b=255-a,this}}lighten(t){t=P.clamp(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e+(255-e)*t,this.g=s+(255-s)*t,this.b=i+(255-i)*t,this}darken(t){t=P.clamp(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e*(1-t),this.g=s*(1-t),this.b=i*(1-t),this}lerp(t,e){e=P.clamp(e,0,1);const{r:s,g:i,b:r}=this.color;return this.r=s+(t.r-s)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,s){return s=P.clamp(s,0,1),this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}static gradient(t,e,s){try{return ie.lerpColors(new Bt(t),new Bt(e),s).toString()}catch{return e}}static random(){return ie.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Bt.nextIndex){Bt.nextIndex=t;const e=Object.keys(Ds),s=e.length;return ie.setHEX(Ds[e[Bt.nextIndex++%s]]).toString()}setColorName(t){const e=Ds[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(Ds).map(t=>ie.setHEX(t).toString())}setRGB(t,e,s,i=1){return this.r=t,this.g=e,this.b=s,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,s,i=1){const r=P.euclideanModulo(t,1),a=P.clamp(e,0,1),o=P.clamp(s,0,1);if(a===0)this.r=o*255,this.g=o*255,this.b=o*255;else{const h=o<=.5?o*(1+a):o+a-o*a,c=2*o-h;this.r=Er(c,h,r+.3333333333333333)*255,this.g=Er(c,h,r)*255,this.b=Er(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,s=this.g,i=this.b,r=Math.max(e,s,i)/255,a=Math.min(e,s,i)/255;let o,h;const c=(a+r)/2;if(a===r)o=0,h=0;else{const l=r-a;switch(h=c<=.5?l/(r+a):l/(2-r-a),r){case e:o=(s-i)/l+(s<i?6:0);break;case s:o=(i-e)/l+2;break;case i:default:o=(e-s)/l+4;break}o/=6}return t&&t.setHSL(o,h,c,this.a),{h:o,s:h,l:c,a:this.a}}offsetHSL(t,e,s){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+s)}lerpHSL(t,e){const s=this.getHSL(),i=t.getHSL(),r=P.lerp(s.h,i.h,e),a=P.lerp(s.s,i.s,e),o=P.lerp(s.l,i.l,e);return this.setHSL(r,a,o),this}setHSV(t,e,s,i=1){const r=P.clamp(t,0,1)*360,a=P.clamp(e,0,1),o=P.clamp(s,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=o*(1-a),u=o*(1-c*a),d=o*(1-(1-c)*a),f=[[o,d,l],[u,o,l],[l,o,d],[l,u,o],[d,l,o],[o,l,u]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,s,i=1){this.setHSV(t,e,s,i)}getHSV(t){const{r:e,g:s,b:i,a:r}=this.color,a=Math.max(e,s,i),o=Math.min(e,s,i),h=a-o;let c;e===a?c=(s-i)/h:s===a?c=2+(i-e)/h:c=4+(e-s)/h,c/=6,c<0&&(c+=1);const l=h==0?0:c,u=a===0?0:h/a,d=a/255;return t&&t.setHSV(l,u,d,r),{h:l,s:u,v:d,a:r}}getHSB(t){const{h:e,s,v:i,a:r}=this.getHSV(t);return{h:e,s,b:i,a:r}}}const ie=new Bt;function Le(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Oe(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const uc="",ze="srgb",_r="srgb-linear",Sr="linear",vn="srgb",fc=new We().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),dc=new We().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),mc=[.64,.33,.3,.6,.15,.06],pc=[.2126,.7152,.0722],gc=[.3127,.329],Tr={enabled:!0,workingColorSpace:_r,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===vn&&(n.r=Le(n.r),n.g=Le(n.g),n.b=Le(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===vn&&(n.r=Oe(n.r),n.g=Oe(n.g),n.b=Oe(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===uc?Sr:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};Tr.define({[_r]:{primaries:mc,whitePoint:gc,transfer:Sr,toXYZ:fc,fromXYZ:dc,luminanceCoefficients:pc,workingColorSpaceConfig:{unpackColorSpace:ze},outputColorSpaceConfig:{drawingBufferColorSpace:ze}},[ze]:{primaries:mc,whitePoint:gc,transfer:vn,toXYZ:fc,fromXYZ:dc,luminanceCoefficients:pc,outputColorSpaceConfig:{drawingBufferColorSpace:ze}}});function Er(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?n+(t-n)*6*e:e<.5?t:e<.6666666666666666?n+(t-n)*6*(.6666666666666666-e):n}class lt{id;d;parent;attrs;_centerX;_centerY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;show;followMouse;drag;transform$=new ls;isMouseIn=!1;isDragging=!1;el;constructor(t){this.id=P.generateUUID(),this.d=t?.d,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this._centerX=t?.centerX,this._centerY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),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.show=typeof t?.show=="boolean"?t?.show:!0,this.followMouse=typeof t?.followMouse=="boolean"?t?.followMouse:!1,this.drag=t?.drag}destroy(){}moveTo(t,e){const s=this._x,i=this._y;(s!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dx:t-s,dy:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}rotateTo(t){this._degree=t}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree=t}scaleTo(t,e){this._scaleX=t,this._scaleY=e||t}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}pathD(){return this.d?(this.d instanceof bt||(this.d=new bt(this.d)),this.d):new bt(this.toSVGPathData())}forcePathD(t){this.d=t}getBaseOptions(){return{d:this.d,attrs:this.getAttrs(),centerX:this._centerX,centerY:this._centerY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,followMouse:this.followMouse,drag:this.drag}}clone(){const t=this.cloneShape();return this.parent&&(t.parent={...this.parent}),t}cloneShape(){return new lt(this.getBaseOptions())}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let s=this._centerX||0,i=this._centerY||0;if(typeof this._centerX>"u"&&typeof this._centerY>"u"){const r=this.getBoundingClientRectCenter(e);if(t||!this.parent)s=r.x,i=r.y;else{const a=this.parent.combo.getBoundingClientRectCenter(e);s=a.x-this.parent.dx,i=a.y-this.parent.dy}}return{x:s,y:i}}isPointInPath(t,e,s){if(t instanceof vr)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}isPointInStroke(t,e,s){if(t instanceof vr)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}setAttr(t,e){if(typeof t!="string")for(const s in t){const i=t[s];i&&(this.attrs[P.toKebab(s)]=i)}else e&&(this.attrs[P.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[P.toKebab(t)]||e}hasAttr(t){return!!this.getAttr(t)}getAttrs(){return{...this.attrs}}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const s=t?.friction||1;this.vx*=s,this.vy*=s,this.moveTo(this.x+this.vx,this.y+this.vy)}animateEaseTo(t,e){const s=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*s,this.vy=r*s,this.animate(e)}animateSpringTo(t,e){const s=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,a=i.y-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.animate({friction:.9,...e})}animateSpringMassTo(t,e){const s=e?.springLength||100,i=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}distance(t){return pe(this.x,this.y,t.x,t.y)}rotateToTarget(t){this.rotateTo(_t($t(this.x,this.y,t.x,t.y)))}followTo(t,e=3){this.rotateToTarget(t);const{dx:s,dy:i}=He(J(this.degree),e);this.vx=s,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateToTarget(t);const{dx:s,dy:i}=He(J(this.degree),e);this.ax=s,this.ay=i,this.animate()}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}checkCollision(t){}checkWall(t){}getTotalLength(){return this.pathD().getTotalLength()}interpolate(t){return this.pathD().interpolate(t)}getPointAtLength(t){return this.pathD().getPointAtLength(t)}trailPath(t=0){const e=this.getTotalLength();return{subPathD:this.pathD().getSubPathD(0,t*e),point:this.getPointAtLength(t*e)}}strokeDashTween(t=1e3,e){const s=P.maxDotNumber(this.pathD().getTotalLength(),0);this.setAttr({strokeDasharray:`${s} ${s}`,strokeDashoffset:`${s}`});const i=e?.onUpdate,r=new ps({frameDuration:t});r.addTween({offset:s},{offset:0},Object.assign(e||{},{onUpdate:(a,o)=>{this.setAttr("strokeDashoffset",""+P.maxDotNumber(a.offset,2)),i?.(a,o)}})),r.play()}}class zt{options;commonChildShapeOptions;shapes=[];x=0;y=0;degree=0;scaleX=1;scaleY=1;constructor(t,e){if(this.options=t,this.commonChildShapeOptions=e,t?.svg){let s=0,i=0,r=0,a=0;const o=new i0(t.svg).parse();for(let h=0,c=o.length;h<c;h++){const l=o[h];if(l.type=="viewbox"&&l.width&&l.height){if(s=parseFloat(l.width),i=parseFloat(l.height),t.forceWidth){const x=s/i;r=t.forceWidth,a=r/x}else r=s,a=i;continue}if(l.type!="path"||!ic(l.path))continue;const u={};for(const x in l)x==="type"||x==="path"||x==="transform"||(u[x]=l[x]);const d=ac(rc(l.path)),f=[];let p=[];for(let x=0,b=d.length;x<b;x++){const w=d[x];p.push(w),w[0].toLowerCase()=="z"&&(f.push(p),p=[])}p.length&&f.push(p),f.forEach(x=>{const b=new lt({...e,d:x,attrs:{...e?.attrs,...u}});if(l.transform){const g=Vi(l.transform).split();b.moveTo(g.x,g.y),b.rotateTo(g.degree),b.scaleTo(g.scaleX,g.scaleY)}r&&s&&a&&i&&b.scaleTo(b.scaleX*(r/s),b.scaleY*(a/i)),this.addShape(b)})}}}destroy(){this.shapes.forEach(t=>t.destroy())}clone(){const t=this.cloneShapeCombo();return t.x=this.x,t.y=this.y,t.degree=this.degree,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shapes=this.shapes.map(e=>{const s=e.clone();return s.parent&&(s.parent.combo=t),s}),t}cloneShapeCombo(){return new zt(this.options,this.commonChildShapeOptions)}addShape(t,e=0,s=0){t.parent={combo:this,dx:e||t.x,dy:s||t.y},this.shapes.push(t)}comboMove(t,e){this.x+=t,this.y+=e,this.shapes.forEach(s=>{s.move(t,e)})}comboRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.rotate(t)})}comboScale(t,e){this.scaleX*=t,this.scaleY*=e||t,this.shapes.forEach(s=>{s.scale(t,e)})}comboTransform(t){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1)}getBoundingClientRect(t=2){const e=[],s=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);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,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...s),a=Math.max(...e),o=Math.max(...s);return{x:P.maxDotNumber(i,t),y:P.maxDotNumber(r,t),width:P.maxDotNumber(a-i,t),height:P.maxDotNumber(o-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:P.maxDotNumber(e.x+e.width*.5,t),y:P.maxDotNumber(e.y+e.height*.5,t)}}setAttr(t,e){typeof t!="string"?this.shapes.forEach(s=>{s.setAttr(t)}):e&&this.shapes.forEach(s=>{s.setAttr(t,e)})}sort(){this.shapes=this.shapes.map(t=>({shape:t,perimeter:t.pathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendTo(this);for(let i=s;i<e;i++)this.addShape(t.shapes[i].clone())}strokeDashTween(t,e){const s=this.shapes.length-1;switch(e?.type){case"sequence":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=P.maxDotNumber(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(const c in o){const l=P.extractNumber(c).number;this.shapes[l].setAttr("strokeDashoffset",""+P.maxDotNumber(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}function h0(n,t){n.forEach(s=>{s.animate(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=n.length;for(let s=0,i=e-1;s<i;s++)for(let r=s+1;r<e;r++)n[s].checkCollision(n[r])}function c0(n){const t=n.length;n.forEach((e,s)=>{e.animate();for(let i=s+1;i<t;i++)e.checkCollision(n[i]),e.gravitateTo(n[i])})}function l0(n,t){n.forEach((e,s)=>{s>0&&e.animateSpringTo(n[s-1],t)})}function u0(n,t){const e=t?.springLength||100;n.forEach(s=>{s.isDragging||n.filter(i=>i.id!==s.id).forEach(i=>{const r=$t(s.x,s.y,i.x,i.y);s.animateSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}function f0(n,t,e){const s=n.length,i=[];return n.forEach((r,a)=>{r.animate(e),r.x>t.x+t.width?r.moveXTo(t.x):r.x<t.x&&r.moveXTo(t.x+t.width),r.y>t.y+t.height?r.moveYTo(t.y):r.y<t.y&&r.moveYTo(t.y+t.height);for(let o=a+1;o<s;o++)i.push([r.x,r.y,n[o].x,n[o].y,r.animateSpringMassTo(n[o],e)])}),i}function Pr(n){if(n.length<2)throw new Error("shapes个数必须大于等于2");const t=n.length-1,e=new Array(t);for(let s=0;s<t;s++){const i=n[s].pathD(),r=n[s+1].pathD(),a=Math.max(i.getPolymorphPoints().length,r.getPolymorphPoints().length);e[s]=bt.getInterpolator(i.getExpendedPolymorphPointsPathD(a),r.getExpendedPolymorphPointsPathD(a))}return s=>{const i=P.maxDotNumber(t*s,6),r=Math.min(Math.floor(i),t-1),a=P.maxDotNumber(i-r,6),o=new lt({d:e[r](a)}),h=n[r].getAttr("fill","none"),c=n[r+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&o.setAttr("fill",Bt.gradient(h,c,a).toString());const l=n[r].getAttr("stroke","none"),u=n[r+1].getAttr("stroke","none");return typeof l=="string"&&typeof u=="string"&&o.setAttr("stroke",Bt.gradient(l,u,a).toString()),o}}function yc(n){if(n.length<2)throw new Error("shapeCombos个数必须大于等于2");let t=0,e;const s=[];n.forEach(a=>{let o;a instanceof zt?(o=a,o.sort()):(o=new zt,o.addShape(a)),s.push(o),t<o.shapes.length&&(t=o.shapes.length,e=o)}),s.forEach(a=>{a!==e&&a.expendTo(e)});const i=[];s.forEach((a,o)=>{a.shapes.forEach((h,c)=>{i[c]=i[c]||[],i[c][o]=h})});const r=[];return i.forEach(a=>{r.push(Pr(a))}),a=>{const o=new zt;return r.forEach(h=>{o.addShape(h(a))}),o}}function d0(n,t=6e3,e){const s=n.findIndex(o=>o instanceof zt)>=0?yc(n):Pr(n),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),i instanceof lt?e?.shape?.(i):i instanceof zt&&i.shapes.forEach(c=>{e?.shape?.(c)})}})),a.play()}function m0(n,t,e,s,i){if(i==0)throw new Error("no dividing by zero, please");const r=[],a=360/i;for(let h=0;h<i;h+=1){const c=a*h*Math.PI/180,l=n+2*e*Math.cos(c),u=t+2*e*Math.sin(c);r.push(new fr({x:n,y:t,rx:e,ry:s,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),r.push(new fr({x:l,y:u,rx:e,ry:s,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:n,toY:t}))}return new lt({d:bt.fromLines(r)})}function p0(n=document.documentElement,t="canvas"){_h(n);let e=null,s=null,i=null;t=="svg"&&(e=nc("svg"),Ps(n,e)),t=="canvas"&&(s=Ph("canvas"),Ps(n,s));const r={x:0,y:0,width:0,height:0},a=lr(n).subscribe(b=>{r.x=b.x,r.y=b.y,r.width=b.width,r.height=b.height,e&&De(e,{viewBox:`0 0 ${r.width} ${r.height}`,width:`${r.width}`,height:`${r.height}`}),s&&(De(s,{width:`${r.width}`,height:`${r.height}`}),i=new vr(s,r.width,r.height,!1))}),o=[];let h="",c="",l="default";const u=(b="default")=>{b!=l&&(n.style.cursor=b,l=b)},d=Re(),f=Gh(e||s||n,{useMousePoint:d}).subscribe(()=>{}),p=b=>{b.followMouse&&(!P.withinErrorMarginNumber(b.x,d.current.x,5)||!P.withinErrorMarginNumber(b.y,d.current.y,5))&&b.followTo(d.current),b.drag&&b.drag.enable&&b.drag.targetToAfterDrop&&(b.isDragging||b.animateEaseTo(b.drag.targetToAfterDrop,{easing:b.drag.easing}))},x=(...b)=>{const w=[];b.forEach(g=>{g instanceof zt?w.push(...g.shapes):w.push(g)}),e&&o.filter(g=>w.findIndex(v=>v.id==g.id)==-1).forEach(g=>{g.el&&(g.el.remove(),delete g.el)}),i&&i.clearRect(),P.flushArray(o,w),h="",d.current.isDown||(c="");for(const g of o){if(!g.show)continue;p(g);const v=g.transformOrigin(),_=v.x,M=v.y;if(e){const E=g.toSVGPathD();g.el||(g.el=t0(E,g.id),Ps(e,g.el));const D=new xt;D.translate(g.x,g.y),D.rotate(g.degree,_,M),D.scale(g.scaleX,g.scaleY,_,M),De(g.el,{d:E,transform:D.toString(),...g.getAttrs()})}if(i&&(i.save(),i.translate(g.x,g.y),i.rotate(J(g.degree),_,M),i.scale(g.scaleX,g.scaleY,_,M),g.toCanvasContext(i),ih(i,g.getAttrs()),i.hasSetCustomStrokeStyle&&i.stroke(),i.hasSetCustomFillStyle&&i.fill()),e?g.isMouseIn=g.isPointInPath(e,d.current.x,d.current.y)||g.isPointInStroke(e,d.current.x,d.current.y):i?g.isMouseIn=g.isPointInPath(i,d.current.x,d.current.y)||g.isPointInStroke(i,d.current.x,d.current.y):g.isMouseIn=!1,g.isMouseIn&&(u("pointer"),h=g.id),g.isDragging=g.id==c,d.current.isDown&&(g.isDragging||!c&&g.isMouseIn&&g.drag&&g.drag.enable)){u("grabbing"),g.isDragging=!0,c=g.id;let E=d.current.x-d.start.x,D=d.current.y-d.start.y;if(E||D){if(g.drag&&g.drag.enable&&g.drag.alongPath){const B=g.parent?g.parent.combo.x:g.x,Y=g.parent?g.parent.combo.y:g.y,V=_+(g.parent?.dx||0),$=M+(g.parent?.dy||0),W=g.parent?g.parent.combo.degree:g.degree,Q=g.parent?g.parent.combo.scaleX:g.scaleX,Z=g.parent?g.parent.combo.scaleY:g.scaleY,ft=g.drag.alongPath.transform(B,Y,V,$,W,Q,Z).closestPoint(d.current.x,d.current.y),Et=g.x,It=g.y;console.log(ft.point.x,ft.point.y,Et,It),E=ft.point.x-Et,D=ft.point.y-It,console.log(E,D)}(E||D)&&(g.move(E,D),g.parent?.combo.shapes.forEach(B=>{B.drag?.followSibling&&B!==g&&B.move(E,D)}))}d.setStart(d.current)}else g.isMouseIn&&g.drag&&g.drag.enable&&u("grab");i&&i.restore()}!h&&!c&&u("default")};return{rect:r,mousePoint:d.current,shapes:o,draw:x,ctx:i,unsubscribe:()=>{a.unsubscribe(),f.unsubscribe()},downloadSVG:()=>{e&&e0(e)}}}class Qe extends lt{dx;dy;constructor(t){if(super(t),t?.lineLength){const e=He(J(t?.lineDegree||0),t.lineLength);this.dx=e.dx,this.dy=e.dy}else t?.lineDx||t?.lineDy?(this.dx=t?.lineDx||0,this.dy=t?.lineDy||0):(this.dx=0,this.dy=0)}cloneShape(){return new Qe({...super.getBaseOptions(),lineDx:this.dx,lineDy:this.dy})}toSVGPathData(){return[["m",0,0],["l",this.dx,this.dy]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.dx,this.dy)}lineToAbsolutePoint(t){this.dx=t.x-this.x,this.dy=t.y-this.y}intersection(t){const e=this.transformOrigin(),i=this.pathD().transform(this.x,this.y,e.x,e.y,this.degree,this.scaleX,this.scaleY).normalizedLines[0],r=t.transformOrigin(),o=t.pathD().transform(this.x,this.y,r.x,r.y,t.degree,t.scaleX,t.scaleY).normalizedLines[0];return i.intersection(o)}}class Mr extends zt{constructor(t,e){super(t,e);const s=new Qe({...e,drag:{...e?.drag,followSibling:!0},lineLength:100,lineDegree:90});this.addShape(s);const i=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(i);const r=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(r)}cloneShapeCombo(){return new Mr(this.options,this.commonChildShapeOptions)}}class ts extends lt{radius;constructor(t){super(t),this.radius=t?.ballRadius||0}cloneShape(){return new ts({...super.getBaseOptions(),ballRadius:this.radius})}getBoundingClientRect(){return{x:-this.radius,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 je(this.x,this.y)}scalar(t){return this.moveTo(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=qt(-r,e,s),h=qt(-r,this.vx,this.vy),c=qt(-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 u=Math.abs(h.x)+Math.abs(c.x),d=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/u*d,o.x+=c.x/u*d;const f=qt(r,a.x,a.y),p=qt(r,o.x,o.y);t.moveTo(this.x+p.x,this.y+p.y),this.moveTo(this.x+f.x,this.y+f.y);const x=qt(r,h.x,h.y),b=qt(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.moveXTo(r-this.radius),this.vx*=e):this.x-this.radius<s&&(this.moveXTo(s+this.radius),this.vx*=e),this.y+this.radius>a?(this.moveYTo(a-this.radius),this.vy*=e):this.y-this.radius<i&&(this.moveYTo(i+this.radius),this.vy*=e)}}class Cr extends lt{constructor(t){super(t)}cloneShape(){return new Cr({...super.getBaseOptions()})}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 Ne extends lt{width;height;borderRadius;constructor(t){super(t),this.width=t.rectWidth,this.height=t.rectHeight,this.borderRadius=t.rectBorderRadius||0}cloneShape(){return new Ne({...super.getBaseOptions(),rectWidth:this.width,rectHeight:this.height,rectBorderRadius:this.borderRadius})}static fromCubicBezier(t,e,s,i,r,a,o,h){const l=new pt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h}).getBoundingClientRect();return new Ne({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.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){return t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height}}class Ar extends lt{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Ar({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 Ir extends lt{rx;ry;constructor(t){super(t),this.rx=t?.heartRx??50,this.ry=t?.heartRy??50}cloneShape(){return new Ir({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 kr extends lt{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new kr({...super.getBaseOptions(),starR:this.r})}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(J(s)),r=this.r*Math.sin(J(s));t.push(["l",i,r])}return t}}class Dr extends lt{constructor(t){super(t)}cloneShape(){return new Dr({...super.getBaseOptions()})}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 Rr extends lt{constructor(t){super(t)}cloneShape(){return new Rr({...super.getBaseOptions()})}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 Lr extends lt{constructor(t){super(t),this.d="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"}cloneShape(){return new Lr({...super.getBaseOptions()})}}class Or extends zt{constructor(t,e){super(t,e);const s=new lt({...e,drag:{...e?.drag,followSibling:!0},show:typeof t?.showFlame=="boolean"?t.showFlame:!1,d:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]]});this.addShape(s);const i=new lt({...e,drag:{...e?.drag,followSibling:!0},d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]});this.addShape(i)}cloneShapeCombo(){return new Or({...this.options,showFlame:this.showFlame},this.commonChildShapeOptions)}set showFlame(t){this.shapes[0].show=t}get showFlame(){return this.shapes[0].show}}class zr extends zt{width;height;cornerRadius;constructor(t,e){super(t,e),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const s=new Ne({...e,drag:{...e?.drag,followSibling:!0},x:0-this.cornerRadius,y:0-this.height*.5,rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(s);const i=new ts({...e,drag:{...e?.drag,followSibling:!0},x:0,y:0,ballRadius:2});this.addShape(i);const r=new ts({...e,drag:{...e?.drag,followSibling:!0},x:0+this.width,y:0,ballRadius:2});this.addShape(r)}cloneShapeCombo(){return new zr({...this.options,segmentWidth:this.width,segmentHeight:this.height},this.commonChildShapeOptions)}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(J(t.degree))*this.width,y:t.y+Math.sin(J(t.degree))*this.width}}}class Nr extends zt{value$=new ls;subscription;constructor(t,e){super(t,e);const s=t?.sliderMin||0,i=t?.sliderMax||100,r=t?.sliderStep||1,a=P.stepNumber(s,i,r),o=a(typeof t?.sliderDefaultValue=="number"?P.clamp(t.sliderDefaultValue,s,i):s);this.value$.next(o);const h=o/(i-s),c=t?.sliderWidth||100,l=t?.sliderHeight||4,u=l*.5,d=l*2.5,f=t?.sliderBackgroundColor||"#f5f5f5",p=t?.sliderForegroundColor||"#5a82f0",x=new Ne({...e,rectWidth:c,rectHeight:l,rectBorderRadius:u,attrs:{...e?.attrs,fill:f},drag:{...e?.drag,enable:!1}});this.addShape(x);const b=new Ne({...e,rectWidth:c*h,rectHeight:l,rectBorderRadius:u,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!1}});this.addShape(b);const w=new ts({...e,x:c*h,y:u,ballRadius:d,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!0,alongPath:new bt([["m",0,0],["l",c,0]])}});this.addShape(w),this.subscription=w.transform$.subscribe(({dx:g})=>{b.width=P.clamp(b.width+(g||0),0,c),this.value$.next(a((w.x-x.x)/c*(i-s)+s))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new Nr({...this.options},this.commonChildShapeOptions)}}async function g0(n,t){return new Promise(e=>{new MutationObserver((i,r)=>{t(i,r),e(()=>{r.disconnect()})}).observe(n,{attributes:!0,childList:!0,subtree:!0})})}function wc(n,t={attributes:!0,childList:!0,subtree:!0}){return new et(e=>{const s=new MutationObserver(i=>{e.next(i)});return s.observe(n,t),()=>{s.disconnect()}})}async function y0(n,t,e={threshold:.5}){return new Promise(s=>{new IntersectionObserver((r,a)=>{t(r,a),s(()=>{a.unobserve(n)})},e).observe(n)})}function xc(n,t={threshold:.5}){return new et(e=>{const s=new IntersectionObserver((i,r)=>{e.next(i)},t);return s.observe(n),()=>{s.unobserve(n),s.disconnect()}})}function w0(n,t){return qh().pipe(fe(null),it(()=>{const{width:e,height:s}=t?.root?.getBoundingClientRect()||jh(),{top:i,left:r,right:a,bottom:o}=n.getBoundingClientRect();return(i>=0&&i<=s||o>=0&&o<=s)&&(r>=0&&r<=e||a>=0&&a<=e)}),ue())}function x0(n,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return xc(n,{threshold:e,root:t?.root}).pipe(it(s=>{let i=s[0];if(s.length>1){const r=s.find(a=>a.isIntersecting);r&&(i=r)}return i.isIntersecting&&i.intersectionRatio>=e}),ue())}let bc=!1;function b0(){bc||(bc=!0,sh(`
|
|
14
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function hs(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var qe=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,i,r;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Ee(a),h=o.next();!h.done;h=o.next()){var c=h.value;c.remove(this)}}catch(x){t={error:x}}finally{try{h&&!h.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(q(l))try{l()}catch(x){r=x instanceof ai?x.errors:[x]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Ee(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{Wa(p)}catch(x){r=r??[],x instanceof ai?r=Pe(Pe([],le(r)),le(x.errors)):r.push(x)}}}catch(x){s={error:x}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}}if(r)throw new ai(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Wa(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&hs(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&hs(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),ja=qe.EMPTY;function Ha(n){return n instanceof qe||n&&"closed"in n&&q(n.remove)&&q(n.add)&&q(n.unsubscribe)}function Wa(n){q(n)?n():n.unsubscribe()}var Ja={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},oi={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=oi.delegate;return i?.setTimeout?i.setTimeout.apply(i,Pe([n,t],le(e))):setTimeout.apply(void 0,Pe([n,t],le(e)))},clearTimeout:function(n){var t=oi.delegate;return(t?.clearTimeout||clearTimeout)(n)},delegate:void 0};function Za(n){oi.setTimeout(function(){throw n})}function cs(){}function Ks(n){n()}var hi=function(n){ce(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Ha(e)&&e.add(s)):s.destination=Nu,s}return t.create=function(e,s,i){return new Qs(e,s,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(qe),Lu=Function.prototype.bind;function ci(n,t){return Lu.call(n,t)}var Ou=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){tn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){tn(s)}else tn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){tn(e)}},n}(),Qs=function(n){ce(t,n);function t(e,s,i){var r=n.call(this)||this,a;if(q(e)||!e)a={next:e??void 0,error:s??void 0,complete:i??void 0};else{var o;r&&Ja.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=function(){return r.unsubscribe()},a={next:e.next&&ci(e.next,o),error:e.error&&ci(e.error,o),complete:e.complete&&ci(e.complete,o)}):a=e}return r.destination=new Ou(a),r}return t}(hi);function tn(n){Za(n)}function zu(n){throw n}var Nu={closed:!0,next:cs,error:zu,complete:cs},li=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Me(n){return n}function Bu(n){return n.length===0?Me:n.length===1?n[0]:function(e){return n.reduce(function(s,i){return i(s)},e)}}var et=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Fu(t)?t:new Qs(t,e,s);return Ks(function(){var a=i,o=a.operator,h=a.source;r.add(o?o.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=Ka(e),new e(function(i,r){var a=new Qs({next:function(o){try{t(o)}catch(h){r(h),a.unsubscribe()}},error:r,complete:i});s.subscribe(a)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[li]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Bu(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=Ka(t),new t(function(s,i){var r;e.subscribe(function(a){return r=a},function(a){return i(a)},function(){return s(r)})})},n.create=function(t){return new n(t)},n}();function Ka(n){var t;return(t=n??Ja.Promise)!==null&&t!==void 0?t:Promise}function Yu(n){return n&&q(n.next)&&q(n.error)&&q(n.complete)}function Fu(n){return n&&n instanceof hi||Yu(n)&&Ha(n)}function Xu(n){return q(n?.lift)}function Dt(n){return function(t){if(Xu(t))return t.lift(function(e){try{return n(e,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function ht(n,t,e,s,i){return new Uu(n,t,e,s,i)}var Uu=function(n){ce(t,n);function t(e,s,i,r,a,o){var h=n.call(this,e)||this;return h.onFinalize=a,h.shouldUnsubscribe=o,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(hi),Vu=ri(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ls=function(n){ce(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var s=new Qa(this,this);return s.operator=e,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new Vu},t.prototype.next=function(e){var s=this;Ks(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var a=Ee(s.currentObservers),o=a.next();!o.done;o=a.next()){var h=o.value;h.next(e)}}catch(c){i={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var s=this;Ks(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=e;for(var i=s.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ks(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var s=e.observers;s.length;)s.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var s=this,i=this,r=i.hasError,a=i.isStopped,o=i.observers;return r||a?ja:(this.currentObservers=null,o.push(e),new qe(function(){s.currentObservers=null,hs(o,e)}))},t.prototype._checkFinalizedStatuses=function(e){var s=this,i=s.hasError,r=s.thrownError,a=s.isStopped;i?e.error(r):a&&e.complete()},t.prototype.asObservable=function(){var e=new et;return e.source=this,e},t.create=function(e,s){return new Qa(e,s)},t}(et),Qa=function(n){ce(t,n);function t(e,s){var i=n.call(this)||this;return i.destination=e,i.source=s,i}return t.prototype.next=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,e)},t.prototype.error=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,e)},t.prototype.complete=function(){var e,s;(s=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||s===void 0||s.call(e)},t.prototype._subscribe=function(e){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(e))!==null&&i!==void 0?i:ja},t}(ls),to={now:function(){return(to.delegate||Date).now()},delegate:void 0},$u=function(n){ce(t,n);function t(e,s){return n.call(this)||this}return t.prototype.schedule=function(e,s){return this},t}(qe),en={setInterval:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=en.delegate;return i?.setInterval?i.setInterval.apply(i,Pe([n,t],le(e))):setInterval.apply(void 0,Pe([n,t],le(e)))},clearInterval:function(n){var t=en.delegate;return(t?.clearInterval||clearInterval)(n)},delegate:void 0},Gu=function(n){ce(t,n);function t(e,s){var i=n.call(this,e,s)||this;return i.scheduler=e,i.work=s,i.pending=!1,i}return t.prototype.schedule=function(e,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=e;var r=this.id,a=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(a,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,s),this},t.prototype.requestAsyncId=function(e,s,i){return i===void 0&&(i=0),en.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&en.clearInterval(s)},t.prototype.execute=function(e,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,s){var i=!1,r;try{this.work(e)}catch(a){i=!0,r=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,s=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,hs(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t}($u),eo=function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,s){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(s,e)},n.now=to.now,n}(),qu=function(n){ce(t,n);function t(e,s){s===void 0&&(s=eo.now);var i=n.call(this,e,s)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var s=this.actions;if(this._active){s.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=s.shift());if(this._active=!1,i){for(;e=s.shift();)e.unsubscribe();throw i}},t}(eo),ui=new qu(Gu),ju=ui,so=new et(function(n){return n.complete()});function no(n){return n&&q(n.schedule)}function fi(n){return n[n.length-1]}function Hu(n){return q(fi(n))?n.pop():void 0}function us(n){return no(fi(n))?n.pop():void 0}function Wu(n,t){return typeof fi(n)=="number"?n.pop():t}var di=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function io(n){return q(n?.then)}function ro(n){return q(n[li])}function ao(n){return Symbol.asyncIterator&&q(n?.[Symbol.asyncIterator])}function oo(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ju(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ho=Ju();function co(n){return q(n?.[ho])}function lo(n){return Du(this,arguments,function(){var e,s,i,r;return qa(this,function(a){switch(a.label){case 0:e=n.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ge(e.read())];case 3:return s=a.sent(),i=s.value,r=s.done,r?[4,Ge(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ge(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function uo(n){return q(n?.getReader)}function wt(n){if(n instanceof et)return n;if(n!=null){if(ro(n))return Zu(n);if(di(n))return Ku(n);if(io(n))return Qu(n);if(ao(n))return fo(n);if(co(n))return tf(n);if(uo(n))return ef(n)}throw oo(n)}function Zu(n){return new et(function(t){var e=n[li]();if(q(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ku(n){return new et(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function Qu(n){return new et(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Za)})}function tf(n){return new et(function(t){var e,s;try{for(var i=Ee(n),r=i.next();!r.done;r=i.next()){var a=r.value;if(t.next(a),t.closed)return}}catch(o){e={error:o}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(e)throw e.error}}t.complete()})}function fo(n){return new et(function(t){sf(n,t).catch(function(e){return t.error(e)})})}function ef(n){return fo(lo(n))}function sf(n,t){var e,s,i,r;return ku(this,void 0,void 0,function(){var a,o;return qa(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=Ru(n),h.label=1;case 1:return[4,e.next()];case 2:if(s=h.sent(),!!s.done)return[3,4];if(a=s.value,t.next(a),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=h.sent(),i={error:o},[3,11];case 6:return h.trys.push([6,,9,10]),s&&!s.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Qt(n,t,e,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function mo(n,t){return t===void 0&&(t=0),Dt(function(e,s){e.subscribe(ht(s,function(i){return Qt(s,n,function(){return s.next(i)},t)},function(){return Qt(s,n,function(){return s.complete()},t)},function(i){return Qt(s,n,function(){return s.error(i)},t)}))})}function mi(n,t){return t===void 0&&(t=0),Dt(function(e,s){s.add(n.schedule(function(){return e.subscribe(s)},t))})}function nf(n,t){return wt(n).pipe(mi(t),mo(t))}function rf(n,t){return wt(n).pipe(mi(t),mo(t))}function af(n,t){return new et(function(e){var s=0;return t.schedule(function(){s===n.length?e.complete():(e.next(n[s++]),e.closed||this.schedule())})})}function of(n,t){return new et(function(e){var s;return Qt(e,t,function(){s=n[ho](),Qt(e,t,function(){var i,r,a;try{i=s.next(),r=i.value,a=i.done}catch(o){e.error(o);return}a?e.complete():e.next(r)},0,!0)}),function(){return q(s?.return)&&s.return()}})}function po(n,t){if(!n)throw new Error("Iterable cannot be null");return new et(function(e){Qt(e,t,function(){var s=n[Symbol.asyncIterator]();Qt(e,t,function(){s.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function hf(n,t){return po(lo(n),t)}function cf(n,t){if(n!=null){if(ro(n))return nf(n,t);if(di(n))return af(n,t);if(io(n))return rf(n,t);if(ao(n))return po(n,t);if(co(n))return of(n,t);if(uo(n))return hf(n,t)}throw oo(n)}function fs(n,t){return t?cf(n,t):wt(n)}function lf(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n);return fs(n,e)}var uf=ri(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function ff(n,t){var e=typeof t=="object";return new Promise(function(s,i){var r=new Qs({next:function(a){s(a),r.unsubscribe()},error:i,complete:function(){e?s(t.defaultValue):i(new uf)}});n.subscribe(r)})}function df(n){return n instanceof Date&&!isNaN(n)}function it(n,t){return Dt(function(e,s){var i=0;e.subscribe(ht(s,function(r){s.next(n.call(t,r,i++))}))})}var mf=Array.isArray;function pf(n,t){return mf(t)?n.apply(void 0,Pe([],le(t))):n(t)}function pi(n){return it(function(t){return pf(n,t)})}var gf=Array.isArray,yf=Object.getPrototypeOf,wf=Object.prototype,xf=Object.keys;function bf(n){if(n.length===1){var t=n[0];if(gf(t))return{args:t,keys:null};if(vf(t)){var e=xf(t);return{args:e.map(function(s){return t[s]}),keys:e}}}return{args:n,keys:null}}function vf(n){return n&&typeof n=="object"&&yf(n)===wf}function _f(n,t){return n.reduce(function(e,s,i){return e[s]=t[i],e},{})}function Sf(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n),s=Hu(n),i=bf(n),r=i.args,a=i.keys;if(r.length===0)return fs([],e);var o=new et(Tf(r,e,a?function(h){return _f(a,h)}:Me));return s?o.pipe(pi(s)):o}function Tf(n,t,e){return e===void 0&&(e=Me),function(s){go(t,function(){for(var i=n.length,r=new Array(i),a=i,o=i,h=function(l){go(t,function(){var u=fs(n[l],t),d=!1;u.subscribe(ht(s,function(f){r[l]=f,d||(d=!0,o--),o||s.next(e(r.slice()))},function(){--a||s.complete()}))},s)},c=0;c<i;c++)h(c)},s)}}function go(n,t,e){n?Qt(e,n,t):t()}function Ef(n,t,e,s,i,r,a,o){var h=[],c=0,l=0,u=!1,d=function(){u&&!h.length&&!c&&t.complete()},f=function(x){return c<s?p(x):h.push(x)},p=function(x){r&&t.next(x),c++;var b=!1;wt(e(x,l++)).subscribe(ht(t,function(w){i?.(w),r?f(w):t.next(w)},function(){b=!0},void 0,function(){if(b)try{c--;for(var w=function(){var g=h.shift();a?Qt(t,a,function(){return p(g)}):p(g)};h.length&&c<s;)w();d()}catch(g){t.error(g)}}))};return n.subscribe(ht(t,f,function(){u=!0,d()})),function(){o?.()}}function gi(n,t,e){return e===void 0&&(e=1/0),q(t)?gi(function(s,i){return it(function(r,a){return t(s,r,i,a)})(wt(n(s,i)))},e):(typeof t=="number"&&(e=t),Dt(function(s,i){return Ef(s,i,n,e)}))}function yo(n){return n===void 0&&(n=1/0),gi(Me,n)}function Pf(){return yo(1)}function wo(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Pf()(fs(n,us(n)))}var Mf=["addListener","removeListener"],Cf=["addEventListener","removeEventListener"],Af=["on","off"];function yi(n,t,e,s){if(q(e)&&(s=e,e=void 0),s)return yi(n,t,e).pipe(pi(s));var i=le(Df(n)?Cf.map(function(o){return function(h){return n[o](t,h,e)}}):If(n)?Mf.map(xo(n,t)):kf(n)?Af.map(xo(n,t)):[],2),r=i[0],a=i[1];if(!r&&di(n))return gi(function(o){return yi(o,t,e)})(wt(n));if(!r)throw new TypeError("Invalid event target");return new et(function(o){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return o.next(1<c.length?c:c[0])};return r(h),function(){return a(h)}})}function xo(n,t){return function(e){return function(s){return n[e](t,s)}}}function If(n){return q(n.addListener)&&q(n.removeListener)}function kf(n){return q(n.on)&&q(n.off)}function Df(n){return q(n.addEventListener)&&q(n.removeEventListener)}function st(n,t,e){return e?st(n,t).pipe(pi(e)):new et(function(s){var i=function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return s.next(a.length===1?a[0]:a)},r=n(i);return q(t)?function(){return t(i,r)}:void 0})}function Rf(n,t,e){n===void 0&&(n=0),e===void 0&&(e=ju);var s=-1;return t!=null&&(no(t)?e=t:s=t),new et(function(i){var r=df(n)?+n-e.now():n;r<0&&(r=0);var a=0;return e.schedule(function(){i.closed||(i.next(a++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function Lf(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n),s=Wu(n,1/0),i=n;return i.length?i.length===1?wt(i[0]):yo(s)(fs(i,e)):so}var Of=Array.isArray;function zf(n){return n.length===1&&Of(n[0])?n[0]:n}function bo(n,t){return Dt(function(e,s){var i=0;e.subscribe(ht(s,function(r){return n.call(t,r,i++)&&s.next(r)}))})}function wi(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n=zf(n),n.length===1?wt(n[0]):new et(Nf(n))}function Nf(n){return function(t){for(var e=[],s=function(r){e.push(wt(n[r]).subscribe(ht(t,function(a){if(e){for(var o=0;o<e.length;o++)o!==r&&e[o].unsubscribe();e=null}t.next(a)})))},i=0;e&&!t.closed&&i<n.length;i++)s(i)}}function ue(n,t){return t===void 0&&(t=Me),n=n??Bf,Dt(function(e,s){var i,r=!0;e.subscribe(ht(s,function(a){var o=t(a);(r||!n(i,o))&&(r=!1,i=o,s.next(a))}))})}function Bf(n,t){return n===t}function vo(n,t){return t?function(e){return e.pipe(vo(function(s,i){return wt(n(s,i)).pipe(it(function(r,a){return t(s,r,i,a)}))}))}:Dt(function(e,s){var i=0,r=null,a=!1;e.subscribe(ht(s,function(o){r||(r=ht(s,void 0,function(){r=null,a&&s.complete()}),wt(n(o,i++)).subscribe(r))},function(){a=!0,!r&&s.complete()}))})}function fe(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=us(n);return Dt(function(s,i){(e?wo(n,s,e):wo(n,s)).subscribe(i)})}function sn(n,t){return Dt(function(e,s){var i=null,r=0,a=!1,o=function(){return a&&!i&&s.complete()};e.subscribe(ht(s,function(h){i?.unsubscribe();var c=0,l=r++;wt(n(h,l)).subscribe(i=ht(s,function(u){return s.next(t?t(h,u,l,c++):u)},function(){i=null,o()}))},function(){a=!0,o()}))})}function Yf(){return sn(Me)}function xi(n){return Dt(function(t,e){wt(n).subscribe(ht(e,function(){return e.complete()},cs)),!e.closed&&t.subscribe(e)})}function Ce(n,t,e){var s=q(n)||t||e?{next:n,error:t,complete:e}:n;return s?Dt(function(i,r){var a;(a=s.subscribe)===null||a===void 0||a.call(s);var o=!0;i.subscribe(ht(r,function(h){var c;(c=s.next)===null||c===void 0||c.call(s,h),r.next(h)},function(){var h;o=!1,(h=s.complete)===null||h===void 0||h.call(s),r.complete()},function(h){var c;o=!1,(c=s.error)===null||c===void 0||c.call(s,h),r.error(h)},function(){var h,c;o&&((h=s.unsubscribe)===null||h===void 0||h.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Me}function Ff(n,t){return Dt(function(e,s){var i=t??{},r=i.leading,a=r===void 0?!0:r,o=i.trailing,h=o===void 0?!1:o,c=!1,l=null,u=null,d=!1,f=function(){u?.unsubscribe(),u=null,h&&(b(),d&&s.complete())},p=function(){u=null,d&&s.complete()},x=function(w){return u=wt(n(w)).subscribe(ht(s,f,p))},b=function(){if(c){c=!1;var w=l;l=null,s.next(w),!d&&x(w)}};e.subscribe(ht(s,function(w){c=!0,l=w,!(u&&!u.closed)&&(a?b():x(w))},function(){d=!0,!(h&&c&&u&&!u.closed)&&s.complete()}))})}function Xf(n,t,e){t===void 0&&(t=ui);var s=Rf(n,t);return Ff(function(){return s},e)}function Uf(n,t){return Dt(function(e,s){var i=[],r=function(a){for(;0<i.length;)i.shift().error(a);s.error(a)};wt(n).subscribe(ht(s,function(a){var o=new ls;i.push(o);var h=new qe,c=function(){hs(i,o),o.complete(),h.unsubscribe()},l;try{l=wt(t(a))}catch(u){r(u);return}s.next(o.asObservable()),h.add(l.subscribe(ht(s,c,cs,r)))},cs)),e.subscribe(ht(s,function(a){var o,h,c=i.slice();try{for(var l=Ee(c),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(a)}}catch(f){o={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}finally{if(o)throw o.error}}},function(){for(;0<i.length;)i.shift().complete();s.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function j(n,t,e,s=!1){const i=async r=>{await e(r)};try{n.addEventListener(t,i,s)}catch{n.attachEvent("on"+t,i)}return()=>{try{n.removeEventListener(t,i,s)}catch{n.detachEvent("on"+t,i)}}}function U(n,t,e=!1){return yi(n,t,{capture:e})}function de(n){if(n.preventDefault){n.preventDefault();return}try{n.returnValue=!1}catch{}}function _o(n){if(n.stopPropagation){n.stopPropagation();return}try{n.cancelBubble=!0}catch{}}const Vf=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],$f=["keydown","keyup","keypress"],Gf=["touchstart","touchend","touchcancel","touchmove"],qf=["pointerdown","pointerup","pointercancel","pointermove"],jf=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Hf=["change"];function Wf(n,t,e={bubbles:!0,detail:{}}){if(!n)return;let s;try{Vf.includes(t)?s=new MouseEvent(t,e):$f.includes(t)?s=new KeyboardEvent(t,e):Gf.includes(t)?s=new TouchEvent(t,e):qf.includes(t)?s=new PointerEvent(t,e):jf.includes(t)?s=new DragEvent(t,e):Hf.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(n.dispatchEvent)n.dispatchEvent(s);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function Jf(n,t){const e=n.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Zf(n,t){let e=document.createElement(n);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}const nn=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function Kf(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Qf(n,t){const e=n.split("."),s=t.split(".");for(let i=0,r=e.length;i<r;i++){if(s.length==i)return 1;if(e[i]!=s[i])return e[i]>s[i]?1:-1}return e.length!=s.length?-1:0}function bi(){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()}const td=()=>{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};function ed(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function sd(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function vi(){return nn()==="ios"}function So(){return nn()==="macos"}function nd(){return vi()|So()}function To(){return nn()==="android"}function id(){return vi()||To()}function Eo(){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 rd=Eo()!==-1,ad=document.documentMode?document.documentMode===9:!1,od=document.documentMode?document.documentMode===10:!1,hd=document.documentMode?document.documentMode===11:!1;function Po(){return bi()==="wechat"}function Mo(){return bi()==="ali"}function cd(){return Po()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function ld(){return Mo()&&navigator.userAgent.match(/miniprogram/i)}const ud=typeof document<"u",Co=typeof window<"u",fd=typeof history<"u",dd=Co&&window.File&&window.FileReader&&window.FileList&&window.Blob,Ao=(()=>!!(P.root.Worker&&P.root.Blob&&P.root.Promise&&P.root.OffscreenCanvas&&P.root.OffscreenCanvasRenderingContext2D&&P.root.HTMLCanvasElement&&P.root.HTMLCanvasElement.prototype.transferControlToOffscreen&&P.root.URL&&P.root.URL.createObjectURL))(),md=typeof Path2D=="function"&&typeof DOMMatrix=="function",Io=function(){if(!P.root.OffscreenCanvas)return!1;const n=new OffscreenCanvas(1,1),t=n.getContext("2d");t.fillRect(0,0,1,1);const e=n.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),pd=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},gd="webkit moz ms o".split(" ");function rn(n){return typeof n=="function"&&/native code/.test(n.toString())}function yd(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}(function(){if(!window.requestAnimationFrame){let n=P.now();window.requestAnimationFrame=function(t){const e=P.now(),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)})})();function _i(n){let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function Si(n,t=0){if(t==0)return n(P.now()),()=>{};{const e=P.now();return _i(s=>s-e>=t?(n(s),!1):!0)}}function wd(n,t=0){let e=!1,s=0;const i=P.now(),r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t<=o),Si(r,Math.max(0,t-o))};return Si(r,t),()=>{e=!0}}function xd(n,t=20){const e=1e3/t;let s=0,i;return()=>(P.now()-s>=e&&(s=P.now(),i=n()),i)}window.requestIdleCallback=window.requestIdleCallback||function(n,t){const e=P.now();return setTimeout(function(){n({didTimeout:P.now()-e>50,timeRemaining:()=>Math.max(0,50-(P.now()-e))})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(n){clearTimeout(n)};function ko(n,t){requestIdleCallback(e=>{e.timeRemaining()>0||t?n():ko(n,t)},{timeout:t})}const Ti=new P.CacheMap;let Ei=!1;function Pi(n,t,e){n&&t&&Ti.set(n,{cb:t,startTime:P.now(),timeout:e}),!Ei&&(Ei=!0,vd(s=>{Ei=!1;let i=s.timeRemaining();Ti.filter((r,a)=>{let o=!1;const h=P.now();(i>0||a.timeout&&P.now()-a.startTime>=a.timeout)&&(a.cb(),o=!0);const c=P.now();return i-=c-h,!o}),Ti.length>0&&Pi()}))}let an=0,Ae=33,me=33,Mi;const Do=new MessageChannel,bd=Do.port2;Do.port1.onmessage=n=>{Mi!==null&&Mi({didTimeout:an<=P.now(),timeRemaining:()=>Math.max(0,an-P.now())})};function vd(n){return Mi=n,requestAnimationFrame(t=>{let e=t-an+me;e<me&&Ae<me?(e<8&&(e=8),me=e<Ae?Ae:e):e>me&&Ae>me?me=e<Ae?Ae:e:Ae=e,an=t+me,bd.postMessage(null)})}function _d(n){if(typeof setImmediate<"u"&&rn(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(rn(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&rn(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function Sd(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class ds{static _nextId=0;static nextId(){return ds._nextId++}}const z={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-z.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?z.Bounce.In(n*2)*.5:z.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 Ro(n){switch(n){case z.Quadratic.In:return z.Quadratic.Out;case z.Quadratic.Out:return z.Quadratic.In;case z.Quadratic.InOut:return z.Quadratic.InOut;case z.Cubic.In:return z.Cubic.Out;case z.Cubic.Out:return z.Cubic.In;case z.Cubic.InOut:return z.Cubic.InOut;case z.Quartic.In:return z.Quartic.Out;case z.Quartic.Out:return z.Quartic.In;case z.Quartic.InOut:return z.Quartic.InOut;case z.Quintic.In:return z.Quintic.Out;case z.Quintic.Out:return z.Quintic.In;case z.Quintic.InOut:return z.Quintic.InOut;case z.Sinusoidal.In:return z.Sinusoidal.Out;case z.Sinusoidal.Out:return z.Sinusoidal.In;case z.Sinusoidal.InOut:return z.Sinusoidal.InOut;case z.Exponential.In:return z.Exponential.Out;case z.Exponential.Out:return z.Exponential.In;case z.Exponential.InOut:return z.Exponential.InOut;case z.Circular.In:return z.Circular.Out;case z.Circular.Out:return z.Circular.In;case z.Circular.InOut:return z.Circular.InOut;case z.Elastic.In:return z.Elastic.Out;case z.Elastic.Out:return z.Elastic.In;case z.Elastic.InOut:return z.Elastic.InOut;case z.Back.In:return z.Back.Out;case z.Back.Out:return z.Back.In;case z.Back.InOut:return z.Back.InOut;case z.Bounce.In:return z.Bounce.Out;case z.Bounce.Out:return z.Bounce.In;case z.Bounce.InOut:return z.Bounce.InOut;default:return n}}const Td=4,Ed=.001,Pd=1e-7,Md=10,ms=11,on=1/(ms-1),Cd=typeof Float32Array=="function";function Lo(n,t){return 1-3*t+3*n}function Oo(n,t){return 3*t-6*n}function zo(n){return 3*n}function hn(n,t,e){return((Lo(t,e)*n+Oo(t,e))*n+zo(t))*n}function No(n,t,e){return 3*Lo(t,e)*n*n+2*Oo(t,e)*n+zo(t)}function Ad(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=hn(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Pd&&++o<Md);return a}function Id(n,t,e,s){for(let i=0;i<Td;++i){const r=No(t,e,s);if(r===0)return t;const a=hn(t,e,s)-n;t-=a/r}return t}function kd(n){return n}function Ci(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 kd;const i=Cd?new Float32Array(ms):new Array(ms);for(let a=0;a<ms;++a)i[a]=hn(a*on,n,e);function r(a){let o=0,h=1;const c=ms-1;for(;h!==c&&i[h]<=a;++h)o+=on;--h;const l=(a-i[h])/(i[h+1]-i[h]),u=o+l*on,d=No(u,n,e);return d>=Ed?Id(a,u,n,e):d===0?u:Ad(a,o,o+on,n,e)}return a=>a===0||a===1?a:hn(r(a),t,s)}function Ai(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 Bo(n){const[t,e,s,i]=Ai(n);return[1-s,1-i,1-t,1-e]}function Dd(n){return Ci(...Ai(n))}function Rd(n){return Ci(...Bo(n))}const te={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=te.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=te.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=te.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=te.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 Yo{_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=P.now(),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 Nt=new Yo;class Ii{constructor(t,e=Nt){this._object=t,this._group=e}_id=ds.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=z.Linear.None;_interpolationFunction=te.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=P.now()){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=P.now()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=P.now()){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=Nt){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=z.Linear.None){return this._easingFunction=t,this}interpolation(t=te.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=P.now(),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 Ld=ds.nextId,Od=Nt.getAll.bind(Nt),zd=Nt.removeAll.bind(Nt),Nd=Nt.add.bind(Nt),Bd=Nt.remove.bind(Nt),Yd=Nt.update.bind(Nt),Fd={now:P.now,Sequence:ds,Easing:z,Interpolation:te,Group:Yo,Tween:Ii,nextId:Ld,getAll:Od,removeAll:zd,add:Nd,remove:Bd,update:Yd};class ki{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=P.now(),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=P.now();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){P.ShellSort(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||z.Linear.None,interpolationFunction:s?.interpolationFunction||te.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 ki,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=_i(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 Ii({...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(),P.deleteArrayItem(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new ki;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=Ro(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}}const cn=new P.CacheMap,Fo=(n=!0)=>{cn.filter((t,e)=>(e.alternate&&(En(e,e.alternate),n&&cn.set(t,e.alternate),e.alternate=void 0),n))};function Di(n){let t=cn.get(n);return t||(t=Tn(n),cn.set(n,t)),t}function Xo(n){const t=Di(n);return t.alternate||(t.alternate=Tn(n)),t.alternate}function Xd(n,t,e=!0){t(Xo(n)),Fo(e)}function Ri(n,t,e=!0){t(Xo(n)),Pi("FLUSH_DOM_ACTION",()=>Fo(e),50)}function J(n){return n*Math.PI/180}function _t(n){return n*180/Math.PI}function je(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function pe(n,t,e,s){return je(e-n,s-t)}function $t(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function He(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Ud(n,t,e){if(typeof e=="number"){const s=je(n,t,e);return{x:n/=s,y:t/=s,z:e/=s}}else{const s=je(n,t);return{x:n/=s,y:t/=s}}}function Vd(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=_t($t(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 Uo=$d("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 $d(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 St(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 ln(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 Gd(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function qd(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const gs={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"}};let un=class{__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",St("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)}},Li=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Vo=class ia{__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(gs);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=gs[i].canvas}}__getStyleState(){const t={},e=Object.keys(gs);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(gs);for(let r=0;r<i.length;r++){const a=gs[i[r]],o=this[i[r]];if(a.apply){if(o instanceof Li){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,St("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof un)e.setAttribute(a.apply,St("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,St("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),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(Uo);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=Uo[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(St("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(St("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(St("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(St("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(St("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(St("L {x} {y}",this.__currentPosition)):this.__addPathCommand(St("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(St("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(St("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],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],x=e+f*d[1],b=[-h[1],h[0]],w=[c[1],-c[0]],g=function(M){const E=M[0];return M[1]>=0?Math.acos(E):-Math.acos(E)},v=g(b),_=g(w);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,v,_)}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:ln(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new un(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:ln(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 un(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":Gd(this.textAlign),"dominant-baseline":qd(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),u=a?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),a?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(St("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ln(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",St("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,u,d,f,p,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 w=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+s+", "+i+")";if(e instanceof ia){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.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),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ln(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 ia&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Li(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Oi=class{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 Vo({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}}},zi=class{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=$t(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),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const jd=class extends zi{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,u=(t-s)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,x=f*f/(r*r)+p*p/(a*a);if(x>1){const $=Math.sqrt(x);throw r=$*r,a=$*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*p*p-a*a*f*f)/(r*r*p*p+a*a*f*f)),w=h!=c?1:-1,g=w*b*r*p/a,v=w*b*-a*f/r,_=(t+s)/2,M=(e+i)/2,E=Math.cos(l)*g-Math.sin(l)*v+_,D=Math.sin(l)*g+Math.cos(l)*v+M,B=($,W,Q,Z)=>($*Z>=W*Q?1:-1)*Math.acos(($*Q+W*Z)/(Math.sqrt($*$+W*W)*Math.sqrt(Q*Q+Z*Z))),Y=B(1,0,t-E,e-D)-l,V=B(t-E,e-D,s-E,i-D);return[E,D,r,a,l,Y,Y+V]}},Hd=class extends zi{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}}},ge=class Ns extends zi{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}));const l=[],u=c.length;for(let p=0;p<u;p++){for(let x=p+1;x<u;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const d={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},f={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.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,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const x=l*u[p]+l,b=this.base3(x,t,s,r,o),w=this.base3(x,e,i,a,h);f+=d[p]*Math.sqrt(b*b+w*w)}return l*f}length(t=1){return Ns.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||Ns.bezlen(e,s,i,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=Ns.bezlen(e,s,i,r,a,o,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=Ns.bezlen(e,s,i,r,a,o,h,c,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),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),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,g=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:x},end:{x:b,y:w},alpha:g}}},ys=Math.PI*2;function $o(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 Wd(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,d=a*a,f=o*o,p=l*l,x=u*u;let b=d*f-d*x-f*p;b<0&&(b=0),b/=d*x+f*p,b=Math.sqrt(b)*(i===r?-1:1);const w=b*a/o*u,g=b*-o/a*l,v=c*w-h*g+(n+e)/2,_=h*w+c*g+(t+s)/2,M=(l-w)/a,E=(u-g)/o,D=(-l-w)/a,B=(-u-g)/o,Y=$o(1,0,M,E);let V=$o(M,E,D,B);return r===0&&V>0&&(V-=ys),r===1&&V<0&&(V+=ys),[v,_,Y,V]}function Jd(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 Go(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*ys/360),l=Math.cos(h*ys/360),u=l*(n-e)/2+c*(t-s)/2,d=-c*(n-e)/2+l*(t-s)/2;if(u===0&&d===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const f=u*u/(a*a)+d*d/(o*o);f>1&&(a*=Math.sqrt(f),o*=Math.sqrt(f));const p=Wd(n,t,e,s,i,r,a,o,c,l),x=[];let b=p[2],w=p[3];const g=Math.max(Math.ceil(Math.abs(w)/(ys/4)),1);w/=g;for(let v=0;v<g;v++)x.push(Jd(b,w)),b+=w;return x.map(v=>{for(let _=0;_<v.length;_+=2){let M=v[_+0],E=v[_+1];M*=a,E*=o;const D=l*M-c*E,B=c*M+l*E;v[_+0]=D+p[0],v[_+1]=B+p[1]}return v})}function Ni(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 ws(n,t,e,s){return[n,t,e,s,e,s]}const xs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class Ie{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&De(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||P.generateUUID()})}static downloadFromSVGElement(t,e="shape"){return gn(si(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return gn(P.toBlob(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return ei(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 Ie.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=P.extractAllNumbers(r);for(a=="m"&&o.length>xs[a]&&(e.push([i,...o.splice(0,xs[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<xs[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,xs[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,u;for(let d=0,f=t.length;d<f;d++){let p=t[d];const x=p[0];switch(x){case"M":s=p[1],i=p[2];break;case"A":const b=Go(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((v,_)=>{const[M,E,D,B,Y,V,$,W]=v;p=["C",D,B,Y,V,$,W],_<b.length-1&&e.push(p)});break;case"S":let w=r,g=a;(u=="C"||u=="S")&&(w+=w-c,g+=g-l),p=["C",w,g,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...Ni(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...Ni(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...ws(r,a,p[1],p[2])];break;case"H":p=["C",...ws(r,a,p[1],a)];break;case"V":p=["C",...ws(r,a,r,p[1])];break;case"Z":p=["C",...ws(r,a,s,i)];break}u=x,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}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}}let Zd=class he{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(Ie.parseSVGPath(t),e):t instanceof he?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=Ie.normalizeSVGPath(Ie.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 ge({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 he;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 ge({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 he;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 jd){Go(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,x,b,w]=c;this.normalizedLines.push(new ge({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})),this.prevPathX=b,this.prevPathY=w});return}let e,s,i,r,a,o;t instanceof ge?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Hd?[e,s,i,r,a,o]=Ni(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=ws(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new ge({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 Ie.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 xt;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,u=r.c2y,d=r.toX,f=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:u}=t.transformPoint({x:l,y:u}),{x:d,y:f}=t.transformPoint({x:d,y:f}),i.push(new ge({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:u,toX:d,toY:f}))}),{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 he;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=a.length;l<u;l++){const d=a[l],f=d.length();if(h+f>e&&!o){const p=d.getPointAtSegmentLength(e-h);if(c.appendLine(new ge({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new ge({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:d.x,toY:d.y})),h+=f;continue}h+=f,c.appendLine(d)}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){const l=this.getPointAtLength(c),u=Math.pow(pe(l.x,l.y,t,e),2);u<a&&(i=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=Math.pow(pe(l.x,l.y,t,e),2),d=r+o,f=this.getPointAtLength(d),p=Math.pow(pe(f.x,f.y,t,e),2);c>=0&&u<a?(i=l,r=c,a=u):d<=s&&p<a?(i=f,r=d,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?$t(h.x,h.y,i.x,i.y):$t(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+=pe(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++],u=e[o++],d=e[o++],f=e[o++];a.push(["C",h,c,l,u,d,f]);let p=0;for(;p<r&&i>0;)a.push(["C",d,f,d,f,d,f]),i-=6,p++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=P.maxDotNumber(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:he.fromPolymorphPoints(he.mixPoints(new he({d:t}).polymorphPoints,new he({d:e}).polymorphPoints,s)).toSVGPathData()}},Kd=class extends P.EventBus{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=P.generateUUID(),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=P.extractAllNumbers(s).reduce((i,r)=>i+r,0)}return P.reactive(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Zd,P.watchEffect(()=>{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 xt;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new xt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Oi)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 Oi)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 P.newConstructor(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])=>[P.toKebab(s),i]))):e&&(this.attrs[P.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[P.toKebab(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[P.toKebab(t)]}distance(t){return pe(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=_t($t(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=He(J(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=He(J(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=P.parseNumber(t?.gravity,0);this.vy+=e;const s=P.parseNumber(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=P.parseNumber(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=P.parseNumber(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=P.parseNumber(e?.springLength,100),i=P.parseNumber(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=P.maxDotNumber(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",""+P.maxDotNumber(o.offset,2)),r?.(o,h)}})),a.play()}};class Qd extends Kd{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}=qt(J(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=qt(J(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=qt(J(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 je(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 fn=Qd;class Bi{_x;_y;_z;_w;constructor(t=0,e=0,s=0,i=1){this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,r,a,o){let h=s[i+0],c=s[i+1],l=s[i+2],u=s[i+3];const d=r[a+0],f=r[a+1],p=r[a+2],x=r[a+3];if(o===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(o===1){t[e+0]=d,t[e+1]=f,t[e+2]=p,t[e+3]=x;return}if(u!==x||h!==d||c!==f||l!==p){let b=1-o;const w=h*d+c*f+l*p+u*x,g=w>=0?1:-1,v=1-w*w;if(v>Number.EPSILON){const M=Math.sqrt(v),E=Math.atan2(M,w*g);b=Math.sin(b*E)/M,o=Math.sin(o*E)/M}const _=o*g;if(h=h*b+d*_,c=c*b+f*_,l=l*b+p*_,u=u*b+x*_,b===1-o){const M=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=M,c*=M,l*=M,u*=M}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,i,r,a){const o=s[i],h=s[i+1],c=s[i+2],l=s[i+3],u=r[a],d=r[a+1],f=r[a+2],p=r[a+3];return t[e]=o*p+l*u+h*f-c*d,t[e+1]=h*p+l*d+c*u-o*f,t[e+2]=c*p+l*f+o*d-h*u,t[e+3]=l*p-o*u-h*d-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,s=this._z,i=this._w){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new Bi(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t.x,i=t.y,r=t.z,a=t.order,o=Math.cos,h=Math.sin,c=o(s/2),l=o(i/2),u=o(r/2),d=h(s/2),f=h(i/2),p=h(r/2);switch(a){case"XYZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"YXZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"ZXY":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"ZYX":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"YZX":this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case"XZY":this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],i=e[4],r=e[8],a=e[1],o=e[5],h=e[9],c=e[2],l=e[6],u=e[10],d=s+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(a-i)*f}else if(s>o&&s>u){const f=2*Math.sqrt(1+s-o-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-s-u);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-s-o);this._w=(a-i)/f,this._x=(r+c)/f,this._y=(h+l)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(P.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,i=t._y,r=t._z,a=t._w,o=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+a*o+i*c-r*h,this._y=i*l+a*h+r*o-s*c,this._z=r*l+a*c+s*h-i*o,this._w=a*l-s*o-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,r=this._z,a=this._w;let o=a*t._w+s*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=s,this._y=i,this._z=r,this;const h=1-o*o;if(h<=Number.EPSILON){const f=1-e;return this._w=f*a+e*this._w,this._x=f*s+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),l=Math.atan2(c,o),u=Math.sin((1-e)*l)/c,d=Math.sin(e*l)/c;return this._w=a*u+this._w*d,this._x=s*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class bs{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new bs(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return qo.copy(this).projectOnVector(t),this.sub(qo)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(P.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*s-a*i+t.x,this.y=r*i+a*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rt{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new Rt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(jo.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(jo.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*i,this.y=r[1]*e+r[4]*s+r[7]*i,this.z=r[2]*e+r[5]*s+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=t.value,a=1/(r[3]*e+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*s+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*s+r[10]*i+r[14])*a,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,r=t.x,a=t.y,o=t.z,h=t.w,c=2*(a*i-o*s),l=2*(o*e-r*i),u=2*(r*s-a*e);return this.x=e+h*c+a*u-o*l,this.y=s+h*l+o*c-r*u,this.z=i+h*u+r*l-a*c,this}transformDirection(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*i,this.y=r[1]*e+r[5]*s+r[9]*i,this.z=r[2]*e+r[6]*s+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this.z=P.clamp(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this.z=P.clamp(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,i=t.y,r=t.z,a=e.x,o=e.y,h=e.z;return this.x=i*h-r*o,this.y=r*a-s*h,this.z=s*o-i*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Fi.copy(this).projectOnVector(t),this.sub(Fi)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Fi.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(P.clamp(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),s=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Yi{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,i=1){this.x=t,this.y=e,this.z=s,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,s=0,i=1){return this.x=t,this.y=e,this.z=s,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new Yi(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=this.w,a=t.value;return this.x=a[0]*e+a[4]*s+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*s+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*s+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*s+a[11]*i+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,s,i,r;const h=t.value,c=h[0],l=h[4],u=h[8],d=h[1],f=h[5],p=h[9],x=h[2],b=h[6],w=h[10];if(Math.abs(l-d)<.01&&Math.abs(u-x)<.01&&Math.abs(p-b)<.01){if(Math.abs(l+d)<.1&&Math.abs(u+x)<.1&&Math.abs(p+b)<.1&&Math.abs(c+f+w-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const v=(c+1)/2,_=(f+1)/2,M=(w+1)/2,E=(l+d)/4,D=(u+x)/4,B=(p+b)/4;return v>_&&v>M?v<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(v),i=E/s,r=D/s):_>M?_<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(_),s=E/i,r=B/i):M<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(M),s=D/r,i=B/r),this.set(s,i,r,e),this}let g=Math.sqrt((b-p)*(b-p)+(u-x)*(u-x)+(d-l)*(d-l));return Math.abs(g)<.001&&(g=1),this.x=(b-p)/g,this.y=(u-x)/g,this.z=(d-l)/g,this.w=Math.acos((c+f+w-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=P.clamp(this.x,t.x,e.x),this.y=P.clamp(this.y,t.y,e.y),this.z=P.clamp(this.z,t.z,e.z),this.w=P.clamp(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=P.clamp(this.x,t,e),this.y=P.clamp(this.y,t,e),this.z=P.clamp(this.z,t,e),this.w=P.clamp(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(P.clamp(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const qo=new bs,Fi=new Rt,jo=new Bi,vs=2e3,Xi=2001,Ho=[1,0,0,1],Wo=[1,0,0,1,0,0],Jo=[1,0,0,0,1,0,0,0,1],Zo=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Ui{value;constructor(t=Ho){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,s=0,i=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=i,this}identity(){return this.value=Array.from(Ho),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Ui(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[2],h=s[1],c=s[3],l=i[0],u=i[2],d=i[1],f=i[3];return r[0]=a*l+o*d,r[2]=a*u+o*f,r[1]=h*l+c*d,r[3]=h*u+c*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class We{value;constructor(t=Jo){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,s=0,i=0,r=1,a=0,o=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=a,l[8]=c,this}identity(){return this.value=Array.from(Jo),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new We(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[3],h=s[6],c=s[1],l=s[4],u=s[7],d=s[2],f=s[5],p=s[8],x=i[0],b=i[3],w=i[6],g=i[1],v=i[4],_=i[7],M=i[2],E=i[5],D=i[8];return r[0]=a*x+o*g+h*M,r[3]=a*b+o*v+h*E,r[6]=a*w+o*_+h*D,r[1]=c*x+l*g+u*M,r[4]=c*b+l*v+u*E,r[7]=c*w+l*_+u*D,r[2]=d*x+f*g+p*M,r[5]=d*b+f*v+p*E,r[8]=d*w+f*_+p*D,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-s*r*l+s*o*h+i*r*c-i*a*h}invert(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=l*a-o*c,d=o*h-l*r,f=c*r-a*h,p=e*u+s*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/p;return t[0]=u*x,t[1]=(i*c-l*s)*x,t[2]=(o*s-i*a)*x,t[3]=d*x,t[4]=(l*e-i*h)*x,t[5]=(i*r-o*e)*x,t[6]=f*x,t[7]=(s*h-c*e)*x,t[8]=(a*e-s*r)*x,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,i,r,a,o){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(h*a+c*o)+a+t,-i*c,i*h,-i*(-c*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Vi.makeScale(t,e)),this}rotate(t){return this.premultiply(Vi.makeRotation(-t)),this}translate(t,e){return this.premultiply(Vi.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class Ct{value;is3dSpecial=!1;constructor(t=Zo){this.value=Array.from(t)}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}set(t=1,e=0,s=0,i=0,r=0,a=1,o=0,h=0,c=0,l=0,u=1,d=0,f=0,p=0,x=0,b=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=s,w[12]=i,w[1]=r,w[5]=a,w[9]=o,w[13]=h,w[2]=c,w[6]=l,w[10]=u,w[14]=d,w[3]=f,w[7]=p,w[11]=x,w[15]=b,this}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(Zo),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new Ct(this.value)}static fromString(t){const e=new Ct,s=P.regMatchAll("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(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 xt(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=>P.maxDotNumber(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=_t(P.clamp(Math.asin(-this.m13),-1,1));let r=_t(Math.atan2(this.m23,this.m33));Math.cos(J(i))===0&&(r=_t(Math.atan2(-this.m31,this.m22)));let a=_t(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:_t(this.m14),skewY:_t(this.m24),skewZ:_t(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,i=1/Je.setFromMatrix4Column(t,0).length(),r=1/Je.setFromMatrix4Column(t,1).length(),a=1/Je.setFromMatrix4Column(t,2).length();return e[0]=s[0]*i,e[1]=s[1]*i,e[2]=s[2]*i,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*a,e[9]=s[9]*a,e[10]=s[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,i=t.y,r=t.z,a=Math.cos(s),o=Math.sin(s),h=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const d=a*l,f=a*u,p=o*l,x=o*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=f+p*c,e[5]=d-x*c,e[9]=-o*h,e[2]=x-d*c,e[6]=p+f*c,e[10]=a*h}else if(t.order==="YXZ"){const d=h*l,f=h*u,p=c*l,x=c*u;e[0]=d+x*o,e[4]=p*o-f,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=f*o-p,e[6]=x+d*o,e[10]=a*h}else if(t.order==="ZXY"){const d=h*l,f=h*u,p=c*l,x=c*u;e[0]=d-x*o,e[4]=-a*u,e[8]=p+f*o,e[1]=f+p*o,e[5]=a*l,e[9]=x-d*o,e[2]=-a*c,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const d=a*l,f=a*u,p=o*l,x=o*u;e[0]=h*l,e[4]=p*c-f,e[8]=d*c+x,e[1]=h*u,e[5]=x*c+d,e[9]=f*c-p,e[2]=-c,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const d=a*h,f=a*c,p=o*h,x=o*c;e[0]=h*l,e[4]=x-d*u,e[8]=p*u+f,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=f*u+p,e[10]=d-x*u}else if(t.order==="XZY"){const d=a*h,f=a*c,p=o*h,x=o*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=d*u+x,e[5]=a*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=o*l,e[10]=x*u+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(tm,t,em)}lookAt(t,e,s){const i=this.value;return Lt.subVectors(t,e),Lt.lengthSq()===0&&(Lt.z=1),Lt.normalize(),ye.crossVectors(s,Lt),ye.lengthSq()===0&&(Math.abs(s.z)===1?Lt.x+=1e-4:Lt.z+=1e-4,Lt.normalize(),ye.crossVectors(s,Lt)),ye.normalize(),dn.crossVectors(Lt,ye),i[0]=ye.x,i[4]=dn.x,i[8]=Lt.x,i[1]=ye.y,i[5]=dn.y,i[9]=Lt.y,i[2]=ye.z,i[6]=dn.z,i[10]=Lt.z,this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,a=s[0],o=s[4],h=s[8],c=s[12],l=s[1],u=s[5],d=s[9],f=s[13],p=s[2],x=s[6],b=s[10],w=s[14],g=s[3],v=s[7],_=s[11],M=s[15],E=i[0],D=i[4],B=i[8],Y=i[12],V=i[1],$=i[5],W=i[9],Q=i[13],Z=i[2],Yt=i[6],ft=i[10],Et=i[14],It=i[3],O=i[7],L=i[11],X=i[15];return r[0]=a*E+o*V+h*Z+c*It,r[4]=a*D+o*$+h*Yt+c*O,r[8]=a*B+o*W+h*ft+c*L,r[12]=a*Y+o*Q+h*Et+c*X,r[1]=l*E+u*V+d*Z+f*It,r[5]=l*D+u*$+d*Yt+f*O,r[9]=l*B+u*W+d*ft+f*L,r[13]=l*Y+u*Q+d*Et+f*X,r[2]=p*E+x*V+b*Z+w*It,r[6]=p*D+x*$+b*Yt+w*O,r[10]=p*B+x*W+b*ft+w*L,r[14]=p*Y+x*Q+b*Et+w*X,r[3]=g*E+v*V+_*Z+M*It,r[7]=g*D+v*$+_*Yt+M*O,r[11]=g*B+v*W+_*ft+M*L,r[15]=g*Y+v*Q+_*Et+M*X,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],s=t[4],i=t[8],r=t[12],a=t[1],o=t[5],h=t[9],c=t[13],l=t[2],u=t[6],d=t[10],f=t[14],p=t[3],x=t[7],b=t[11],w=t[15];return p*(+r*h*u-i*c*u-r*o*d+s*c*d+i*o*f-s*h*f)+x*(+e*h*f-e*c*d+r*a*d-i*a*f+i*c*l-r*h*l)+b*(+e*c*u-e*o*f-r*a*u+s*a*f+r*o*l-s*c*l)+w*(-i*o*l-e*h*u+e*o*d+i*a*u-s*a*d+s*h*l)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const i=this.value;return t instanceof Rt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&(i[12]=t,i[13]=e,i[14]=s),this}invert(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],a=t[4],o=t[5],h=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],x=t[13],b=t[14],w=t[15],g=u*b*c-x*d*c+x*h*f-o*b*f-u*h*w+o*d*w,v=p*d*c-l*b*c-p*h*f+a*b*f+l*h*w-a*d*w,_=l*x*c-p*u*c+p*o*f-a*x*f-l*o*w+a*u*w,M=p*u*h-l*x*h-p*o*d+a*x*d+l*o*b-a*u*b,E=e*g+s*v+i*_+r*M;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/E;return t[0]=g*D,t[1]=(x*d*r-u*b*r-x*i*f+s*b*f+u*i*w-s*d*w)*D,t[2]=(o*b*r-x*h*r+x*i*c-s*b*c-o*i*w+s*h*w)*D,t[3]=(u*h*r-o*d*r-u*i*c+s*d*c+o*i*f-s*h*f)*D,t[4]=v*D,t[5]=(l*b*r-p*d*r+p*i*f-e*b*f-l*i*w+e*d*w)*D,t[6]=(p*h*r-a*b*r-p*i*c+e*b*c+a*i*w-e*h*w)*D,t[7]=(a*d*r-l*h*r+l*i*c-e*d*c-a*i*f+e*h*f)*D,t[8]=_*D,t[9]=(p*u*r-l*x*r-p*s*f+e*x*f+l*s*w-e*u*w)*D,t[10]=(a*x*r-p*o*r+p*s*c-e*x*c-a*s*w+e*o*w)*D,t[11]=(l*o*r-a*u*r-l*s*c+e*u*c+a*s*f-e*o*f)*D,t[12]=M*D,t[13]=(l*x*i-p*u*i+p*s*d-e*x*d-l*s*b+e*u*b)*D,t[14]=(p*o*i-a*x*i-p*s*h+e*x*h+a*s*b-e*o*b)*D,t[15]=(a*u*i-l*o*i+l*s*h-e*u*h-a*s*d+e*o*d)*D,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,i))}makeTranslation(t,e,s){return t instanceof Rt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),i=Math.sin(e),r=1-s,a=t.x,o=t.y,h=t.z,c=r*a,l=r*o;return this.set(c*a+s,c*o-i*h,c*h+i*o,0,c*o+i*h,l*o+s,l*h-i*a,0,c*h-i*o,l*h+i*a,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,i,r,a){return this.set(1,s,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,s,i,r,a,o=vs){const h=this.value,c=2*r/(e-t),l=2*r/(s-i),u=(e+t)/(e-t),d=(s+i)/(s-i);let f,p;if(o===vs)f=-(a+r)/(a-r),p=-2*a*r/(a-r);else if(o===Xi)f=-a/(a-r),p=-a*r/(a-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+o);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=d,h[13]=0,h[2]=0,h[6]=0,h[10]=f,h[14]=p,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,s,i,r,a,o=vs){const h=this.value,c=1/(e-t),l=1/(s-i),u=1/(a-r),d=(e+t)*c,f=(s+i)*l;let p,x;if(o===vs)p=(a+r)*u,x=-2*u;else if(o===Xi)p=r*u,x=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-d,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=x,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,s){const i=this.value,r=e.x,a=e.y,o=e.z,h=e.w,c=r+r,l=a+a,u=o+o,d=r*c,f=r*l,p=r*u,x=a*l,b=a*u,w=o*u,g=h*c,v=h*l,_=h*u,M=s.x,E=s.y,D=s.z;return i[0]=(1-(x+w))*M,i[1]=(f+_)*M,i[2]=(p-v)*M,i[3]=0,i[4]=(f-_)*E,i[5]=(1-(d+w))*E,i[6]=(b+g)*E,i[7]=0,i[8]=(p+v)*D,i[9]=(b-g)*D,i[10]=(1-(d+x))*D,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,s){const i=this.value;let r=Je.set(i[0],i[1],i[2]).length();const a=Je.set(i[4],i[5],i[6]).length(),o=Je.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Gt.copy(this);const c=1/r,l=1/a,u=1/o;return Gt.value[0]*=c,Gt.value[1]*=c,Gt.value[2]*=c,Gt.value[4]*=l,Gt.value[5]*=l,Gt.value[6]*=l,Gt.value[8]*=u,Gt.value[9]*=u,Gt.value[10]*=u,e.setFromRotationMatrix4(Gt),s.x=r,s.y=a,s.z=o,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,s=0){return this.multiply(new Ct([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 Ct([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,i=t.y,r=t.z;return e[0]*=s,e[4]*=i,e[8]*=r,e[1]*=s,e[5]*=i,e[9]*=r,e[2]*=s,e[6]*=i,e[10]*=r,e[3]*=s,e[7]*=i,e[11]*=r,this}rotateX(t){const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=J(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new Ct([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 Ct([1,0,0,J(t),0,1,0,J(e),0,0,1,J(s),0,0,0,1]))}perspective(t){return this.multiply(new Ct([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 u=-i/l;return e+=u*(a-e),s+=u*(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 fn({x:t,y:e}),a=new fn({x:t+s,y:e}),o=new fn({x:t+s,y:e+i}),h=new fn({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),u=Math.max(r.x,a.x,o.x,h.x)-c,d=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:u,height:d}}}class xt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Wo){this.value=Array.from(t),this.matrix4=this.toMatrix4()}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}static fromString(t){const e=new xt,s=P.regMatchAll("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){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 Ct(e)}identity(){return this.value=Array.from(Wo),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),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}multiplyScalar(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.multiplyScalar(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 xt(this.value)}multiply(t){const e=this.clone(),s=t instanceof xt?t:new xt(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}invert(){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,u=-c*i+a*o,d=h*i-r*o;let f=t*l+e*u+s*d;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+s*h)*f,this.m13=(a*e-s*r)*f,this.m21=u*f,this.m22=(c*t-s*o)*f,this.m23=(-a*t+s*i)*f,this.m31=d*f,this.m32=(-h*t+e*o)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new xt;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=_t(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:_t(Math.atan2(-this.m21,this.m22)),skewY:_t(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],u=t.value[3],d=t.value[4],f=t.value[5],p=h*u,x=c*l,b=(l*s-e*u)/(x-p),w=(h*s-e*c)/(p-x),g=(l*r-i*u)/(x-p),v=(h*r-i*c)/(p-x),_=(l*(o-f)+u*(d-a))/(x-p),M=(h*(o-f)+c*(d-a))/(p-x),E=[b,w,g,v,_,M];return new xt(E)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>P.maxDotNumber(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),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.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const i=J(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.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:a}=this.matrix4.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.toMatrix4(),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.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:a}=this.matrix4.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(J(e)),Math.sin(J(e)),-Math.sin(J(t)),Math.cos(J(t)),0,0]),this.toMatrix4(),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.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const tm=new Rt(0,0,0),em=new Rt(1,1,1),ye=new Rt,dn=new Rt,Lt=new Rt,Je=new Rt,Vi=new We,Gt=new Ct;function $i(n){const t=new xt;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.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new Ct(r)),t.matrix4.toMatrix(t);break}return""}),t}function qt(n,t,e){const s=new xt;return s.rotate(_t(n)),s.transformPoint({x:t,y:e})}function Gi(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=J(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 sm(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,Gi(t)),s}function ke(n,t,e){const s=Di(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[P.toCamel(t)]||s.props.style[P.toKebab(t)]||"":s.props.style}function qi(n,t,e){Ri(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})},!0)}function ji(n){const t={};if(getComputedStyle){const e=getComputedStyle(n);for(let s=0,i=e.length;s<i;s++)t[e[s]]=e.getPropertyValue(t[s])}else{const e=n.currentStyle;for(const s in e)t[s]=e[s]}return n.style.cssText&&n.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[s,i]=e.split(":");s&&i&&(t[s.trim()]=i.trim())}),t}function nm(n,t,e){let s=n.style[t]||"";if(!s&&getComputedStyle){t=P.toKebab(t);const i=getComputedStyle(n,e),r=i.getPropertyPriority(t);s=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=n.currentStyle[t]||""),s}function mn(n,t,e){typeof t=="string"&&e?n.style.setProperty(P.toKebab(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{mn(n,s,t[s])})}function Hi(n,t){typeof t=="string"?n.style.removeProperty(P.toKebab(t)):Object.keys(t).forEach(e=>{Hi(n,e)})}function Ko(n,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=n,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(s)}}}function im(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:ke(n,"transform")||""});const s=$i(e.transform),i={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=ke(n,r)),Object.assign(i,{[r]:`${a}`});break}}return Object.assign(i,{transform:s.toString()}),i}function De(n,t,e){if(t===void 0&&e===void 0)return Wi(n);if(typeof t=="string"&&e===void 0)return Qo(n,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=""+e),Ri(n,i=>{Object.entries(s).forEach(([r,a])=>{i.props[r]=""+a})})}const rm=["-o-","-ms-","-moz-","-webkit-",""];function Wi(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=ji(n):t[r.nodeName]=r.nodeValue)}return t}function Qo(n,t){return t==="style"?ji(n):n.getAttribute(P.toKebab(t))}function Ze(n,t,e){return n.setAttribute(P.toKebab(t),""+e)}function am(n,t){t.split(/[,\s]+/i).forEach(e=>{const s=P.toKebab(e.trim());s!=""&&n.removeAttribute(s)})}function th(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}function om(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}}function eh(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const hm=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 u=e;const d=String.fromCharCode;do{const p=l*(u-1);let x="";for(let b=0;b<t;b++){const w=b<<2;x+=d(h[p+w+2])+d(h[p+w+1])+d(h[p+w])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let x="";if(typeof p=="string")x=p;else for(let b=0;b<p.length;b++)x+=String.fromCharCode(p[b]);return btoa(x)}return f(r.concat(a))+f(c)};function cm(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")}const lm=(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)};function um(n,t){return createImageBitmap(n,t)}function fm(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=Ji(t),a=Ji(e),o=Ji(s);return"rgb("+r+","+a+","+o+")"}function Ji(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 dm=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)},mm=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)},pm=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)},gm=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)},ym=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)},wm=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)},xm=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)},bm=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)},vm=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)},_m=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)},Sm=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)},Tm=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)},Em=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)},Pm=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)},Mm=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)},Cm=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)},Am=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)},Im=n=>sh(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),km=n=>sh(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Dm=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)},Rm=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=nh([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)};function Lm(n,t,e,s,i,r=!1,a){const{data:o,width:h,height:c}=n;let l=i,u=s,d=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),d<1?d=1:d>h&&(d=h),f<1?f=1:f>c&&(f=c),l+d>h&&(d=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let w=0;w<h;w++){const g=(b*h+w)*4;w>=l&&w<=l+d&&b>=u&&b<=u+f?(p[g]=o[g],p[g+1]=o[g+1],p[g+2]=o[g+2],p[g+3]=o[g+3]):(p[g]=255,p[g+1]=255,p[g+2]=255,p[g+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(d*f*4);for(let b=u;b<=u+f;b++)for(let w=l;w<=l+d;w++){const g=((b-u)*d+w-l)*4,v=(b*h+w)*4;p[g]=o[v],p[g+1]=o[v+1],p[g+2]=o[v+2],p[g+3]=o[v+3]}return new ImageData(p,d,f)}}function Om(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 u=0;u<r;u++){const d=(l*r+u)*4;let f=-1;u<o?l<o?f=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(f=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(l-(a-o),2))):u>r-o-1&&(l<o?f=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(f=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(f)>o?(h[d]=255,h[d+1]=255,h[d+2]=255,h[d+3]=s||e.toUpperCase()==="PNG"?0:255):(h[d]=i[d],h[d+1]=i[d+1],h[d+2]=i[d+2],h[d+3]=s||e.toUpperCase()==="PNG"?i[d+3]:255)}return new ImageData(h,r,a)}function zm(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)}function Nm(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)}function Bm(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 u=s[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),a[l+3]=u}return new ImageData(a,i,r)}function Ym(n,t,e,s){const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,u=s;e+c>a&&(l=a-c),s+h>r&&(u=r-h);const d=new Uint8ClampedArray(i.length);for(let p=0;p<a;p++)for(let x=0;x<r;x++){const b=(p*r+x)*4;if(x<u||x>u+h||p<=l||p>=l+c)d[b]=i[b],d[b+1]=i[b+1],d[b+2]=i[b+2],d[b+3]=i[b+3];else{const w=(p*r+x-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,g=[o[w],o[w+1],o[w+2],o[w+3]],v=[i[b],i[b+1],i[b+2],i[b+3]],_=nh(g,v);d[b]=_[0],d[b+1]=_[1],d[b+2]=_[2],d[b+3]=_[3]}}return new ImageData(d,r,a)}function Fm(n,t,e,s,i,r=10){const{data:a,width:o,height:h}=n;let c=i,l=s,u=t,d=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),u<1?u=1:u>o&&(u=o),d<1?d=1:d>h&&(d=h),c+u>o&&(u=o-c),l+d>h&&(d=h-l);const f=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const w=(x*o+b)*4;if(b>=c&&b<=c+u&&x>=l&&x<=l+d){const g=Math.floor((b-c)/r),v=Math.floor((x-l)/r);let _=Math.floor(r*(g+1)-r/2+c),M=Math.floor(r*(v+1)-r/2+l);_>o-1&&(_=o-1),M>h-1&&(M=h-1);const E=(M*o+_)*4;f[w]=a[E],f[w+1]=a[E+1],f[w+2]=a[E+2],f[w+3]=a[E+3]}else f[w]=a[w],f[w+1]=a[w+1],f[w+2]=a[w+2],f[w+3]=a[w+3]}return new ImageData(f,o,h)}function Xm(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 u=0;u<r;u++)for(let d=0;d<i;d++){const f=(u*i+d)*4,p=a[f],x=a[f+1],b=a[f+2],w=a[f+3];p===h.r&&x===h.g&&b===h.b&&w===h.a&&c.a!==0?(o[f]=c.r,o[f+1]=c.g,o[f+2]=c.b,o[f+3]=c.a):(o[f]=s[f],o[f+1]=s[f+1],o[f+2]=s[f+2],o[f+3]=s[f+3])}return new ImageData(o,i,r)}return n}function sh(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 u=c+l;h===0||h===s-1||o===0||o===i-1?r[u]=e[u]:r[u]=t[0]*e[u-s*4-4]+t[1]*e[u-s*4]+t[2]*e[u-s*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+s*4-4]+t[7]*e[u+s*4]+t[8]*e[u+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)}function nh(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]}const Zi=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}}},ih=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}}},rh=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(u,d){if(u>>>d)throw new Error("length over");for(;c+d>=8;)h.writeByte(255&(u<<c|l)),d-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+d},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const u=a();for(let b=0;b<h;b++)u.add(String.fromCharCode(b));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const d=Zi(),f=i(d);f.write(h,l);let p=0,x=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const b=String.fromCharCode(s[p]);p+=1,u.contains(x+b)?x=x+b:(f.write(u.indexOf(x),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(x+b)),x=b)}return f.write(u.indexOf(x),l),f.write(c,l),f.flush(),d.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(P.radixStringToNumber("0x"+t[1]+t[2])),o.writeByte(P.radixStringToNumber("0x"+t[3]+t[4])),o.writeByte(P.radixStringToNumber("0x"+t[5]+t[6])),o.writeByte(P.radixStringToNumber("0x"+e[1]+e[2])),o.writeByte(P.radixStringToNumber("0x"+e[3]+e[4])),o.writeByte(P.radixStringToNumber("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(";")}}},ah=function(n,t,e,s){const i=rh(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=Zi();i.write(r);const a=ih(),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},Ot={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},_s={M:0,L:1,H:2,Q:3},we={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ut={glog:function(n){if(n<1)throw new Error("glog("+n+")");return ut.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return ut.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)ut.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)ut.EXP_TABLE[n]=ut.EXP_TABLE[n-4]^ut.EXP_TABLE[n-5]^ut.EXP_TABLE[n-6]^ut.EXP_TABLE[n-8];for(let n=0;n<255;n++)ut.LOG_TABLE[ut.EXP_TABLE[n]]=n;const K={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(;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(n<<10|t)^K.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return K.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case we.PATTERN000:return(t+e)%2==0;case we.PATTERN001:return t%2==0;case we.PATTERN010:return e%3==0;case we.PATTERN011:return(t+e)%3==0;case we.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case we.PATTERN101:return t*e%2+t*e%3==0;case we.PATTERN110:return(t*e%2+t*e%3)%2==0;case we.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Ke([1],0);for(let e=0;e<n;e++)t=t.multiply(new Ke([1,ut.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Ot.MODE_NUMBER:return 10;case Ot.MODE_ALPHA_NUM:return 9;case Ot.MODE_8BIT_BYTE:return 8;case Ot.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Ot.MODE_NUMBER:return 12;case Ot.MODE_ALPHA_NUM:return 11;case Ot.MODE_8BIT_BYTE:return 16;case Ot.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Ot.MODE_NUMBER:return 14;case Ot.MODE_ALPHA_NUM:return 13;case Ot.MODE_8BIT_BYTE:return 16;case Ot.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 Ke{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]^=ut.gexp(ut.glog(this.get(s))+ut.glog(t.get(i)));return new Ke(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=ut.glog(this.get(0))-ut.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]^=ut.gexp(ut.glog(t.get(i))+e);return new Ke(s,0).mod(t)}}class ee{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=ee.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 ee(h,c))}return r}static getRsBlockTable(t,e){switch(e){case _s.L:return ee.RS_BLOCK_TABLE[(t-1)*4+0];case _s.M:return ee.RS_BLOCK_TABLE[(t-1)*4+1];case _s.Q:return ee.RS_BLOCK_TABLE[(t-1)*4+2];case _s.H:return ee.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class oh{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 Um{mode;data;constructor(t){this.mode=Ot.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 xe{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=_s[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Um(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=ee.getRSBlocks(t,this.errorCorrectLevel),s=new oh;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(),K.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=xe.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=K.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=K.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=K.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=K.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),K.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=ee.getRSBlocks(t,e),r=new oh;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),K.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(xe.PAD0,8),r.getLengthInBits()>=a*8));)r.put(xe.PAD1,8);return xe.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 u=0;u<e.length;u++){const d=e[u].dataCount,f=e[u].totalCount-d;i=Math.max(i,d),r=Math.max(r,f),a[u]=new Array(d);for(let w=0;w<a[u].length;w++)a[u][w]=255&t.buffer[w+s];s+=d;const p=K.getErrorCorrectPolynomial(f),b=new Ke(a[u],p.getLength()-1).mod(p);o[u]=new Array(p.getLength()-1);for(let w=0;w<o[u].length;w++){const g=w+b.getLength()-o[u].length;o[u][w]=g>=0?b.get(g):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<i;u++)for(let d=0;d<e.length;d++)u<a[d].length&&(c[l++]=a[d][u]);for(let u=0;u<r;u++)for(let d=0;d<e.length;d++)u<o[d].length&&(c[l++]=o[d][u]);return c}}const hh=Math.ceil,Ss=Math.floor,ch=Math.round;function Vm(n,t){const e=P.utf16to8(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 xe(r,s);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-a*2)/l,d=a,f=i-a;return ah(i,o,h,function(p,x){if(d<=p&&p<f&&d<=x&&x<f){const b=Ss((p-d)/u),w=Ss((x-d)/u);return c.isDark(w,b)?0:1}else return 1})}function $m(n,t){const e=t.x||0,s=t.y||0,i=P.utf16to8(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ss(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",d=new xe(c,a);d.addData(i),d.make();const f=d.getModuleCount(),p=(o-h*2)/f;r.fillStyle=u,r.fillRect(e,s,o,o);for(let x=0;x<f;x++)for(let b=0;b<f;b++){const w=hh((b+1)*p)-Ss(b*p),g=hh((x+1)*p)-Ss(x*p);r.fillStyle=d.isDark(x,b)?l:u,r.fillRect(e+ch(b*p)+h,s+ch(x*p)+h,w,g)}}const pn=new bs,ot=new Rt;function Ts(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function At(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class se{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=s,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=P.cloneTypedArray(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[s+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)pn.fromBufferAttribute(this,e),pn.applyMatrix3(t),this.setXY(e,pn.x,pn.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyMatrix3(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyMatrix4(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.applyNormalMatrix(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)ot.fromBufferAttribute(this,e),ot.transformDirection(t),this.setXYZ(e,ot.x,ot.y,ot.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Ts(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=At(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ts(e,this.array)),e}setX(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ts(e,this.array)),e}setY(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ts(e,this.array)),e}setZ(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ts(e,this.array)),e}setW(t,e){return this.normalized&&(e=At(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,i){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array),i=At(i,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this}setXYZW(t,e,s,i,r){return t*=this.itemSize,this.normalized&&(e=At(e,this.array),s=At(s,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return P.newConstructor(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class Gm extends se{constructor(t,e,s=!1){super(new Int8Array(t),e,s)}}class qm extends se{constructor(t,e,s=!1){super(new Uint8Array(t),e,s)}}class jm extends se{constructor(t,e,s=!1){super(new Uint8ClampedArray(t),e,s)}}class Hm extends se{constructor(t,e,s=!1){super(new Int16Array(t),e,s)}}class Wm extends se{constructor(t,e,s=!1){super(new Uint16Array(t),e,s)}}class Jm extends se{constructor(t,e,s=!1){super(new Int32Array(t),e,s)}}class Zm extends se{constructor(t,e,s=!1){super(new Uint32Array(t),e,s)}}class Km extends se{constructor(t,e,s=!1){super(new Float32Array(t),e,s)}}const lh={map:new Map,transform:function(n){if(Io)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 Qm(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function tp(n,t,e){const s=n.createPattern(lh.transform(t),"no-repeat");if(s){const i=Gi(e);s.setTransform(i),n.fillStyle=s}}function uh(n){return window.URL.createObjectURL(n)}function ep(n){return window.URL.revokeObjectURL(n)}function fh(n){let t=!1,e;function s(){document.readyState==="loading"||t||(n(),e?.(),t=!0)}try{e=j(document,"DOMContentLoaded",s)}catch{e=j(window,"load",s)}return s(),()=>{t||e()}}function dh(n){return j(window,"beforeunload",t=>{n(t)})}async function sp(n,t=6e4){return new Promise((e,s)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=a=>{clearTimeout(r),e(a),i.onerror=i.onload=null},i.onerror=a=>{clearTimeout(r),s(a)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}function gn(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}async function np(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=o=>{clearTimeout(a),s(o),r.onerror=r.onload=null},r.onerror=o=>{clearTimeout(a),i(o)},r.setAttribute("href",n);const a=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function ip(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}const mh=new P.CacheMap;async function ph(n,t=6e4){return new Promise((e,s)=>{const i=typeof n=="string"?n:uh(n),r=mh.get(i);if(r)return e(r);const a=document.createElement("img");a.onload=()=>{clearTimeout(o);const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:eh(a)};mh.set(i,l),e(l),a.onerror=a.onload=null},a.onerror=h=>{clearTimeout(o),s(h)},a.src=i;const o=setTimeout(()=>{s("Timeout!")},t)})}async function gh(n=P.ReadInBrowserEnum.text,t=["*"]){const s=(await ni(t))[0],i=await os(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function rp(n=["image/*"]){const e=(await ni(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await os(e,P.ReadInBrowserEnum.arraybuffer),i=P.toBlob(s),r=await ph(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function op(){return window.getSelection()?.toString()||""}function hp(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}function cp(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}async function lp(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function up(n,t){window.scrollTo(n,t)}function fp(){let n=P.noop,t=P.noop;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=dh(()=>{window.history.scrollRestoration="auto"}),t=fh(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function dp(n){return/(html|body)/i.test(n.tagName)||n===document.documentElement}const mp=n=>n===document.activeElement&&(n.type||n.href),Ki=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function pp(n){return n*Ki()}function gp(n){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):Ki()}const yp=n=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},wp=n=>n.parentElement,Qi=(n,t=[])=>!n||n.parentElement===null&&n.parentNode===null?t:Qi(n.parentElement,t.concat([n]));function xp(n){const t=Qi(n);for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(ke(t[e],"overflow")+ke(t[e],"overflow-y")+ke(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const bp=(n,t)=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),vp=n=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),_p=n=>n.nextElementSibling,Sp=n=>n.previousElementSibling,Tp=(n,t)=>n.closest(t),Ep=n=>n.shadowRoot,Es=n=>n.tagName==="INPUT"||n instanceof HTMLInputElement,tr=n=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,Pp=n=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,er=n=>Es(n)&&n.getAttribute("type")==="checkbox",sr=n=>Es(n)&&n.getAttribute("type")==="radio",Mp=n=>Es(n)&&n.getAttribute("type")==="text",Cp=n=>Es(n)&&n.getAttribute("type")==="number";function Ap(n,t){if(tr(n)){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}}function Ip(n,t){if(sr(n)){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}}function kp(n,t){er(n)&&(n.checked=t)}const Ps=(n,t,e="append")=>{typeof t=="string"?n[e](vh(t)):n[e](t)},yh=function(n,t){if(typeof t=="string"){n.innerHTML=t;const e=Sh(n);e!=n&&(n=e)}else Ps(t,"replaceWith")},wh=function(n){yh(n,"")},Dp=(n,t)=>{n.textContent=t},Rp=n=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},Lp=n=>n.remove();function Op(n,t){ke(n,"display")=="none"&&t===void 0||t===!0?xh(n):bh(n)}function xh(n){qi(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function bh(n){qi(n,"display","none")}function nr(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(e){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&&De(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function zp(n,t){nr(n,t,"add")}function Np(n,t){nr(n,t,"remove")}function Bp(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function vh(n,t=!1){const e=document.createElement("template");return e.innerHTML=n,t&&e.content.childNodes.forEach(s=>{const i=Sh(s);i!=s&&e.content.replaceChild(i,s)}),e.content}function _h(n){return document.createElement.call(document,n)}function Yp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Fp(n){return document.createTextNode.call(document,n)}function Sh(n){return n.tagName=="SCRIPT"&&(n=Th(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Th(t),t)}),n}function Th(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function Xp(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Up(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}function ir(){return{x:0,y:0,isDown:!1}}function Re(){const n=ir(),t=ir();return{start:n,current:t,setStart:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,s)},setCurrent:(e,s)=>{t.x=e.x,t.y=e.y,t.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1}}}function yn(n=document.documentElement,t=!1){return U(n,"mousemove",t)}function Eh(n=document.documentElement,t=!1){return U(n,"mousedown",t)}function Ph(n=document.documentElement,t=!1){return U(n,"mouseup",t)}function Vp(n=document.documentElement,t=!1){return U(n,"mouseover",t)}function $p(n=document.documentElement,t=!1){return U(n,"mouseout",t)}function Gp(n=document.documentElement,t=!1){return U(n,"mouseenter",t)}function qp(n=document.documentElement,t=!1){return U(n,"mouseleave",t)}function jp(n=document.documentElement,t=!1){return U(n,"click",t)}function Hp(n=document.documentElement,t=!1){return U(n,"dblclick",t)}function Wp(n=document.documentElement,t=!1){return U(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Jp(n=document.documentElement,t=!1){return U(n,"contextmenu",t)}function Mh(n=document.documentElement,t=!1){return U(n,"touchmove",t)}function Ch(n=document.documentElement,t=!1){return U(n,"touchstart",t)}function Ah(n=document.documentElement,t=!1){return U(n,"touchend",t)}function Ih(n=document.documentElement,t=!1){return U(n,"touchcancel",t)}function rr(n=document.documentElement,t=!1){return U(n,"pointermove",t)}function ar(n=document.documentElement,t=!1){return U(n,"pointerdown",t)}function or(n=document.documentElement,t=!1){return U(n,"pointerup",t)}function hr(n=document.documentElement,t=!1){return U(n,"pointercancel",t)}function Zp(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Kp(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function Qp(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function tg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function eg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function sg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function ng(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function ig(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function rg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function ag(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function og(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function hg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function cg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("press",e)},e=>{t.off("press",e)})}function lg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function ug(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function fg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function dg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function mg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function pg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function gg(n=document.documentElement){const t=new tt(n);return st(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function yg(n=document.documentElement){const t=new tt(document.documentElement);return st(e=>{const s=i=>{!i.target||n==i.target||n.contains(i.target)||e(i)};return t.on("tap",s),s},(e,s)=>{t.off("tap",s)})}function wg(n=document.documentElement,t=!1){return U(n,"transitionstart",t)}function xg(n=document.documentElement,t=!1){return U(n,"transitionend",t)}function bg(n=document.documentElement,t=!1){return U(n,"animationstart",t)}function vg(n=document.documentElement,t=!1){return U(n,"animationend",t)}function kh(n=document.documentElement,t=!1){return U(n,"drag",t)}function Dh(n=document.documentElement,t=!1){return U(n,"dragstart",t)}function Rh(n=document.documentElement,t=!1){return U(n,"dragend",t)}function Lh(n=document.documentElement,t=!1){return U(n,"drop",t)}function Oh(n=document.documentElement,t=!1){return U(n,"dragenter",t)}function zh(n=document.documentElement,t=!1){return U(n,"dragleave",t)}function Nh(n=document.documentElement,t=!1){return U(n,"dragover",t)}function Bh(n=document.documentElement,t=!1){return U(n,"keydown",t)}function Yh(n=document.documentElement,t=!1){return U(n,"keyup",t)}function _g(n=document.documentElement,t=!1){return U(n,"keypress",t)}function Sg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return yn(n).pipe(it(s=>(e.setCurrent(ct(s,n)),e)))}function Tg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return yn(n).pipe(Uf(Eh(n).pipe(Ce(s=>{e.setStart(ct(s,n),!0),t?.start?.(s,e)})),()=>Ph(n).pipe(Ce(s=>{e.setCurrent(ct(s,n),!1),t?.end?.(s,e)}))),Yf(),it(s=>(e.setCurrent(ct(s,n),!0),e)))}function Eg(n=document.documentElement,t){const e=t?.useMousePoint||Re();return Ch(n).pipe(Ce(s=>{const i=s.changedTouches[0];e.setStart(ct(i,n),!0),t?.start?.(i,e)}),sn(()=>Mh(n).pipe(xi(wi(Ah(n),Ih(n)).pipe(Ce(s=>{const i=s.changedTouches[0];e.setCurrent(ct(i,n),!1),t?.end?.(i,e)}))))),it(s=>{const i=s.changedTouches[0];return e.setCurrent(ct(i,n),!0),e}))}function Fh(n=document.documentElement,t){const e=t?.useMousePoint||Re();return ar(n).pipe(Ce(s=>{e.setStart(ct(s,n),!0),t?.start?.(s,e)}),sn(()=>rr(n).pipe(xi(wi(or(n),hr(n)).pipe(Ce(s=>{e.setCurrent(ct(s,n),!1),t?.end?.(s,e)}))))),it(s=>(e.setCurrent(ct(s,n),!0),e)))}function Xh(n=document.documentElement,t){const e=t?.useMousePoint||Re();return Lf(yn(n),ar(n)).pipe(vo(s=>s instanceof PointerEvent?(e.setStart(ct(s,n),!0),t?.start?.(s,e),rr(n).pipe(xi(wi(or(n),hr(n)).pipe(Ce(i=>{e.setCurrent(ct(i,n),!1),t?.end?.(i,e)}))))):s instanceof MouseEvent?lf(s):so),it(s=>(e.setCurrent(ct(s,n),s instanceof PointerEvent),e)))}function Pg(n){return new et(t=>Fh(n,{start:()=>{t.next(0)},end:(s,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(s=>{t.next(s.current.y-s.start.y)}).unsubscribe).pipe(ue())}function Mg(n,t){Ze(n,"draggable","true");const e=Dh(n,!0).subscribe(r=>{de(r),_o(r);const a=r.dataTransfer;a&&(a.effectAllowed="move",a.setData("text/plain","some-data")),t?.onStart?.(r)}),s=kh(n).subscribe(r=>{de(r),t?.onDrag?.(r)}),i=Rh(n).subscribe(r=>{de(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe()}}function Cg(n,t){const e=Oh(n).subscribe(a=>{de(a),t?.onEnter?.(a)}),s=Nh(n).subscribe(a=>{de(a);const o=a.dataTransfer;o&&(o.dropEffect="move"),t?.onOver?.(a)}),i=zh(n).subscribe(a=>{de(a),t?.onLeave?.(a)}),r=Lh(n).subscribe(a=>{de(a);const o=a.dataTransfer;if(!o){t?.onDrop?.(a,[]);return}t?.onDrop?.(a,[...o.files])});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function Uh(n=100){return U(document,"scroll",!0).pipe(Xf(n))}function Ag(){return U(window,"visibilitychange",!0).pipe(it(()=>!document.hidden),ue())}function Ig(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Ms(){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 kg(){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 Vh(){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 Dg(){const{scrollWidth:n,scrollHeight:t}=Ms();return{width:n,height:t}}function cr(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ms();return{x:e+r,y:t+a,width:s,height:i}}function Rg(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 $h(n){return n.getBoundingClientRect()}function Lg(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 Og(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=Ms(),s=e-n;return s<=0?0:t/s*100}function zg(n){if("center"in n){const t=n.center,e=$h(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function lr(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}=Ms();return{x:n.clientX+t,y:n.clientY+e}}function ct(n,t){const e={x:0,y:0};if(t){const s=lr(n),i=cr(t);e.x=P.clamp(s.x-i.x,0,i.width),e.y=P.clamp(s.y-i.y,0,i.height)}else{let s=0,i=0;if("currentTarget"in n&&n.currentTarget&&n.target&&n.currentTarget!=n.target){const r=n.currentTarget.getBoundingClientRect(),a=n.target.getBoundingClientRect();s=a.left-r.left,i=a.top-r.top}if("offsetX"in n)e.x=n.offsetX+s,e.y=n.offsetY+i;else{const r=lr(n),a=cr(n.target);e.x=P.clamp(r.x-a.x+s,0,a.width),e.y=P.clamp(r.y-a.y+i,0,a.height)}}return e}function Ng(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const Bg={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};function Yg(n){if(n.key)return n.key;if(n.keyCode)return n.keyCode;if(n.which)return n.which}function Gh(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function qh(n){return Bh(n.target||document||window).pipe(bo(t=>Gh(t,n)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function Fg(n){return Yh(n.target||document||window).pipe(bo(t=>Gh(t,n)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function jh(n={keys:["o"]},t=P.ReadInBrowserEnum.text){return qh(n).pipe(sn(async()=>await gh(t)))}async function Xg(n={keys:["o"]},t=P.ReadInBrowserEnum.text){return ff(jh(n,t))}async function Hh(n,t){return new Promise(e=>{const s=new ResizeObserver(i=>{const a=i[0].contentRect;t(a),e(()=>{s.unobserve(n)})});s.observe(n)})}function ur(n=document.documentElement,t){let e,s,i,r;return new et(a=>{const o=new ResizeObserver(h=>{const l=h[0].contentRect;(e!=l.x||s!=l.y||i!=l.width||r!=l.height)&&(e=l.x,s=l.y,i=l.width,r=l.height,a.next(l))});return o.observe(n,t),()=>{o.unobserve(n),o.disconnect()}})}function Ug(n){return n(window.innerWidth,window.innerHeight),j(window,"orientationchange"in window?"orientationchange":"resize",t=>{const e=t.target.innerWidth,s=t.target.innerHeight;n(e,s)})}function Vg(){return U(window,"orientationchange"in window?"orientationchange":"resize").pipe(it(n=>({width:n.target.innerWidth,height:n.target.innerHeight})),fe({width:window.innerWidth,height:window.innerHeight}))}function $g(){const n={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:!1,this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-n.x,t.dStartY=t.y-n.y,t.isDown=typeof s=="boolean"?s:!1}}}function Gg(n=document.documentElement){const t=new P.EventBus,e=new tt(n);let s=[];const i=$g(),r=i.mousePoint,a=k=>{t.emit("mouseDown",k)},o=k=>{t.emit("mouseUp",k)},h=k=>{r.isDown||i.setCurrentMousePoint(ct(k,n)),t.emit("mouseMove",k)},c=k=>{t.emit("mouseOver",k)},l=k=>{t.emit("mouseOut",k)},u=k=>{t.emit("mouseEnter",k)},d=k=>{t.emit("mouseLeave",k)},f=k=>{t.emit("mouseClick",k)},p=k=>{t.emit("mouseDoubleClick",k)},x=k=>{t.emit("mouseWheel",k)},b=k=>{t.emit("mouseContextMenu",k)},w=k=>{t.emit("touchStart",k)},g=k=>{t.emit("touchEnd",k)},v=k=>{t.emit("touchCancel",k)},_=k=>{const rt=k.changedTouches[0];r.isDown||i.setCurrentMousePoint(ct(rt,n)),t.emit("touchMove",k)},M=k=>{t.emit("pointerDown",k)},E=k=>{t.emit("pointerUp",k)},D=k=>{t.emit("pointerCancel",k)},B=k=>{t.emit("pointerMove",k)},Y=k=>{t.emit("pan",k)},V=k=>{t.emit("panStart",k)},$=k=>{t.emit("panMove",k)},W=k=>{t.emit("panEnd",k)},Q=k=>{t.emit("panCancel",k)},Z=k=>{t.emit("panLeft",k)},Yt=k=>{t.emit("panRight",k)},ft=k=>{t.emit("panUp",k)},Et=k=>{t.emit("panDown",k)},It=k=>{t.emit("pinch",k)},O=k=>{t.emit("pinchin",k)},L=k=>{t.emit("pinchout",k)},X=k=>{t.emit("press",k)},H=k=>{t.emit("rotate",k)},Pt=k=>{t.emit("swipe",k)},jt=k=>{t.emit("swipeLeft",k)},Cn=k=>{t.emit("swipeRight",k)},An=k=>{t.emit("swipeUp",k)},dt=k=>{t.emit("swipeDown",k)},Jt=k=>{t.emit("tap",k)},nt=k=>{!k.target||n==k.target||n.contains(k.target)||t.emit("tapOutSide",k)},vt=k=>{t.emit("transitionstart",k)},ss=k=>{t.emit("transitionend",k)},Ye=k=>{t.emit("animationstart",k)},Fe=k=>{t.emit("animationend",k)};let ve={...n.getBoundingClientRect(),width:n.offsetWidth,height:n.offsetHeight};return{el:n,get rect(){return ve},mousePoint:r,eb:t,start:async function(){s.push(j(n,"mousedown",a)),s.push(j(n,"mouseup",o)),s.push(j(n,"mousemove",h)),s.push(j(n,"mouseover",c)),s.push(j(n,"mouseout",l)),s.push(j(n,"mouseenter",u)),s.push(j(n,"mouseleave",d)),s.push(j(n,"click",f)),s.push(j(n,"dblclick",p)),s.push(j(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",x)),s.push(j(n,"contextmenu",b)),s.push(j(n,"touchstart",w)),s.push(j(n,"touchend",g)),s.push(j(n,"touchcancel",v)),s.push(j(n,"touchmove",_)),s.push(j(n,"pointerdown",M)),s.push(j(n,"pointerup",E)),s.push(j(n,"pointercancel",D)),s.push(j(n,"pointermove",B)),e.on("pan",Y),e.on("panstart",V),e.on("panmove",$),e.on("panend",W),e.on("pancancel",Q),e.on("panleft",Z),e.on("panright",Yt),e.on("panup",ft),e.on("pandown",Et),e.on("pinch",It),e.on("pinchin",O),e.on("pinchout",L),e.on("press",X),e.on("rotate",H),e.on("swipe",Pt),e.on("swipeleft",jt),e.on("swiperight",Cn),e.on("swipeup",An),e.on("swipedown",dt),e.on("tap",Jt),s.push(j(document,"pointerdown",nt)),s.push(j(n,"transitionstart",vt)),s.push(j(n,"transitionend",ss)),s.push(j(n,"animationstart",Ye)),s.push(j(n,"animationend",Fe));const k=await Hh(n,rt=>{ve=rt,t.emit("resize",rt)});s.push(k),s.push(Wh(this,{start:rt=>{i.setStartMousePoint(ct(rt,n),!0)},move:rt=>{i.setCurrentMousePoint(ct(rt,n))},end:rt=>{i.setCurrentMousePoint(ct(rt,n),!1)}}))},end:()=>{t.removeAllListeners(),s.forEach(k=>k()),s=[],e.off("pan",Y),e.off("panstart",V),e.off("panmove",$),e.off("panend",W),e.off("pancancel",Q),e.off("panleft",Z),e.off("panright",Yt),e.off("panup",ft),e.off("pandown",Et),e.off("pinch",It),e.off("pinchin",O),e.off("pinchout",L),e.off("press",X),e.off("rotate",H),e.off("swipe",Pt),e.off("swipeleft",jt),e.off("swiperight",Cn),e.off("swipeup",An),e.off("swipedown",dt),e.off("tap",Jt)}}}function Wh(n,t){return Jh(n,t)}function Jh(n,t){const e=n.eb,s=a=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(a)},i=a=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(a)},r=a=>{t?.move?.(a)};return e.on("pointerDown",s),()=>e.off("pointerDown",s)}function qg(n,t){const e=n.eb,s=a=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(a)},i=a=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(a)},r=a=>{t?.move?.(a)};return e.on("mouseDown",s),()=>e.off("mouseDown",s)}function jg(n,t){const e=n.eb,s=a=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const o=a.changedTouches[0];t?.start?.(o)},i=a=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const o=a.changedTouches[0];t?.end?.(o)},r=a=>{const o=a.changedTouches[0];t?.move?.(o)};return e.on("touchStart",s),()=>e.off("touchStart",s)}class Hg{multicast;buffer;handlers=P.createExpandingRingQueue(10);constructor(t){this.buffer=t?.buffer||P.createExpandingRingQueue(10),this.multicast=typeof t?.multicast=="boolean"?t?.multicast:!1}put(t){if(this.multicast){this.handlers.flush().forEach(s=>s(t));return}if(this.handlers.length===0)return this.buffer.put(t);const e=this.handlers.take();e&&e(t)}take(t){if(!this.multicast){const e=this.buffer.take();if(e){t(e);return}}this.handlers.put(t)}flush(t){this.multicast||this.buffer.flush().forEach(t)}}let fr=class{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=$t(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),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class dr extends fr{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?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,u=(t-s)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,x=f*f/(r*r)+p*p/(a*a);if(x>1){const $=Math.sqrt(x);throw r=$*r,a=$*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*p*p-a*a*f*f)/(r*r*p*p+a*a*f*f)),w=h!=c?1:-1,g=w*b*r*p/a,v=w*b*-a*f/r,_=(t+s)/2,M=(e+i)/2,E=Math.cos(l)*g-Math.sin(l)*v+_,D=Math.sin(l)*g+Math.cos(l)*v+M,B=($,W,Q,Z)=>($*Z>=W*Q?1:-1)*Math.acos(($*Q+W*Z)/(Math.sqrt($*$+W*W)*Math.sqrt(Q*Q+Z*Z))),Y=B(1,0,t-E,e-D)-l,V=B(t-E,e-D,s-E,i-D);return[E,D,r,a,l,Y,Y+V]}}class Wg extends fr{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(0,...t),y:Math.min(0,...e)},h={x:Math.max(0,...t),y:Math.max(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 Jg=Wg;class pt extends fr{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}clone(){return new pt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}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}));const l=[],u=c.length;for(let p=0;p<u;p++){for(let x=p+1;x<u;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const d={x:Math.min(...o),y:Math.min(...a)},f={x:Math.max(...o),y:Math.max(...a)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.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,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const x=l*u[p]+l,b=pt.base3(x,t,s,r,o),w=pt.base3(x,e,i,a,h);f+=d[p]*Math.sqrt(b*b+w*w)}return l*f}length(t=1){return pt.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||pt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=pt.bezlen(e,s,i,r,a,o,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=pt.bezlen(e,s,i,r,a,o,h,c,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),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),u=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,g=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:x},end:{x:b,y:w},alpha:g}}}const Cs=Math.PI*2;function Zh(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 Zg(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,d=a*a,f=o*o,p=l*l,x=u*u;let b=d*f-d*x-f*p;b<0&&(b=0),b/=d*x+f*p,b=Math.sqrt(b)*(i===r?-1:1);const w=b*a/o*u,g=b*-o/a*l,v=c*w-h*g+(n+e)/2,_=h*w+c*g+(t+s)/2,M=(l-w)/a,E=(u-g)/o,D=(-l-w)/a,B=(-u-g)/o,Y=Zh(1,0,M,E);let V=Zh(M,E,D,B);return r===0&&V>0&&(V-=Cs),r===1&&V<0&&(V+=Cs),[v,_,Y,V]}function Kg(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 Kh(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*Cs/360),l=Math.cos(h*Cs/360),u=l*(n-e)/2+c*(t-s)/2,d=-c*(n-e)/2+l*(t-s)/2;if(u===0&&d===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const f=u*u/(a*a)+d*d/(o*o);f>1&&(a*=Math.sqrt(f),o*=Math.sqrt(f));const p=Zg(n,t,e,s,i,r,a,o,c,l),x=[];let b=p[2],w=p[3];const g=Math.max(Math.ceil(Math.abs(w)/(Cs/4)),1);w/=g;for(let v=0;v<g;v++)x.push(Kg(b,w)),b+=w;return x.map(v=>{for(let _=0;_<v.length;_+=2){let M=v[_+0],E=v[_+1];M*=a,E*=o;const D=l*M-c*E,B=c*M+l*E;v[_+0]=D+p[0],v[_+1]=B+p[1]}return v})}function mr(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 As(n,t,e,s){return[n,t,e,s,e,s]}const wn={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Qh(n="path",t){const e=document.createElementNS.call(document,"http://www.w3.org/2000/svg",n);return t&&De(e,t),e}function Qg(n,t){return Qh("path",{d:n,id:t||P.generateUUID()})}function t0(n,t="shape"){return gn(si(n),`${t}.svg`)}function tc(n){return typeof n!="string"?!1:(n=n.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(n)&&/[\dz]$/i.test(n))}function e0(n){return n.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function ec(n){const t=[];return tc(n)&&n.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,s,i)=>{let r=s.toLowerCase();const a=P.extractAllNumbers(i);for(r=="m"&&a.length>wn[r]&&(t.push([s,...a.splice(0,wn[r])]),r="l",s=s=="m"?"l":"L");a.length;){if(a.length<wn[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${s} } args:{ ${a} }`);t.push([s,...a.splice(0,wn[r])])}return r=="z"&&t.push([s]),""}),t}function sc(n){let t=0,e=0,s=0,i=0;return n.map(function(r){const a=r[0],o=a.toUpperCase();if(a!=o)switch(r[0]=o,a){case"a":r[6]+=s,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=s;break;default:for(let h=1;h<r.length;)r[h++]+=s,r[h++]+=i}switch(o){case"Z":s=t,i=e;break;case"H":s=r[1];break;case"V":i=r[1];break;case"M":s=t=r[1],i=e=r[2];break;default:s=r[r.length-2],i=r[r.length-1]}return r})}function s0(n){const t=[];let e=0,s=0,i=0,r=0,a=0,o=0,h=0,c=0,l;for(let u=0,d=n.length;u<d;u++){let f=n[u];const p=f[0];switch(p){case"M":e=f[1],s=f[2];break;case"A":const x=Kh(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!x.length)continue;x.forEach((g,v)=>{const[_,M,E,D,B,Y,V,$]=g;f=["C",E,D,B,Y,V,$],v<x.length-1&&t.push(f)});break;case"S":let b=i,w=r;(l=="C"||l=="S")&&(b+=b-h,w+=w-c),f=["C",b,w,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(a=i*2-a,o=r*2-o):(a=i,o=r),f=["C",...mr(i,r,a,o,f[1],f[2])];break;case"Q":a=f[1],o=f[2],f=["C",...mr(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...As(i,r,f[1],f[2])];break;case"H":f=["C",...As(i,r,f[1],r)];break;case"V":f=["C",...As(i,r,i,f[1])];break;case"Z":f=["C",...As(i,r,e,s)];break}l=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(h=f[f.length-4],c=f[f.length-3]):(h=i,c=r),t.push(f)}return t}class Is{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(()=>{Is.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 pr extends P.EventBus{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=P.stringLength(this.source);if(t===0){this.emit("finish");return}let e,s,i=P.charAt(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=P.charAt(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==`
|
|
15
|
+
`&&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":P.regTest("whitespace",t)?(this.textchunk+=nc(this.entity),this.mode="text"):t==";"?(this.textchunk+=nc(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(!P.regTest("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":P.regTest("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(P.regTest("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(P.regTest("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":P.regTest("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(P.regTest("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(!P.regTest("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(P.regTest("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 nc(n){const t={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 e;return n.charAt(0)=="#"?n.charAt(1).toLowerCase()=="x"?e=parseInt(n.substring(2),16):e=parseInt(n.substring(1),10):e=t[n],e?String.fromCharCode(e):"&"+n}var ic=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function gr(n,t={}){var e=1,s=1;function i(O){var L=O.match(/\n/g);L&&(e+=L.length);var X=O.lastIndexOf(`
|
|
16
|
+
`);s=~X?O.length-X:s+O.length}function r(){var O={line:e,column:s};return function(L){return L.position=new a(O),p(),L}}function a(O){this.start=O,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(O){var L=new Error(t.source+":"+e+":"+s+": "+O);if(L.reason=O,L.filename=t.source,L.line=e,L.column=s,L.source=n,t.silent)o.push(L);else throw L}function c(){var O=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:O,parsingErrors:o}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var O,L=[];for(p(),x(L);n.length&&n.charAt(0)!="}"&&(O=Et()||It());)O!==!1&&(L.push(O),x(L));return L}function f(O){var L=O.exec(n);if(L){var X=L[0];return i(X),n=n.slice(X.length),L}}function p(){f(/^\s*/)}function x(O){var L;for(O=O||[];L=b();)L!==!1&&O.push(L);return O}function b(){var O=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var L=2;n.charAt(L)!=""&&(n.charAt(L)!="*"||n.charAt(L+1)!="/");)++L;if(L+=2,n.charAt(L-1)==="")return h("End of comment missing");var X=n.slice(2,L-2);return s+=2,i(X),n=n.slice(L),s+=2,O({type:"comment",comment:X})}}function w(){var O=f(/^([^{]+)/);if(O)return ne(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(L){return L.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(L){return L.replace(/\u200C/g,",")})}function g(){var O=r(),L=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(L){if(L=ne(L[0]),!f(/^:\s*/))return h("property missing ':'");var X=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),H=O({type:"declaration",property:L.replace(ic,""),value:X?ne(X[0]).replace(ic,""):""});return f(/^[;\s]*/),H}}function v(){var O=[];if(!l())return h("missing '{'");x(O);for(var L;L=g();)L!==!1&&(O.push(L),x(O));return u()?O:h("missing '}'")}function _(){for(var O,L=[],X=r();O=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)L.push(O[1]),f(/^,\s*/);if(L.length)return X({type:"keyframe",values:L,declarations:v()})}function M(){var O=r(),L=f(/^@([-\w]+)?keyframes\s*/);if(L){var X=L[1];if(L=f(/^([-\w]+)\s*/),!L)return h("@keyframes missing name");var H=L[1];if(!l())return h("@keyframes missing '{'");for(var Pt,jt=x();Pt=_();)jt.push(Pt),jt=jt.concat(x());return u()?O({type:"keyframes",name:H,vendor:X,keyframes:jt}):h("@keyframes missing '}'")}}function E(){var O=r(),L=f(/^@supports *([^{]+)/);if(L){var X=ne(L[1]);if(!l())return h("@supports missing '{'");var H=x().concat(d());return u()?O({type:"supports",supports:X,rules:H}):h("@supports missing '}'")}}function D(){var O=r(),L=f(/^@host\s*/);if(L){if(!l())return h("@host missing '{'");var X=x().concat(d());return u()?O({type:"host",rules:X}):h("@host missing '}'")}}function B(){var O=r(),L=f(/^@media *([^{]+)/);if(L){var X=ne(L[1]);if(!l())return h("@media missing '{'");var H=x().concat(d());return u()?O({type:"media",media:X,rules:H}):h("@media missing '}'")}}function Y(){var O=r(),L=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(L)return O({type:"custom-media",name:ne(L[1]),media:ne(L[2])})}function V(){var O=r(),L=f(/^@page */);if(L){var X=w()||[];if(!l())return h("@page missing '{'");for(var H=x(),Pt;Pt=g();)H.push(Pt),H=H.concat(x());return u()?O({type:"page",selectors:X,declarations:H}):h("@page missing '}'")}}function $(){var O=r(),L=f(/^@([-\w]+)?document *([^{]+)/);if(L){var X=ne(L[1]),H=ne(L[2]);if(!l())return h("@document missing '{'");var Pt=x().concat(d());return u()?O({type:"document",document:H,vendor:X,rules:Pt}):h("@document missing '}'")}}function W(){var O=r(),L=f(/^@font-face\s*/);if(L){if(!l())return h("@font-face missing '{'");for(var X=x(),H;H=g();)X.push(H),X=X.concat(x());return u()?O({type:"font-face",declarations:X}):h("@font-face missing '}'")}}var Q=ft("import"),Z=ft("charset"),Yt=ft("namespace");function ft(O){var L=new RegExp("^@"+O+"\\s*([^;]+);");return function(){var X=r(),H=f(L);if(H){var Pt={type:O};return Pt[O]=H[1].trim(),X(Pt)}}}function Et(){if(n[0]=="@")return M()||B()||Y()||E()||Q()||Z()||Yt()||$()||V()||D()||W()}function It(){var O=r(),L=w();return L?(x(),O({type:"rule",selectors:L,declarations:v()})):h("selector missing")}return yr(c())}function ne(n){return n?n.replace(/^\s+|\s+$/g,""):""}function yr(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){yr(a,s)}):r&&typeof r=="object"&&yr(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}let n0=class extends pr{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=gr(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const 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(const 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),xr(this.currentItem.style,this.currentItem,br)}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&&xr(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+wr(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(const r in e){const a=e[r];if(br.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"&&xr(a,this.currentItem,br),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 wr(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 wr(n,t,i,r)-wr(e,s,i,r)}function xr(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){const 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 br=["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 bt{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){const e=typeof t=="string"?ec(t):t||[],s=s0(sc(e));let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];o[0]=="M"?(i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new pt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(t instanceof dr){Kh(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,x,b,w]=c;this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})),this.prevPathX=b,this.prevPathY=w});return}if(t instanceof pt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,s,i,r,a,o;t instanceof Jg?[e,s,i,r,a,o]=mr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=As(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new pt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}static fromPolymorphPoints(t){const e=new bt;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 pt({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 bt;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}clone(){return bt.fromLines(this.normalizedLines)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,s=this.normalizedLines.length;e<s;e++)t.push(...this.normalizedLines[e].toSVGPathData());return t}toSVGPathD(){return e0(this.toSVGPathData())}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{e.toCanvasContext(t)})}getBoundingClientRect(t=2){const e=[],s=[];if(this.normalizedLines.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,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...s),a=Math.max(...e),o=Math.max(...s);return{x:P.maxDotNumber(i,t),y:P.maxDotNumber(r,t),width:P.maxDotNumber(a-i,t),height:P.maxDotNumber(o-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:P.maxDotNumber(e.x+e.width*.5,t),y:P.maxDotNumber(e.y+e.height*.5,t)}}transform(t,e,s,i,r,a,o){const h=new xt;return h.translate(t,e),h.rotate(r,s,i),h.scale(a,o,s,i),h.isIdentity?this.clone():bt.fromLines(this.normalizedLines.map(c=>{let l=c.x,u=c.y,d=c.c1x,f=c.c1y,p=c.c2x,x=c.c2y,b=c.toX,w=c.toY;return{x:l,y:u}=h.transformPoint({x:l,y:u}),{x:d,y:f}=h.transformPoint({x:d,y:f}),{x:p,y:x}=h.transformPoint({x:p,y:x}),{x:b,y:w}=h.transformPoint({x:b,y:w}),new pt({x:l,y:u,c1x:d,c1y:f,c2x:p,c2y:x,toX:b,toY:w})}))}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0,s=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const a=this.normalizedLines[r];if(s=a.length(),e+s>=t)return a.getPointAtSegmentLength(t-e);e+=s}return this.normalizedLines[i-1].getPointAtSegmentLength(s)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let s=t*e,i=this.normalizedLines[0];if(s--,s>1)for(let r=1;r<e&&(i=this.normalizedLines[r],s>1);r++)s-=1;return i.interpolate(s)}}getSubPathD(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubPathDAtLength(this,t);{const s=this.getSubPathDAtLength(this,e,1);return t?this.getSubPathDAtLength(s,t):s}}getSubPathDAtLength(t,e,s){let i=null,r=0;const a=new bt;a.prevPathX=a.startPathX=t.startPathX,a.prevPathY=a.startPathY=t.startPathY;for(let o=0,h=this.normalizedLines.length;o<h;o++){const c=this.normalizedLines[o],l=c.length();if(r+l>e&&!i){const u=c.getPointAtSegmentLength(e-r);if(a._appendLine(new pt({c1x:u.start.x,c1y:u.start.y,c2x:u.m.x,c2y:u.m.y,toX:u.x,toY:u.y})),s)return a;i=a,a._appendLine(new pt({c1x:u.n.x,c1y:u.n.y,c2x:u.end.x,c2y:u.end.y,toX:c.x,toY:c.y})),r+=l;continue}r+=l,a._appendLine(c)}return a}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){const l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<a&&(i=l,r=c,a=u)}for(o/=2;o>.5;){const c=r-o,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),d=r+o,f=this.getPointAtLength(d),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<a?(i=l,r=c,a=u):d<=s&&p<a?(i=f,r=d,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?$t(h.x,h.y,i.x,i.y):$t(i.x,i.y,h.x,h.y),distance:Math.sqrt(a)}}getPolymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.toX,e.toY]),[]))}getPolymorphPointsPerimeter(){const t=this.getPolymorphPoints(),e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=pe(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}getExpendedPolymorphPointsPathD(t){const e=this.getPolymorphPoints(),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++],u=e[o++],d=e[o++],f=e[o++];a.push(["C",h,c,l,u,d,f]);let p=0;for(;p<r&&i>0;)a.push(["C",d,f,d,f,d,f]),i-=6,p++}return new bt(a)}static getInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?new bt(t.toSVGPathD()):Math.abs(s-1)<Number.EPSILON?new bt(e.toSVGPathD()):bt.fromPolymorphPoints(P.lerps(t.getPolymorphPoints(),e.getPolymorphPoints(),s))}}const rc=i0("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 i0(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 Tt(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 xn(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 r0(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function a0(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const ks={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 vr{__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",Tt("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 ac{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class bn{__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(ks);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=ks[i].canvas}}__getStyleState(){const t={},e=Object.keys(ks);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(ks);for(let r=0;r<i.length;r++){const a=ks[i[r]],o=this[i[r]];if(a.apply){if(o instanceof ac){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,Tt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof vr)e.setAttribute(a.apply,Tt("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,Tt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),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(rc);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=rc[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(Tt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Tt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Tt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(Tt("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(Tt("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(Tt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Tt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(Tt("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(Tt("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],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],x=e+f*d[1],b=[-h[1],h[0]],w=[c[1],-c[0]],g=function(M){const E=M[0];return M[1]>=0?Math.acos(E):-Math.acos(E)},v=g(b),_=g(w);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,v,_)}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:xn(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new vr(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:xn(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 vr(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":r0(this.textAlign),"dominant-baseline":a0(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),u=a?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),a?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Tt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=xn(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",Tt("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,u,d,f,p,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 w=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+s+", "+i+")";if(e instanceof bn){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.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),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=xn(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 bn&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ac(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class _r{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 bn({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}}}const Ds={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Bt{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let s;if(s=/^(\w+)\(([^)]*)\)/.exec(t)){const i=s[2];let r;switch(s[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=P.clamp(parseFloat(r[1]),0,100)*255/100,this.g=P.clamp(parseFloat(r[2]),0,100)*255/100,this.b=P.clamp(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(s=/#([A-Fa-f0-9]+)/.exec(t)){const i=s[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Bt?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=P.clamp(Math.round(P.parseNumber(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=P.clamp(P.parseNumber(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*s+r[6]*i,this.g=r[1]*e+r[4]*s+r[7]*i,this.b=r[2]*e+r[5]*s+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${P.maxDotNumber(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=ze){Er.fromWorkingColorSpace(ie.copy(this),t);const e=ie.r,s=ie.g,i=ie.b;return t!==ze?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Bt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Le(t.r),this.g=Le(t.g),this.b=Le(t.b),this}copyLinearToSRGB(t){return this.r=Oe(t.r),this.g=Oe(t.g),this.b=Oe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",s="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const{r:i,g:r,b:a}=this.color;return this.r=255-i,this.g=255-r,this.b=255-a,this}}lighten(t){t=P.clamp(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e+(255-e)*t,this.g=s+(255-s)*t,this.b=i+(255-i)*t,this}darken(t){t=P.clamp(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e*(1-t),this.g=s*(1-t),this.b=i*(1-t),this}lerp(t,e){e=P.clamp(e,0,1);const{r:s,g:i,b:r}=this.color;return this.r=s+(t.r-s)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,s){return s=P.clamp(s,0,1),this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}static gradient(t,e,s){try{return ie.lerpColors(new Bt(t),new Bt(e),s).toString()}catch{return e}}static random(){return ie.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Bt.nextIndex){Bt.nextIndex=t;const e=Object.keys(Ds),s=e.length;return ie.setHEX(Ds[e[Bt.nextIndex++%s]]).toString()}setColorName(t){const e=Ds[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(Ds).map(t=>ie.setHEX(t).toString())}setRGB(t,e,s,i=1){return this.r=t,this.g=e,this.b=s,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,s,i=1){const r=P.euclideanModulo(t,1),a=P.clamp(e,0,1),o=P.clamp(s,0,1);if(a===0)this.r=o*255,this.g=o*255,this.b=o*255;else{const h=o<=.5?o*(1+a):o+a-o*a,c=2*o-h;this.r=Pr(c,h,r+.3333333333333333)*255,this.g=Pr(c,h,r)*255,this.b=Pr(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,s=this.g,i=this.b,r=Math.max(e,s,i)/255,a=Math.min(e,s,i)/255;let o,h;const c=(a+r)/2;if(a===r)o=0,h=0;else{const l=r-a;switch(h=c<=.5?l/(r+a):l/(2-r-a),r){case e:o=(s-i)/l+(s<i?6:0);break;case s:o=(i-e)/l+2;break;case i:default:o=(e-s)/l+4;break}o/=6}return t&&t.setHSL(o,h,c,this.a),{h:o,s:h,l:c,a:this.a}}offsetHSL(t,e,s){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+s)}lerpHSL(t,e){const s=this.getHSL(),i=t.getHSL(),r=P.lerp(s.h,i.h,e),a=P.lerp(s.s,i.s,e),o=P.lerp(s.l,i.l,e);return this.setHSL(r,a,o),this}setHSV(t,e,s,i=1){const r=P.clamp(t,0,1)*360,a=P.clamp(e,0,1),o=P.clamp(s,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=o*(1-a),u=o*(1-c*a),d=o*(1-(1-c)*a),f=[[o,d,l],[u,o,l],[l,o,d],[l,u,o],[d,l,o],[o,l,u]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,s,i=1){this.setHSV(t,e,s,i)}getHSV(t){const{r:e,g:s,b:i,a:r}=this.color,a=Math.max(e,s,i),o=Math.min(e,s,i),h=a-o;let c;e===a?c=(s-i)/h:s===a?c=2+(i-e)/h:c=4+(e-s)/h,c/=6,c<0&&(c+=1);const l=h==0?0:c,u=a===0?0:h/a,d=a/255;return t&&t.setHSV(l,u,d,r),{h:l,s:u,v:d,a:r}}getHSB(t){const{h:e,s,v:i,a:r}=this.getHSV(t);return{h:e,s,b:i,a:r}}}const ie=new Bt;function Le(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Oe(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const oc="",ze="srgb",Sr="srgb-linear",Tr="linear",vn="srgb",hc=new We().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),cc=new We().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),lc=[.64,.33,.3,.6,.15,.06],uc=[.2126,.7152,.0722],fc=[.3127,.329],Er={enabled:!0,workingColorSpace:Sr,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===vn&&(n.r=Le(n.r),n.g=Le(n.g),n.b=Le(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===vn&&(n.r=Oe(n.r),n.g=Oe(n.g),n.b=Oe(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===oc?Tr:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};Er.define({[Sr]:{primaries:lc,whitePoint:fc,transfer:Tr,toXYZ:hc,fromXYZ:cc,luminanceCoefficients:uc,workingColorSpaceConfig:{unpackColorSpace:ze},outputColorSpaceConfig:{drawingBufferColorSpace:ze}},[ze]:{primaries:lc,whitePoint:fc,transfer:vn,toXYZ:hc,fromXYZ:cc,luminanceCoefficients:uc,outputColorSpaceConfig:{drawingBufferColorSpace:ze}}});function Pr(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?n+(t-n)*6*e:e<.5?t:e<.6666666666666666?n+(t-n)*6*(.6666666666666666-e):n}class lt{id;d;parent;attrs;_centerX;_centerY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;show;followMouse;drag;transform$=new ls;isMouseIn=!1;isDragging=!1;el;constructor(t){this.id=P.generateUUID(),this.d=t?.d,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this._centerX=t?.centerX,this._centerY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),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.show=typeof t?.show=="boolean"?t?.show:!0,this.followMouse=typeof t?.followMouse=="boolean"?t?.followMouse:!1,this.drag=t?.drag}destroy(){}moveTo(t,e){const s=this._x,i=this._y;(s!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dx:t-s,dy:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}rotateTo(t){this._degree=t}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree=t}scaleTo(t,e){this._scaleX=t,this._scaleY=e||t}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}pathD(){return this.d?(this.d instanceof bt||(this.d=new bt(this.d)),this.d):new bt(this.toSVGPathData())}forcePathD(t){this.d=t}getBaseOptions(){return{d:this.d,attrs:this.getAttrs(),centerX:this._centerX,centerY:this._centerY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,followMouse:this.followMouse,drag:this.drag}}clone(){const t=this.cloneShape();return this.parent&&(t.parent={...this.parent}),t}cloneShape(){return new lt(this.getBaseOptions())}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let s=this._centerX||0,i=this._centerY||0;if(typeof this._centerX>"u"&&typeof this._centerY>"u"){const r=this.getBoundingClientRectCenter(e);if(t||!this.parent)s=r.x,i=r.y;else{const a=this.parent.combo.getBoundingClientRectCenter(e);s=a.x-this.parent.dx,i=a.y-this.parent.dy}}return{x:s,y:i}}isPointInPath(t,e,s){if(t instanceof _r)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}isPointInStroke(t,e,s){if(t instanceof _r)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}setAttr(t,e){if(typeof t!="string")for(const s in t){const i=t[s];i&&(this.attrs[P.toKebab(s)]=i)}else e&&(this.attrs[P.toKebab(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[P.toKebab(t)]||e}hasAttr(t){return!!this.getAttr(t)}getAttrs(){return{...this.attrs}}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const s=t?.friction||1;this.vx*=s,this.vy*=s,this.moveTo(this.x+this.vx,this.y+this.vy)}animateEaseTo(t,e){const s=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*s,this.vy=r*s,this.animate(e)}animateSpringTo(t,e){const s=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,a=i.y-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.animate({friction:.9,...e})}animateSpringMassTo(t,e){const s=e?.springLength||100,i=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}distance(t){return pe(this.x,this.y,t.x,t.y)}rotateToTarget(t){this.rotateTo(_t($t(this.x,this.y,t.x,t.y)))}followTo(t,e=3){this.rotateToTarget(t);const{dx:s,dy:i}=He(J(this.degree),e);this.vx=s,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateToTarget(t);const{dx:s,dy:i}=He(J(this.degree),e);this.ax=s,this.ay=i,this.animate()}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}checkCollision(t){}checkWall(t){}getTotalLength(){return this.pathD().getTotalLength()}interpolate(t){return this.pathD().interpolate(t)}getPointAtLength(t){return this.pathD().getPointAtLength(t)}trailPath(t=0){const e=this.getTotalLength();return{subPathD:this.pathD().getSubPathD(0,t*e),point:this.getPointAtLength(t*e)}}strokeDashTween(t=1e3,e){const s=P.maxDotNumber(this.pathD().getTotalLength(),0);this.setAttr({strokeDasharray:`${s} ${s}`,strokeDashoffset:`${s}`});const i=e?.onUpdate,r=new ps({frameDuration:t});r.addTween({offset:s},{offset:0},Object.assign(e||{},{onUpdate:(a,o)=>{this.setAttr("strokeDashoffset",""+P.maxDotNumber(a.offset,2)),i?.(a,o)}})),r.play()}}class zt{options;commonChildShapeOptions;shapes=[];x=0;y=0;degree=0;scaleX=1;scaleY=1;constructor(t,e){if(this.options=t,this.commonChildShapeOptions=e,t?.svg){let s=0,i=0,r=0,a=0;const o=new n0(t.svg).parse();for(let h=0,c=o.length;h<c;h++){const l=o[h];if(l.type=="viewbox"&&l.width&&l.height){if(s=parseFloat(l.width),i=parseFloat(l.height),t.forceWidth){const x=s/i;r=t.forceWidth,a=r/x}else r=s,a=i;continue}if(l.type!="path"||!tc(l.path))continue;const u={};for(const x in l)x==="type"||x==="path"||x==="transform"||(u[x]=l[x]);const d=sc(ec(l.path)),f=[];let p=[];for(let x=0,b=d.length;x<b;x++){const w=d[x];p.push(w),w[0].toLowerCase()=="z"&&(f.push(p),p=[])}p.length&&f.push(p),f.forEach(x=>{const b=new lt({...e,d:x,attrs:{...e?.attrs,...u}});if(l.transform){const g=$i(l.transform).split();b.moveTo(g.x,g.y),b.rotateTo(g.degree),b.scaleTo(g.scaleX,g.scaleY)}r&&s&&a&&i&&b.scaleTo(b.scaleX*(r/s),b.scaleY*(a/i)),this.addShape(b)})}}}destroy(){this.shapes.forEach(t=>t.destroy())}clone(){const t=this.cloneShapeCombo();return t.x=this.x,t.y=this.y,t.degree=this.degree,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shapes=this.shapes.map(e=>{const s=e.clone();return s.parent&&(s.parent.combo=t),s}),t}cloneShapeCombo(){return new zt(this.options,this.commonChildShapeOptions)}addShape(t,e=0,s=0){t.parent={combo:this,dx:e||t.x,dy:s||t.y},this.shapes.push(t)}comboMove(t,e){this.x+=t,this.y+=e,this.shapes.forEach(s=>{s.move(t,e)})}comboRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.rotate(t)})}comboScale(t,e){this.scaleX*=t,this.scaleY*=e||t,this.shapes.forEach(s=>{s.scale(t,e)})}comboTransform(t){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1)}getBoundingClientRect(t=2){const e=[],s=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);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,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...s),a=Math.max(...e),o=Math.max(...s);return{x:P.maxDotNumber(i,t),y:P.maxDotNumber(r,t),width:P.maxDotNumber(a-i,t),height:P.maxDotNumber(o-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:P.maxDotNumber(e.x+e.width*.5,t),y:P.maxDotNumber(e.y+e.height*.5,t)}}setAttr(t,e){typeof t!="string"?this.shapes.forEach(s=>{s.setAttr(t)}):e&&this.shapes.forEach(s=>{s.setAttr(t,e)})}sort(){this.shapes=this.shapes.map(t=>({shape:t,perimeter:t.pathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendTo(this);for(let i=s;i<e;i++)this.addShape(t.shapes[i].clone())}strokeDashTween(t,e){const s=this.shapes.length-1;switch(e?.type){case"sequence":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=P.maxDotNumber(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(const c in o){const l=P.extractNumber(c).number;this.shapes[l].setAttr("strokeDashoffset",""+P.maxDotNumber(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}function o0(n,t){n.forEach(s=>{s.animate(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=n.length;for(let s=0,i=e-1;s<i;s++)for(let r=s+1;r<e;r++)n[s].checkCollision(n[r])}function h0(n){const t=n.length;n.forEach((e,s)=>{e.animate();for(let i=s+1;i<t;i++)e.checkCollision(n[i]),e.gravitateTo(n[i])})}function c0(n,t){n.forEach((e,s)=>{s>0&&e.animateSpringTo(n[s-1],t)})}function l0(n,t){const e=t?.springLength||100;n.forEach(s=>{s.isDragging||n.filter(i=>i.id!==s.id).forEach(i=>{const r=$t(s.x,s.y,i.x,i.y);s.animateSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}function u0(n,t,e){const s=n.length,i=[];return n.forEach((r,a)=>{r.animate(e),r.x>t.x+t.width?r.moveXTo(t.x):r.x<t.x&&r.moveXTo(t.x+t.width),r.y>t.y+t.height?r.moveYTo(t.y):r.y<t.y&&r.moveYTo(t.y+t.height);for(let o=a+1;o<s;o++)i.push([r.x,r.y,n[o].x,n[o].y,r.animateSpringMassTo(n[o],e)])}),i}function Mr(n){if(n.length<2)throw new Error("shapes个数必须大于等于2");const t=n.length-1,e=new Array(t);for(let s=0;s<t;s++){const i=n[s].pathD(),r=n[s+1].pathD(),a=Math.max(i.getPolymorphPoints().length,r.getPolymorphPoints().length);e[s]=bt.getInterpolator(i.getExpendedPolymorphPointsPathD(a),r.getExpendedPolymorphPointsPathD(a))}return s=>{const i=P.maxDotNumber(t*s,6),r=Math.min(Math.floor(i),t-1),a=P.maxDotNumber(i-r,6),o=new lt({d:e[r](a)}),h=n[r].getAttr("fill","none"),c=n[r+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&o.setAttr("fill",Bt.gradient(h,c,a).toString());const l=n[r].getAttr("stroke","none"),u=n[r+1].getAttr("stroke","none");return typeof l=="string"&&typeof u=="string"&&o.setAttr("stroke",Bt.gradient(l,u,a).toString()),o}}function dc(n){if(n.length<2)throw new Error("shapeCombos个数必须大于等于2");let t=0,e;const s=[];n.forEach(a=>{let o;a instanceof zt?(o=a,o.sort()):(o=new zt,o.addShape(a)),s.push(o),t<o.shapes.length&&(t=o.shapes.length,e=o)}),s.forEach(a=>{a!==e&&a.expendTo(e)});const i=[];s.forEach((a,o)=>{a.shapes.forEach((h,c)=>{i[c]=i[c]||[],i[c][o]=h})});const r=[];return i.forEach(a=>{r.push(Mr(a))}),a=>{const o=new zt;return r.forEach(h=>{o.addShape(h(a))}),o}}function f0(n,t=6e3,e){const s=n.findIndex(o=>o instanceof zt)>=0?dc(n):Mr(n),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),i instanceof lt?e?.shape?.(i):i instanceof zt&&i.shapes.forEach(c=>{e?.shape?.(c)})}})),a.play()}function d0(n,t,e,s,i){if(i==0)throw new Error("no dividing by zero, please");const r=[],a=360/i;for(let h=0;h<i;h+=1){const c=a*h*Math.PI/180,l=n+2*e*Math.cos(c),u=t+2*e*Math.sin(c);r.push(new dr({x:n,y:t,rx:e,ry:s,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),r.push(new dr({x:l,y:u,rx:e,ry:s,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:n,toY:t}))}return new lt({d:bt.fromLines(r)})}function m0(n=document.documentElement,t="canvas"){wh(n);let e=null,s=null,i=null;t=="svg"&&(e=Qh("svg"),Ps(n,e)),t=="canvas"&&(s=_h("canvas"),Ps(n,s));const r={x:0,y:0,width:0,height:0},a=ur(n).subscribe(b=>{r.x=b.x,r.y=b.y,r.width=b.width,r.height=b.height,e&&De(e,{viewBox:`0 0 ${r.width} ${r.height}`,width:`${r.width}`,height:`${r.height}`}),s&&(De(s,{width:`${r.width}`,height:`${r.height}`}),i=new _r(s,r.width,r.height,!1))}),o=[];let h="",c="",l="default";const u=(b="default")=>{b!=l&&(n.style.cursor=b,l=b)},d=Re(),f=Xh(e||s||n,{useMousePoint:d}).subscribe(()=>{}),p=b=>{b.followMouse&&(!P.withinErrorMarginNumber(b.x,d.current.x,5)||!P.withinErrorMarginNumber(b.y,d.current.y,5))&&b.followTo(d.current),b.drag&&b.drag.enable&&b.drag.targetToAfterDrop&&(b.isDragging||b.animateEaseTo(b.drag.targetToAfterDrop,{easing:b.drag.easing}))},x=(...b)=>{const w=[];b.forEach(g=>{g instanceof zt?w.push(...g.shapes):w.push(g)}),e&&o.filter(g=>w.findIndex(v=>v.id==g.id)==-1).forEach(g=>{g.el&&(g.el.remove(),delete g.el)}),i&&i.clearRect(),P.flushArray(o,w),h="",d.current.isDown||(c="");for(const g of o){if(!g.show)continue;p(g);const v=g.transformOrigin(),_=v.x,M=v.y;if(e){const E=g.toSVGPathD();g.el||(g.el=Qg(E,g.id),Ps(e,g.el));const D=new xt;D.translate(g.x,g.y),D.rotate(g.degree,_,M),D.scale(g.scaleX,g.scaleY,_,M),De(g.el,{d:E,transform:D.toString(),...g.getAttrs()})}if(i&&(i.save(),i.translate(g.x,g.y),i.rotate(J(g.degree),_,M),i.scale(g.scaleX,g.scaleY,_,M),g.toCanvasContext(i),th(i,g.getAttrs()),i.hasSetCustomStrokeStyle&&i.stroke(),i.hasSetCustomFillStyle&&i.fill()),e?g.isMouseIn=g.isPointInPath(e,d.current.x,d.current.y)||g.isPointInStroke(e,d.current.x,d.current.y):i?g.isMouseIn=g.isPointInPath(i,d.current.x,d.current.y)||g.isPointInStroke(i,d.current.x,d.current.y):g.isMouseIn=!1,g.isMouseIn&&(u("pointer"),h=g.id),g.isDragging=g.id==c,d.current.isDown&&(g.isDragging||!c&&g.isMouseIn&&g.drag&&g.drag.enable)){u("grabbing"),g.isDragging=!0,c=g.id;let E=d.current.x-d.start.x,D=d.current.y-d.start.y;if(E||D){if(g.drag&&g.drag.enable&&g.drag.alongPath){const B=g.parent?g.parent.combo.x:g.x,Y=g.parent?g.parent.combo.y:g.y,V=_+(g.parent?.dx||0),$=M+(g.parent?.dy||0),W=g.parent?g.parent.combo.degree:g.degree,Q=g.parent?g.parent.combo.scaleX:g.scaleX,Z=g.parent?g.parent.combo.scaleY:g.scaleY,ft=g.drag.alongPath.transform(B,Y,V,$,W,Q,Z).closestPoint(d.current.x,d.current.y),Et=g.x,It=g.y;console.log(ft.point.x,ft.point.y,Et,It),E=ft.point.x-Et,D=ft.point.y-It,console.log(E,D)}(E||D)&&(g.move(E,D),g.parent?.combo.shapes.forEach(B=>{B.drag?.followSibling&&B!==g&&B.move(E,D)}))}d.setStart(d.current)}else g.isMouseIn&&g.drag&&g.drag.enable&&u("grab");i&&i.restore()}!h&&!c&&u("default")};return{rect:r,mousePoint:d.current,shapes:o,draw:x,ctx:i,unsubscribe:()=>{a.unsubscribe(),f.unsubscribe()},downloadSVG:()=>{e&&t0(e)}}}class Qe extends lt{dx;dy;constructor(t){if(super(t),t?.lineLength){const e=He(J(t?.lineDegree||0),t.lineLength);this.dx=e.dx,this.dy=e.dy}else t?.lineDx||t?.lineDy?(this.dx=t?.lineDx||0,this.dy=t?.lineDy||0):(this.dx=0,this.dy=0)}cloneShape(){return new Qe({...super.getBaseOptions(),lineDx:this.dx,lineDy:this.dy})}toSVGPathData(){return[["m",0,0],["l",this.dx,this.dy]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.dx,this.dy)}lineToAbsolutePoint(t){this.dx=t.x-this.x,this.dy=t.y-this.y}intersection(t){const e=this.transformOrigin(),i=this.pathD().transform(this.x,this.y,e.x,e.y,this.degree,this.scaleX,this.scaleY).normalizedLines[0],r=t.transformOrigin(),o=t.pathD().transform(this.x,this.y,r.x,r.y,t.degree,t.scaleX,t.scaleY).normalizedLines[0];return i.intersection(o)}}class Cr extends zt{constructor(t,e){super(t,e);const s=new Qe({...e,drag:{...e?.drag,followSibling:!0},lineLength:100,lineDegree:90});this.addShape(s);const i=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(i);const r=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(r)}cloneShapeCombo(){return new Cr(this.options,this.commonChildShapeOptions)}}class ts extends lt{radius;constructor(t){super(t),this.radius=t?.ballRadius||0}cloneShape(){return new ts({...super.getBaseOptions(),ballRadius:this.radius})}getBoundingClientRect(){return{x:-this.radius,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 je(this.x,this.y)}scalar(t){return this.moveTo(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=qt(-r,e,s),h=qt(-r,this.vx,this.vy),c=qt(-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 u=Math.abs(h.x)+Math.abs(c.x),d=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/u*d,o.x+=c.x/u*d;const f=qt(r,a.x,a.y),p=qt(r,o.x,o.y);t.moveTo(this.x+p.x,this.y+p.y),this.moveTo(this.x+f.x,this.y+f.y);const x=qt(r,h.x,h.y),b=qt(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.moveXTo(r-this.radius),this.vx*=e):this.x-this.radius<s&&(this.moveXTo(s+this.radius),this.vx*=e),this.y+this.radius>a?(this.moveYTo(a-this.radius),this.vy*=e):this.y-this.radius<i&&(this.moveYTo(i+this.radius),this.vy*=e)}}class Ar extends lt{constructor(t){super(t)}cloneShape(){return new Ar({...super.getBaseOptions()})}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 Ne extends lt{width;height;borderRadius;constructor(t){super(t),this.width=t.rectWidth,this.height=t.rectHeight,this.borderRadius=t.rectBorderRadius||0}cloneShape(){return new Ne({...super.getBaseOptions(),rectWidth:this.width,rectHeight:this.height,rectBorderRadius:this.borderRadius})}static fromCubicBezier(t,e,s,i,r,a,o,h){const l=new pt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h}).getBoundingClientRect();return new Ne({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.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){return t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height}}class Ir extends lt{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Ir({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 kr extends lt{rx;ry;constructor(t){super(t),this.rx=t?.heartRx??50,this.ry=t?.heartRy??50}cloneShape(){return new kr({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 Dr extends lt{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Dr({...super.getBaseOptions(),starR:this.r})}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(J(s)),r=this.r*Math.sin(J(s));t.push(["l",i,r])}return t}}class Rr extends lt{constructor(t){super(t)}cloneShape(){return new Rr({...super.getBaseOptions()})}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 Lr extends lt{constructor(t){super(t)}cloneShape(){return new Lr({...super.getBaseOptions()})}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 Or extends lt{constructor(t){super(t),this.d="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"}cloneShape(){return new Or({...super.getBaseOptions()})}}class zr extends zt{constructor(t,e){super(t,e);const s=new lt({...e,drag:{...e?.drag,followSibling:!0},show:typeof t?.showFlame=="boolean"?t.showFlame:!1,d:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]]});this.addShape(s);const i=new lt({...e,drag:{...e?.drag,followSibling:!0},d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]});this.addShape(i)}cloneShapeCombo(){return new zr({...this.options,showFlame:this.showFlame},this.commonChildShapeOptions)}set showFlame(t){this.shapes[0].show=t}get showFlame(){return this.shapes[0].show}}class Nr extends zt{width;height;cornerRadius;constructor(t,e){super(t,e),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const s=new Ne({...e,drag:{...e?.drag,followSibling:!0},x:0-this.cornerRadius,y:0-this.height*.5,rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(s);const i=new ts({...e,drag:{...e?.drag,followSibling:!0},x:0,y:0,ballRadius:2});this.addShape(i);const r=new ts({...e,drag:{...e?.drag,followSibling:!0},x:0+this.width,y:0,ballRadius:2});this.addShape(r)}cloneShapeCombo(){return new Nr({...this.options,segmentWidth:this.width,segmentHeight:this.height},this.commonChildShapeOptions)}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(J(t.degree))*this.width,y:t.y+Math.sin(J(t.degree))*this.width}}}class Br extends zt{value$=new ls;subscription;constructor(t,e){super(t,e);const s=t?.sliderMin||0,i=t?.sliderMax||100,r=t?.sliderStep||1,a=P.stepNumber(s,i,r),o=a(typeof t?.sliderDefaultValue=="number"?P.clamp(t.sliderDefaultValue,s,i):s);this.value$.next(o);const h=o/(i-s),c=t?.sliderWidth||100,l=t?.sliderHeight||4,u=l*.5,d=l*2.5,f=t?.sliderBackgroundColor||"#f5f5f5",p=t?.sliderForegroundColor||"#5a82f0",x=new Ne({...e,rectWidth:c,rectHeight:l,rectBorderRadius:u,attrs:{...e?.attrs,fill:f},drag:{...e?.drag,enable:!1}});this.addShape(x);const b=new Ne({...e,rectWidth:c*h,rectHeight:l,rectBorderRadius:u,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!1}});this.addShape(b);const w=new ts({...e,x:c*h,y:u,ballRadius:d,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!0,alongPath:new bt([["m",0,0],["l",c,0]])}});this.addShape(w),this.subscription=w.transform$.subscribe(({dx:g})=>{b.width=P.clamp(b.width+(g||0),0,c),this.value$.next(a((w.x-x.x)/c*(i-s)+s))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new Br({...this.options},this.commonChildShapeOptions)}}async function p0(n,t){return new Promise(e=>{new MutationObserver((i,r)=>{t(i,r),e(()=>{r.disconnect()})}).observe(n,{attributes:!0,childList:!0,subtree:!0})})}function mc(n,t={attributes:!0,childList:!0,subtree:!0}){return new et(e=>{const s=new MutationObserver(i=>{e.next(i)});return s.observe(n,t),()=>{s.disconnect()}})}async function g0(n,t,e={threshold:.5}){return new Promise(s=>{new IntersectionObserver((r,a)=>{t(r,a),s(()=>{a.unobserve(n)})},e).observe(n)})}function pc(n,t={threshold:.5}){return new et(e=>{const s=new IntersectionObserver((i,r)=>{e.next(i)},t);return s.observe(n),()=>{s.unobserve(n),s.disconnect()}})}function y0(n,t){return Uh().pipe(fe(null),it(()=>{const{width:e,height:s}=t?.root?.getBoundingClientRect()||Vh(),{top:i,left:r,right:a,bottom:o}=n.getBoundingClientRect();return(i>=0&&i<=s||o>=0&&o<=s)&&(r>=0&&r<=e||a>=0&&a<=e)}),ue())}function w0(n,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return pc(n,{threshold:e,root:t?.root}).pipe(it(s=>{let i=s[0];if(s.length>1){const r=s.find(a=>a.isIntersecting);r&&(i=r)}return i.isIntersecting&&i.intersectionRatio>=e}),ue())}let gc=!1;function x0(){gc||(gc=!0,Ko(`
|
|
17
17
|
:root {
|
|
18
18
|
--sat:env(safe-area-inset-top, 0px);
|
|
19
19
|
--sar:env(safe-area-inset-right, 0px);
|
|
@@ -26,15 +26,15 @@ var ZYZGroupCoreWeb=function(m,P){"use strict";function ia(n){return n&&n.__esMo
|
|
|
26
26
|
--sab:env(safe-area-inset-bottom, 0px);
|
|
27
27
|
--sal:env(safe-area-inset-left, 0px);
|
|
28
28
|
}
|
|
29
|
-
`))}b0();function v0(){return lr(document.documentElement).pipe(di(li),it(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function _0(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new et(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((s,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),s()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(s=>{t.next({longitude:s.coords.longitude,latitude:s.coords.latitude})},s=>{t.error(s)},n)}).catch(s=>{t.error(s)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function vc(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n);return U(t,"change").pipe(it(e=>e.matches),fe(t.matches),ue())}function _c(){return wc(document).pipe(it(()=>location),fe(location))}function S0(){return _c().pipe(it(n=>n.href),fe(location.href),ue())}function T0(){return U(window,"hashchange").pipe(it(n=>n.target.location.hash.replace("#","")),fe(window.location.hash.replace("#","")),ue())}function E0(){return U(window,"popstate").pipe(it(n=>n.state),fe(null),ue())}function P0(n,t,e){if(typeof t=="string"&&(t=P.toCamel(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function M0(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function Br(n,t){const e=Math.max(t?.aliveInSeconds||0,0),s=Math.max(t?.aliveUntilTimestamp||0,0);function i(a,o=!1){return P.isPrimitive(a)||!P.hasSymbol(a,P.SYMBOL_TIMESTAMP)?{v:a,[P.SYMBOL_TIMESTAMP]:P.milliseconds()}:o?a:{...a,[P.SYMBOL_TIMESTAMP]:P.milliseconds()}}let r=i(n,!0);return{get:()=>{let a=r.v;return(e&&P.milliseconds()>r[P.SYMBOL_TIMESTAMP]+e*1e3||s&&P.milliseconds()>s)&&(a=void 0),{value:typeof a<"u"?r:void 0,rawValue:a}},set:a=>r=i(a)}}function Sc(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const o=window.localStorage.getItem(e);o&&(s=P.parse(o))}catch{}const{get:i,set:r}=Br(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),a=P.ref(i().value);return P.watchEffect(()=>{if(typeof a.value<"u")try{window.localStorage.setItem(e,P.stringify(a.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const o=i();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function C0(){window.localStorage.clear()}const{get:Tc,set:A0}=Sc(P.createSymbol("theme")),Ec=new ls,I0=Ec.pipe(fe(void 0));function Pc(n){switch(A0(n),n){case"dark":document.documentElement.classList.add("dark"),Ze(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),Ze(document.documentElement,"data-theme","light");break}return Ec.next(n),n}function k0(){return Pc(Tc()=="dark"?"light":"dark")}function D0(){return Tf([I0,vc("(prefers-color-scheme: dark)")]).pipe(it(([n,t])=>{if(n)return n;const e=Tc();return e||(t?"dark":"light")}))}function R0(n,t=""){return getComputedStyle(document.documentElement).getPropertyValue(n)||t}function L0(n,t){document.documentElement.style.setProperty(n,t)}function O0(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const o=window.sessionStorage.getItem(e);o&&(s=P.parse(o))}catch{}const{get:i,set:r}=Br(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),a=P.ref(i().value);return P.watchEffect(()=>{if(typeof a.value<"u")try{window.sessionStorage.setItem(e,P.stringify(a.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const o=i();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function z0(){window.sessionStorage.clear()}function N0(n,t){const e=P.ref(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return P.watchEffect(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=n+"="+encodeURIComponent(e.value)+s+i+r+a}}),{get:()=>e.value,set:s=>e.value=s}}function B0(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function Y0(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function F0(n,t=1,e){return new Promise((s,i)=>{let r;const a=window.indexedDB.open(n,t);a.onerror=()=>{i("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,Y0(r,e),s(r)}})}function X0(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{i(o)}})}const Yr=new P.CacheMap;function Fr(n,t){return P.objectSignature({url:n,...t})}async function _n(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Fr(n,t),s=new AbortController;Yr.set(e,s);const{responseType:i,onProgress:r,timeout:a}={responseType:"json",timeout:6e4,...t},o=setTimeout(()=>{throw s.abort(),new Error(`${a} ms Timeout!`)},a);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(Yr.delete(e),clearTimeout(o),h.status===200||h.status===0){if(h.status===0&&P.warnLog("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,d=u!==0;let f=0;const p=new ReadableStream({start(x){function b(){c.read().then(({done:w,value:g})=>{w?x.close():(f+=g.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:d,loaded:f,total:u})),x.enqueue(g),b())}).catch(w=>{x.error(w)})}b()}});h=new Response(p)}switch(i){case"arraybuffer":return await h.arrayBuffer();case"blob":return await h.blob();case"json":return await h.json();case"text":default:return await h.text()}}else return Promise.reject(h)}function U0(n,t){const e=Yr.get(Fr(n,t));e&&e.abort()}function V0(n=3,t){return P.retry(_n,n,t)}function $0(n=6e4){return P.cache(_n,n)}function G0(n=6e4,t=3,e){return P.cache(P.retry(_n,t,e),n)}const q0={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?"下午":"晚上"}},j0={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]}]`}},be=new P.CacheMap;let Sn="zh-cn";Xr(j0),Xr(q0);function Xr(n,t){if(!n)return be.get(Sn);let e;if(typeof n=="string"){const s=n.toLowerCase();if(be.get(s))e=s;else if(t)be.set(s,t),e=s;else return be.get(Sn)}else{const{name:s}=n;be.set(s,n),e=s}return e&&(Sn=e),be.get(e)||be.get(Sn)}function Be(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function Tn(n){return Be(n.tagName,Hi(n),Array.from(n.children).map(t=>Tn(t)),n)}function es(n,t=document.documentElement){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):e==="style"?mn(n.el,n.props[e]):Ze(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{es(e,n.el)})),t.appendChild(n.el),n.el}function En(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(es(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 if(o==="style"){for(const l in h)l in c||ji(e,l);mn(e,c)}else Ze(e,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=>{es(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)En(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{es(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class H0{state;el;constructor(t,e){this.state=P.reactive(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if(er(s)){const l=s;P.watchEffect(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(tr(s)){const l=s;P.watchEffect(()=>{l.checked=P.isInArray(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const d=u.target,f=d.value;d.checked?P.appendUniqueArray(this.getStateValue(c),f):P.deleteArrayItem(this.getStateValue(c),f)})}else if(Qi(s)){const l=s;P.watchEffect(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=s;P.watchEffect(()=>{l.value=this.getStateValue(c)});const u=d=>{this.setStateValue(c,d.target.value)};l.addEventListener("input",u)}else h==="v-text"?P.watchEffect(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&P.watchEffect(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(i);a&&a[1]&&P.watchEffect(()=>{e.textContent=i.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let a=0;a<r-1;a++)s=s[i[a]];s[i[r-1]]=e}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){
|
|
29
|
+
`))}x0();function b0(){return ur(document.documentElement).pipe(mi(ui),it(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function v0(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new et(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((s,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),s()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(s=>{t.next({longitude:s.coords.longitude,latitude:s.coords.latitude})},s=>{t.error(s)},n)}).catch(s=>{t.error(s)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function yc(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n);return U(t,"change").pipe(it(e=>e.matches),fe(t.matches),ue())}function wc(){return mc(document).pipe(it(()=>location),fe(location))}function _0(){return wc().pipe(it(n=>n.href),fe(location.href),ue())}function S0(){return U(window,"hashchange").pipe(it(n=>n.target.location.hash.replace("#","")),fe(window.location.hash.replace("#","")),ue())}function T0(){return U(window,"popstate").pipe(it(n=>n.state),fe(null),ue())}function E0(n,t,e){if(typeof t=="string"&&(t=P.toCamel(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function P0(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function Yr(n,t){const e=Math.max(t?.aliveInSeconds||0,0),s=Math.max(t?.aliveUntilTimestamp||0,0);function i(a,o=!1){return P.isPrimitive(a)||!P.hasSymbol(a,P.SYMBOL_TIMESTAMP)?{v:a,[P.SYMBOL_TIMESTAMP]:P.milliseconds()}:o?a:{...a,[P.SYMBOL_TIMESTAMP]:P.milliseconds()}}let r=i(n,!0);return{get:()=>{let a=r.v;return(e&&P.milliseconds()>r[P.SYMBOL_TIMESTAMP]+e*1e3||s&&P.milliseconds()>s)&&(a=void 0),{value:typeof a<"u"?r:void 0,rawValue:a}},set:a=>r=i(a)}}function xc(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const o=window.localStorage.getItem(e);o&&(s=P.parse(o))}catch{}const{get:i,set:r}=Yr(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),a=P.ref(i().value);return P.watchEffect(()=>{if(typeof a.value<"u")try{window.localStorage.setItem(e,P.stringify(a.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const o=i();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function M0(){window.localStorage.clear()}const{get:bc,set:C0}=xc(P.createSymbol("theme")),vc=new ls,A0=vc.pipe(fe(void 0));function _c(n){switch(C0(n),n){case"dark":document.documentElement.classList.add("dark"),Ze(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),Ze(document.documentElement,"data-theme","light");break}return vc.next(n),n}function I0(){return _c(bc()=="dark"?"light":"dark")}function k0(){return Sf([A0,yc("(prefers-color-scheme: dark)")]).pipe(it(([n,t])=>{if(n)return n;const e=bc();return e||(t?"dark":"light")}))}function D0(n,t=""){return getComputedStyle(document.documentElement).getPropertyValue(n)||t}function R0(n,t){document.documentElement.style.setProperty(n,t)}function L0(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const o=window.sessionStorage.getItem(e);o&&(s=P.parse(o))}catch{}const{get:i,set:r}=Yr(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),a=P.ref(i().value);return P.watchEffect(()=>{if(typeof a.value<"u")try{window.sessionStorage.setItem(e,P.stringify(a.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const o=i();return a.value=o.value,o.rawValue},set:o=>a.value=r(o)}}function O0(){window.sessionStorage.clear()}function z0(n,t){const e=P.ref(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return P.watchEffect(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=n+"="+encodeURIComponent(e.value)+s+i+r+a}}),{get:()=>e.value,set:s=>e.value=s}}function N0(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function B0(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function Y0(n,t=1,e){return new Promise((s,i)=>{let r;const a=window.indexedDB.open(n,t);a.onerror=()=>{i("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,B0(r,e),s(r)}})}function F0(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{i(o)}})}const Fr=new P.CacheMap;function Xr(n,t){return P.objectSignature({url:n,...t})}async function _n(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Xr(n,t),s=new AbortController;Fr.set(e,s);const{responseType:i,onProgress:r,timeout:a}={responseType:"json",timeout:6e4,...t},o=setTimeout(()=>{throw s.abort(),new Error(`${a} ms Timeout!`)},a);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(Fr.delete(e),clearTimeout(o),h.status===200||h.status===0){if(h.status===0&&P.warnLog("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,d=u!==0;let f=0;const p=new ReadableStream({start(x){function b(){c.read().then(({done:w,value:g})=>{w?x.close():(f+=g.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:d,loaded:f,total:u})),x.enqueue(g),b())}).catch(w=>{x.error(w)})}b()}});h=new Response(p)}switch(i){case"arraybuffer":return await h.arrayBuffer();case"blob":return await h.blob();case"json":return await h.json();case"text":default:return await h.text()}}else return Promise.reject(h)}function X0(n,t){const e=Fr.get(Xr(n,t));e&&e.abort()}function U0(n=3,t){return P.retry(_n,n,t)}function V0(n=6e4){return P.cache(_n,n)}function $0(n=6e4,t=3,e){return P.cache(P.retry(_n,t,e),n)}const G0={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?"下午":"晚上"}},q0={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]}]`}},be=new P.CacheMap;let Sn="zh-cn";Ur(q0),Ur(G0);function Ur(n,t){if(!n)return be.get(Sn);let e;if(typeof n=="string"){const s=n.toLowerCase();if(be.get(s))e=s;else if(t)be.set(s,t),e=s;else return be.get(Sn)}else{const{name:s}=n;be.set(s,n),e=s}return e&&(Sn=e),be.get(e)||be.get(Sn)}function Be(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function Tn(n){return Be(n.tagName,Wi(n),Array.from(n.children).map(t=>Tn(t)),n)}function es(n,t=document.documentElement){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):e==="style"?mn(n.el,n.props[e]):Ze(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{es(e,n.el)})),t.appendChild(n.el),n.el}function En(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(es(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 if(o==="style"){for(const l in h)l in c||Hi(e,l);mn(e,c)}else Ze(e,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=>{es(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)En(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{es(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class j0{state;el;constructor(t,e){this.state=P.reactive(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if(sr(s)){const l=s;P.watchEffect(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(er(s)){const l=s;P.watchEffect(()=>{l.checked=P.isInArray(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const d=u.target,f=d.value;d.checked?P.appendUniqueArray(this.getStateValue(c),f):P.deleteArrayItem(this.getStateValue(c),f)})}else if(tr(s)){const l=s;P.watchEffect(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=s;P.watchEffect(()=>{l.value=this.getStateValue(c)});const u=d=>{this.setStateValue(c,d.target.value)};l.addEventListener("input",u)}else h==="v-text"?P.watchEffect(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&P.watchEffect(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(i);a&&a[1]&&P.watchEffect(()=>{e.textContent=i.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let a=0;a<r-1;a++)s=s[i[a]];s[i[r-1]]=e}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){
|
|
30
30
|
let output = "";
|
|
31
31
|
function echo(html){
|
|
32
32
|
output += html;
|
|
33
33
|
}
|
|
34
34
|
${t}
|
|
35
35
|
return output;
|
|
36
|
-
})`}}class
|
|
37
|
-
`)):d.send(Object.entries(r).map(([v,_])=>`${encodeURIComponent(v)}=${encodeURIComponent(_)}`).join("&"));break}})}async function
|
|
36
|
+
})`}}class H0{requestid=0;url;socket;waitings={};messageQueue=[];constructor(t){this.url=t,this._connect()}_connect(){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send)},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;console.log(`ws(${this.url}) closed : ${e} ${s} ${i}`)},this.socket.onerror=t=>{console.log(`ws(${this.url}) error : ${t.type}`)},this.socket.onmessage=t=>{if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitings[e.requestid];s&&s.resolve?.(e)}}catch{}else t.data instanceof ArrayBuffer||t.data instanceof Blob}}_send(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):(this.messageQueue.push(t),this._connect())}open(){this._connect()}close(){this.socket&&this.socket.close()}async send(t,e=5e3){this.requestid++;const s=this.waitings[this.requestid]={requestid:this.requestid};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._send(i),setTimeout(()=>{o("Timeout!")},e)});return delete this.waitings[this.requestid],r}}function W0(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 Pn(n=window.location.href){try{return new URL(n)}catch{const e="(?<protocol>https?:)",s="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",a="(?<hash>(?:#.*)?)",h=new RegExp(`^${e}//${s}${i}${r}${a}$`).exec(n);return{href:n,protocol:h?.groups?.protocol??"",host:h?.groups?.host??"",hostname:h?.groups?.hostname??"",port:h?.groups?.port??"",pathname:h?.groups?.pathname??"",search:h?.groups?.search??"",hash:h?.groups?.hash??""}}}function J0(n){const t=Pn(n);return t.protocol==="http:"||t.protocol==="https:"}function Sc(n=window.location.href){const t=Pn(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Z0(n=Pn().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}const K0=(n=window.location.href)=>JSON.parse('{"'+decodeURI(n.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');function Mn(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function Tc(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Ec(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Q0(n,t){return Ec(n,Mn(t))}function Vr(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function t1(n,t){return Vr(n,Mn(t))}class e1{worker;cbs={};constructor(t){if(Ao)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 s1{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){P.deleteArrayItem(this.port1MessageCbs,t)}offPort1MessageError(t){P.deleteArrayItem(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){P.deleteArrayItem(this.port2MessageCbs,t)}offPort2MessageError(t){P.deleteArrayItem(this.port2MessageErrorCbs,t)}}function Pc(){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 n1(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:u=3e4}=t||{},d=Pc();d.timeout=u,d.responseType=l,d.onreadystatechange=function(g){d.readyState===4&&(d.status===200?e(d.response):s(d.statusText))},d.ontimeout=()=>{s(`${n} is timed out for ${u}ms.`)},d.addEventListener("load",g=>t?.load?.(g,d),!1),d.addEventListener("loadstart",g=>t?.loadstart?.(g,d),!1),d.addEventListener("loadend",g=>t?.loadend?.(g,d),!1),d.addEventListener("progress",g=>{if(g.lengthComputable){const v=Math.round(g.loaded*100/g.total);t?.progress?.(g,d,v)}},!1),d.addEventListener("error",g=>t?.error?.(g,d),!1),d.addEventListener("abort",g=>t?.abort?.(g,d),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,x=!1,b=!1;function w(){c&&(d.withCredentials=!0);for(const g in h)P.toKebab(g).toLowerCase()=="content-type"&&h[g].toLowerCase()=="multipart/form-data"?(p=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(P.toKebab(g).toLowerCase()=="content-type"&&(h[g].toLowerCase().indexOf("text/plain")>=0?x=!0:h[g].toLowerCase().indexOf("application/json")>=0&&(b=!0)),d.setRequestHeader(g,h[g]))}switch(f){case"GET":let g="";r instanceof FormData?g=Tc(r):g=Mn(r),d.open("GET",Vr(n,g),!0),w(),d.send(null);break;default:d.open(f,n,!0),w(),p?d.sendAsBinary(a):b?d.send(JSON.stringify(r)):x?d.send(Object.entries(r).map(([v,_])=>`${v}=${_}`).join(`\r
|
|
37
|
+
`)):d.send(Object.entries(r).map(([v,_])=>`${encodeURIComponent(v)}=${encodeURIComponent(_)}`).join("&"));break}})}async function i1(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 u=0,d=h.files?.length||0;u<d;u++){const f=h.files?.[u];if(f){const p=await os(f,P.ReadInBrowserEnum.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
|
|
38
38
|
Content-Type: `+f.type+`\r
|
|
39
39
|
\r
|
|
40
40
|
`+p+`\r
|
|
@@ -44,9 +44,9 @@ Content-Type: `+f.type+`\r
|
|
|
44
44
|
`):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
45
45
|
`+e.join("--"+t.boundary+`\r
|
|
46
46
|
`)+"--"+t.boundary+`--\r
|
|
47
|
-
`,t}class
|
|
47
|
+
`,t}class r1 extends pr{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=gr(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const 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(const 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),Gr(this.currentItem.style,this.currentItem,qr)}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&&Gr(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+$r(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(const r in e){const a=e[r];if(qr.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"&&Gr(a,this.currentItem,qr),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 $r(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 $r(n,t,i,r)-$r(e,s,i,r)}function Gr(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){const 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 qr=["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 a1{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Is(t),this.remoteVideoUtil=new Is(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:
|
|
48
48
|
${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:
|
|
49
49
|
${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:
|
|
50
50
|
${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:
|
|
51
|
-
${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 h1{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.")}}const kc=[],Dc={};function qr(n){kc.push(n)}function c1(n,t=!1){const e=Mc();if(Dc[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{kc.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})),Dc[e]=!0}function l1(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 u1(n){qr(function(){wx.updateAppMessageShareData(n)})}function f1(n){qr(function(){wx.updateTimelineShareData(n)})}function d1(n){wx.chooseImage(n)}function m1(n){wx.previewImage(n)}function p1(n){wx.uploadImage(n)}function g1(n){wx.downloadImage(n)}function y1(n){wx.getLocalImgData(n)}function w1(){wx.startRecord()}function x1(n){wx.stopRecord(n)}function b1(n){wx.onVoiceRecordEnd(n)}function v1(n){wx.playVoice(n)}function _1(n){wx.pauseVoice(n)}function S1(n){wx.stopVoice(n)}function T1(n){wx.onVoicePlayEnd(n)}function E1(n){wx.uploadVoice(n)}function P1(n){wx.downloadVoice(n)}function M1(n){wx.translateVoice(n)}function C1(n){wx.getNetworkType(n)}function A1(n){wx.openLocation(n)}function I1(n){wx.getLocation(n)}function k1(n){wx.scanQRCode(n)}function D1(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 R1(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function L1(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Rs(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 O1(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 z1(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(s){t?.(s.code)})}function N1(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(s){t?.(s)})}function B1(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(){t?.()})}function Y1(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Rs(s,"chooseImage"))}}),function(s){t?.(s)})}function F1(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(){t?.()})}class X1{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 U1{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(),es(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Be("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?Be("span",{class:`current ${r}`},i):Be("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(Be("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(Be("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"}),En(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)}}return m.ActionChannel=Wg,m.ArrowShape=Cr,m.BallShape=ts,m.BezierEasing=Mi,m.BufferAttribute=se,m.COLOR_NAMES=Ds,m.CSSToJSEasing=Rd,m.Clock=Ii,m.Color=Bt,m.ColorManagement=Tr,m.CommonKeyCode=Yg,m.CrossShape=Lr,m.CustomCanvasContext=jo,m.CustomCanvasGradient=un,m.CustomCanvasPattern=Ri,m.DOMParse=mr,m.DOMSVGUtil=Ie,m.DOMToBlob=ei,m.DOMToString=ti,m.DOMVideo=Is,m.Easing=z,m.FetchWithAxios=Ga,m.FetchWithAxiosRequestCancel=qa,m.FileUpload=Iu,m.Float32BufferAttribute=Qm,m.FoxShape=Dr,m.HeartShape=Ar,m.HeartVariantShape=Ir,m.Int16BufferAttribute=Wm,m.Int32BufferAttribute=Zm,m.Int8BufferAttribute=qm,m.Interpolation=te,m.LineShape=Qe,m.LinearSRGBColorSpace=_r,m.LinearToSRGB=Oe,m.LinearTransfer=Sr,m.Ls=be,m.MVVM=H0,m.Matrix=xt,m.Matrix2=Xi,m.Matrix3=We,m.Matrix4=Ct,m.NoColorSpace=uc,m.Pagination=U1,m.QRCode=xe,m.RabbitShape=Rr,m.RectShape=Ne,m.SRGBColorSpace=ze,m.SRGBToLinear=Le,m.SRGBTransfer=vn,m.SVGParse=a1,m.SVGParsedPathArgsLength=xs,m.SegmentShapeCombo=zr,m.Shape=lt,m.ShapeCombo=zt,m.ShipShapeCombo=Or,m.SliderShapeCombo=Nr,m.StarShape=kr,m.TWEEN=Xd,m.Timeline=ps,m.TreeShapeCombo=Mr,m.Tween=Ai,m.Uint16BufferAttribute=Jm,m.Uint32BufferAttribute=Km,m.Uint8BufferAttribute=jm,m.Uint8ClampedBufferAttribute=Hm,m.Vector2=bs,m.Vector3=Rt,m.Vector4=Bi,m.WebGLCoordinateSystem=vs,m.WebGLRenderer=h1,m.WebGPUCoordinateSystem=Fi,m.WebRTCClient=o1,m.WebSocketClient=W0,m.YZCanvasContext=Li,m.YZMessageChannel=n1,m.YZWorker=s1,m.__color=ie,m.addClass=Np,m.addWatermark=Fm,m.addWxJsReadyFnBeforeConfig=qr,m.ajax=i1,m.aliJsChooseImage=Y1,m.aliJsGetLocation=N1,m.aliJsOpenLocation=B1,m.aliJsPreviewImage=F1,m.aliJsReady=L1,m.aliJsScan=z1,m.aliJsTradePay=O1,m.angle=$t,m.animateShapes=h0,m.animateSpringChainShapes=l0,m.animateSpringConnectShapes=u0,m.animateSpringMassShapes=f0,m.animationEnd$=_g,m.animationStart$=vg,m.appendURL=Ur,m.appendURLRecord=e1,m.atomReadAttribute=nh,m.atomReadAttributes=Hi,m.atomReadStyle=im,m.atomReadStyles=qi,m.atomRemoveAttribute=om,m.atomRemoveDataset=M0,m.atomRemoveStyle=ji,m.atomWriteAttribute=Ze,m.atomWriteStyle=mn,m.base64EncodeOutputStream=hh,m.bitmapMapper=mh,m.blobToImageData=fm,m.byteArrayOutputStream=Ji,m.canDrawBitmap=Lo,m.canUsePaths=pd,m.canUseWorker=Ro,m.cancelBubble=Po,m.cancelFetch=U0,m.changeBrightness=Bm,m.changeCheckboxChecked=Dp,m.changeDiaphaneity=Ym,m.changeRadioChecked=kp,m.changeSelected=Ip,m.changeSize=Nm,m.checkWxJsApi=l1,m.clearCookies=B0,m.clearLocalStorage=C0,m.clearSessionStorage=z0,m.closest=Ep,m.combineTransformToMatrix=rm,m.compareVersion=td,m.computeImageDisplayRect=hm,m.containsChild=vp,m.createDefaultMousePoint=nr,m.createElement=Ph,m.createElementNS=Fp,m.createFragment=Eh,m.createIndexDB=F0,m.createObjectURL=ph,m.createRunCycleInMaxRate=bd,m.createTextNode=Xp,m.createXMLHttpRequest=Ic,m.cssAttrsToCanvasAttrs=ih,m.distance=pe,m.domPrefixes=am,m.drag$=Oh,m.dragEnd$=Nh,m.dragEnter$=Yh,m.dragLeave$=Fh,m.dragOver$=Xh,m.dragStart$=zh,m.drawBitmapInCanvas=ep,m.drawQRCodeToCanvas=Gm,m.drop$=Bh,m.easeNameToCubicBezier=Ci,m.empty=_h,m.fireEvent=Jf,m.flipSideToSide=mm,m.flipUpsideDown=pm,m.flushURL=Ac,m.flushURLRecord=t1,m.formDataToSearch=Cc,m.generateRosettaShape=m0,m.getBitmapFromCanvas=tp,m.getBodyPosition=Dg,m.getBrowserClient=xi,m.getBrowserClientVersion=ed,m.getBrowserLanguage=sd,m.getCSSVar=R0,m.getDOMMatrix=$i,m.getDirection=$d,m.getDocumentElementPosition=Ms,m.getElementPositionInPage=hr,m.getElementPositionInPage2=Lg,m.getElementPositionInViewport=Hh,m.getEmSize=yp,m.getFetchId=Fr,m.getFileExtension=Cu,m.getFileMD5Hash=Ha,m.getFileTypeFromFile=Mu,m.getFormSubmitData=r1,m.getImageData=rh,m.getImageDataByAIData=Um,m.getImageMainColor=dm,m.getInnerText=Lp,m.getInternetExplorerVersion=Ao,m.getKeyCode=Fg,m.getMIME=Au,m.getMouseButton=Bg,m.getMousePositionInElement=ct,m.getMousePositionInPage=cr,m.getMousePositionInViewport=Ng,m.getOperatingSystem=nn,m.getOperatingSystemVersion=Qf,m.getPageSize=Rg,m.getParameters=Q0,m.getPolymorphShapeCombosInterpolator=yc,m.getPolymorphShapesInterpolator=Pr,m.getRelativeBoundingClientRect=Og,m.getRemSize=Zi,m.getScreenPosition=kg,m.getSelectedText=hp,m.getStyle=ke,m.getTheme$=D0,m.getTimeZone=nd,m.getURL=Pn,m.getVerticalScrollPercentInPage=zg,m.getViewportSize=jh,m.getVnode=ki,m.gifImage=ch,m.gravitateShapes=c0,m.h=Be,m.hFromEl=Tn,m.hasClass=Yp,m.hasDocument=fd,m.hasHistory=dd,m.hasWindow=Do,m.hideEl=Th,m.html=vh,m.iframePostMessage=Up,m.imageDataToBitmap=cm,m.imageDataToBlob=um,m.imageDataToDataURL=lm,m.immediateVnode=Ud,m.injectStyle=sh,m.injectWxJsConfig=c1,m.insert=Ps,m.isActiveEl=pp,m.isAliBrowser=ko,m.isAliMiniProgram=ud,m.isAndroid=Co,m.isAppleDevice=id,m.isBrowserSupportFileAPI=md,m.isElement=gd,m.isEventSupported=Kf,m.isIE=ad,m.isIE10=hd,m.isIE11=cd,m.isIE9=od,m.isIOS=bi,m.isInput=Es,m.isInputCheckbox=tr,m.isInputNumber=Ap,m.isInputRadio=er,m.isInputText=Cp,m.isMacOS=Mo,m.isMobile=rd,m.isNative=rn,m.isRootEl=mp,m.isSelect=Qi,m.isTextArea=Mp,m.isTouchSupport=wd,m.isURL=Z0,m.isWxBrowser=Io,m.isWxMiniProgram=ld,m.jpgToPng=Rm,m.keyDown$=Uh,m.keyPress$=Sg,m.keyUp$=Vh,m.leftRotate=gm,m.length=je,m.mapTDTJSSDK=X1,m.marginSharpen=Dm,m.microTask=Td,m.mosaic=Xm,m.mount=es,m.mouseClick$=Hp,m.mouseContextMenu$=Zp,m.mouseDoubleClick$=Wp,m.mouseDown$=Ah,m.mouseEnter$=qp,m.mouseLeave$=jp,m.mouseMove$=yn,m.mouseOut$=Gp,m.mouseOver$=$p,m.mouseUp$=Ih,m.mouseWheel$=Jp,m.nearestElement=wp,m.nextElementSibling=Sp,m.nextTick=Sd,m.normalizePoint=Vd,m.objectSignature=$a,m.onBeforeUnload=yh,m.onDocumentReady=gh,m.outputGifBase64=lh,m.outputQRCodeBase64=$m,m.pan$=Kp,m.panCancel$=sg,m.panDown$=ag,m.panEnd$=eg,m.panLeft$=ng,m.panMove$=Qp,m.panRight$=ig,m.panStart$=tg,m.panUp$=rg,m.parent=xp,m.parents=Ki,m.parseCSS=pr,m.parseTransformToMatrix=Vi,m.patch=En,m.pinch$=og,m.pinchIn$=hg,m.pinchOut$=cg,m.pngToJpg=Lm,m.pointerCancel$=or,m.pointerDown$=rr,m.pointerMove$=ir,m.pointerUp$=ar,m.polar=He,m.polymorphShapesTween=d0,m.prefixes=yd,m.press$=lg,m.preventDefault=de,m.previousElementSibling=Tp,m.radiusClip=zm,m.readFileInBrowser=os,m.recordToSearch=Mn,m.rectClip=Om,m.rem2px=gp,m.remove=Op,m.removeClass=Bp,m.requestAnimationFrameCycle=vi,m.reverseCSSToJSEasing=Ld,m.reverseEaseNameToCubicBezier=Uo,m.reverseEasing=No,m.revokeObjectURL=sp,m.rightRotate=ym,m.rotate$=ug,m.rotatePoint=qt,m.scheduleIdle=Oo,m.scheduleVnode=Di,m.scheduleYZIdle=Ei,m.scrollParent=bp,m.scrollTo=fp,m.searchToRecord=K0,m.selectFileInBrowser=si,m.setCSSVar=L0,m.setIntervalAccurate=xd,m.setManualScroll=dp,m.setRem=J0,m.setStyle=Gi,m.setTheme=Pc,m.setTimeoutAccurate=_i,m.setWindowTitle=cp,m.shadowRoot=Pp,m.sharpen=km,m.showEl=Sh,m.siblings=_p,m.signature=Va,m.simulateMouseEventFromTouch=Zf,m.stringToDOM=Pu,m.swipe$=fg,m.swipeDown$=gg,m.swipeLeft$=dg,m.swipeRight$=mg,m.swipeUp$=pg,m.tap$=yg,m.tapOutSide$=wg,m.text=Rp,m.toBlackAndWhite=bm,m.toBlue=Tm,m.toBlueAndGreen=Mm,m.toBlueAndGrey=Im,m.toDegree=_t,m.toGreen=Sm,m.toGreenAndGrey=Am,m.toGrey=wm,m.toGrey2=xm,m.toOpposite=vm,m.toRadian=J,m.toRed=_m,m.toRedAndBlue=Pm,m.toRedAndGreen=Em,m.toRedAndGrey=Cm,m.toggleClass=sr,m.toggleElDisplay=zp,m.toggleTheme=k0,m.touchCancel$=Lh,m.touchEnd$=Rh,m.touchMove$=kh,m.touchStart$=Dh,m.transformPath2D=nm,m.transitionEnd$=bg,m.transitionStart$=xg,m.trimHash=Mc,m.useAttribute=De,m.useClickA=gn,m.useClipboard=up,m.useCookie=N0,m.useCoords$=_0,m.useDataset=P0,m.useDraggable=Cg,m.useDraw=p0,m.useDrop=Ag,m.useElementEventBus=qg,m.useEvent$=U,m.useEventListener=j,m.useFetch=_n,m.useFetchCache=$0,m.useFetchRetry=V0,m.useFetchRetryCache=G0,m.useHashChange$=T0,m.useHotKeyDown$=Jh,m.useHotKeyFile=Ug,m.useHotKeyFile$=Zh,m.useHotKeyUp$=Xg,m.useIntersection=y0,m.useIntersection$=xc,m.useLoadImage=xh,m.useLoadLink=ip,m.useLoadScript=np,m.useLocalStorage=Sc,m.useLocale=Xr,m.useLocation$=_c,m.useMatchMedia$=vc,m.useMouseAndPointerDownMovePoint$=Gh,m.useMouseDownMovePoint$=Eg,m.useMouseMovePoint$=Tg,m.useMousePoint=Re,m.useMutation=g0,m.useMutation$=wc,m.usePointerDownMovePoint$=$h,m.usePopStateChange$=E0,m.usePressDownMove=Qh,m.usePressDownMoveWithMouse=jg,m.usePressDownMoveWithPointer=tc,m.usePressDownMoveWithTouch=Hg,m.usePull$=Mg,m.useResize=Kh,m.useResize$=lr,m.useRunInSandbox=Vp,m.useSafeArea$=v0,m.useScroll$=qh,m.useSelectFile=bh,m.useSelectFileImage=op,m.useSessionStorage=O0,m.useTimestampValue=Br,m.useTouchDownMovePoint$=Pg,m.useUrlChange$=S0,m.useVisible$=x0,m.useVisibleSimple$=w0,m.useWindowResize=Vg,m.useWindowResize$=$g,m.useWindowVisible$=Ig,m.vibrate=lp,m.waitForStyleSheetsLoaded=rp,m.writeToIndexDB=X0,m.wxJsChooseImage=d1,m.wxJsDownloadImage=g1,m.wxJsDownloadVoice=P1,m.wxJsGetLocalImgData=y1,m.wxJsGetLocation=I1,m.wxJsGetNetworkType=C1,m.wxJsLogin=R1,m.wxJsOnVoicePlayEnd=T1,m.wxJsOnVoiceRecordEnd=b1,m.wxJsOpenLocation=A1,m.wxJsPauseVoice=_1,m.wxJsPay=D1,m.wxJsPlayVoice=v1,m.wxJsPreviewImage=m1,m.wxJsScanQRCode=k1,m.wxJsStartRecord=w1,m.wxJsStopRecord=x1,m.wxJsStopVoice=S1,m.wxJsTranslateVoice=M1,m.wxJsUpdateAppMessageShareData=u1,m.wxJsUpdateTimelineShareData=f1,m.wxJsUploadImage=p1,m.wxJsUploadVoice=E1,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({},ZYZGroupCoreCommon);
|
|
51
|
+
${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 o1{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.")}}const Mc=[],Cc={};function jr(n){Mc.push(n)}function h1(n,t=!1){const e=Sc();if(Cc[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{Mc.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})),Cc[e]=!0}function c1(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 l1(n){jr(function(){wx.updateAppMessageShareData(n)})}function u1(n){jr(function(){wx.updateTimelineShareData(n)})}function f1(n){wx.chooseImage(n)}function d1(n){wx.previewImage(n)}function m1(n){wx.uploadImage(n)}function p1(n){wx.downloadImage(n)}function g1(n){wx.getLocalImgData(n)}function y1(){wx.startRecord()}function w1(n){wx.stopRecord(n)}function x1(n){wx.onVoiceRecordEnd(n)}function b1(n){wx.playVoice(n)}function v1(n){wx.pauseVoice(n)}function _1(n){wx.stopVoice(n)}function S1(n){wx.onVoicePlayEnd(n)}function T1(n){wx.uploadVoice(n)}function E1(n){wx.downloadVoice(n)}function P1(n){wx.translateVoice(n)}function M1(n){wx.getNetworkType(n)}function C1(n){wx.openLocation(n)}function A1(n){wx.getLocation(n)}function I1(n){wx.scanQRCode(n)}function k1(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 D1(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function R1(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Rs(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 L1(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 O1(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(s){t?.(s.code)})}function z1(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(s){t?.(s)})}function N1(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(){t?.()})}function B1(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Rs(s,"chooseImage"))}}),function(s){t?.(s)})}function Y1(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Rs(s))}}),function(){t?.()})}class F1{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)}}const Ac=window.crypto.subtle;Ac||console.warn("Crypto API not supported");async function Ic(n,t="SHA-256"){const e=await Ac.digest(t,P.getUint8ArrayFromString(n));return P.getStringFromArrayBuffer(e)}async function X1(n,t="SHA-256"){const e=JSON.stringify(P.getSortedObjectString(n));return Ic(e,t)}class U1{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(),es(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Be("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?Be("span",{class:`current ${r}`},i):Be("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(Be("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(Be("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"}),En(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)}}class V1{config={};axios;constructor(t={}){this.config={...t},this.axios=new ti({baseURL:this.config.baseURL,timeout:this.config.timeout,headers:this.config.headers,responseType:this.config.responseType,responseEncoding:this.config.responseEncoding,interceptor:this.config.interceptor})}}return m.ActionChannel=Hg,m.ArrowShape=Ar,m.BallShape=ts,m.BezierEasing=Ci,m.BufferAttribute=se,m.COLOR_NAMES=Ds,m.CSSToJSEasing=Dd,m.Clock=ki,m.Color=Bt,m.ColorManagement=Er,m.CommonKeyCode=Bg,m.Context=V1,m.CrossShape=Or,m.CustomCanvasContext=Vo,m.CustomCanvasGradient=un,m.CustomCanvasPattern=Li,m.DOMParse=pr,m.DOMSVGUtil=Ie,m.DOMToBlob=si,m.DOMToString=ei,m.DOMVideo=Is,m.Easing=z,m.FetchWithAxios=ti,m.FileUpload=Au,m.Float32BufferAttribute=Km,m.FoxShape=Rr,m.HeartShape=Ir,m.HeartVariantShape=kr,m.Int16BufferAttribute=Hm,m.Int32BufferAttribute=Jm,m.Int8BufferAttribute=Gm,m.Interpolation=te,m.LineShape=Qe,m.LinearSRGBColorSpace=Sr,m.LinearToSRGB=Oe,m.LinearTransfer=Tr,m.Ls=be,m.MVVM=j0,m.Matrix=xt,m.Matrix2=Ui,m.Matrix3=We,m.Matrix4=Ct,m.NoColorSpace=oc,m.Pagination=U1,m.QRCode=xe,m.RabbitShape=Lr,m.RectShape=Ne,m.SRGBColorSpace=ze,m.SRGBToLinear=Le,m.SRGBTransfer=vn,m.SVGParse=r1,m.SVGParsedPathArgsLength=xs,m.SegmentShapeCombo=Nr,m.Shape=lt,m.ShapeCombo=zt,m.ShipShapeCombo=zr,m.SliderShapeCombo=Br,m.StarShape=Dr,m.TWEEN=Fd,m.Timeline=ps,m.TreeShapeCombo=Cr,m.Tween=Ii,m.Uint16BufferAttribute=Wm,m.Uint32BufferAttribute=Zm,m.Uint8BufferAttribute=qm,m.Uint8ClampedBufferAttribute=jm,m.Vector2=bs,m.Vector3=Rt,m.Vector4=Yi,m.WebGLCoordinateSystem=vs,m.WebGLRenderer=o1,m.WebGPUCoordinateSystem=Xi,m.WebRTCClient=a1,m.WebSocketClient=H0,m.YZCanvasContext=Oi,m.YZMessageChannel=s1,m.YZWorker=e1,m.__color=ie,m.addClass=zp,m.addWatermark=Ym,m.addWxJsReadyFnBeforeConfig=jr,m.ajax=n1,m.aliJsChooseImage=B1,m.aliJsGetLocation=z1,m.aliJsOpenLocation=N1,m.aliJsPreviewImage=Y1,m.aliJsReady=R1,m.aliJsScan=O1,m.aliJsTradePay=L1,m.angle=$t,m.animateShapes=o0,m.animateSpringChainShapes=c0,m.animateSpringConnectShapes=l0,m.animateSpringMassShapes=u0,m.animationEnd$=vg,m.animationStart$=bg,m.appendURL=Vr,m.appendURLRecord=t1,m.atomReadAttribute=Qo,m.atomReadAttributes=Wi,m.atomReadStyle=nm,m.atomReadStyles=ji,m.atomRemoveAttribute=am,m.atomRemoveDataset=P0,m.atomRemoveStyle=Hi,m.atomWriteAttribute=Ze,m.atomWriteStyle=mn,m.base64EncodeOutputStream=ih,m.bitmapMapper=lh,m.blobToImageData=um,m.byteArrayOutputStream=Zi,m.canDrawBitmap=Io,m.canUsePaths=md,m.canUseWorker=Ao,m.cancelBubble=_o,m.cancelFetch=X0,m.changeBrightness=Nm,m.changeCheckboxChecked=kp,m.changeDiaphaneity=Bm,m.changeRadioChecked=Ip,m.changeSelected=Ap,m.changeSize=zm,m.checkWxJsApi=c1,m.clearCookies=N0,m.clearLocalStorage=M0,m.clearSessionStorage=O0,m.closest=Tp,m.combineTransformToMatrix=im,m.compareVersion=Qf,m.computeImageDisplayRect=om,m.containsChild=bp,m.createDefaultMousePoint=ir,m.createElement=_h,m.createElementNS=Yp,m.createFragment=vh,m.createIndexDB=Y0,m.createObjectURL=uh,m.createRunCycleInMaxRate=xd,m.createTextNode=Fp,m.createXMLHttpRequest=Pc,m.cssAttrsToCanvasAttrs=th,m.distance=pe,m.domPrefixes=rm,m.drag$=kh,m.dragEnd$=Rh,m.dragEnter$=Oh,m.dragLeave$=zh,m.dragOver$=Nh,m.dragStart$=Dh,m.drawBitmapInCanvas=tp,m.drawQRCodeToCanvas=$m,m.drop$=Lh,m.easeNameToCubicBezier=Ai,m.empty=wh,m.fireEvent=Wf,m.flipSideToSide=dm,m.flipUpsideDown=mm,m.flushURL=Ec,m.flushURLRecord=Q0,m.formDataToSearch=Tc,m.generateRosettaShape=d0,m.getBitmapFromCanvas=Qm,m.getBodyPosition=kg,m.getBrowserClient=bi,m.getBrowserClientVersion=td,m.getBrowserLanguage=ed,m.getCSSVar=D0,m.getDOMMatrix=Gi,m.getDirection=Vd,m.getDocumentElementPosition=Ms,m.getElementPositionInPage=cr,m.getElementPositionInPage2=Rg,m.getElementPositionInViewport=$h,m.getEmSize=gp,m.getFetchId=Xr,m.getFileExtension=Mu,m.getFileMD5Hash=$a,m.getFileTypeFromFile=Pu,m.getFormSubmitData=i1,m.getImageData=eh,m.getImageDataByAIData=Xm,m.getImageMainColor=fm,m.getInnerText=Rp,m.getInternetExplorerVersion=Eo,m.getKeyCode=Yg,m.getMIME=Cu,m.getMouseButton=Ng,m.getMousePositionInElement=ct,m.getMousePositionInPage=lr,m.getMousePositionInViewport=zg,m.getOperatingSystem=nn,m.getOperatingSystemVersion=Kf,m.getPageSize=Dg,m.getParameters=K0,m.getPolymorphShapeCombosInterpolator=dc,m.getPolymorphShapesInterpolator=Mr,m.getRelativeBoundingClientRect=Lg,m.getRemSize=Ki,m.getScreenPosition=Ig,m.getSelectedText=op,m.getStyle=ke,m.getTheme$=k0,m.getTimeZone=sd,m.getURL=Pn,m.getVerticalScrollPercentInPage=Og,m.getViewportSize=Vh,m.getVnode=Di,m.gifImage=rh,m.gravitateShapes=h0,m.h=Be,m.hFromEl=Tn,m.hasClass=Bp,m.hasDocument=ud,m.hasHistory=fd,m.hasWindow=Co,m.hideEl=bh,m.html=yh,m.iframePostMessage=Xp,m.imageDataToBitmap=hm,m.imageDataToBlob=lm,m.imageDataToDataURL=cm,m.immediateVnode=Xd,m.injectStyle=Ko,m.injectWxJsConfig=h1,m.insert=Ps,m.isActiveEl=mp,m.isAliBrowser=Mo,m.isAliMiniProgram=ld,m.isAndroid=To,m.isAppleDevice=nd,m.isBrowserSupportFileAPI=dd,m.isElement=pd,m.isEventSupported=Zf,m.isIE=rd,m.isIE10=od,m.isIE11=hd,m.isIE9=ad,m.isIOS=vi,m.isInput=Es,m.isInputCheckbox=er,m.isInputNumber=Cp,m.isInputRadio=sr,m.isInputText=Mp,m.isMacOS=So,m.isMobile=id,m.isNative=rn,m.isRootEl=dp,m.isSelect=tr,m.isTextArea=Pp,m.isTouchSupport=yd,m.isURL=J0,m.isWxBrowser=Po,m.isWxMiniProgram=cd,m.jpgToPng=Dm,m.keyDown$=Bh,m.keyPress$=_g,m.keyUp$=Yh,m.leftRotate=pm,m.length=je,m.mapTDTJSSDK=F1,m.marginSharpen=km,m.microTask=Sd,m.mosaic=Fm,m.mount=es,m.mouseClick$=jp,m.mouseContextMenu$=Jp,m.mouseDoubleClick$=Hp,m.mouseDown$=Eh,m.mouseEnter$=Gp,m.mouseLeave$=qp,m.mouseMove$=yn,m.mouseOut$=$p,m.mouseOver$=Vp,m.mouseUp$=Ph,m.mouseWheel$=Wp,m.nearestElement=yp,m.nextElementSibling=_p,m.nextTick=_d,m.normalizePoint=Ud,m.objectSignature=X1,m.onBeforeUnload=dh,m.onDocumentReady=fh,m.outputGifBase64=ah,m.outputQRCodeBase64=Vm,m.pan$=Zp,m.panCancel$=eg,m.panDown$=rg,m.panEnd$=tg,m.panLeft$=sg,m.panMove$=Kp,m.panRight$=ng,m.panStart$=Qp,m.panUp$=ig,m.parent=wp,m.parents=Qi,m.parseCSS=gr,m.parseTransformToMatrix=$i,m.patch=En,m.pinch$=ag,m.pinchIn$=og,m.pinchOut$=hg,m.pngToJpg=Rm,m.pointerCancel$=hr,m.pointerDown$=ar,m.pointerMove$=rr,m.pointerUp$=or,m.polar=He,m.polymorphShapesTween=f0,m.prefixes=gd,m.press$=cg,m.preventDefault=de,m.previousElementSibling=Sp,m.radiusClip=Om,m.readFileInBrowser=os,m.recordToSearch=Mn,m.rectClip=Lm,m.rem2px=pp,m.remove=Lp,m.removeClass=Np,m.requestAnimationFrameCycle=_i,m.reverseCSSToJSEasing=Rd,m.reverseEaseNameToCubicBezier=Bo,m.reverseEasing=Ro,m.revokeObjectURL=ep,m.rightRotate=gm,m.rotate$=lg,m.rotatePoint=qt,m.scheduleIdle=ko,m.scheduleVnode=Ri,m.scheduleYZIdle=Pi,m.scrollParent=xp,m.scrollTo=up,m.searchToRecord=Z0,m.selectFileInBrowser=ni,m.setCSSVar=R0,m.setIntervalAccurate=wd,m.setManualScroll=fp,m.setRem=W0,m.setStyle=qi,m.setTheme=_c,m.setTimeoutAccurate=Si,m.setWindowTitle=hp,m.shadowRoot=Ep,m.sharpen=Im,m.showEl=xh,m.siblings=vp,m.signature=Ic,m.simulateMouseEventFromTouch=Jf,m.stringToDOM=Eu,m.swipe$=ug,m.swipeDown$=pg,m.swipeLeft$=fg,m.swipeRight$=dg,m.swipeUp$=mg,m.tap$=gg,m.tapOutSide$=yg,m.text=Dp,m.toBlackAndWhite=xm,m.toBlue=Sm,m.toBlueAndGreen=Pm,m.toBlueAndGrey=Am,m.toDegree=_t,m.toGreen=_m,m.toGreenAndGrey=Cm,m.toGrey=ym,m.toGrey2=wm,m.toOpposite=bm,m.toRadian=J,m.toRed=vm,m.toRedAndBlue=Em,m.toRedAndGreen=Tm,m.toRedAndGrey=Mm,m.toggleClass=nr,m.toggleElDisplay=Op,m.toggleTheme=I0,m.touchCancel$=Ih,m.touchEnd$=Ah,m.touchMove$=Mh,m.touchStart$=Ch,m.transformPath2D=sm,m.transitionEnd$=xg,m.transitionStart$=wg,m.trimHash=Sc,m.useAttribute=De,m.useClickA=gn,m.useClipboard=lp,m.useCookie=z0,m.useCoords$=v0,m.useDataset=E0,m.useDraggable=Mg,m.useDraw=m0,m.useDrop=Cg,m.useElementEventBus=Gg,m.useEvent$=U,m.useEventListener=j,m.useFetch=_n,m.useFetchCache=V0,m.useFetchRetry=U0,m.useFetchRetryCache=$0,m.useHashChange$=S0,m.useHotKeyDown$=qh,m.useHotKeyFile=Xg,m.useHotKeyFile$=jh,m.useHotKeyUp$=Fg,m.useIntersection=g0,m.useIntersection$=pc,m.useLoadImage=ph,m.useLoadLink=np,m.useLoadScript=sp,m.useLocalStorage=xc,m.useLocale=Ur,m.useLocation$=wc,m.useMatchMedia$=yc,m.useMouseAndPointerDownMovePoint$=Xh,m.useMouseDownMovePoint$=Tg,m.useMouseMovePoint$=Sg,m.useMousePoint=Re,m.useMutation=p0,m.useMutation$=mc,m.usePointerDownMovePoint$=Fh,m.usePopStateChange$=T0,m.usePressDownMove=Wh,m.usePressDownMoveWithMouse=qg,m.usePressDownMoveWithPointer=Jh,m.usePressDownMoveWithTouch=jg,m.usePull$=Pg,m.useResize=Hh,m.useResize$=ur,m.useRunInSandbox=Up,m.useSafeArea$=b0,m.useScroll$=Uh,m.useSelectFile=gh,m.useSelectFileImage=rp,m.useSessionStorage=L0,m.useTimestampValue=Yr,m.useTouchDownMovePoint$=Eg,m.useUrlChange$=_0,m.useVisible$=w0,m.useVisibleSimple$=y0,m.useWindowResize=Ug,m.useWindowResize$=Vg,m.useWindowVisible$=Ag,m.vibrate=cp,m.waitForStyleSheetsLoaded=ip,m.writeToIndexDB=F0,m.wxJsChooseImage=f1,m.wxJsDownloadImage=p1,m.wxJsDownloadVoice=E1,m.wxJsGetLocalImgData=g1,m.wxJsGetLocation=A1,m.wxJsGetNetworkType=M1,m.wxJsLogin=D1,m.wxJsOnVoicePlayEnd=S1,m.wxJsOnVoiceRecordEnd=x1,m.wxJsOpenLocation=C1,m.wxJsPauseVoice=v1,m.wxJsPay=k1,m.wxJsPlayVoice=b1,m.wxJsPreviewImage=d1,m.wxJsScanQRCode=I1,m.wxJsStartRecord=y1,m.wxJsStopRecord=w1,m.wxJsStopVoice=_1,m.wxJsTranslateVoice=P1,m.wxJsUpdateAppMessageShareData=l1,m.wxJsUpdateTimelineShareData=u1,m.wxJsUploadImage=m1,m.wxJsUploadVoice=T1,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({},ZYZGroupCoreCommon);
|
|
52
52
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|