@zyzgroup/core-web 0.1.89 → 0.1.92

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.
Files changed (92) hide show
  1. package/dist/css/better.css +5 -0
  2. package/dist/css/theme.css +62 -38
  3. package/dist/zyzgroup_core_web.iife.js +71 -32
  4. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  5. package/dist/zyzgroup_core_web.js +23687 -20742
  6. package/dist/zyzgroup_core_web.js.map +1 -1
  7. package/dist/zyzgroup_core_web.umd.cjs +71 -32
  8. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  9. package/package.json +1 -1
  10. package/types/Context.d.ts +3 -6
  11. package/types/Context.d.ts.map +1 -1
  12. package/types/Pagination.d.ts +1 -1
  13. package/types/Pagination.d.ts.map +1 -1
  14. package/types/WebMonitor.d.ts +6 -0
  15. package/types/WebMonitor.d.ts.map +1 -1
  16. package/types/WebSocketClient.d.ts.map +1 -1
  17. package/types/animate/Timeline.d.ts.map +1 -1
  18. package/types/animate/index.d.ts +0 -1
  19. package/types/animate/index.d.ts.map +1 -1
  20. package/types/canvas/html-in-canvas.d.ts +1 -0
  21. package/types/canvas/html-in-canvas.d.ts.map +1 -0
  22. package/types/components/SideEffectTags.d.ts +25 -0
  23. package/types/components/SideEffectTags.d.ts.map +1 -0
  24. package/types/components/component-core.d.ts +29 -0
  25. package/types/components/component-core.d.ts.map +1 -0
  26. package/types/components/index.d.ts +3 -0
  27. package/types/components/index.d.ts.map +1 -0
  28. package/types/components/vnode.d.ts +12 -0
  29. package/types/components/vnode.d.ts.map +1 -0
  30. package/types/file.d.ts +9 -11
  31. package/types/file.d.ts.map +1 -1
  32. package/types/hooks/index.d.ts +0 -2
  33. package/types/hooks/index.d.ts.map +1 -1
  34. package/types/hooks/useAttribute.d.ts.map +1 -1
  35. package/types/hooks/useDraw/DrawContext.d.ts.map +1 -1
  36. package/types/hooks/useDraw/Shape.d.ts.map +1 -1
  37. package/types/hooks/useDraw/shapes/ConfettiShapeCombo.d.ts.map +1 -1
  38. package/types/hooks/useDraw/svg/SVGUtil.d.ts.map +1 -1
  39. package/types/hooks/useElement.d.ts +3 -2
  40. package/types/hooks/useElement.d.ts.map +1 -1
  41. package/types/hooks/useElementEvents.d.ts +3 -3
  42. package/types/hooks/useElementEvents.d.ts.map +1 -1
  43. package/types/hooks/useLocale/useLocale.d.ts +2 -2
  44. package/types/hooks/useLocale/useLocale.d.ts.map +1 -1
  45. package/types/hooks/useStyle.d.ts.map +1 -1
  46. package/types/hooks/useTheme.d.ts +53 -4
  47. package/types/hooks/useTheme.d.ts.map +1 -1
  48. package/types/index.d.ts +1 -5
  49. package/types/index.d.ts.map +1 -1
  50. package/types/math/BufferAttribute.d.ts +0 -71
  51. package/types/math/BufferAttribute.d.ts.map +1 -1
  52. package/types/math/Euler.d.ts +0 -32
  53. package/types/math/Euler.d.ts.map +1 -1
  54. package/types/math/Matrix.d.ts +0 -6
  55. package/types/math/Matrix.d.ts.map +1 -1
  56. package/types/math/Quaternion.d.ts +0 -51
  57. package/types/math/Quaternion.d.ts.map +1 -1
  58. package/types/math/Shape.d.ts +1 -0
  59. package/types/math/Shape.d.ts.map +1 -1
  60. package/types/math/Vector.d.ts +0 -11
  61. package/types/math/Vector.d.ts.map +1 -1
  62. package/types/math/core/Box3.d.ts +0 -45
  63. package/types/math/core/Box3.d.ts.map +1 -1
  64. package/types/math/core/Frustum.d.ts +0 -22
  65. package/types/math/core/Frustum.d.ts.map +1 -1
  66. package/types/math/core/Object3D.d.ts +0 -95
  67. package/types/math/core/Object3D.d.ts.map +1 -1
  68. package/types/math/core/Plane.d.ts +0 -30
  69. package/types/math/core/Plane.d.ts.map +1 -1
  70. package/types/math/core/Ray.d.ts +0 -31
  71. package/types/math/core/Ray.d.ts.map +1 -1
  72. package/types/math/core/Sphere.d.ts +0 -28
  73. package/types/math/core/Sphere.d.ts.map +1 -1
  74. package/types/math/core/Triangle.d.ts +0 -33
  75. package/types/math/core/Triangle.d.ts.map +1 -1
  76. package/types/math/index.d.ts +0 -1
  77. package/types/math/index.d.ts.map +1 -1
  78. package/types/math/shapes/Point3Ds.d.ts.map +1 -1
  79. package/types/MVVM.d.ts +0 -12
  80. package/types/MVVM.d.ts.map +0 -1
  81. package/types/animate/schedule.d.ts +0 -15
  82. package/types/animate/schedule.d.ts.map +0 -1
  83. package/types/color.d.ts +0 -111
  84. package/types/color.d.ts.map +0 -1
  85. package/types/hooks/useFetch.d.ts +0 -14
  86. package/types/hooks/useFetch.d.ts.map +0 -1
  87. package/types/hooks/useVnode.d.ts +0 -7
  88. package/types/hooks/useVnode.d.ts.map +0 -1
  89. package/types/signature.d.ts +0 -30
  90. package/types/signature.d.ts.map +0 -1
  91. package/types/vnode.d.ts +0 -18
  92. package/types/vnode.d.ts.map +0 -1
@@ -1,4 +1,45 @@
1
- (function(d,Mn){typeof exports=="object"&&typeof module<"u"?Mn(exports):typeof define=="function"&&define.amd?define(["exports"],Mn):(d=typeof globalThis<"u"?globalThis:d||self,Mn(d.ZYZGroupCoreWeb={}))})(this,function(d){"use strict";const Mn={};function Qu(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this||Mn}const St=Qu(),tf="@YZ/";function Mi(s,t=tf){return s.startsWith(t)?s:`${t}${s}`}function Ai(s){return typeof s=="string"&&s.startsWith("Symbol(")&&s.endsWith(")")}function Ii(s){return Ai(s)&&(s=s.slice(7,-1)),s}function ys(s){return s=Ii(s),s=Mi(s),typeof Symbol=="function"?Symbol(s):`Symbol(${s})`}const An=ys("TIMESTAMP"),ef=ys("META");function nf(s,t){const e=t.toString();if(!Ai(e))return!1;if(s&&typeof s=="object"){if(Ii(e)=="")return t in s;for(const n of Reflect.ownKeys(s))if(n.toString()==e)return!0;return!1}return!1}function Pa(s){if(!Ai(s))return s;switch(s=Ii(s),s){case Mi("TIMESTAMP"):return An;case Mi("META"):return ef;default:return ys(s)}}function Di(s){if(Array.isArray(s))return s.map(Di);if(s&&typeof s=="object"){const t={};for(const e of Reflect.ownKeys(s)){const n=s[e];t[typeof e=="symbol"?e.toString():e]=typeof n=="symbol"?n.toString():Di(n)}return t}return typeof s=="symbol"?s.toString():s}function ki(s){if(Array.isArray(s))return s.map(ki);if(s&&typeof s=="object"){const t={};for(const e of Object.keys(s))t[Pa(e)]=ki(s[e]);return t}return Pa(s)}function Li(s){return JSON.stringify(Di(s))}const Ri=Li;function Ta(s){return ki(JSON.parse(s))}var Et=(s=>(s.UNKNOWN="",s.TEXT="text/plain",s.MD="text/plain",s.HTML="text/html",s.XML_TEXT="text/xml",s.CSS="text/css",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.BMP="image/bmp",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICON="image/x-icon",s.MICROSOFT_ICON="image/vnd.microsoft.icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.MP4="video/mp4",s.OGG="audio/ogg",s.WAV="audio/wav",s.MIDI="audio/midi",s.WEBM="video/webm",s.VIDEO_OGG="video/ogg",s.OCTET_STREAM="application/octet-stream",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.JSON="application/json",s.XML="application/xml",s.XHTML="application/xhtml+xml",s.XWWW="application/x-www-form-urlencoded",s.DOC="application/msword",s.CSV="application/x-csv",s.EXCEL="application/vnb.ms-excel",s.PPT="application/vnb.mspowerpoint",s.PDF="application/pdf",s.ZIP="application/zip",s.TGZ="application/x-gtar",s.TAR_GZ="application/x-gzip",s.EOT="appliaction/vnd.ms-fontobject",s.TTF="aplication/font-sfnt",s.PKCS12="aplication/pkcs12",s))(Et||{}),ws=(s=>(s.ascii="ascii",s.utf8="utf8",s.utf16le="utf16le",s.ucs2="ucs2",s.base64="base64",s.base64url="base64url",s.latin1="latin1",s.binary="binary",s.hex="hex",s))(ws||{}),Ut=(s=>(s.text="text",s.dataURL="dataURL",s.binaryString="binaryString",s.arraybuffer="arraybuffer",s))(Ut||{}),In=(s=>(s.md5="md5",s.sha1="sha1",s.sha256="sha256",s.SHA256="SHA-256",s.sha512="sha512",s.SHA512="SHA-512",s.AESGCM="AES-GCM",s.ECDSA="ECDSA",s))(In||{});const bs=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(bs("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^[1]{1}[0-9]{10}$/;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
1
+ (function(g,Hn){typeof exports=="object"&&typeof module<"u"?Hn(exports):typeof define=="function"&&define.amd?define(["exports"],Hn):(g=typeof globalThis<"u"?globalThis:g||self,Hn(g.ZYZGroupCoreWeb={}))})(this,function(g){"use strict";const Hn=Function("return this")();function Kf(){const s=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,t=typeof window=="object"&&window&&window.Object===Object&&window,e=typeof global=="object"&&global&&global.Object===Object&&global,n=typeof self=="object"&&self&&self.Object===Object&&self;return s||t||e||n||this||Hn}const tt=Kf(),ii=typeof process=="object"&&process?process:{env:{NODE_ENV:"",terminal:""},argv:[],execPath:"",platform:""};({...ii.env});const oc="@YZ/";function Zf(s,t=oc){return s.startsWith(t)}function ac(s,t=oc){return Zf(s,t)?s:`${t}${s}`}function cc(s){return typeof s=="string"&&s.startsWith("Symbol(")&&s.endsWith(")")}function hc(s){return cc(s)&&(s=s.slice(7,-1)),s}function oi(s){return s=hc(s),s=ac(s),typeof Symbol=="function"?Symbol(s):`Symbol(${s})`}const Qf=oi("META");function lc(s){if(!cc(s))return s;switch(s=hc(s),s){case ac("META"):return Qf;default:return oi(s)}}function ai(s){if(Array.isArray(s))return s.map(ai);if(s&&typeof s=="object"){const t={};for(const e of Reflect.ownKeys(s)){const n=s[e];t[typeof e=="symbol"?e.toString():e]=typeof n=="symbol"?n.toString():ai(n)}return t}return typeof s=="symbol"?s.toString():s}function ci(s){if(Array.isArray(s))return s.map(ci);if(s&&typeof s=="object"){const t={};for(const e of Object.keys(s))t[lc(e)]=ci(s[e]);return t}return lc(s)}function uc(s){return JSON.stringify(ai(s))}function fc(s){return ci(JSON.parse(s))}const dc=NaN,td=Symbol("NO_VALUE"),Ns={immediate:0,high:100,normal:200,low:300,idle:400};var ye=(s=>(s[s["text/plain"]=0]="text/plain",s[s["text/html"]=1]="text/html",s[s["text/xml"]=2]="text/xml",s[s["text/css"]=3]="text/css",s[s["image/jpeg"]=4]="image/jpeg",s[s["image/png"]=5]="image/png",s[s["image/gif"]=6]="image/gif",s[s["image/bmp"]=7]="image/bmp",s[s["image/webp"]=8]="image/webp",s[s["image/svg+xml"]=9]="image/svg+xml",s[s["image/x-icon"]=10]="image/x-icon",s[s["image/vnd.microsoft.icon"]=11]="image/vnd.microsoft.icon",s[s["image/octet-stream"]=12]="image/octet-stream",s[s["audio/mpeg"]=13]="audio/mpeg",s[s["video/mp4"]=14]="video/mp4",s[s["audio/ogg"]=15]="audio/ogg",s[s["audio/wav"]=16]="audio/wav",s[s["audio/midi"]=17]="audio/midi",s[s["video/webm"]=18]="video/webm",s[s["video/ogg"]=19]="video/ogg",s[s["application/octet-stream"]=20]="application/octet-stream",s[s["application/javascript"]=21]="application/javascript",s[s["application/ecmascript"]=22]="application/ecmascript",s[s["application/json"]=23]="application/json",s[s["application/xml"]=24]="application/xml",s[s["application/xhtml+xml"]=25]="application/xhtml+xml",s[s["application/x-www-form-urlencoded"]=26]="application/x-www-form-urlencoded",s[s["application/msword"]=27]="application/msword",s[s["application/x-csv"]=28]="application/x-csv",s[s["application/vnb.ms-excel"]=29]="application/vnb.ms-excel",s[s["application/vnb.mspowerpoint"]=30]="application/vnb.mspowerpoint",s[s["application/pdf"]=31]="application/pdf",s[s["application/zip"]=32]="application/zip",s[s["application/x-gtar"]=33]="application/x-gtar",s[s["application/x-gzip"]=34]="application/x-gzip",s[s["appliaction/vnd.ms-fontobject"]=35]="appliaction/vnd.ms-fontobject",s[s["aplication/font-sfnt"]=36]="aplication/font-sfnt",s[s["aplication/pkcs12"]=37]="aplication/pkcs12",s))(ye||{}),ie=(s=>(s[s.text=0]="text",s[s.dataURL=1]="dataURL",s[s.binaryString=2]="binaryString",s[s.arraybuffer=3]="arraybuffer",s))(ie||{});const Fs={ascii:"ascii",utf8:"utf8","utf-8":"utf-8",utf16le:"utf16le","utf-16le":"utf-16le",ucs2:"ucs2","ucs-2":"ucs-2",base64:"base64",base64url:"base64url",latin1:"latin1",binary:"binary",hex:"hex"};var nt={};/**
2
+ * @license React
3
+ * react.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mc;function ed(){if(mc)return nt;mc=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),d=Symbol.iterator;function f(A){return A===null||typeof A!="object"?null:(A=d&&A[d]||A["@@iterator"],typeof A=="function"?A:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,_={};function y(A,L,H){this.props=A,this.context=L,this.refs=_,this.updater=H||m}y.prototype.isReactComponent={},y.prototype.setState=function(A,L){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,L,"setState")},y.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function b(){}b.prototype=y.prototype;function v(A,L,H){this.props=A,this.context=L,this.refs=_,this.updater=H||m}var w=v.prototype=new b;w.constructor=v,p(w,y.prototype),w.isPureReactComponent=!0;var E=Array.isArray;function C(){}var D={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function O(A,L,H){var W=H.ref;return{$$typeof:s,type:A,key:L,ref:W!==void 0?W:null,props:H}}function U(A,L){return O(A.type,L,A.props)}function V(A){return typeof A=="object"&&A!==null&&A.$$typeof===s}function q(A){var L={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(H){return L[H]})}var ft=/\/+/g;function pt(A,L){return typeof A=="object"&&A!==null&&A.key!=null?q(""+A.key):L.toString(36)}function zt(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(C,C):(A.status="pending",A.then(function(L){A.status==="pending"&&(A.status="fulfilled",A.value=L)},function(L){A.status==="pending"&&(A.status="rejected",A.reason=L)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function wt(A,L,H,W,ht){var mt=typeof A;(mt==="undefined"||mt==="boolean")&&(A=null);var Q=!1;if(A===null)Q=!0;else switch(mt){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(A.$$typeof){case s:case t:Q=!0;break;case l:return Q=A._init,wt(Q(A._payload),L,H,W,ht)}}if(Q)return ht=ht(A),Q=W===""?"."+pt(A,0):W,E(ht)?(H="",Q!=null&&(H=Q.replace(ft,"$&/")+"/"),wt(ht,L,H,"",function(Ct){return Ct})):ht!=null&&(V(ht)&&(ht=U(ht,H+(ht.key==null||A&&A.key===ht.key?"":(""+ht.key).replace(ft,"$&/")+"/")+Q)),L.push(ht)),1;Q=0;var Pt=W===""?".":W+":";if(E(A))for(var at=0;at<A.length;at++)W=A[at],mt=Pt+pt(W,at),Q+=wt(W,L,H,mt,ht);else if(at=f(A),typeof at=="function")for(A=at.call(A),at=0;!(W=A.next()).done;)W=W.value,mt=Pt+pt(W,at++),Q+=wt(W,L,H,mt,ht);else if(mt==="object"){if(typeof A.then=="function")return wt(zt(A),L,H,W,ht);throw L=String(A),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return Q}function It(A,L,H){if(A==null)return A;var W=[],ht=0;return wt(A,W,"","",function(mt){return L.call(H,mt,ht++)}),W}function Xt(A){if(A._status===-1){var L=A._result;L=L(),L.then(function(H){(A._status===0||A._status===-1)&&(A._status=1,A._result=H)},function(H){(A._status===0||A._status===-1)&&(A._status=2,A._result=H)}),A._status===-1&&(A._status=0,A._result=L)}if(A._status===1)return A._result.default;throw A._result}var Y=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},N={map:It,forEach:function(A,L,H){It(A,function(){L.apply(this,arguments)},H)},count:function(A){var L=0;return It(A,function(){L++}),L},toArray:function(A){return It(A,function(L){return L})||[]},only:function(A){if(!V(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return nt.Activity=u,nt.Children=N,nt.Component=y,nt.Fragment=e,nt.Profiler=r,nt.PureComponent=v,nt.StrictMode=n,nt.Suspense=c,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,nt.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},nt.cache=function(A){return function(){return A.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(A,L,H){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=p({},A.props),ht=A.key;if(L!=null)for(mt in L.key!==void 0&&(ht=""+L.key),L)!$.call(L,mt)||mt==="key"||mt==="__self"||mt==="__source"||mt==="ref"&&L.ref===void 0||(W[mt]=L[mt]);var mt=arguments.length-2;if(mt===1)W.children=H;else if(1<mt){for(var Q=Array(mt),Pt=0;Pt<mt;Pt++)Q[Pt]=arguments[Pt+2];W.children=Q}return O(A.type,ht,W)},nt.createContext=function(A){return A={$$typeof:o,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:i,_context:A},A},nt.createElement=function(A,L,H){var W,ht={},mt=null;if(L!=null)for(W in L.key!==void 0&&(mt=""+L.key),L)$.call(L,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ht[W]=L[W]);var Q=arguments.length-2;if(Q===1)ht.children=H;else if(1<Q){for(var Pt=Array(Q),at=0;at<Q;at++)Pt[at]=arguments[at+2];ht.children=Pt}if(A&&A.defaultProps)for(W in Q=A.defaultProps,Q)ht[W]===void 0&&(ht[W]=Q[W]);return O(A,mt,ht)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(A){return{$$typeof:a,render:A}},nt.isValidElement=V,nt.lazy=function(A){return{$$typeof:l,_payload:{_status:-1,_result:A},_init:Xt}},nt.memo=function(A,L){return{$$typeof:h,type:A,compare:L===void 0?null:L}},nt.startTransition=function(A){var L=D.T,H={};D.T=H;try{var W=A(),ht=D.S;ht!==null&&ht(H,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(C,Y)}catch(mt){Y(mt)}finally{L!==null&&H.types!==null&&(L.types=H.types),D.T=L}},nt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},nt.use=function(A){return D.H.use(A)},nt.useActionState=function(A,L,H){return D.H.useActionState(A,L,H)},nt.useCallback=function(A,L){return D.H.useCallback(A,L)},nt.useContext=function(A){return D.H.useContext(A)},nt.useDebugValue=function(){},nt.useDeferredValue=function(A,L){return D.H.useDeferredValue(A,L)},nt.useEffect=function(A,L){return D.H.useEffect(A,L)},nt.useEffectEvent=function(A){return D.H.useEffectEvent(A)},nt.useId=function(){return D.H.useId()},nt.useImperativeHandle=function(A,L,H){return D.H.useImperativeHandle(A,L,H)},nt.useInsertionEffect=function(A,L){return D.H.useInsertionEffect(A,L)},nt.useLayoutEffect=function(A,L){return D.H.useLayoutEffect(A,L)},nt.useMemo=function(A,L){return D.H.useMemo(A,L)},nt.useOptimistic=function(A,L){return D.H.useOptimistic(A,L)},nt.useReducer=function(A,L,H){return D.H.useReducer(A,L,H)},nt.useRef=function(A){return D.H.useRef(A)},nt.useState=function(A){return D.H.useState(A)},nt.useSyncExternalStore=function(A,L,H){return D.H.useSyncExternalStore(A,L,H)},nt.useTransition=function(){return D.H.useTransition()},nt.version="19.2.5",nt}var Bs={exports:{}};/**
10
+ * @license React
11
+ * react.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */Bs.exports;var pc;function nd(){return pc||(pc=1,function(s,t){({}).NODE_ENV!=="production"&&function(){function e(x,k){Object.defineProperty(i.prototype,x,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",k[0],k[1])}})}function n(x){return x===null||typeof x!="object"?null:(x=Se&&x[Se]||x["@@iterator"],typeof x=="function"?x:null)}function r(x,k){x=(x=x.constructor)&&(x.displayName||x.name)||"ReactClass";var B=x+"."+k;_e[B]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",k,x),_e[B]=!0)}function i(x,k,B){this.props=x,this.context=k,this.refs=vt,this.updater=B||pe}function o(){}function a(x,k,B){this.props=x,this.context=k,this.refs=vt,this.updater=B||pe}function c(){}function h(x){return""+x}function l(x){try{h(x);var k=!1}catch{k=!0}if(k){k=console;var B=k.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return B.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),h(x)}}function u(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===Vr?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case A:return"Fragment";case H:return"Profiler";case L:return"StrictMode";case Q:return"Suspense";case Pt:return"SuspenseList";case Ue:return"Activity"}if(typeof x=="object")switch(typeof x.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case N:return"Portal";case ht:return x.displayName||"Context";case W:return(x._context.displayName||"Context")+".Consumer";case mt:var k=x.render;return x=x.displayName,x||(x=k.displayName||k.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case at:return k=x.displayName||null,k!==null?k:u(x.type)||"Memo";case Ct:k=x._payload,x=x._init;try{return u(x(k))}catch{}}return null}function d(x){if(x===A)return"<>";if(typeof x=="object"&&x!==null&&x.$$typeof===Ct)return"<...>";try{var k=u(x);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function f(){var x=rt.A;return x===null?null:x.getOwner()}function m(){return Error("react-stack-top-frame")}function p(x){if(Gt.call(x,"key")){var k=Object.getOwnPropertyDescriptor(x,"key").get;if(k&&k.isReactWarning)return!1}return x.key!==void 0}function _(x,k){function B(){Hr||(Hr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}B.isReactWarning=!0,Object.defineProperty(x,"key",{get:B,configurable:!0})}function y(){var x=u(this.type);return Jr[x]||(Jr[x]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),x=this.props.ref,x!==void 0?x:null}function b(x,k,B,j,J,ct){var ot=B.ref;return x={$$typeof:Y,type:x,key:k,props:B,_owner:j},(ot!==void 0?ot:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:y}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function v(x,k){return k=b(x.type,k,x.props,x._owner,x._debugStack,x._debugTask),x._store&&(k._store.validated=x._store.validated),k}function w(x){E(x)?x._store&&(x._store.validated=1):typeof x=="object"&&x!==null&&x.$$typeof===Ct&&(x._payload.status==="fulfilled"?E(x._payload.value)&&x._payload.value._store&&(x._payload.value._store.validated=1):x._store&&(x._store.validated=1))}function E(x){return typeof x=="object"&&x!==null&&x.$$typeof===Y}function C(x){var k={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(B){return k[B]})}function D(x,k){return typeof x=="object"&&x!==null&&x.key!=null?(l(x.key),C(""+x.key)):k.toString(36)}function $(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(c,c):(x.status="pending",x.then(function(k){x.status==="pending"&&(x.status="fulfilled",x.value=k)},function(k){x.status==="pending"&&(x.status="rejected",x.reason=k)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function O(x,k,B,j,J){var ct=typeof x;(ct==="undefined"||ct==="boolean")&&(x=null);var ot=!1;if(x===null)ot=!0;else switch(ct){case"bigint":case"string":case"number":ot=!0;break;case"object":switch(x.$$typeof){case Y:case N:ot=!0;break;case Ct:return ot=x._init,O(ot(x._payload),k,B,j,J)}}if(ot){ot=x,J=J(ot);var bt=j===""?"."+D(ot,0):j;return As(J)?(B="",bt!=null&&(B=bt.replace(ks,"$&/")+"/"),O(J,k,B,"",function(Ce){return Ce})):J!=null&&(E(J)&&(J.key!=null&&(ot&&ot.key===J.key||l(J.key)),B=v(J,B+(J.key==null||ot&&ot.key===J.key?"":(""+J.key).replace(ks,"$&/")+"/")+bt),j!==""&&ot!=null&&E(ot)&&ot.key==null&&ot._store&&!ot._store.validated&&(B._store.validated=2),J=B),k.push(J)),1}if(ot=0,bt=j===""?".":j+":",As(x))for(var lt=0;lt<x.length;lt++)j=x[lt],ct=bt+D(j,lt),ot+=O(j,k,B,ct,J);else if(lt=n(x),typeof lt=="function")for(lt===x.entries&&(Ms||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ms=!0),x=lt.call(x),lt=0;!(j=x.next()).done;)j=j.value,ct=bt+D(j,lt++),ot+=O(j,k,B,ct,J);else if(ct==="object"){if(typeof x.then=="function")return O($(x),k,B,j,J);throw k=String(x),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return ot}function U(x,k,B){if(x==null)return x;var j=[],J=0;return O(x,j,"","",function(ct){return k.call(B,ct,J++)}),j}function V(x){if(x._status===-1){var k=x._ioInfo;k!=null&&(k.start=k.end=performance.now()),k=x._result;var B=k();if(B.then(function(J){if(x._status===0||x._status===-1){x._status=1,x._result=J;var ct=x._ioInfo;ct!=null&&(ct.end=performance.now()),B.status===void 0&&(B.status="fulfilled",B.value=J)}},function(J){if(x._status===0||x._status===-1){x._status=2,x._result=J;var ct=x._ioInfo;ct!=null&&(ct.end=performance.now()),B.status===void 0&&(B.status="rejected",B.reason=J)}}),k=x._ioInfo,k!=null){k.value=B;var j=B.displayName;typeof j=="string"&&(k.name=j)}x._status===-1&&(x._status=0,x._result=B)}if(x._status===1)return k=x._result,k===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
18
+
19
+ Your code should look like:
20
+ const MyComponent = lazy(() => import('./MyComponent'))
21
+
22
+ Did you accidentally put curly braces around the import?`,k),"default"in k||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
23
+
24
+ Your code should look like:
25
+ const MyComponent = lazy(() => import('./MyComponent'))`,k),k.default;throw x._result}function q(){var x=rt.H;return x===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
26
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
27
+ 2. You might be breaking the Rules of Hooks
28
+ 3. You might have more than one copy of React in the same app
29
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),x}function ft(){rt.asyncTransitions--}function pt(x){if(rn===null)try{var k=("require"+Math.random()).slice(0,7);rn=(s&&s[k]).call(s,"timers").setImmediate}catch{rn=function(B){xn===!1&&(xn=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var j=new MessageChannel;j.port1.onmessage=B,j.port2.postMessage(void 0)}}return rn(x)}function zt(x){return 1<x.length&&typeof AggregateError=="function"?new AggregateError(x):x[0]}function wt(x,k){k!==Gn-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Gn=k}function It(x,k,B){var j=rt.actQueue;if(j!==null)if(j.length!==0)try{Xt(j),pt(function(){return It(x,k,B)});return}catch(J){rt.thrownErrors.push(J)}else rt.actQueue=null;0<rt.thrownErrors.length?(j=zt(rt.thrownErrors),rt.thrownErrors.length=0,B(j)):k(x)}function Xt(x){if(!Ds){Ds=!0;var k=0;try{for(;k<x.length;k++){var B=x[k];do{rt.didUsePromise=!1;var j=B(!1);if(j!==null){if(rt.didUsePromise){x[k]=B,x.splice(0,k);return}B=j}else break}while(1)}x.length=0}catch(J){x.splice(0,k+1),rt.thrownErrors.push(J)}finally{Ds=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Y=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),ht=Symbol.for("react.context"),mt=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Pt=Symbol.for("react.suspense_list"),at=Symbol.for("react.memo"),Ct=Symbol.for("react.lazy"),Ue=Symbol.for("react.activity"),Se=Symbol.iterator,_e={},pe={isMounted:function(){return!1},enqueueForceUpdate:function(x){r(x,"forceUpdate")},enqueueReplaceState:function(x){r(x,"replaceState")},enqueueSetState:function(x){r(x,"setState")}},z=Object.assign,vt={};Object.freeze(vt),i.prototype.isReactComponent={},i.prototype.setState=function(x,k){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,k,"setState")},i.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};var Ot={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Sn in Ot)Ot.hasOwnProperty(Sn)&&e(Sn,Ot[Sn]);o.prototype=i.prototype,Ot=a.prototype=new o,Ot.constructor=a,z(Ot,i.prototype),Ot.isPureReactComponent=!0;var As=Array.isArray,Vr=Symbol.for("react.client.reference"),rt={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Gt=Object.prototype.hasOwnProperty,qr=console.createTask?console.createTask:function(){return null};Ot={react_stack_bottom_frame:function(x){return x()}};var Hr,Wr,Jr={},Ha=Ot.react_stack_bottom_frame.bind(Ot,m)(),Kr=qr(d(m)),Ms=!1,ks=/\/+/g,Is=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)},xn=!1,rn=null,Gn=0,Vn=!1,Ds=!1,Zr=typeof queueMicrotask=="function"?function(x){queueMicrotask(function(){return queueMicrotask(x)})}:pt;Ot=Object.freeze({__proto__:null,c:function(x){return q().useMemoCache(x)}});var Sn={map:U,forEach:function(x,k,B){U(x,function(){k.apply(this,arguments)},B)},count:function(x){var k=0;return U(x,function(){k++}),k},toArray:function(x){return U(x,function(k){return k})||[]},only:function(x){if(!E(x))throw Error("React.Children.only expected to receive a single React element child.");return x}};t.Activity=Ue,t.Children=Sn,t.Component=i,t.Fragment=A,t.Profiler=H,t.PureComponent=a,t.StrictMode=L,t.Suspense=Q,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=rt,t.__COMPILER_RUNTIME=Ot,t.act=function(x){var k=rt.actQueue,B=Gn;Gn++;var j=rt.actQueue=k!==null?k:[],J=!1;try{var ct=x()}catch(lt){rt.thrownErrors.push(lt)}if(0<rt.thrownErrors.length)throw wt(k,B),x=zt(rt.thrownErrors),rt.thrownErrors.length=0,x;if(ct!==null&&typeof ct=="object"&&typeof ct.then=="function"){var ot=ct;return Zr(function(){J||Vn||(Vn=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(lt,Ce){J=!0,ot.then(function(_n){if(wt(k,B),B===0){try{Xt(j),pt(function(){return It(_n,lt,Ce)})}catch(Ja){rt.thrownErrors.push(Ja)}if(0<rt.thrownErrors.length){var Wa=zt(rt.thrownErrors);rt.thrownErrors.length=0,Ce(Wa)}}else lt(_n)},function(_n){wt(k,B),0<rt.thrownErrors.length&&(_n=zt(rt.thrownErrors),rt.thrownErrors.length=0),Ce(_n)})}}}var bt=ct;if(wt(k,B),B===0&&(Xt(j),j.length!==0&&Zr(function(){J||Vn||(Vn=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),rt.actQueue=null),0<rt.thrownErrors.length)throw x=zt(rt.thrownErrors),rt.thrownErrors.length=0,x;return{then:function(lt,Ce){J=!0,B===0?(rt.actQueue=j,pt(function(){return It(bt,lt,Ce)})):lt(bt)}}},t.cache=function(x){return function(){return x.apply(null,arguments)}},t.cacheSignal=function(){return null},t.captureOwnerStack=function(){var x=rt.getCurrentStack;return x===null?null:x()},t.cloneElement=function(x,k,B){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var j=z({},x.props),J=x.key,ct=x._owner;if(k!=null){var ot;t:{if(Gt.call(k,"ref")&&(ot=Object.getOwnPropertyDescriptor(k,"ref").get)&&ot.isReactWarning){ot=!1;break t}ot=k.ref!==void 0}ot&&(ct=f()),p(k)&&(l(k.key),J=""+k.key);for(bt in k)!Gt.call(k,bt)||bt==="key"||bt==="__self"||bt==="__source"||bt==="ref"&&k.ref===void 0||(j[bt]=k[bt])}var bt=arguments.length-2;if(bt===1)j.children=B;else if(1<bt){ot=Array(bt);for(var lt=0;lt<bt;lt++)ot[lt]=arguments[lt+2];j.children=ot}for(j=b(x.type,J,j,ct,x._debugStack,x._debugTask),J=2;J<arguments.length;J++)w(arguments[J]);return j},t.createContext=function(x){return x={$$typeof:ht,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:W,_context:x},x._currentRenderer=null,x._currentRenderer2=null,x},t.createElement=function(x,k,B){for(var j=2;j<arguments.length;j++)w(arguments[j]);j={};var J=null;if(k!=null)for(lt in Wr||!("__self"in k)||"key"in k||(Wr=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),p(k)&&(l(k.key),J=""+k.key),k)Gt.call(k,lt)&&lt!=="key"&&lt!=="__self"&&lt!=="__source"&&(j[lt]=k[lt]);var ct=arguments.length-2;if(ct===1)j.children=B;else if(1<ct){for(var ot=Array(ct),bt=0;bt<ct;bt++)ot[bt]=arguments[bt+2];Object.freeze&&Object.freeze(ot),j.children=ot}if(x&&x.defaultProps)for(lt in ct=x.defaultProps,ct)j[lt]===void 0&&(j[lt]=ct[lt]);J&&_(j,typeof x=="function"?x.displayName||x.name||"Unknown":x);var lt=1e4>rt.recentlyCreatedOwnerStacks++;return b(x,J,j,f(),lt?Error("react-stack-top-frame"):Ha,lt?qr(d(x)):Kr)},t.createRef=function(){var x={current:null};return Object.seal(x),x},t.forwardRef=function(x){x!=null&&x.$$typeof===at?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof x!="function"?console.error("forwardRef requires a render function but was given %s.",x===null?"null":typeof x):x.length!==0&&x.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",x.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),x!=null&&x.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var k={$$typeof:mt,render:x},B;return Object.defineProperty(k,"displayName",{enumerable:!1,configurable:!0,get:function(){return B},set:function(j){B=j,x.name||x.displayName||(Object.defineProperty(x,"name",{value:j}),x.displayName=j)}}),k},t.isValidElement=E,t.lazy=function(x){x={_status:-1,_result:x};var k={$$typeof:Ct,_payload:x,_init:V},B={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return x._ioInfo=B,k._debugInfo=[{awaited:B}],k},t.memo=function(x,k){x==null&&console.error("memo: The first argument must be a component. Instead received: %s",x===null?"null":typeof x),k={$$typeof:at,type:x,compare:k===void 0?null:k};var B;return Object.defineProperty(k,"displayName",{enumerable:!1,configurable:!0,get:function(){return B},set:function(j){B=j,x.name||x.displayName||(Object.defineProperty(x,"name",{value:j}),x.displayName=j)}}),k},t.startTransition=function(x){var k=rt.T,B={};B._updatedFibers=new Set,rt.T=B;try{var j=x(),J=rt.S;J!==null&&J(B,j),typeof j=="object"&&j!==null&&typeof j.then=="function"&&(rt.asyncTransitions++,j.then(ft,ft),j.then(c,Is))}catch(ct){Is(ct)}finally{k===null&&B._updatedFibers&&(x=B._updatedFibers.size,B._updatedFibers.clear(),10<x&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),k!==null&&B.types!==null&&(k.types!==null&&k.types!==B.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),k.types=B.types),rt.T=k}},t.unstable_useCacheRefresh=function(){return q().useCacheRefresh()},t.use=function(x){return q().use(x)},t.useActionState=function(x,k,B){return q().useActionState(x,k,B)},t.useCallback=function(x,k){return q().useCallback(x,k)},t.useContext=function(x){var k=q();return x.$$typeof===W&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),k.useContext(x)},t.useDebugValue=function(x,k){return q().useDebugValue(x,k)},t.useDeferredValue=function(x,k){return q().useDeferredValue(x,k)},t.useEffect=function(x,k){return x==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),q().useEffect(x,k)},t.useEffectEvent=function(x){return q().useEffectEvent(x)},t.useId=function(){return q().useId()},t.useImperativeHandle=function(x,k,B){return q().useImperativeHandle(x,k,B)},t.useInsertionEffect=function(x,k){return x==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),q().useInsertionEffect(x,k)},t.useLayoutEffect=function(x,k){return x==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),q().useLayoutEffect(x,k)},t.useMemo=function(x,k){return q().useMemo(x,k)},t.useOptimistic=function(x,k){return q().useOptimistic(x,k)},t.useReducer=function(x,k,B){return q().useReducer(x,k,B)},t.useRef=function(x){return q().useRef(x)},t.useState=function(x){return q().useState(x)},t.useSyncExternalStore=function(x,k,B){return q().useSyncExternalStore(x,k,B)},t.useTransition=function(){return q().useTransition()},t.version="19.2.5",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(Bs,Bs.exports)),Bs.exports}({}).NODE_ENV==="production"?ed():nd();const hi={}.NODE_ENV!=="production"?Object.freeze({}):{},sd=()=>{},gc=Object.assign,yc=Array.isArray,Us=s=>typeof s=="function",rd=s=>typeof s=="string",id=s=>typeof s=="symbol",li=s=>s!==null&&typeof s=="object";let bc;const $s=()=>bc||(bc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(id));function wc(s){return ui(s)?wc(s.__v_raw):!!(s&&s.__v_isReactive)}function ui(s){return!!(s&&s.__v_isReadonly)}function fi(s){return!!(s&&s.__v_isShallow)}function En(s){const t=s&&s.__v_raw;return t?En(t):s}function vc(s){return s?s.__v_isRef===!0:!1}/**
30
+ * @vue/runtime-core v3.5.13
31
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
32
+ * @license MIT
33
+ **/const an=[];function od(s){an.push(s)}function ad(){an.pop()}let di=!1;function cd(s,...t){if(di)return;di=!0;const e=an.length?an[an.length-1].component:null,n=e&&e.appContext.config.warnHandler,r=hd();if(n)mi(n,e,11,[s+t.map(i=>{var o,a;return(a=(o=i.toString)==null?void 0:o.call(i))!=null?a:JSON.stringify(i)}).join(""),e&&e.proxy,r.map(({vnode:i})=>`at <${Mc(e,i.type)}>`).join(`
34
+ `),r]);else{const i=[`[Vue warn]: ${s}`,...t];r.length&&i.push(`
35
+ `,...ld(r)),console.warn(...i)}di=!1}function hd(){let s=an[an.length-1];if(!s)return[];const t=[];for(;s;){const e=t[0];e&&e.vnode===s?e.recurseCount++:t.push({vnode:s,recurseCount:0});const n=s.component&&s.component.parent;s=n&&n.vnode}return t}function ld(s){const t=[];return s.forEach((e,n)=>{t.push(...n===0?[]:[`
36
+ `],...ud(e))}),t}function ud({vnode:s,recurseCount:t}){const e=t>0?`... (${t} recursive calls)`:"",n=s.component?s.component.parent==null:!1,r=` at <${Mc(s.component,s.type,n)}`,i=">"+e;return s.props?[r,...fd(s.props),i]:[r+i]}function fd(s){const t=[],e=Object.keys(s);return e.slice(0,3).forEach(n=>{t.push(...xc(n,s[n]))}),e.length>3&&t.push(" ..."),t}function xc(s,t,e){return rd(t)?(t=JSON.stringify(t),e?t:[`${s}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?e?t:[`${s}=${t}`]:vc(t)?(t=xc(s,En(t.value),!0),e?t:[`${s}=Ref<`,t,">"]):Us(t)?[`${s}=fn${t.name?`<${t.name}>`:""}`]:(t=En(t),e?t:[`${s}=`,t])}const Sc={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function mi(s,t,e,n){try{return n?s(...n):s()}catch(r){_c(r,t,e)}}function _c(s,t,e,n=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||hi;if(t){let a=t.parent;const c=t.proxy,h={}.NODE_ENV!=="production"?Sc[e]:`https://vuejs.org/error-reference/#runtime-${e}`;for(;a;){const l=a.ec;if(l){for(let u=0;u<l.length;u++)if(l[u](s,c,h)===!1)return}a=a.parent}if(i){mi(i,null,10,[s,c,h]);return}}dd(s,e,r,n,o)}function dd(s,t,e,n=!0,r=!1){if({}.NODE_ENV!=="production"){const i=Sc[t];if(e&&od(e),cd(`Unhandled error${i?` during execution of ${i}`:""}`),e&&ad(),n)throw s;console.error(s)}else{if(r)throw s;console.error(s)}}const oe=[];let Pe=-1;const Tn=[];let Ge=null,Pn=0;const md=Promise.resolve();let pi=null;const pd=100;function gd(s){let t=Pe+1,e=oe.length;for(;t<e;){const n=t+e>>>1,r=oe[n],i=Wn(r);i<s||i===s&&r.flags&2?t=n+1:e=n}return t}function yd(s){if(!(s.flags&1)){const t=Wn(s),e=oe[oe.length-1];!e||!(s.flags&2)&&t>=Wn(e)?oe.push(s):oe.splice(gd(t),0,s),s.flags|=1,Cc()}}function Cc(){pi||(pi=md.then(Ec))}function bd(s){yc(s)?Tn.push(...s):Ge&&s.id===-1?Ge.splice(Pn+1,0,s):s.flags&1||(Tn.push(s),s.flags|=1),Cc()}function wd(s){if(Tn.length){const t=[...new Set(Tn)].sort((e,n)=>Wn(e)-Wn(n));if(Tn.length=0,Ge){Ge.push(...t);return}for(Ge=t,{}.NODE_ENV!=="production"&&(s=s||new Map),Pn=0;Pn<Ge.length;Pn++){const e=Ge[Pn];({}).NODE_ENV!=="production"&&Tc(s,e)||(e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2)}Ge=null,Pn=0}}const Wn=s=>s.id==null?s.flags&2?-1:1/0:s.id;function Ec(s){({}).NODE_ENV!=="production"&&(s=s||new Map);const t={}.NODE_ENV!=="production"?e=>Tc(s,e):sd;try{for(Pe=0;Pe<oe.length;Pe++){const e=oe[Pe];if(e&&!(e.flags&8)){if({}.NODE_ENV!=="production"&&t(e))continue;e.flags&4&&(e.flags&=-2),mi(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2)}}}finally{for(;Pe<oe.length;Pe++){const e=oe[Pe];e&&(e.flags&=-2)}Pe=-1,oe.length=0,wd(s),pi=null,(oe.length||Tn.length)&&Ec(s)}}function Tc(s,t){const e=s.get(t)||0;if(e>pd){const n=t.i,r=n&&Ac(n.type);return _c(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return s.set(t,e+1),!1}const gi=new Map;({}).NODE_ENV!=="production"&&($s().__VUE_HMR_RUNTIME__={createRecord:yi(vd),rerender:yi(xd),reload:yi(Sd)});const Ys=new Map;function vd(s,t){return Ys.has(s)?!1:(Ys.set(s,{initialDef:js(t),instances:new Set}),!0)}function js(s){return Ed(s)?s.__vccOpts:s}function xd(s,t){const e=Ys.get(s);e&&(e.initialDef.render=t,[...e.instances].forEach(n=>{t&&(n.render=t,js(n.type).render=t),n.renderCache=[],n.update()}))}function Sd(s,t){const e=Ys.get(s);if(!e)return;t=js(t),Pc(e.initialDef,t);const n=[...e.instances];for(let r=0;r<n.length;r++){const i=n[r],o=js(i.type);let a=gi.get(o);a||(o!==e.initialDef&&Pc(o,t),gi.set(o,a=new Set)),a.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(a.add(i),i.ceReload(t.styles),a.delete(i)):i.parent?yd(()=>{i.parent.update(),a.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(o)}bd(()=>{gi.clear()})}function Pc(s,t){gc(s,t);for(const e in s)e!=="__file"&&!(e in t)&&delete s[e]}function yi(s){return(t,e)=>{try{return s(t,e)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}$s().requestIdleCallback,$s().cancelIdleCallback;{const s=$s(),t=(e,n)=>{let r;return(r=s[e])||(r=s[e]=[]),r.push(n),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};t("__VUE_INSTANCE_SETTERS__",e=>e),t("__VUE_SSR_SETTERS__",e=>e)}const _d=/(?:^|[-_])(\w)/g,Cd=s=>s.replace(_d,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ac(s,t=!0){return Us(s)?s.displayName||s.name:s.name||t&&s.__name}function Mc(s,t,e=!1){let n=Ac(t);if(!n&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(n=r[1])}if(!n&&s&&s.parent){const r=i=>{for(const o in i)if(i[o]===t)return o};n=r(s.components||s.parent.type.components)||r(s.appContext.components)}return n?Cd(n):e?"App":"Anonymous"}function Ed(s){return Us(s)&&"__vccOpts"in s}function Td(){if({}.NODE_ENV==="production"||typeof window>"u")return;const s={style:"color:#3ba776"},t={style:"color:#1677ff"},e={style:"color:#f5222d"},n={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(u){return li(u)?u.__isVue?["div",s,"VueInstance"]:vc(u)?["div",{},["span",s,l(u)],"<",a("_value"in u?u._value:u),">"]:wc(u)?["div",{},["span",s,fi(u)?"ShallowReactive":"Reactive"],"<",a(u),`>${ui(u)?" (readonly)":""}`]:ui(u)?["div",{},["span",s,fi(u)?"ShallowReadonly":"Readonly"],"<",a(u),">"]:null:null},hasBody(u){return u&&u.__isVue},body(u){if(u&&u.__isVue)return["div",{},...i(u.$)]}};function i(u){const d=[];u.type.props&&u.props&&d.push(o("props",En(u.props))),u.setupState!==hi&&d.push(o("setup",u.setupState)),u.data!==hi&&d.push(o("data",En(u.data)));const f=c(u,"computed");f&&d.push(o("computed",f));const m=c(u,"inject");return m&&d.push(o("injected",m)),d.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),d}function o(u,d){return d=gc({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(f=>["div",{},["span",n,f+": "],a(d[f],!1)])]]:["span",{}]}function a(u,d=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",e,JSON.stringify(u)]:typeof u=="boolean"?["span",n,u]:li(u)?["object",{object:d?En(u):u}]:["span",e,String(u)]}function c(u,d){const f=u.type;if(Us(f))return;const m={};for(const p in u.ctx)h(f,p,d)&&(m[p]=u.ctx[p]);return m}function h(u,d,f){const m=u[f];if(yc(m)&&m.includes(d)||li(m)&&d in m||u.extends&&h(u.extends,d,f)||u.mixins&&u.mixins.some(p=>h(p,d,f)))return!0}function l(u){return fi(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}/**
37
+ * vue v3.5.13
38
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
39
+ * @license MIT
40
+ **/function Pd(){Td()}({}).NODE_ENV!=="production"&&Pd();var bi=function(s,t){return bi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])},bi(s,t)};function An(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");bi(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function wi(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function vi(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),r,i=[],o;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)i.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return i}function xi(s,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return s.concat(i||Array.prototype.slice.call(t))}function Ae(s){return typeof s=="function"}function kc(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Si=kc(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
41
+ `+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
42
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function _i(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var Xs=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=wi(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(Ae(l))try{l()}catch(p){i=p instanceof Si?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=wi(u),f=d.next();!f.done;f=d.next()){var m=f.value;try{Oc(m)}catch(p){i=i??[],p instanceof Si?i=xi(xi([],vi(i)),vi(p.errors)):i.push(p)}}}catch(p){n={error:p}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(i)throw new Si(i)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Oc(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&_i(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&_i(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),Ic=Xs.EMPTY;function Dc(s){return s instanceof Xs||s&&"closed"in s&&Ae(s.remove)&&Ae(s.add)&&Ae(s.unsubscribe)}function Oc(s){Ae(s)?s():s.unsubscribe()}var Rc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ad={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,xi([s,t],vi(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Md(s){Ad.setTimeout(function(){throw s})}function Lc(){}function Gs(s){s()}var Ci=function(s){An(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Dc(e)&&e.add(n)):n.destination=Od,n}return t.create=function(e,n,r){return new Ti(e,n,r)},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,s.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}(Xs),kd=Function.prototype.bind;function Ei(s,t){return kd.call(s,t)}var Id=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){Vs(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Vs(n)}else Vs(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Vs(e)}},s}(),Ti=function(s){An(t,s);function t(e,n,r){var i=s.call(this)||this,o;if(Ae(e)||!e)o={next:e??void 0,error:n??void 0,complete:r??void 0};else{var a;i&&Rc.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return i.unsubscribe()},o={next:e.next&&Ei(e.next,a),error:e.error&&Ei(e.error,a),complete:e.complete&&Ei(e.complete,a)}):o=e}return i.destination=new Id(o),i}return t}(Ci);function Vs(s){Md(s)}function Dd(s){throw s}var Od={closed:!0,next:Lc,error:Dd,complete:Lc},Rd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ld(s){return s}function zd(s){return s.length===0?Ld:s.length===1?s[0]:function(t){return s.reduce(function(e,n){return n(e)},t)}}var zc=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var r=this,i=Fd(t)?t:new Ti(t,e,n);return Gs(function(){var o=r,a=o.operator,c=o.source;i.add(a?a.call(i,c):c?r._subscribe(i):r._trySubscribe(i))}),i},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Nc(e),new e(function(r,i){var o=new Ti({next:function(a){try{t(a)}catch(c){i(c),o.unsubscribe()}},error:i,complete:r});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Rd]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return zd(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Nc(t),new t(function(n,r){var i;e.subscribe(function(o){return i=o},function(o){return r(o)},function(){return n(i)})})},s.create=function(t){return new s(t)},s}();function Nc(s){var t;return(t=s??Rc.Promise)!==null&&t!==void 0?t:Promise}function Nd(s){return s&&Ae(s.next)&&Ae(s.error)&&Ae(s.complete)}function Fd(s){return s&&s instanceof Ci||Nd(s)&&Dc(s)}(function(s){An(t,s);function t(e,n,r,i,o,a){var c=s.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(h){try{n(h)}catch(l){e.error(l)}}:s.prototype._next,c._error=i?function(h){try{i(h)}catch(l){e.error(l)}finally{this.unsubscribe()}}:s.prototype._error,c._complete=r?function(){try{r()}catch(h){e.error(h)}finally{this.unsubscribe()}}:s.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Ci);var Bd=kc(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Fc=function(s){An(t,s);function t(){var e=s.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 n=new Bc(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Bd},t.prototype.next=function(e){var n=this;Gs(function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=wi(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var n=this;Gs(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var r=n.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;Gs(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.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(),s.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 n=this,r=this,i=r.hasError,o=r.isStopped,a=r.observers;return i||o?Ic:(this.currentObservers=null,a.push(e),new Xs(function(){n.currentObservers=null,_i(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,r=n.hasError,i=n.thrownError,o=n.isStopped;r?e.error(i):o&&e.complete()},t.prototype.asObservable=function(){var e=new zc;return e.source=this,e},t.create=function(e,n){return new Bc(e,n)},t}(zc),Bc=function(s){An(t,s);function t(e,n){var r=s.call(this)||this;return r.destination=e,r.source=n,r}return t.prototype.next=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)},t.prototype.error=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:Ic},t}(Fc);(function(s){An(t,s);function t(e){var n=s.call(this)||this;return n._value=e,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var n=s.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},t.prototype.getValue=function(){var e=this,n=e.hasError,r=e.thrownError,i=e._value;if(n)throw r;return this._throwIfClosed(),i},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t})(Fc);const qs=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(qs("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^[1]{1}[0-9]{10}$/;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
2
43
  [\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
3
44
  |[\u{4E00}-\u{9FCC}]
4
45
  |[\u{3400}-\u{4DB5}]
@@ -7,38 +48,43 @@
7
48
  |[\u{2B740}-\u{2B81D}]
8
49
  |[\u{2B820}-\u{2CEAF}]
9
50
  |[\u{2CEB0}-\u{2EBEF}]
10
- `.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},ue=(s,t)=>(typeof s=="string"&&(s=bs(s)||new RegExp(s)),s.test(t)),Ma=(s,t)=>{typeof s=="string"&&(s=bs(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},Aa=(s,t)=>{typeof s=="string"&&(s=bs(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const i of n)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function sf(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function Ia(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Dn(s=12,t="all"){let e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789";t=="number"&&(e="0123456789");const n=e.length;let i="";for(let r=0;r<s;r++)i+=e[Math.floor(Math.random()*n)];return i}function rf(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const dt=(s,t="-")=>{let e=s.replace(new RegExp("[_-]?([A-Z])","g"),t+"$1").toLowerCase();const n=new RegExp(`^${t}`);return n.test(s)||(e=e.replace(n,"")),e};function of(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function Da(s){return rf(of(s))}function ka(s){let t="";for(let e=0,n=s.length;e<n;e++){const i=s.charCodeAt(e);i>=1&&i<=127?t+=s.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function af(s){return s.slice(0)}function hf(s,t=!0){const e=t?af(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}const cf="[object Undefined]",lf="[object Null]",uf="[object Boolean]",ff="[object Number]",df="[object BigInt]",La="[object String]",mf="[object Symbol]",pf="[object Function]",gf="[object Array]",yf="[object GeneratorFunction]";function xs(s){return Object.prototype.toString.call(s)}function wf(s){return s!=null}function bf(s){return xs(s)===La}function Ra(s){const t=xs(s);return t===cf||t===lf||t===uf||t===ff||t===La||t===mf||t===df}function xf(s){const t=xs(s);return t==pf||t==yf}function vs(s){return xs(s)===gf}function Ss(s){return!!s&&typeof s=="object"}function kn(s){return Ss(s)&&!vs(s)}const Oa=s=>{for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t))return!1;return!0};function za(s){const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&t.push(e);return t}function cn(s,t,e=!0){if(kn(s)&&kn(t))for(const n of za(t))(e||typeof s[n]>"u")&&(kn(s[n])&&kn(t[n])?cn(s[n],t[n],e):s[n]=t[n]);return s}function Na(s,...t){return new s.constructor(...t)}function Xe(s,t=`\r
11
- `,e=6,n=1){if(bf(s))return`"${s}"`;if(Ra(s))return""+s;if(xf(s))return"[Fn]";if(n>e)return vs(s)?"[...]":"{...}";let i="",r="";for(let o=0;o<n;o++)i+=" ",o>0&&(r+=" ");return vs(s)?`[${s.map(o=>t+i+Xe(o,t,e,n+1)).join(", ")}${t}${r}]`:`{${za(s).map(o=>`${t}${i}${o}: ${Xe(s[o],t,e,n+1)}`).join(", ")}${t}${r}}`}function vf(s,t="",e=["","sign","key"]){return kn(s)?Object.keys(s).filter(n=>{for(let i=0,r=e.length;i<r;i++)if(s[n]==e[i])return!1;return!0}).sort().map(n=>`${n}=${s[n]}`).join("&")+t:String(s)}function Ba(s,t,e=""){let n=[];return s===t?n:typeof s!="object"||typeof t!="object"||!s||!t?(n.push({path:e,newValue:t,oldValue:s}),n):(new Set([...Object.keys(s),...Object.keys(t)]).forEach(i=>{const r=e?`${e}.${i}`:i;n=n.concat(Ba(s[i],t[i],r))}),n)}function Sf(s){return Number.isNaN(s)}function _f(s){if(s<=1)return!1;for(let t=2;t<=Math.sqrt(s);t++)if(s%t===0)return!1;return!0}function Cf(s){for(;!_f(s);)s++;return s}function Wt(s,t){const e=parseFloat(s);return Number.isNaN(e)?typeof t=="number"?t:NaN:e}function Oi(s=1e-6){return function(t,e){return Math.abs(t-e)<s}}function B(s,t,e){const n=Math.min(t,e),i=Math.max(t,e);return s<n?n:s>i?i:s}function Ef(s,t){return(s%t+t)%t}function _s(s,t,e){return typeof s=="number"&&typeof t=="number"?(1-e)*s+e*t:typeof s=="number"?s:typeof t=="number"?t:0}function Pf(s,t,e){const n=Math.max(s.length,t.length),i=new Array(n);for(let r=0;r<n;r++)i[r]=_s(s[r],t[r],e);return i}function Tf(s,t,e){return n=>{const i=B(n,s,t);return e==0?i:t-i<e?t:Math.round(i/e)*e}}function Mf(s,t=12){return Wt(s,0).toFixed(t)}function F(s,t=12){return+Mf(s,t)}function zi(s,t){const e=Ma("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):wf(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(e.matchIndex+e.fullMatch.length):""}}function Ni(s){const t=Ma("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function Af(s=[],t=[]){const e=s.length,n=t.length;for(let r=0;r<n;r++)s[r]=t[r];let i=Math.max(0,e-n);for(;i>0;)s.pop(),i--;return s}function Fa(s,t){const e=s.findIndex(n=>n===t);return e>=0&&s.splice(e,1),s}function Ya(s,t){return s.findIndex(e=>e==t)>=0}function If(s,...t){return t.forEach(e=>{Ya(s,e)||s.push(e)}),s}function lt(){return(performance||Date).now()}function $t(s=new Date){return s.getTime()}function Df(s=new Date,t="yyyy-mm-dd hh:ii:ss.SSS"){return Nf(s,t)}function kf(s){return!Sf(s.valueOf())}function Lf(s,t=3){const e=Math.max(s.length,6);let n="";for(let r=0;r<e-4;r++)n+=s[r]||"0";const i=[n,""+(s[e-4]||"0")+(s[e-3]||"0"),""+(s[e-2]||"0")+(s[e-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+":"+i[1];case 3:return i[0]+":"+i[1]+":"+i[2]}}function Rf(s){const t=Math.max(s.length,6);let e=0;e+=(s[t-2]||0)*10+(s[t-1]||0),e+=((s[t-4]||0)*10+(s[t-3]||0))*60;let n=0;for(let i=0;i<t-4;i++)n=n*10+(s[i]||0);return e+=n*60*60,Math.floor(Math.max(0,e))}function Of(s,t=!1){let e=0;typeof s=="number"?e=s:e=Rf(s);const n=[],i=e%60;n.unshift(i%10),n.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(n.unshift(r%10),n.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(n.unshift(o%10),n.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)n.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;n.unshift(o%10),n.unshift(Math.floor(o/10))}return n}function zf(s,t=1,e=!1){return s[s.length-1]+=t,Of(s,e)}function Nf(s,t="yyyy-mm-dd hh:ii:ss"){if(!kf(s))return"";const e=/(y+)/.exec(t);if(e&&e[1]){const i=e[1];t=t.replace(i,(s.getFullYear()+"").substring(4-i.length))}const n={"m+":s.getMonth()+1,"d+":s.getDate(),"h+":s.getHours(),"i+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),"S+":s.getMilliseconds()};for(const i in n){const r=new RegExp("("+i+")").exec(t);if(r&&r[1]){const o=r[1];t=t.replace(o,o.length===1?""+n[i]:("00"+n[i]).slice(-o.length))}}return t}function Cs(s,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,n=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function i(o,a=!1){return Ra(o)||vs(o)?{v:o,[An]:$t()}:a&&nf(o,An)?o:{...o,[An]:$t()}}let r=i(s,!0);return{get:()=>{let o=!1;return(e>=0&&$t()>r[An]+e*1e3||n>=0&&$t()>n)&&(o=!0),o&&(r.v=void 0),r},set:o=>r=i(o)}}const Bf=typeof window<"u";!!(St.Worker&&St.Blob&&St.Promise&&St.OffscreenCanvas&&St.OffscreenCanvasRenderingContext2D&&St.HTMLCanvasElement&&St.HTMLCanvasElement.prototype.transferControlToOffscreen&&St.URL&&St.URL.createObjectURL);const Ff=(()=>{if(!St.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");if(!t)return!1;t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0})();let Xa;try{Xa=Map}catch{Xa=function(){}}let Ua;try{Ua=Set}catch{Ua=function(){}}const ln=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(n||i||r)&&(e=e.slice(2)),n&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return o};function Bi(s){return new TextEncoder().encode(s)}function $a(s){return String.fromCharCode.apply(null,new Uint16Array(s))}function Fi(s,t){const e=t?.mime,n=t?.encode,i=t?.type;return i?new Blob([s],{type:i}):e?n===ws.base64?new Blob([s],{type:`${e};${n}`}):n===ws.utf8?new Blob([s],{type:`${e};charset=${n}`}):new Blob([s],{type:`${e}`}):new Blob([s])}const Yf=s=>{let t=Et.UNKNOWN;switch(new DataView(s).getUint32(0,Xf()).toString(16).toUpperCase()){case"FFD8FFDB":t=Et.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Et.JPEG;break;case"89504E47":t=Et.PNG;break;case"47494638":t=Et.GIF;break;case"52494646":t=Et.WEBP;break;case"25504446":t=Et.PDF;break;case"504B0304":t=Et.ZIP;break}return t};function Xf(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Ln={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class Uf{queue;limit;overflow;constructor(t=10,e=Ln.EXPAND){this.queue=[],this.limit=t,this.overflow=e}length(){return this.queue.length}isEmpty(){return this.length()===0}findIndex(t){return this.queue.findIndex(t)}deleteIndex(t){return!!this.queue.splice(t,1).length}delete(t){const e=this.findIndex(t);return e>-1?this.deleteIndex(e):!1}enqueue(t){if(this.length()<this.limit){this.queue.push(t);return}switch(this.overflow){case Ln.EXPAND:this.limit*=2,this.queue.push(t);break;case Ln.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Ln.THROW:throw new Error(`Queue limit(${this.limit}) overflow!`)}}push(t){this.enqueue(t)}put(t){this.enqueue(t)}dequeue(){return this.queue.shift()}pop(){return this.dequeue()}take(){return this.dequeue()}peek(){return this.queue[0]}index(t){return this.queue[t]}clear(){this.queue=[]}flush(){const t=[];let e;for(;e=this.dequeue();)t.push(e);return t}}const $f=s=>new Uf(s,Ln.EXPAND),Ga={SLIDE:1,EXPAND:2};class Gf{size;table;objectSignature;overflow;ttl;constructor(t){this.table=new Array(t?.size||137),this.size=this.table.length,this.objectSignature=t?.objectSignature||(e=>String(e)),this.overflow=t?.overflow||Ga.EXPAND,this.ttl=t?.ttl||6e4}hash(t){if(t==null||t==null)throw new Error("HashTable can't put undefined or null");const e=this.objectSignature(t),n=31;let i=0;for(let r=0,o=e.length;r<o;r++)i+=n*i+e.charCodeAt(r);return i%this.size}resize(){const t=this.size,e=Cf(this.size*2),n=new Array(e),i=this.table;this.table=n,this.size=e;for(let r=0,o=t;r<o;r++)if(i[r]!==void 0&&!this.isOutdated(i[r])){let a=this.hash(i[r].value);for(;n[a]!==void 0;)a=(a+1)%e;n[a]=i[r]}i.length=0}put(t){this.size>200&&Math.random()<.1&&this.clean();let e=this.hash(t);const n=e;for(;this.table[e]!==void 0&&!this.isOutdated(this.table[e]);)if(e=(e+1)%this.size,n==e){if(this.overflow==Ga.EXPAND)return this.resize(),this.put(t);break}return this.table[e]={value:t,timestamp:Date.now()},e}traverse(t){for(let e=0,n=this.size;e<n;e++)if(this.table[e]!==void 0&&!t(this.table[e].value,e))return e;return-1}update(t){this.traverse((e,n)=>(t(e)===!1&&this.deleteIndex(n),!0))}getIndex(t){let e=this.hash(t);const n=e;for(;this.table[e]?.value!==t;)if(this.table[e]===void 0||(this.isOutdated(this.table[e])&&(this.table[e]=void 0),e=(e+1)%this.size,n==e))return-1;return this.isOutdated(this.table[e])?(this.table[e]=void 0,-1):e}has(t){return this.getIndex(t)>=0}find(t){const e=this.traverse(n=>!t(n));return e>=0?this.table[e]?.value:void 0}deleteIndex(t){return t>=0&&t<this.size&&this.table[t]!==void 0?(this.table[t]=void 0,!0):!1}delete(t){return this.deleteIndex(this.getIndex(t))}clear(){this.table=[]}isOutdated(t){return Date.now()-t.timestamp>this.ttl}clean(){for(let t=0,e=this.size;t<e;t++)this.table[t]!==void 0&&this.isOutdated(this.table[t])&&(this.table[t]=void 0)}}class Rn{maps=new Map;constructor(){}entries(){return[...this.maps.entries()]}keys(){return[...this.maps.keys()]}values(){return[...this.maps.values()]}json(){const t={};for(const e of this.maps)t[e[0]]=e[1];return t}get length(){return this.maps.size}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){let e=-1;for(const n of this.maps)if(++e==t)return n}getEntry(t){for(const e of this.maps)if(t(e[0],e[1]))return e}firstEntry(){return this.getEntryFromIndex(0)}shift(){const t=this.firstEntry();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.maps.delete(t)}clear(){this.maps.clear()}update(t){const e=this.entries();for(let n=0,i=e.length;n<i;n++){const[r,o]=e[n];t(r,o)===!1&&this.delete(r)}}}function Vf(){St.OPEN_LOG=!0}function jf(){St.OPEN_LOG=!1}function qf(s){St.LOG_UPLOAD_FN=s}function Va(){return!!St.OPEN_LOG}function ja(s){St.LOG_UPLOAD_FN&&St.LOG_UPLOAD_FN(s)}function ie(s){ja({level:"info",msg:s}),Va()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(s))}function Es(s){ja({level:"warn",msg:s}),Va()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(s))}const qa=()=>{};function Ha(s=0,t){const e=t?.min||300,n=t?.max||6e4,i=t?.exponent||2,r=t?.factor||.5;let o=e*Math.pow(i,s);if(r){const a=Math.random(),h=Math.floor(a*r*o);o=Math.floor(a*10)&1?o+h:o-h}return Math.min(o,n)|0}function Yi(s,t=3,e,n){return async function(...i){const r=`retry(${s.name})(${i.map(a=>Xe(a))})`;let o;for(let a=0;a<t;a++)try{return await s.call(n||this,...i)}catch(h){ie(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:Ha(a)))}throw ie(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${Xe(o)}`),o}}function Xi(s,t=60,e=new Rn,n){return async function(...i){const r=`cache(${s.name})(${i.map(c=>Xe(c))})`,o=Date.now();t&&e.update((c,l)=>o-l.timestamp<t*1e3);const a=Ri(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return ie(`${r} 击中缓存`),h.value;e.delete(a)}try{ie(`${r} 没有缓存, 尝试立即执行...`);const c=await s.call(n||this,...i);return ie(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw ie(`${r} 执行失败 : ${Xe(c)}`),c}}}var Ui=function(s,t){return Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Ui(s,t)};function $i(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ui(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Wa(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Gi(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Vi(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function fe(s){return typeof s=="function"}function Hf(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ji=Hf(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
12
- `+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
13
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Ja(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var qi=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Wa(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(g){t={error:g}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(fe(l))try{l()}catch(g){r=g instanceof ji?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=Wa(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Ka(p)}catch(g){r=r??[],g instanceof ji?r=Vi(Vi([],Gi(r)),Gi(g.errors)):r.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new ji(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ka(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Ja(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Ja(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}();qi.EMPTY;function Za(s){return s instanceof qi||s&&"closed"in s&&fe(s.remove)&&fe(s.add)&&fe(s.unsubscribe)}function Ka(s){fe(s)?s():s.unsubscribe()}var Qa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Wf={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,Vi([s,t],Gi(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Jf(s){Wf.setTimeout(function(){throw s})}function th(){}function Zf(s){s()}var Hi=function(s){$i(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Za(e)&&e.add(n)):n.destination=ed,n}return t.create=function(e,n,i){return new Ji(e,n,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,s.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}(qi),Kf=Function.prototype.bind;function Wi(s,t){return Kf.call(s,t)}var Qf=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){Ps(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Ps(n)}else Ps(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Ps(e)}},s}(),Ji=function(s){$i(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(fe(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Qa.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Wi(e.next,a),error:e.error&&Wi(e.error,a),complete:e.complete&&Wi(e.complete,a)}):o=e}return r.destination=new Qf(o),r}return t}(Hi);function Ps(s){Jf(s)}function td(s){throw s}var ed={closed:!0,next:th,error:td,complete:th},nd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function sd(s){return s}function id(s){return s.length===0?sd:s.length===1?s[0]:function(t){return s.reduce(function(e,n){return n(e)},t)}}(function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=od(t)?t:new Ji(t,e,n);return Zf(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=eh(e),new e(function(i,r){var o=new Ji({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[nd]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return id(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=eh(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s})();function eh(s){var t;return(t=s??Qa.Promise)!==null&&t!==void 0?t:Promise}function rd(s){return s&&fe(s.next)&&fe(s.error)&&fe(s.complete)}function od(s){return s&&s instanceof Hi||rd(s)&&Za(s)}(function(s){$i(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(l){e.error(l)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Hi);class ad extends Error{name;response;statusCode;constructor(t,e){super(t),this.name="HttpError",this.response=e,this.statusCode=e.status}toJSON(){return{name:this.name,message:this.message,stack:this.stack,response:this.response,statusCode:this.statusCode}}}let On;function Ee(s){On=s,s(),On=null}class hd{subscribers=new Set;add(){On&&!this.subscribers.has(On)&&this.subscribers.add(On)}notify(t){this.subscribers.forEach(e=>e(t))}}const nh=new WeakMap;function Zi(s,t){let e=nh.get(s);e||(e=new Map,nh.set(s,e));let n=e.get(t);return n||(n=new hd,e.set(t,n)),n}const Ki=sh;function sh(s,t){if(!Ss(s))return s;const e=typeof t?.deep=="boolean"?t?.deep:!0,n=t?.path||"",i=t?.callback,r={get(o,a,h){const c=n?`${n}.${String(a)}`:String(a);let l=Reflect.get(o,a,h);const u=Zi(o,a);if(e&&Ss(l)&&!("isYZProxy"in l)){const m=sh(l,{deep:!0,path:c,callback:i});Array.isArray(l)&&(m.YZProxyArrayDep=u),l=m}return u.add(),l},set(o,a,h,c){const l=Reflect.get(o,a,c),u=Reflect.set(o,a,h,c);if(a=="YZProxyArrayDep")return u;if(l!==h){let m;Array.isArray(o)?m=o.YZProxyArrayDep:m=Zi(o,a);const f={path:n?`${n}.${String(a)}`:String(a),newValue:h,oldValue:l};m.notify(f),i&&i(f)}return u},deleteProperty(o,a){if(!(a in o))return!1;let h=typeof a=="symbol"?void 0:o[a];Ss(h)&&(h=Array.isArray(h)?[...h]:{...h});const c=Reflect.deleteProperty(o,a);if(c){let l;Array.isArray(o)?l=o.YZProxyArrayDep:l=Zi(o,a);const u={path:n?`${n}.${String(a)}`:String(a),newValue:void 0,oldValue:h};l.notify(u),i&&i(u)}return c},has(o,a){return a==="isYZProxy"||a in o}};return new Proxy(s,r)}class Ts{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(n?e.bind(n):e),this}addListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n?e.bind(n):e),this}on(t,e,n){return this.addListener(t,e,n),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(n=>{n(...e)}),this}once(t,e,n){const i=(...r)=>{n?e.apply(n,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function cd(s,t=(e,n)=>e<=n){const e=s.length;let n=Math.floor(e/2);for(;n>0;){for(let i=n;i<e;i++){const r=s[i];let o=i;for(;o>=n&&!t(s[o-n],r);)s[o]=s[o-n],o-=n;s[o]=r}n=Math.floor(n/2)}}function ld(){const s={};return s.promise=new Promise((t,e)=>{s.resolve=t,s.reject=e}),s}let ud=0;function ih(s){const t=ld();let e=!1;return{name:s.name||String(++ud),deadline:typeof s.deadline=="number"?Math.max(s.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let n;const i=s.args||[];s.thisArg?n=await s.fn.call(s.thisArg,...i):n=await s.fn(...i),t.resolve(n)}catch(n){t.reject(n)}}},result:()=>t.promise}}class fd{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||$f(10),typeof t?.concurrency=="number"&&(this.concurrency=Math.max(t?.concurrency,1)),typeof t?.timeRemaining=="number"&&this.setTimeRemaining(t.timeRemaining)}setTimeRemaining(t){this.timeRemaining=Math.max(0,t)}increaseTimeRemaining(t,e=!1){this.timeRemaining!==-1?this.setTimeRemaining(this.timeRemaining+t):e&&this.setTimeRemaining(t)}decreaseTimeRemaining(t){this.timeRemaining!==-1&&this.setTimeRemaining(this.timeRemaining-t)}_exec(t,e=!0){const n=$t();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining($t()-n),this._flush())}}_flush(){for(;!this.suspend&&this.semaphore<this.concurrency&&(this.timeRemaining==-1||this.timeRemaining>0);){const t=this.queue.dequeue();if(!t)break;this._exec(t)}this._timeout()}_timeout(t=0,e=0){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{if(!(this.suspend||this.semaphore>0||!this.queue.length)){for(let n=0;n<this.queue.length();){const i=this.queue.index(n);if(!i)break;i.deadline!=-1&&i.deadline<=$t()?(this._exec(i,!1),this.queue.deleteIndex(n)):n++}this.queue.length()&&(this.timeoutId=setTimeout(()=>{this._timeout(t,++e)},300*Math.pow(2,e)))}},t)}pause(){this.suspend=!0}resume(){this.suspend=!1,this._flush()}addTask(t){this.queue.delete(e=>e.name==t.name),this.queue.enqueue(t)}immediately(t){this._exec(t),this._flush()}asap(t){this.addTask(t),this._flush()}idleCallback(t){this.setTimeRemaining(t.timeRemaining()),this._flush()}clear(){this.queue.clear()}}class rh extends fd{lastResult;constructor(t){super(t)}_exec(t,e=!0){const n=$t();try{this.semaphore++,t.run()}finally{t.result().then(i=>{this.lastResult=i}).finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining($t()-n),this._flush())})}}}class dd{schedule;closeLastDialog;constructor(t){this.schedule=new rh(t)}asap(t,e){const n=ih({fn:i=>new Promise(r=>{this.closeLastDialog=t({...i,onClose:()=>{this.closeLastDialog=void 0,i?.onClose?.(),r()}})}),args:[e]});return this.schedule.asap(n),n}immediately(t,e){return this.clear(),this.asap(t,e)}closeLast(){this.closeLastDialog&&this.closeLastDialog()}clear(){this.schedule.clear(),this.closeLast()}}function oh(s){const t=typeof s.immutable=="boolean"?s.immutable:!0,e=s.initState||{};let n=s.reducer;if(s.enhancer)return s.enhancer(oh)({reducer:n,initState:e,immutable:t});const i=[],r=c=>(i.push(c),()=>{const l=i.indexOf(c);l>-1&&i.splice(l,1)});let o=e;t||(o=Ki(o,{callback:c=>{i.forEach(l=>l(c))}}));const a=c=>{if(t){const l=o;o=n(o,c);const u=Ba(l,o);for(const m of u)i.forEach(f=>f(m))}else n(o,c)},h=c=>{n=c,a({type:"INIT"})};return a({type:"INIT"}),{getState:()=>o,dispatch:a,subscribe:r,replaceReducer:h}}function md(s=window.location.href){try{return new URL(s)}catch{const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${i}${r}$`).exec(s);return{href:s,protocol:o?.groups?.protocol||"",host:o?.groups?.host||"",hostname:o?.groups?.hostname||"",port:o?.groups?.port||"",pathname:o?.groups?.pathname||"",search:o?.groups?.search||"",hash:o?.groups?.hash||""}}}function pd(s=window.location.href){const t=md(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function gd(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function yd(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function wd(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function ah(s,t){return function(){return s.apply(t,arguments)}}const{toString:bd}=Object.prototype,{getPrototypeOf:Qi}=Object,Ms=(s=>t=>{const e=bd.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Jt=s=>(s=s.toLowerCase(),t=>Ms(t)===s),As=s=>t=>typeof t===s,{isArray:un}=Array,zn=As("undefined");function xd(s){return s!==null&&!zn(s)&&s.constructor!==null&&!zn(s.constructor)&&Ot(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const hh=Jt("ArrayBuffer");function vd(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&hh(s.buffer),t}const Sd=As("string"),Ot=As("function"),ch=As("number"),Is=s=>s!==null&&typeof s=="object",_d=s=>s===!0||s===!1,Ds=s=>{if(Ms(s)!=="object")return!1;const t=Qi(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Cd=Jt("Date"),Ed=Jt("File"),Pd=Jt("Blob"),Td=Jt("FileList"),Md=s=>Is(s)&&Ot(s.pipe),Ad=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||Ot(s.append)&&((t=Ms(s))==="formdata"||t==="object"&&Ot(s.toString)&&s.toString()==="[object FormData]"))},Id=Jt("URLSearchParams"),[Dd,kd,Ld,Rd]=["ReadableStream","Request","Response","Headers"].map(Jt),Od=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Nn(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),un(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),o=r.length;let a;for(n=0;n<o;n++)a=r[n],t.call(null,s[a],a,s)}}function lh(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const Ue=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),uh=s=>!zn(s)&&s!==Ue;function tr(){const{caseless:s}=uh(this)&&this||{},t={},e=(n,i)=>{const r=s&&lh(t,i)||i;Ds(t[r])&&Ds(n)?t[r]=tr(t[r],n):Ds(n)?t[r]=tr({},n):un(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Nn(arguments[n],e);return t}const zd=(s,t,e,{allOwnKeys:n}={})=>(Nn(t,(i,r)=>{e&&Ot(i)?s[r]=ah(i,e):s[r]=i},{allOwnKeys:n}),s),Nd=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),Bd=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},Fd=(s,t,e,n)=>{let i,r,o;const a={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)o=i[r],(!n||n(o,s,t))&&!a[o]&&(t[o]=s[o],a[o]=!0);s=e!==!1&&Qi(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},Yd=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},Xd=s=>{if(!s)return null;if(un(s))return s;let t=s.length;if(!ch(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},Ud=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Qi(Uint8Array)),$d=(s,t)=>{const e=(s&&s[Symbol.iterator]).call(s);let n;for(;(n=e.next())&&!n.done;){const i=n.value;t.call(s,i[0],i[1])}},Gd=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},Vd=Jt("HTMLFormElement"),jd=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),fh=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),qd=Jt("RegExp"),dh=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};Nn(e,(i,r)=>{let o;(o=t(i,r,s))!==!1&&(n[r]=o||i)}),Object.defineProperties(s,n)},Hd=s=>{dh(s,(t,e)=>{if(Ot(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(Ot(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Wd=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return un(s)?n(s):n(String(s).split(t)),e},Jd=()=>{},Zd=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function Kd(s){return!!(s&&Ot(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Qd=s=>{const t=new Array(10),e=(n,i)=>{if(Is(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=un(n)?[]:{};return Nn(n,(o,a)=>{const h=e(o,i+1);!zn(h)&&(r[a]=h)}),t[i]=void 0,r}}return n};return e(s,0)},tm=Jt("AsyncFunction"),em=s=>s&&(Is(s)||Ot(s))&&Ot(s.then)&&Ot(s.catch),mh=((s,t)=>s?setImmediate:t?((e,n)=>(Ue.addEventListener("message",({source:i,data:r})=>{i===Ue&&r===e&&n.length&&n.shift()()},!1),i=>{n.push(i),Ue.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Ot(Ue.postMessage)),nm=typeof queueMicrotask<"u"?queueMicrotask.bind(Ue):typeof process<"u"&&process.nextTick||mh,A={isArray:un,isArrayBuffer:hh,isBuffer:xd,isFormData:Ad,isArrayBufferView:vd,isString:Sd,isNumber:ch,isBoolean:_d,isObject:Is,isPlainObject:Ds,isReadableStream:Dd,isRequest:kd,isResponse:Ld,isHeaders:Rd,isUndefined:zn,isDate:Cd,isFile:Ed,isBlob:Pd,isRegExp:qd,isFunction:Ot,isStream:Md,isURLSearchParams:Id,isTypedArray:Ud,isFileList:Td,forEach:Nn,merge:tr,extend:zd,trim:Od,stripBOM:Nd,inherits:Bd,toFlatObject:Fd,kindOf:Ms,kindOfTest:Jt,endsWith:Yd,toArray:Xd,forEachEntry:$d,matchAll:Gd,isHTMLForm:Vd,hasOwnProperty:fh,hasOwnProp:fh,reduceDescriptors:dh,freezeMethods:Hd,toObjectSet:Wd,toCamelCase:jd,noop:Jd,toFiniteNumber:Zd,findKey:lh,global:Ue,isContextDefined:uh,isSpecCompliantForm:Kd,toJSONObject:Qd,isAsyncFn:tm,isThenable:em,setImmediate:mh,asap:nm};function U(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});const ph=U.prototype,gh={};["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(s=>{gh[s]={value:s}}),Object.defineProperties(U,gh),Object.defineProperty(ph,"isAxiosError",{value:!0}),U.from=(s,t,e,n,i,r)=>{const o=Object.create(ph);return A.toFlatObject(s,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),U.call(o,s.message,t,e,n,i),o.cause=s,o.name=s.name,r&&Object.assign(o,r),o};const sm=null;function er(s){return A.isPlainObject(s)||A.isArray(s)}function yh(s){return A.endsWith(s,"[]")?s.slice(0,-2):s}function wh(s,t,e){return s?s.concat(t).map(function(n,i){return n=yh(n),!e&&i?"["+n+"]":n}).join(e?".":""):t}function im(s){return A.isArray(s)&&!s.some(er)}const rm=A.toFlatObject(A,{},null,function(s){return/^is[A-Z]/.test(s)});function ks(s,t,e){if(!A.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,p){return!A.isUndefined(p[f])});const n=e.metaTokens,i=e.visitor||c,r=e.dots,o=e.indexes,a=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(A.isDate(f))return f.toISOString();if(!a&&A.isBlob(f))throw new U("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(f)||A.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,p,g){let C=f;if(f&&!g&&typeof f=="object"){if(A.endsWith(p,"{}"))p=n?p:p.slice(0,-2),f=JSON.stringify(f);else if(A.isArray(f)&&im(f)||(A.isFileList(f)||A.endsWith(p,"[]"))&&(C=A.toArray(f)))return p=yh(p),C.forEach(function(y,v){!(A.isUndefined(y)||y===null)&&t.append(o===!0?wh([p],v,r):o===null?p:p+"[]",h(y))}),!1}return er(f)?!0:(t.append(wh(g,p,r),h(f)),!1)}const l=[],u=Object.assign(rm,{defaultVisitor:c,convertValue:h,isVisitable:er});function m(f,p){if(!A.isUndefined(f)){if(l.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));l.push(f),A.forEach(f,function(g,C){(!(A.isUndefined(g)||g===null)&&i.call(t,g,A.isString(C)?C.trim():C,p,u))===!0&&m(g,p?p.concat(C):[C])}),l.pop()}}if(!A.isObject(s))throw new TypeError("data must be an object");return m(s),t}function bh(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function nr(s,t){this._pairs=[],s&&ks(s,this,t)}const xh=nr.prototype;xh.append=function(s,t){this._pairs.push([s,t])},xh.toString=function(s){const t=s?function(e){return s.call(this,e,bh)}:bh;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};function om(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vh(s,t,e){if(!t)return s;const n=e&&e.encode||om;A.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=A.isURLSearchParams(t)?t.toString():new nr(t,e).toString(n),r){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class am{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(e){e!==null&&t(e)})}}const Sh=am,_h={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hm=typeof URLSearchParams<"u"?URLSearchParams:nr,cm=typeof FormData<"u"?FormData:null,lm=typeof Blob<"u"?Blob:null,um={isBrowser:!0,classes:{URLSearchParams:hm,FormData:cm,Blob:lm},protocols:["http","https","file","blob","url","data"]},sr=typeof window<"u"&&typeof document<"u",ir=typeof navigator=="object"&&navigator||void 0,fm=sr&&(!ir||["ReactNative","NativeScript","NS"].indexOf(ir.product)<0),dm=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),mm=sr&&window.location.href||"http://localhost",pm=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sr,hasStandardBrowserEnv:fm,hasStandardBrowserWebWorkerEnv:dm,navigator:ir,origin:mm},Symbol.toStringTag,{value:"Module"})),_t={...pm,...um};function gm(s,t){return ks(s,new _t.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return _t.isNode&&A.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function ym(s){return A.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wm(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Ch(s){function t(e,n,i,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),h=r>=e.length;return o=!o&&A.isArray(i)?i.length:o,h?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,n,i[o],r)&&A.isArray(i[o])&&(i[o]=wm(i[o])),!a)}if(A.isFormData(s)&&A.isFunction(s.entries)){const e={};return A.forEachEntry(s,(n,i)=>{t(ym(n),i,e,0)}),e}return null}function bm(s,t,e){if(A.isString(s))try{return(t||JSON.parse)(s),A.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const rr={transitional:_h,adapter:["xhr","http","fetch"],transformRequest:[function(s,t){const e=t.getContentType()||"",n=e.indexOf("application/json")>-1,i=A.isObject(s);if(i&&A.isHTMLForm(s)&&(s=new FormData(s)),A.isFormData(s))return n?JSON.stringify(Ch(s)):s;if(A.isArrayBuffer(s)||A.isBuffer(s)||A.isStream(s)||A.isFile(s)||A.isBlob(s)||A.isReadableStream(s))return s;if(A.isArrayBufferView(s))return s.buffer;if(A.isURLSearchParams(s))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let r;if(i){if(e.indexOf("application/x-www-form-urlencoded")>-1)return gm(s,this.formSerializer).toString();if((r=A.isFileList(s))||e.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ks(r?{"files[]":s}:s,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),bm(s)):s}],transformResponse:[function(s){const t=this.transitional||rr.transitional,e=t&&t.forcedJSONParsing,n=this.responseType==="json";if(A.isResponse(s)||A.isReadableStream(s))return s;if(s&&A.isString(s)&&(e&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(s)}catch(r){if(i)throw r.name==="SyntaxError"?U.from(r,U.ERR_BAD_RESPONSE,this,null,this.response):r}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_t.classes.FormData,Blob:_t.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],s=>{rr.headers[s]={}});const or=rr,xm=A.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"]),vm=s=>{const t={};let e,n,i;return s&&s.split(`
14
- `).forEach(function(r){i=r.indexOf(":"),e=r.substring(0,i).trim().toLowerCase(),n=r.substring(i+1).trim(),!(!e||t[e]&&xm[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},Eh=Symbol("internals");function Bn(s){return s&&String(s).trim().toLowerCase()}function Ls(s){return s===!1||s==null?s:A.isArray(s)?s.map(Ls):String(s)}function Sm(s){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(s);)t[n[1]]=n[2];return t}const _m=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ar(s,t,e,n,i){if(A.isFunction(n))return n.call(this,t,e);if(i&&(t=e),!!A.isString(t)){if(A.isString(n))return t.indexOf(n)!==-1;if(A.isRegExp(n))return n.test(t)}}function Cm(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function Em(s,t){const e=A.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+e,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})})}class Rs{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function r(a,h,c){const l=Bn(h);if(!l)throw new Error("header name must be a non-empty string");const u=A.findKey(i,l);(!u||i[u]===void 0||c===!0||c===void 0&&i[u]!==!1)&&(i[u||h]=Ls(a))}const o=(a,h)=>A.forEach(a,(c,l)=>r(c,l,h));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(A.isString(t)&&(t=t.trim())&&!_m(t))o(vm(t),e);else if(A.isHeaders(t))for(const[a,h]of t.entries())r(h,a,n);else t!=null&&r(e,t,n);return this}get(t,e){if(t=Bn(t),t){const n=A.findKey(this,t);if(n){const i=this[n];if(!e)return i;if(e===!0)return Sm(i);if(A.isFunction(e))return e.call(this,i,n);if(A.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Bn(t),t){const n=A.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||ar(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let i=!1;function r(o){if(o=Bn(o),o){const a=A.findKey(n,o);a&&(!e||ar(n,n[a],a,e))&&(delete n[a],i=!0)}}return A.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let n=e.length,i=!1;for(;n--;){const r=e[n];(!t||ar(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,n={};return A.forEach(this,(i,r)=>{const o=A.findKey(n,r);if(o){e[o]=Ls(i),delete e[r];return}const a=t?Cm(r):String(r).trim();a!==r&&delete e[r],e[a]=Ls(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return A.forEach(this,(n,i)=>{n!=null&&n!==!1&&(e[i]=t&&A.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
15
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const e=(this[Eh]=this[Eh]={accessors:{}}).accessors,n=this.prototype;function i(r){const o=Bn(r);e[o]||(Em(n,r),e[o]=!0)}return A.isArray(t)?t.forEach(i):i(t),this}}Rs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(Rs.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),A.freezeMethods(Rs);const Zt=Rs;function hr(s,t){const e=this||or,n=t||e,i=Zt.from(n.headers);let r=n.data;return A.forEach(s,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Ph(s){return!!(s&&s.__CANCEL__)}function fn(s,t,e){U.call(this,s??"canceled",U.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(fn,U,{__CANCEL__:!0});function Th(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new U("Request failed with status code "+e.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Pm(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Tm(s,t){s=s||10;const e=new Array(s),n=new Array(s);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(a){const h=Date.now(),c=n[r];o||(o=h),e[i]=a,n[i]=h;let l=r,u=0;for(;l!==i;)u+=e[l++],l=l%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),h-o<t)return;const m=c&&h-c;return m?Math.round(u*1e3/m):void 0}}function Mm(s,t){let e=0,n=1e3/t,i,r;const o=(a,h=Date.now())=>{e=h,i=null,r&&(clearTimeout(r),r=null),s.apply(null,a)};return[(...a)=>{const h=Date.now(),c=h-e;c>=n?o(a,h):(i=a,r||(r=setTimeout(()=>{r=null,o(i)},n-c)))},()=>i&&o(i)]}const Os=(s,t,e=3)=>{let n=0;const i=Tm(50,250);return Mm(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-n,c=i(h),l=o<=a;n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&l?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(u)},e)},Mh=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},Ah=s=>(...t)=>A.asap(()=>s(...t)),Am=_t.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,_t.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(_t.origin),_t.navigator&&/(msie|trident)/i.test(_t.navigator.userAgent)):()=>!0,Im=_t.hasStandardBrowserEnv?{write(s,t,e,n,i,r){const o=[s+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const t=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Dm(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function km(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function Ih(s,t,e){let n=!Dm(t);return s&&(n||e==!1)?km(s,t):t}const Dh=s=>s instanceof Zt?{...s}:s;function $e(s,t){t=t||{};const e={};function n(c,l,u,m){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge.call({caseless:m},c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function i(c,l,u,m){if(A.isUndefined(l)){if(!A.isUndefined(c))return n(void 0,c,u,m)}else return n(c,l,u,m)}function r(c,l){if(!A.isUndefined(l))return n(void 0,l)}function o(c,l){if(A.isUndefined(l)){if(!A.isUndefined(c))return n(void 0,c)}else return n(void 0,l)}function a(c,l,u){if(u in t)return n(c,l);if(u in s)return n(void 0,c)}const h={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,l,u)=>i(Dh(c),Dh(l),u,!0)};return A.forEach(Object.keys(Object.assign({},s,t)),function(c){const l=h[c]||i,u=l(s[c],t[c],c);A.isUndefined(u)&&l!==a||(e[c]=u)}),e}const kh=s=>{const t=$e({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Zt.from(o),t.url=vh(Ih(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let h;if(A.isFormData(e)){if(_t.hasStandardBrowserEnv||_t.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(_t.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(t)),n||n!==!1&&Am(t.url))){const c=i&&r&&Im.read(r);c&&o.set(i,c)}return t},Lm=typeof XMLHttpRequest<"u",Rm=Lm&&function(s){return new Promise(function(t,e){const n=kh(s);let i=n.data;const r=Zt.from(n.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:h}=n,c,l,u,m,f;function p(){m&&m(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(c),n.signal&&n.signal.removeEventListener("abort",c)}let g=new XMLHttpRequest;g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout;function C(){if(!g)return;const v=Zt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),b={data:!o||o==="text"||o==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:v,config:s,request:g};Th(function(x){t(x),p()},function(x){e(x),p()},b),g=null}"onloadend"in g?g.onloadend=C:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(C)},g.onabort=function(){g&&(e(new U("Request aborted",U.ECONNABORTED,s,g)),g=null)},g.onerror=function(){e(new U("Network Error",U.ERR_NETWORK,s,g)),g=null},g.ontimeout=function(){let v=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const b=n.transitional||_h;n.timeoutErrorMessage&&(v=n.timeoutErrorMessage),e(new U(v,b.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,s,g)),g=null},i===void 0&&r.setContentType(null),"setRequestHeader"in g&&A.forEach(r.toJSON(),function(v,b){g.setRequestHeader(b,v)}),A.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),o&&o!=="json"&&(g.responseType=n.responseType),h&&([u,f]=Os(h,!0),g.addEventListener("progress",u)),a&&g.upload&&([l,m]=Os(a),g.upload.addEventListener("progress",l),g.upload.addEventListener("loadend",m)),(n.cancelToken||n.signal)&&(c=v=>{g&&(e(!v||v.type?new fn(null,s,g):v),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(c),n.signal&&(n.signal.aborted?c():n.signal.addEventListener("abort",c)));const y=Pm(n.url);if(y&&_t.protocols.indexOf(y)===-1){e(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,s));return}g.send(i||null)})},Om=(s,t)=>{const{length:e}=s=s?s.filter(Boolean):[];if(t||e){let n=new AbortController,i;const r=function(c){if(!i){i=!0,a();const l=c instanceof Error?c:this.reason;n.abort(l instanceof U?l:new fn(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,r(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const a=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),s=null)};s.forEach(c=>c.addEventListener("abort",r));const{signal:h}=n;return h.unsubscribe=()=>A.asap(a),h}},zm=Om,Nm=function*(s,t){let e=s.byteLength;if(!t||e<t){yield s;return}let n=0,i;for(;n<e;)i=n+t,yield s.slice(n,i),n=i},Bm=async function*(s,t){for await(const e of Fm(s))yield*Nm(e,t)},Fm=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const t=s.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Lh=(s,t,e,n)=>{const i=Bm(s,t);let r=0,o,a=h=>{o||(o=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){a(),h.close();return}let u=l.byteLength;if(e){let m=r+=u;e(m)}h.enqueue(new Uint8Array(l))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},zs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Rh=zs&&typeof ReadableStream=="function",Ym=zs&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),Oh=(s,...t)=>{try{return!!s(...t)}catch{return!1}},Xm=Rh&&Oh(()=>{let s=!1;const t=new Request(_t.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),zh=64*1024,cr=Rh&&Oh(()=>A.isReadableStream(new Response("").body)),Ns={stream:cr&&(s=>s.body)};zs&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ns[t]&&(Ns[t]=A.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new U(`Response type '${t}' is not supported`,U.ERR_NOT_SUPPORT,n)})})})(new Response);const Um=async s=>{if(s==null)return 0;if(A.isBlob(s))return s.size;if(A.isSpecCompliantForm(s))return(await new Request(_t.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(A.isArrayBufferView(s)||A.isArrayBuffer(s))return s.byteLength;if(A.isURLSearchParams(s)&&(s=s+""),A.isString(s))return(await Ym(s)).byteLength},$m=async(s,t)=>A.toFiniteNumber(s.getContentLength())??Um(t),Gm=zs&&(async s=>{let{url:t,method:e,data:n,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:m}=kh(s);c=c?(c+"").toLowerCase():"text";let f=zm([i,r&&r.toAbortSignal()],o),p;const g=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let C;try{if(h&&Xm&&e!=="get"&&e!=="head"&&(C=await $m(l,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),_;if(A.isFormData(n)&&(_=E.headers.get("content-type"))&&l.setContentType(_),E.body){const[L,N]=Mh(C,Os(Ah(h)));n=Lh(E.body,zh,L,N)}}A.isString(u)||(u=u?"include":"omit");const y="credentials"in Request.prototype;p=new Request(t,{...m,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:y?u:void 0});let v=await fetch(p);const b=cr&&(c==="stream"||c==="response");if(cr&&(a||b&&g)){const E={};["status","statusText","headers"].forEach(Y=>{E[Y]=v[Y]});const _=A.toFiniteNumber(v.headers.get("content-length")),[L,N]=a&&Mh(_,Os(Ah(a),!0))||[];v=new Response(Lh(v.body,zh,L,()=>{N&&N(),g&&g()}),E)}c=c||"text";let x=await Ns[A.findKey(Ns,c)||"text"](v,s);return!b&&g&&g(),await new Promise((E,_)=>{Th(E,_,{data:x,headers:Zt.from(v.headers),status:v.status,statusText:v.statusText,config:s,request:p})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,s,p),{cause:y.cause||y}):U.from(y,y&&y.code,s,p)}}),lr={http:sm,xhr:Rm,fetch:Gm};A.forEach(lr,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const Nh=s=>`- ${s}`,Vm=s=>A.isFunction(s)||s===null||s===!1,Bh={getAdapter:s=>{s=A.isArray(s)?s:[s];const{length:t}=s;let e,n;const i={};for(let r=0;r<t;r++){e=s[r];let o;if(n=e,!Vm(e)&&(n=lr[(o=String(e)).toLowerCase()],n===void 0))throw new U(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+r]=n}if(!n){const r=Object.entries(i).map(([a,h])=>`adapter ${a} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since :
16
- `+r.map(Nh).join(`
17
- `):" "+Nh(r[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:lr};function ur(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new fn(null,s)}function Fh(s){return ur(s),s.headers=Zt.from(s.headers),s.data=hr.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Bh.getAdapter(s.adapter||or.adapter)(s).then(function(t){return ur(s),t.data=hr.call(s,s.transformResponse,t),t.headers=Zt.from(t.headers),t},function(t){return Ph(t)||(ur(s),t&&t.response&&(t.response.data=hr.call(s,s.transformResponse,t.response),t.response.headers=Zt.from(t.response.headers))),Promise.reject(t)})}const Yh="1.8.4",Bs={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Bs[s]=function(e){return typeof e===s||"a"+(t<1?"n ":" ")+s}});const Xh={};Bs.transitional=function(s,t,e){function n(i,r){return"[Axios v"+Yh+"] Transitional option '"+i+"'"+r+(e?". "+e:"")}return(i,r,o)=>{if(s===!1)throw new U(n(r," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Xh[r]&&(Xh[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),s?s(i,r,o):!0}},Bs.spelling=function(s){return(t,e)=>(console.warn(`${e} is likely a misspelling of ${s}`),!0)};function jm(s,t,e){if(typeof s!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],o=t[r];if(o){const a=s[r],h=a===void 0||o(a,r,s);if(h!==!0)throw new U("option "+r+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new U("Unknown option "+r,U.ERR_BAD_OPTION)}}const Fs={assertOptions:jm,validators:Bs},re=Fs.validators;class Ys{constructor(t){this.defaults=t,this.interceptors={request:new Sh,response:new Sh}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=`
18
- `+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=$e(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Fs.assertOptions(n,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:Fs.assertOptions(i,{encode:re.function,serialize:re.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Fs.assertOptions(e,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Zt.concat(o,r);const a=[];let h=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(h=h&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let l,u=0,m;if(!h){const p=[Fh.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),m=p.length,l=Promise.resolve(e);u<m;)l=l.then(p[u++],p[u++]);return l}m=a.length;let f=e;for(u=0;u<m;){const p=a[u++],g=a[u++];try{f=p(f)}catch(C){g.call(this,C);break}}try{l=Fh.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,m=c.length;u<m;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=$e(this.defaults,t);const e=Ih(t.baseURL,t.url,t.allowAbsoluteUrls);return vh(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(s){Ys.prototype[s]=function(t,e){return this.request($e(e||{},{method:s,url:t,data:(e||{}).data}))}}),A.forEach(["post","put","patch"],function(s){function t(e){return function(n,i,r){return this.request($e(r||{},{method:s,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Ys.prototype[s]=t(),Ys.prototype[s+"Form"]=t(!0)});const Xs=Ys;class fr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(i){e=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{n.subscribe(a),r=a}).then(i);return o.cancel=function(){n.unsubscribe(r)},o},t(function(i,r,o){n.reason||(n.reason=new fn(i,r,o),e(n.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=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new fr(function(e){t=e}),cancel:t}}}const qm=fr;function Hm(s){return function(t){return s.apply(null,t)}}function Wm(s){return A.isObject(s)&&s.isAxiosError===!0}const dr={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(dr).forEach(([s,t])=>{dr[t]=s});const Jm=dr;function Uh(s){const t=new Xs(s),e=ah(Xs.prototype.request,t);return A.extend(e,Xs.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Uh($e(s,n))},e}const ht=Uh(or);ht.Axios=Xs,ht.CanceledError=fn,ht.CancelToken=qm,ht.isCancel=Ph,ht.VERSION=Yh,ht.toFormData=ks,ht.AxiosError=U,ht.Cancel=ht.CanceledError,ht.all=function(s){return Promise.all(s)},ht.spread=Hm,ht.isAxiosError=Wm,ht.mergeConfig=$e,ht.AxiosHeaders=Zt,ht.formToJSON=s=>Ch(A.isHTMLForm(s)?new FormData(s):s),ht.getAdapter=Bh.getAdapter,ht.HttpStatusCode=Jm,ht.default=ht;const Zm=ht;class $h{instance;canceler;retryCount=0;cacheTime=0;caches=new Rn;constructor(t){this.instance=Zm.create(t),this.canceler=new Km,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(t?.interceptor?.start?.(),this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),Promise.reject(e))),this.instance.interceptors.response.use(e=>(t?.interceptor?.end?.(),this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const n=t.retry||this.retryCount;n&&(e=Yi(e,n));const i=t.cache||this.cacheTime;return i&&(e=Xi(e,i,this.caches)),e(t)}cancel(t){this.canceler.cancelRequest(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,n){return this.request({...n,method:"post",url:t,data:e})}postBlob(t,e,n){return n={...n,headers:{...n?.headers,"Content-Type":"multipart/form-data"}},this.request({...n,method:"post",url:t,data:e})}postForm(t,e,n){return this.instance.postForm(t,e,{...n})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Km{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:n,params:i,data:r}=t;return Ri({method:e,url:n,params:i,data:r})}pendingRequest(t){const e=this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}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()}}function Gh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Vh={exports:{}};(function(s,t){(function(e){s.exports=e()})(function(e){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(y,v){var b=y[0],x=y[1],E=y[2],_=y[3];b+=(x&E|~x&_)+v[0]-680876936|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[1]-389564586|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[2]+606105819|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[3]-1044525330|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[4]-176418897|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[5]+1200080426|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[6]-1473231341|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[7]-45705983|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[8]+1770035416|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[9]-1958414417|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[10]-42063|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[11]-1990404162|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[12]+1804603682|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[13]-40341101|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[14]-1502002290|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[15]+1236535329|0,x=(x<<22|x>>>10)+E|0,b+=(x&_|E&~_)+v[1]-165796510|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[6]-1069501632|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[11]+643717713|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[0]-373897302|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[5]-701558691|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[10]+38016083|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[15]-660478335|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[4]-405537848|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[9]+568446438|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[14]-1019803690|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[3]-187363961|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[8]+1163531501|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[13]-1444681467|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[2]-51403784|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[7]+1735328473|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[12]-1926607734|0,x=(x<<20|x>>>12)+E|0,b+=(x^E^_)+v[5]-378558|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[8]-2022574463|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[11]+1839030562|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[14]-35309556|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[1]-1530992060|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[4]+1272893353|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[7]-155497632|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[10]-1094730640|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[13]+681279174|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[0]-358537222|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[3]-722521979|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[6]+76029189|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[9]-640364487|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[12]-421815835|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[15]+530742520|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[2]-995338651|0,x=(x<<23|x>>>9)+E|0,b+=(E^(x|~_))+v[0]-198630844|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[7]+1126891415|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[14]-1416354905|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[5]-57434055|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[12]+1700485571|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[3]-1894986606|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[10]-1051523|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[1]-2054922799|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[8]+1873313359|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[15]-30611744|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[6]-1560198380|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[13]+1309151649|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[4]-145523070|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[11]-1120210379|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[2]+718787259|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[9]-343485551|0,x=(x<<21|x>>>11)+E|0,y[0]=b+y[0]|0,y[1]=x+y[1]|0,y[2]=E+y[2]|0,y[3]=_+y[3]|0}function r(y){var v=[],b;for(b=0;b<64;b+=4)v[b>>2]=y.charCodeAt(b)+(y.charCodeAt(b+1)<<8)+(y.charCodeAt(b+2)<<16)+(y.charCodeAt(b+3)<<24);return v}function o(y){var v=[],b;for(b=0;b<64;b+=4)v[b>>2]=y[b]+(y[b+1]<<8)+(y[b+2]<<16)+(y[b+3]<<24);return v}function a(y){var v=y.length,b=[1732584193,-271733879,-1732584194,271733878],x,E,_,L,N,Y;for(x=64;x<=v;x+=64)i(b,r(y.substring(x-64,x)));for(y=y.substring(x-64),E=y.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x=0;x<E;x+=1)_[x>>2]|=y.charCodeAt(x)<<(x%4<<3);if(_[x>>2]|=128<<(x%4<<3),x>55)for(i(b,_),x=0;x<16;x+=1)_[x]=0;return L=v*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(L[2],16),Y=parseInt(L[1],16)||0,_[14]=N,_[15]=Y,i(b,_),b}function h(y){var v=y.length,b=[1732584193,-271733879,-1732584194,271733878],x,E,_,L,N,Y;for(x=64;x<=v;x+=64)i(b,o(y.subarray(x-64,x)));for(y=x-64<v?y.subarray(x-64):new Uint8Array(0),E=y.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x=0;x<E;x+=1)_[x>>2]|=y[x]<<(x%4<<3);if(_[x>>2]|=128<<(x%4<<3),x>55)for(i(b,_),x=0;x<16;x+=1)_[x]=0;return L=v*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(L[2],16),Y=parseInt(L[1],16)||0,_[14]=N,_[15]=Y,i(b,_),b}function c(y){var v="",b;for(b=0;b<4;b+=1)v+=n[y>>b*8+4&15]+n[y>>b*8&15];return v}function l(y){var v;for(v=0;v<y.length;v+=1)y[v]=c(y[v]);return y.join("")}l(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function y(v,b){return v=v|0||0,v<0?Math.max(v+b,0):Math.min(v,b)}ArrayBuffer.prototype.slice=function(v,b){var x=this.byteLength,E=y(v,x),_=x,L,N,Y,G;return b!==e&&(_=y(b,x)),E>_?new ArrayBuffer(0):(L=_-E,N=new ArrayBuffer(L),Y=new Uint8Array(N),G=new Uint8Array(this,E,L),Y.set(G),N)}}();function u(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function m(y,v){var b=y.length,x=new ArrayBuffer(b),E=new Uint8Array(x),_;for(_=0;_<b;_+=1)E[_]=y.charCodeAt(_);return v?E:x}function f(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function p(y,v,b){var x=new Uint8Array(y.byteLength+v.byteLength);return x.set(new Uint8Array(y)),x.set(new Uint8Array(v),y.byteLength),b?x:x.buffer}function g(y){var v=[],b=y.length,x;for(x=0;x<b-1;x+=2)v.push(parseInt(y.substr(x,2),16));return String.fromCharCode.apply(String,v)}function C(){this.reset()}return C.prototype.append=function(y){return this.appendBinary(u(y)),this},C.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.length;var v=this._buff.length,b;for(b=64;b<=v;b+=64)i(this._hash,r(this._buff.substring(b-64,b)));return this._buff=this._buff.substring(b-64),this},C.prototype.end=function(y){var v=this._buff,b=v.length,x,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_;for(x=0;x<b;x+=1)E[x>>2]|=v.charCodeAt(x)<<(x%4<<3);return this._finish(E,b),_=l(this._hash),y&&(_=g(_)),this.reset(),_},C.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},C.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},C.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},C.prototype._finish=function(y,v){var b=v,x,E,_;if(y[b>>2]|=128<<(b%4<<3),b>55)for(i(this._hash,y),b=0;b<16;b+=1)y[b]=0;x=this._length*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(x[2],16),_=parseInt(x[1],16)||0,y[14]=E,y[15]=_,i(this._hash,y)},C.hash=function(y,v){return C.hashBinary(u(y),v)},C.hashBinary=function(y,v){var b=a(y),x=l(b);return v?g(x):x},C.ArrayBuffer=function(){this.reset()},C.ArrayBuffer.prototype.append=function(y){var v=p(this._buff.buffer,y,!0),b=v.length,x;for(this._length+=y.byteLength,x=64;x<=b;x+=64)i(this._hash,o(v.subarray(x-64,x)));return this._buff=x-64<b?new Uint8Array(v.buffer.slice(x-64)):new Uint8Array(0),this},C.ArrayBuffer.prototype.end=function(y){var v=this._buff,b=v.length,x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,_;for(E=0;E<b;E+=1)x[E>>2]|=v[E]<<(E%4<<3);return this._finish(x,b),_=l(this._hash),y&&(_=g(_)),this.reset(),_},C.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.ArrayBuffer.prototype.getState=function(){var y=C.prototype.getState.call(this);return y.buff=f(y.buff),y},C.ArrayBuffer.prototype.setState=function(y){return y.buff=m(y.buff,!0),C.prototype.setState.call(this,y)},C.ArrayBuffer.prototype.destroy=C.prototype.destroy,C.ArrayBuffer.prototype._finish=C.prototype._finish,C.ArrayBuffer.hash=function(y,v){var b=h(new Uint8Array(y)),x=l(b);return v?g(x):x},C})})(Vh);var Qm=Vh.exports;const tp=Gh(Qm),ep=Bf&&window.File&&window.FileReader&&window.FileList&&window.Blob;function np(s='script[type="text/js-worker"]'){return Array.prototype.map.call(document.querySelectorAll(s),t=>t.textContent)}const mr=s=>new XMLSerializer().serializeToString(s),sp=(s,t="text/html")=>new DOMParser().parseFromString(s,t),pr=(s,t={mime:Et.SVG,encode:ws.utf8})=>Fi(mr(s),t);async function gr(s=["*"],t){let e=[];const n=document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),n.addEventListener("click",i=>{n.value=""},!1),new Promise((i,r)=>{n.addEventListener("change",o=>{e=Array.from(o.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}),n.click()}).then(i=>(n.remove(),i)).catch(i=>{throw n.remove(),i})}function Fn(s,t=Ut.text,e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{n(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case Ut.dataURL:r.readAsDataURL(s);break;case Ut.binaryString:r.readAsBinaryString(s);break;case Ut.arraybuffer:r.readAsArrayBuffer(s);break;case Ut.text:default:r.readAsText(s)}})}async function ip(s){const t=await Fn(s,Ut.arraybuffer);return Yf(t)}const rp=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function op(s){switch(s.toLowerCase()){case"jpg":case"jpeg":return Et.JPEG;case"gif":return Et.GIF;case"svg":return Et.SVG;case"pdf":return Et.PDF;case"png":default:return Et.PNG}}function jh(s,t,e,n,i,r,o){const a=new FileReader;a.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),o<n.size)jh(s,t,e,n,i,o,Math.min(o+i,n.size));else return s(e.end())}),a.addEventListener("error",h=>t(h)),a.readAsArrayBuffer(n.slice(r,o))}async function qh(s,t=1*1024*1024){return await new Promise((e,n)=>jh(e,n,new tp.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class hp{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 $h({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||1*1024*1024,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 qh(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(()=>{zf(this.time,1),this.onTime?.(Lf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var Hh={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
51
+ `.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},Me=(s,t)=>(typeof s=="string"&&(s=qs(s)||new RegExp(s)),s.test(t)),Uc=(s,t)=>{typeof s=="string"&&(s=qs(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},$c=(s,t)=>{typeof s=="string"&&(s=qs(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const r of n)e.push({matchIndex:typeof r.index=="number"?r.index:-1,fullMatch:r[0],groupMatchs:r.slice(1)});return e};function Ud(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function Yc(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}const $d="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",Yd="0123456789";function jc(s=12,t=$d){let e="";for(let n=0;n<s;n++)e+=t[Math.floor(Math.random()*t.length)];return e}function jd(s=12){return jc(s,Yd)}function Xd(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const Nt=(s,t="-")=>{let e=s.replace(new RegExp("[_-]?([A-Z])","g"),t+"$1").toLowerCase();const n=new RegExp(`^${t}`);return n.test(s)||(e=e.replace(n,"")),e};function Gd(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function Xc(s){return Xd(Gd(s))}function Gc(s){let t="";for(let e=0,n=s.length;e<n;e++){const r=s.charCodeAt(e);r>=1&&r<=127?t+=s.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}function Vd(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:default:return!0}}const Mn=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,r=e.indexOf("0o")==0,i=e.indexOf("0x")==0;(n||r||i)&&(e=e.slice(2)),n&&(t=2),r&&(t=8),i&&(t=16);const o=parseInt(e,t);if(Number.isNaN(o)||e.length==0)throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return o};function Pi(s,t){let e=t?.type;const n=t?.mime,r=t?.encode;if(!e&&n)switch(r){case Fs.utf8:case Fs["utf-8"]:e=`${n};charset=${r}`;break;case Fs.base64:e=`${n};${r}`;break;default:e=`${n}`;break}return new Blob([s],{type:e})}function qd(s){let t=ye["text/plain"];switch(new DataView(s).getUint32(0,Vd()).toString(16).toUpperCase()){case"FFD8FFDB":t=ye["image/jpeg"];break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=ye["image/jpeg"];break;case"89504E47":t=ye["image/png"];break;case"47494638":t=ye["image/gif"];break;case"52494646":t=ye["image/webp"];break;case"25504446":t=ye["application/pdf"];break;case"504B0304":t=ye["application/zip"];break}return t}function Hd(s){return s!=null&&s!==td}function Wd(s){return typeof s=="number"&&!Number.isNaN(s)}const Jd=2**31-1;function ae(s,t){const e=parseFloat(s);return Number.isNaN(e)?typeof t=="number"?t:NaN:e}const Kd=s=>typeof s=="number"&&s>=0&&Number.isFinite(s),Zd=s=>Kd(s)&&s>0,ke=s=>Zd(s)&&s===Math.floor(s),Ai=s=>s===1/0||ke(s);function Mi(s=1e-6){return function(t,e){return Math.abs(t-e)<s}}function K(s,t,e){const n=Math.min(t,e),r=Math.max(t,e);return s<n?n:s>r?r:s}function Qd(s,t){return(s%t+t)%t}function Hs(s,t,e){return typeof s=="number"&&typeof t=="number"?(1-e)*s+e*t:typeof s=="number"?s:typeof t=="number"?t:0}function tm(s,t,e){const n=Math.max(s.length,t.length),r=new Array(n);for(let i=0;i<n;i++)r[i]=Hs(s[i],t[i],e);return r}function em(s,t,e){return n=>{const r=K(n,s,t);return e==0?r:t-r<e?t:Math.round(r/e)*e}}function nm(s,t=2){return ae(s,0).toFixed(t)}function Z(s,t=2){return+nm(s,t)}function ki(s,t){const e=Uc("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Hd(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(e.matchIndex+e.fullMatch.length):""}}function Ii(s){const t=Uc("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function Vc(s,t){for(let e=0,n=s.length;e<n;e++)if(s[e]==t)return!0;return!1}function sm(s=[],t=[]){const e=s.length,n=t.length;for(let i=0;i<n;i++)s[i]=t[i];let r=Math.max(0,e-n);for(;r>0;)s.pop(),r--;return s}function Di(s,t){const e=s.findIndex(n=>n===t);return e>=0&&s.splice(e,1),s}function rm(s,t){return s.splice(0,t)}function im(s,...t){return t.forEach(e=>{Vc(s,e)||s.push(e)}),s}class Ws extends Array{constructor(t){super(t),this.fill(0)}}const qc=s=>ke(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?Ws:null:null;function Js(s,t){let e=s.length;for(;e--;)if(Dm(s[e][0],t))return e;return-1}function Et(){return(typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date).now()}function kn(s=new Date){return s.getTime()}function om(s=new Date,t="yyyy-mm-dd hh:ii:ss.SSS"){return fm(s,t)}function am(s){const t=s.valueOf();return!Number.isNaN(t)}function cm(s,t=3,e=":"){const n=Math.max(s.length,6);let r="";for(let o=0;o<n-4;o++)r+=s[o]||"0";const i=[r,""+(s[n-4]||"0")+(s[n-3]||"0"),""+(s[n-2]||"0")+(s[n-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+e+i[1];case 3:return i[0]+e+i[1]+e+i[2]}}function hm(s){const t=Math.max(s.length,6);let e=0;e+=(s[t-2]||0)*10+(s[t-1]||0),e+=((s[t-4]||0)*10+(s[t-3]||0))*60;let n=0;for(let r=0;r<t-4;r++)n=n*10+(s[r]||0);return e+=n*60*60,Math.floor(Math.max(0,e))}function lm(s,t=!1){let e=0;if(typeof s=="number"?e=s:e=hm(s),e<=0)return[0,0,0,0,0,0];const n=[],r=e%60;n.unshift(r%10),n.unshift(Math.floor(r/10)),e=Math.floor(e/60);const i=e%60;if(n.unshift(i%10),n.unshift(Math.floor(i/10)),e=Math.floor(e/60),t){const o=e%100;for(n.unshift(o%10),n.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)n.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;n.unshift(o%10),n.unshift(Math.floor(o/10))}return n}function um(s,t=1,e=!1){return s[s.length-1]+=t,lm(s,e)}function fm(s,t="yyyy-mm-dd hh:ii:ss"){if(!am(s))return"";const e=/(y+)/.exec(t);if(e&&e[1]){const r=e[1];t=t.replace(r,(s.getFullYear()+"").substring(4-r.length))}const n={"m+":s.getMonth()+1,"d+":s.getDate(),"h+":s.getHours(),"i+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),"S+":s.getMilliseconds()};for(const r in n){const i=new RegExp("("+r+")").exec(t);if(i&&i[1]){const o=i[1];t=t.replace(o,o.length===1?""+n[r]:("00"+n[r]).slice(-o.length))}}return t}const Hc=()=>{};function dm(s=0,t){const e=t?.min??300,n=t?.max??6e4,r=t?.exponent??2,i=t?.factor??.5;let o=e*Math.pow(r,s);if(i){const a=Math.random(),c=Math.floor(a*i*o);o=Math.floor(a*10)&1?o+c:o-c}return Math.min(o,n)|0}function Ks(s,t={}){if(typeof s!="function")throw new TypeError("Expected a function");const e=function(...n){const r=t?.thisArg||this,i=t?.cacheKeyResolver?t.cacheKeyResolver.apply(r,n):String(n[0]),o=e.cache;if(o.has(i))return o.get(i);const a=s.apply(r,n);return a instanceof Promise&&a.catch(()=>o.delete(i)),e.cache=o.set(i,a)||o,a};return e.cache=t?.createCache?t.createCache():new Map,e}Array.prototype.ap=function(s){return this.reduce((t,e)=>t.concat(s.map(e)),[])};function mm(){let s,t;return{promise:new Promise((e,n)=>{s=e,t=n}),resolve:s,reject:t}}function Oi(s,t=e=>console.error(e)){try{const e=s();return Mm(e)?Promise.resolve(e).catch(n=>{t(n)}):e}catch(e){t(e)}}const pm=2147483647;function Wc(s,t,e){if(typeof t!="number"||t<=0)return s;let n;const r=new Promise((i,o)=>{n=setTimeout((a,c)=>{a(new Error(c||`Timeout of ${t}ms!`))},Math.min(t,pm),o,e)});return Promise.race([s,r]).finally(()=>{n!==void 0&&(clearTimeout(n),n=void 0)})}function gm(s,t,e){if(!t)return s;const n=e||"Aborted!";return t.aborted?Promise.reject(new Error(n)):new Promise((r,i)=>{const o=()=>{i(new Error(n))};t.addEventListener("abort",o,{once:!0}),s.finally(()=>{t.removeEventListener("abort",o)}),s.then(r,i)})}const ym="[object Undefined]",bm="[object Null]",wm="[object Boolean]",vm="[object Number]",xm="[object BigInt]",Sm="[object String]",_m="[object Symbol]",Cm="[object Function]",Em="[object GeneratorFunction]",Tm="[object Array]";function Ri(s){return Object.prototype.toString.call(s)}function Pm(s){const t=Ri(s);return t===ym||t===bm||t===wm||t===vm||t===Sm||t===_m||t===xm}function Jc(s){const t=Ri(s);return t==Cm||t==Em}function Kc(s){if(!th(s))return!1;const t=/[\\^$.*+?()[\]{}|]/g,e=/^\[object .+?Constructor\]$/,n=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return(Jc(s)?n:e).test(Om(s))}function Am(s,t){return s?.[t]}function Zc(s,t){const e=Am(s,t);return Kc(e)?e:void 0}Zc(tt,"Map"),Zc(tt,"WeakMap");function Qc(s){return Ri(s)===Tm}function th(s){const t=typeof s;return!!s&&(t=="object"||t=="function")}function cn(s){return!!s&&typeof s=="object"}function Jn(s){return cn(s)&&!Qc(s)}const eh=s=>{for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t))return!1;return!0};function Mm(s){return typeof Promise<"u"&&s instanceof Promise||th(s)&&typeof s.then=="function"&&typeof s.catch=="function"}function km(s){const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&t.push(e);return t}function In(s,t,e=!0){if(Jn(s)&&Jn(t))for(const n of km(t))(e||typeof s[n]>"u")&&(Jn(s[n])&&Jn(t[n])?In(s[n],t[n],e):s[n]=t[n]);return s}function Im(s,...t){return new s.constructor(...t)}function Dm(s,t){return s===t||s!==s&&t!==t}function Om(s){if(s!=null){try{return Function.prototype.toString.call(s)}catch{}try{return""+s}catch{}}return""}function Rm(s,t=["","sign","key"]){return Jn(s)?Object.keys(s).filter(e=>{for(let n=0,r=t.length;n<r;n++)if(s[e]==t[n])return!1;return!0}).sort().map(e=>`${e}=${s[e]}`).join("&"):String(s)}function nh(s,t,e=""){let n=[];return!(typeof s=="object"&&s!==null)||!(typeof t=="object"&&t!==null)?(s===t||n.push({path:e,oldValue:s,newValue:t}),n):(new Set([...Object.keys(s),...Object.keys(t)]).forEach(r=>{const i=e?`${e}.${r}`:r;n=n.concat(nh(s[r],t[r],i))}),n)}function Lm(s,t){let e;return typeof t=="string"?e=t.split("."):e=t,e.reduce((n,r)=>n!=null&&n!=null?n[r]:n,s)}function Ie(s,t){try{return Lm(s,t)}catch{return}}function Li(s,t,e){if(!s||!t)return s;let n;typeof t=="string"?n=t.split("."):n=t;let r=s;for(let i=0,o=n.length-1;i<o;i++){const a=n[i];(!(a in r)||typeof r[a]!="object"||r[a]===null)&&(r[a]=Number.isNaN(Number(n[i+1]))?{}:[]),r=r[a]}return r[n[n.length-1]]=e,s}function Zs(s){if(typeof MessageChannel<"u"&&(Kc(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;t.onmessage=()=>{t.onmessage=null,s()},e.postMessage(null)}else setTimeout(s,0)}async function zm(){return new Promise(s=>{Zs(s)})}if(tt.requestAnimationFrame=tt.requestAnimationFrame||tt.webkitRequestAnimationFrame||tt.mozRequestAnimationFrame||tt.oRequestAnimationFrame||tt.msRequestAnimationFrame,tt.cancelAnimationFrame=tt.cancelAnimationFrame||tt.webkitCancelAnimationFrame||tt.mozCancelAnimationFrame||tt.oCancelAnimationFrame||tt.msCancelAnimationFrame,!tt.requestAnimationFrame){let s=Et();tt.requestAnimationFrame=t=>{const e=Et(),n=Math.max(0,16-(e-s)),r=tt.setTimeout(()=>{t(e+n)},n);return s=e+n,r}}tt.cancelAnimationFrame||(tt.cancelAnimationFrame=s=>{tt.clearTimeout(s)});const Qs=tt.requestAnimationFrame,Nm=tt.cancelAnimationFrame;function Fm(s){let t=!0,e=Qs(function n(r){t&&s(r)&&(e=Qs(n))});return()=>{t=!1,Nm(e)}}tt.requestIdleCallback=tt.requestIdleCallback||function(s,t){const e=Et();return setTimeout(()=>{const n=Et()-e,r={didTimeout:typeof t?.timeout!="number"?!1:n>t.timeout,timeRemaining:()=>Math.max(0,50-n)};s(r)},t?.timeout)},tt.cancelIdleCallback=tt.cancelIdleCallback||function(s){clearTimeout(s)},tt.requestIdleCallback,tt.cancelIdleCallback;let Kn=33,De=33,tr=0,Zn=0,zi=!1;function sh(s){zi||(zi=!0,Qs(t=>{zi=!1,tr=t,Zn===0&&(Zn=tr+De);let e=De+tr-Zn;e<De&&Kn<De?(e<8&&(e=8),De=Math.max(e,Kn)):e>De&&Kn>De&&(De=Math.min(e,Kn)),Kn=e,Zn=tr+De,Zs(()=>{s(Zn),sh(s)})}))}function Bm(s){const t=s?.maxIterations||1e4,e=!!s?.tracing,n=s?.onTrace||(f=>{const m=" ".repeat(f.depth);console.log(`${m}emit#${f.id} parent=${f.parentId} source=${f.source}`)}),r=[];let i=0,o=0;const a=new Set,c=f=>(a.add(f),()=>{a.delete(f)});let h;function l(f,m){const p=h,_={id:String(++i),dataset:f,source:m,createdAt:Et(),parentId:p?.id,depth:p?p.depth+1:0};r.push(_)}let u=!1;function d(){if(u)return;u=!0;let f=0;try{for(;o<r.length;){if(++f>t)throw new Error("Possible infinite signal loop detected");const m=r[o],p=h;h=m,e&&n(m);const _=Array.from(a);for(const y of _)try{y(...m.dataset)}catch(b){Zs(()=>{throw b})}h=p,o++}}finally{u=!1,o>=r.length&&(r.length=0,o=0)}}return{subscribe:c,once(f){const m=c((...p)=>{m(),f(...p)});return m},emit(...f){l(f),d()},emitFrom(f,...m){l(m,f),d()},clear(){a.clear()}}}function Um(s={}){const{concurrency:t=1/0,maxWorkerRunTime:e=6e4}=s;let n=1/0;const r=()=>n===1/0||Et()<n,i=O=>{n=Et()+O,h()};let o=r()?0:1;const a=()=>o>0,c=()=>{o++},h=()=>{o>0&&o--,D()},l=()=>!a()&&!r(),u=async()=>{l()&&await zm()};let d=0,f=[];const m=new Set,p=new Set;let _=0,y=[],b=[];const v=()=>{_===0&&(y.forEach(O=>O()),y=[],f.length===0&&(b.forEach(O=>O()),b=[]))},w=O=>{if(O.signal){if(O.signal.aborted)return O.resultReject("Cancel by Aborted!"),O;O.abortHandler=()=>{O.resultReject("Cancel by Abort!"),f=f.filter(U=>U.id!==O.id),v()},O.signal.addEventListener("abort",O.abortHandler,{once:!0})}if(f.filter(U=>O.invalidates?.includes(U.id)).forEach(U=>{U.resultReject("Cancel by invalidates!")}),f=f.filter(U=>!O.invalidates?.includes(U.id)),O.fold){const U=f.findIndex(V=>V.id===O.id);if(U!==-1){const V=f[U],q=O.fold(V,O);return V.dataset=q.dataset,V}else return f.push(O),O}else return f.push(O),O},E=()=>{if(f.length===0)return;let O=-1,U;for(let V=0,q=f.length;V<q;V++){const ft=f[V];(!U||ft.niceness<U.niceness)&&(O=V,U=ft)}return f.splice(O,1),U};let C=!1;const D=()=>{C||a()||(C=!0,Zs(()=>{for(C=!1;f.length>0&&p.size>0&&_<t&&!a();){const O=E(),U=Wd(O.deadline)&&Et()>=O.deadline,V=O.niceness==Ns.immediate;if(!r()&&!U&&!V){w(O),D();break}if(O.signal?.aborted){O.resultReject("Cancel by Aborted!"),v();continue}_++;const q=p.values().next().value;p.delete(q),gm(Wc(Promise.resolve(q(...O.dataset)),e),O.signal).then(ft=>{O.resultResolve(ft)}).catch(ft=>{O.retry>0?(O.retry--,w(O)):O.resultReject(ft)}).finally(async()=>{m.has(q)&&p.add(q),O.signal&&O.abortHandler&&O.signal.removeEventListener("abort",O.abortHandler),_--,v(),D()})}}))},$=O=>(m.add(O),p.add(O),D(),()=>{m.delete(O),p.delete(O)});return{put(...O){const U=O[O.length-1]||{};let V={};("niceness"in U||"deadline"in U||"retry"in U||"signal"in U||"invalidates"in U||"fold"in U)&&(V=O.pop());const q=mm(),ft=w({id:String(++d),dataset:O,createdAt:Et(),result:q.promise,resultResolve:q.resolve,resultReject:q.reject,niceness:V.niceness??Ns.normal,deadline:V.deadline??dc,retry:V.retry??0,signal:V.signal});return D(),ft},cancel(O){f=f.filter(U=>U.id!==O.id),O.signal&&O.abortHandler&&O.signal.removeEventListener("abort",O.abortHandler),v()},clear(){for(const O of f)O.signal&&O.abortHandler&&O.signal.removeEventListener("abort",O.abortHandler),O.resultReject(new Error("Cleared"));f.length=0,v()},run:$,once(O){const U=$((...V)=>{try{return O(...V)}finally{U()}});return U},async onDrain(){if(!(_===0&&f.length===0))return new Promise(O=>{b.push(O)})},async onIdle(){if(_!==0)return new Promise(O=>{y.push(O)})},pause:c,resume:h,get paused(){return a()},startFrame:i,yieldIfNeeded:u}}class rh{pool;concurrency;maxWorkerRunTime;constructor(t={concurrency:1}){this.concurrency=t.concurrency??1,this.maxWorkerRunTime=t.maxWorkerRunTime??6e4,this.pool=Um({concurrency:this.concurrency,maxWorkerRunTime:this.maxWorkerRunTime});for(let e=0;e<this.concurrency;e++)this.pool.run(async function(n){return await n()})}cancel(t){this.pool.cancel(t)}clear(){this.pool.clear()}get paused(){return this.pool.paused}startFrame(t){this.pool.startFrame(t)}async immediate(t){try{return this.pool.pause(),await this.pool.onIdle(),await Wc(Promise.resolve(t()),this.maxWorkerRunTime)}finally{this.pool.resume()}}asap(t,e){return this.pool.put(t,{niceness:e?.niceness??Ns.normal,deadline:typeof e?.timeout=="number"?Et()+e?.timeout:dc})}}class $m{pool;closes=[];constructor(t={concurrency:1}){this.pool=new rh({...t,maxWorkerRunTime:1/0})}close(t=!0){const e=t?this.closes.length:Math.max(0,this.closes.length-this.pool.concurrency+1),n=rm(this.closes,e);for(const r of n)r()}clear(){this.pool.clear(),this.close()}createNotifyTask(t,e,n=!0){return()=>new Promise((r,i)=>{try{this.close(n);const o=t({...e,onClose:()=>{e?.onClose?.(),r(),Di(this.closes,a)}}),a=()=>{o(),r()};this.closes.push(a)}catch(o){i(o)}})}exclusive(t,e){return this.pool.immediate(this.createNotifyTask(t,e,!0))}enqueue(t,e){const n=this.pool.asap(this.createNotifyTask(t,e,!1));return()=>{this.pool.cancel(n)}}}class Ym{pool;started=!1;constructor(t={concurrency:1}){this.pool=new rh(t),this.pool.startFrame(0)}clear(){this.pool.clear()}start(){this.started||(this.started=!0,sh(t=>{this.pool.startFrame(t-Et())}))}async idle(t,e){return this.start(),await this.pool.asap(t,{niceness:Ns.idle,timeout:e}).result}}const ih=new Ym,jm=ih.idle.bind(ih);function Xm(s){const t=new Set(s);return e=>{let n=e;for(;;){if(t.has(n))return!0;const r=n.lastIndexOf(".");if(r<0)return!1;n=n.slice(0,r)}}}function oh(s){let t=s;const e=Bm();return{get:()=>t,set:n=>{const r=typeof n=="function"?n(t):n,i=nh(t,r);i.length!==0&&(t=r,e.emit(t,i))},subscribe:(n,r)=>{const i=r?.length?Xm(r):null;Oi(()=>{n(t,[])});const o=e.subscribe((a,c)=>{if(!i){Oi(()=>{n(a,c)});return}const h=c.filter(l=>i(l.path));h.length&&Oi(()=>{n(a,h)})});return()=>o()}}}function Gm(s="verbose"){let t=-1;switch(s){case"verbose":t=0;break;case"debug":t=1;break;case"info":t=2;break;case"warn":t=3;break;case"error":t=4;break}tt.OPEN_LOG_LEVEL=t}function ah(){tt.OPEN_LOG_LEVEL=-1}function Vm(s){tt.LOG_UPLOAD_FN=s}ah();function ch(s="verbose"){let t=-1;switch(s){case"verbose":t=0;break;case"debug":t=1;break;case"info":t=2;break;case"warn":t=3;break;case"error":t=4;break}return tt.OPEN_LOG_LEVEL<=t}function hh(s){tt.LOG_UPLOAD_FN&&tt.LOG_UPLOAD_FN(s)}function er(s,t=""){try{if(hh({level:"info",msg:s,type:t}),!ch("info"))return;console.log(s)}catch{}}function ce(s,t=""){try{if(hh({level:"warn",msg:s,type:t}),!ch("warn"))return;console.warn(s)}catch{}}class qm{__data__=[];size=0;constructor(t){t=t||[];const e=t.length;let n=-1;for(;++n<e;){const r=t[n];this.set(r[0],r[1])}}set(t,e){const n=this.__data__,r=Js(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}get(t){const e=this.__data__,n=Js(e,t);return n<0?void 0:e[n][1]}has(t){return Js(this.__data__,t)>-1}delete(t){const e=this.__data__,n=Js(e,t);if(n<0)return!1;const r=e.length-1;return n==r?e.pop():Array.prototype.splice.call(e,n,1),--this.size,!0}clear(){this.__data__=[],this.size=0}*entries(){for(const t of this.__data__)yield t}*keys(){for(const t of this.__data__)yield t[0]}*values(){for(const t of this.__data__)yield t[1]}[Symbol.iterator](){return this.entries()}}const Hm=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lh=new Set,Wm=(s,t,e,n)=>{typeof ii.emitWarning=="function"?ii.emitWarning(s,t,e,n):console.error(`[${e}] ${t}: ${s}`)},Jm=s=>!lh.has(s);class Dn{heap;length;static#a=!1;static create(t){const e=qc(t);if(!e)return[];Dn.#a=!0;const n=new Dn(t,e);return Dn.#a=!1,n}constructor(t,e){if(!Dn.#a)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class Ni{#a;#u;#g;#k;#y;#L;#z;#b;get perf(){return this.#b}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#w;#s;#n;#t;#h;#f;#c;#i;#v;#o;#x;#S;#d;#m;#_;#A;#l;#N;static unsafeExposeInternals(t){return{starts:t.#S,ttls:t.#d,autopurgeTimers:t.#m,sizes:t.#x,keyMap:t.#s,keyList:t.#n,valList:t.#t,next:t.#h,prev:t.#f,get head(){return t.#c},get tail(){return t.#i},free:t.#v,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,n,r,i)=>t.#U(e,n,r,i),moveToTail:e=>t.#R(e),indexes:e=>t.#C(e),rindexes:e=>t.#E(e),isStale:e=>t.#p(e)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#w}get size(){return this.#r}get fetchMethod(){return this.#L}get memoMethod(){return this.#z}get dispose(){return this.#g}get onInsert(){return this.#k}get disposeAfter(){return this.#y}constructor(t){const{max:e=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:h,onInsert:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:_,fetchMethod:y,memoMethod:b,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:C,ignoreFetchAbort:D,perf:$}=t;if($!==void 0&&typeof $?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#b=$??Hm,e!==0&&!ke(e))throw new TypeError("max option must be a nonnegative integer");const O=e?qc(e):Array;if(!O)throw new Error("invalid max value: "+e);if(this.#a=e,this.#u=m,this.maxEntrySize=p||this.#u,this.sizeCalculation=_,this.sizeCalculation){if(!this.#u&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#z=b,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#L=y,this.#A=!!y,this.#s=new Map,this.#n=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#h=new O(e),this.#f=new O(e),this.#c=0,this.#i=0,this.#v=Dn.create(e),this.#r=0,this.#w=0,typeof h=="function"&&(this.#g=h),typeof l=="function"&&(this.#k=l),typeof u=="function"?(this.#y=u,this.#o=[]):(this.#y=void 0,this.#o=void 0),this.#_=!!this.#g,this.#N=!!this.#k,this.#l=!!this.#y,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(this.#u!==0&&!ke(this.#u))throw new TypeError("maxSize must be a positive integer if specified");if(!ke(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ke(r)||r===0?r:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!ke(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(this.#a===0&&this.ttl===0&&this.#u===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#u){const U="LRU_CACHE_UNBOUNDED";Jm(U)&&(lh.add(U),Wm("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,Ni))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#$(){const t=new Ws(this.#a),e=new Ws(this.#a);this.#d=t,this.#S=e;const n=this.ttlAutopurge?Array.from({length:this.#a}):void 0;this.#m=n,this.#Y=(a,c,h=this.#b.now())=>{e[a]=c!==0?h:0,t[a]=c,r(a,c)},this.#I=a=>{e[a]=t[a]!==0?this.#b.now():0,r(a,t[a])};const r=this.ttlAutopurge?(a,c)=>{if(n?.[a]&&(clearTimeout(n[a]),n[a]=void 0),c&&c!==0&&n){const h=setTimeout(()=>{this.#p(a)&&this.#T(this.#n[a],"expire")},c+1);h.unref&&h.unref(),n[a]=h}}:()=>{};this.#P=(a,c)=>{if(t[c]){const h=t[c],l=e[c];if(!h||!l)return;a.ttl=h,a.start=l,a.now=i||o();const u=a.now-l;a.remainingTTL=h-u}};let i=0;const o=()=>{const a=this.#b.now();if(this.ttlResolution>0){i=a;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return a};this.getRemainingTTL=a=>{const c=this.#s.get(a);if(c===void 0)return 0;const h=t[c],l=e[c];if(!h||!l)return 1/0;const u=(i||o())-l;return h-u},this.#p=a=>{const c=e[a],h=t[a];return!!h&&!!c&&(i||o())-c>h}}#I=()=>{};#P=()=>{};#Y=()=>{};#p=()=>!1;#H(){const t=new Ws(this.#a);this.#w=0,this.#x=t,this.#D=e=>{this.#w-=t[e],t[e]=0},this.#j=(e,n,r,i)=>{if(this.#e(n))return 0;if(!ke(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!ke(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r||0},this.#F=(e,n,r)=>{if(t[e]=n,this.#u){const i=this.#u-t[e];for(;this.#w>i;)this.#B(!0)}this.#w+=t[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.#w)}}#D=t=>{};#F=(t,e,n)=>{};#j=(t,e,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#i;this.#X(e)&&((t||!this.#p(e))&&(yield e),e!==this.#c);)e=this.#f[e]}*#E({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#c;this.#X(e)&&((t||!this.#p(e))&&(yield e),e!==this.#i);)e=this.#h[e]}#X(t){return t!==void 0&&this.#s.get(this.#n[t])===t}*entries(){for(const t of this.#C())this.#t[t]!==void 0&&this.#n[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#n[t],this.#t[t]])}*rentries(){for(const t of this.#E())this.#t[t]!==void 0&&this.#n[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#n[t],this.#t[t]])}*keys(){for(const t of this.#C()){const e=this.#n[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(const t of this.#E()){const e=this.#n[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(const t of this.#C())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(const t of this.#E())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const n of this.#C()){const r=this.#t[n],i=this.#e(r)?r.__staleWhileFetching:r;if(i!==void 0&&t(i,this.#n[n],this))return this.#O(this.#n[n],e)}}forEach(t,e=this){for(const n of this.#C()){const r=this.#t[n],i=this.#e(r)?r.__staleWhileFetching:r;i!==void 0&&t.call(e,i,this.#n[n],this)}}rforEach(t,e=this){for(const n of this.#E()){const r=this.#t[n],i=this.#e(r)?r.__staleWhileFetching:r;i!==void 0&&t.call(e,i,this.#n[n],this)}}purgeStale(){let t=!1;for(const e of this.#E({allowStale:!0}))this.#p(e)&&(this.#T(this.#n[e],"expire"),t=!0);return t}info(t){const e=this.#s.get(t);if(e===void 0)return;const n=this.#t[e],r=this.#e(n)?n.__staleWhileFetching:n;if(r===void 0)return;const i={value:r};if(this.#d&&this.#S){const o=this.#d[e],a=this.#S[e];if(o&&a){const c=o-(this.#b.now()-a);i.ttl=c,i.start=Date.now()}}return this.#x&&(i.size=this.#x[e]),i}dump(){const t=[];for(const e of this.#C({allowStale:!0})){const n=this.#n[e],r=this.#t[e],i=this.#e(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;const o={value:i};if(this.#d&&this.#S){o.ttl=this.#d[e];const a=this.#b.now()-this.#S[e];o.start=Math.floor(Date.now()-a)}this.#x&&(o.size=this.#x[e]),t.unshift([n,o])}return t}load(t){this.clear();for(const[e,n]of t){if(n.start){const r=Date.now()-n.start;n.start=this.#b.now()-r}this.#M(e,n.value,n)}}set(t,e,n={}){const{status:r=void 0}=n;return n.status=r,r&&(r.op="set",r.key=t,e!==void 0&&(r.value=e)),this.#M(t,e,n)}#M(t,e,n={}){const{ttl:r=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n;if(e===void 0)return c&&(c.set="deleted"),this.delete(t),this;let{noUpdateTTL:h=this.noUpdateTTL}=n;c&&!this.#e(e)&&(c.value=e);const l=this.#j(t,e,n.size||0,a,c);if(this.maxEntrySize&&l>this.maxEntrySize)return this.#T(t,"set"),c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this;let u=this.#r===0?void 0:this.#s.get(t);if(u===void 0)u=this.#r===0?this.#i:this.#v.length!==0?this.#v.pop():this.#r===this.#a?this.#B(!1):this.#r,this.#n[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#h[this.#i]=u,this.#f[u]=this.#i,this.#i=u,this.#r++,this.#F(u,l,c),c&&(c.set="add"),h=!1,this.#N&&this.#k?.(e,t,"add");else{this.#R(u);const d=this.#t[u];if(e!==d){if(this.#A&&this.#e(d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#_&&this.#g?.(f,t,"set"),this.#l&&this.#o?.push([f,t,"set"]))}else o||(this.#_&&this.#g?.(d,t,"set"),this.#l&&this.#o?.push([d,t,"set"]));if(this.#D(u),this.#F(u,l,c),this.#t[u]=e,c){c.set="replace";const f=d&&this.#e(d)?d.__staleWhileFetching:d;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#N&&this.onInsert?.(e,t,e===d?"update":"replace")}if(r!==0&&!this.#d&&this.#$(),this.#d&&(h||this.#Y(u,r,i),c&&this.#P(c,u)),!o&&this.#l&&this.#o){const d=this.#o;let f;for(;f=d?.shift();)this.#y?.(...f)}return this}pop(){try{for(;this.#r;){const t=this.#t[this.#c];if(this.#B(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#o){const t=this.#o;let e;for(;e=t?.shift();)this.#y?.(...e)}}}#B(t){const e=this.#c,n=this.#n[e],r=this.#t[e];return this.#A&&this.#e(r)?r.__abortController.abort(new Error("evicted")):(this.#_||this.#l)&&(this.#_&&this.#g?.(r,n,"evict"),this.#l&&this.#o?.push([r,n,"evict"])),this.#D(e),this.#m?.[e]&&(clearTimeout(this.#m[e]),this.#m[e]=void 0),t&&(this.#n[e]=void 0,this.#t[e]=void 0,this.#v.push(e)),this.#r===1?(this.#c=this.#i=0,this.#v.length=0):this.#c=this.#h[e],this.#s.delete(n),this.#r--,e}has(t,e={}){const{status:n=void 0}=e;return e.status=n,n&&(n.op="has",n.key=t),this.#W(t,e)}#W(t,e={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=e,i=this.#s.get(t);if(i!==void 0){const o=this.#t[i];if(this.#e(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#p(i))r&&(r.has="stale",this.#P(r,i));else return n&&this.#I(i),r&&(r.has="hit",this.#P(r,i)),!0}else r&&(r.has="miss");return!1}peek(t,e={}){const{status:n=void 0}=e;return n&&(n.op="peek",n.key=t),e.status=n,this.#J(t,e)}#J(t,e){const{status:n,allowStale:r=this.allowStale}=e,i=this.#s.get(t);if(i===void 0||!r&&this.#p(i)){n&&(n.peek=i===void 0?"miss":"stale");return}const o=this.#t[i],a=this.#e(o)?o.__staleWhileFetching:o;return n&&(a!==void 0?(n.peek="hit",n.value=a):n.peek="miss"),a}#U(t,e,n,r){const i=e===void 0?void 0:this.#t[e];if(this.#e(i))return i;const o=new AbortController,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});const c={signal:o.signal,options:n,context:r},h=(p,_=!1)=>{const{aborted:y}=o.signal,b=n.ignoreFetchAbort&&p!==void 0,v=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&p!==void 0);if(n.status&&(y&&!_?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,b&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),y&&!b&&!_)return u(o.signal.reason,v);const w=f,E=this.#t[e];return(E===f||E===void 0&&b&&_)&&(p===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#T(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#M(t,p,c.options))),p},l=p=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),u(p,!1)),u=(p,_)=>{const{aborted:y}=o.signal,b=y&&n.allowStaleOnFetchAbort,v=b||n.allowStaleOnFetchRejection,w=v||n.noDeleteOnFetchRejection,E=f;if(this.#t[e]===f&&(!w||!_&&E.__staleWhileFetching===void 0?this.#T(t,"fetch"):b||(this.#t[e]=E.__staleWhileFetching)),v)return n.status&&E.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw p},d=(p,_)=>{const y=this.#L?.(t,i,c);y&&y instanceof Promise&&y.then(b=>p(b===void 0?void 0:b),_),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=b=>h(b,!0)))})};n.status&&(n.status.fetchDispatched=!0);const f=new Promise(d).then(h,l),m=Object.assign(f,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return e===void 0?(this.#M(t,m,{...c.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=m,m}#e(t){if(!this.#A)return!1;const e=t;return!!e&&e instanceof Promise&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){const{status:n=void 0}=e;return e.status=n,n&&e.context&&(n.context=e.context),this.#G(t,e)}async#G(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:_=!1,status:y,signal:b}=e;if(y&&(y.op="fetch",y.key=t,_&&(y.forceRefresh=!0)),!this.#A)return y&&(y.fetch="get"),this.#O(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:y});const v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:h,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:y,signal:b},w=this.#s.get(t);if(w===void 0){y&&(y.fetch="miss");const E=this.#U(t,w,v,p);return E.__returned=E}else{const E=this.#t[w];if(this.#e(E)){const O=n&&E.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",O&&(y.returnedStale=!0)),O?E.__staleWhileFetching:E.__returned=E}const C=this.#p(w);if(!_&&!C)return y&&(y.fetch="hit"),this.#R(w),r&&this.#I(w),y&&this.#P(y,w),E;const D=this.#U(t,w,v,p),$=D.__staleWhileFetching!==void 0&&n;return y&&(y.fetch=C?"stale":"refresh",$&&C&&(y.returnedStale=!0)),$?D.__staleWhileFetching:D.__returned=D}}forceFetch(t,e={}){const{status:n=void 0}=e;return e.status=n,n&&e.context&&(n.context=e.context),this.#K(t,e)}async#K(t,e={}){const n=await this.#G(t,e);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(t,e={}){const{status:n=void 0}=e;e.status=n,n&&(n.op="memo",n.key=t,e.context&&(n.context=e.context));const r=this.#Z(t,e);return n&&(n.value=r),r}#Z(t,e={}){const n=this.#z;if(!n)throw new Error("no memoMethod provided to constructor");const{context:r,status:i,forceRefresh:o,...a}=e;i&&o&&(i.forceRefresh=!0);const c=this.#O(t,a),h=o||c===void 0;if(i&&(i.memo=h?"miss":"hit",h||(i.value=c)),!h)return c;const l=n(t,c,{options:a,context:r});return i&&(i.value=l),this.#M(t,l,a),l}get(t,e={}){const{status:n=void 0}=e;e.status=n,n&&(n.op="get",n.key=t);const r=this.#O(t,e);return n&&r!==void 0&&(n.value=r),r}#O(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,a=this.#s.get(t);if(a===void 0){o&&(o.get="miss");return}const c=this.#t[a],h=this.#e(c);return o&&this.#P(o,a),this.#p(a)?h?(o&&(o.get="stale-fetching"),n&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(i||this.#T(t,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=h?"fetching":"hit"),this.#R(a),r&&this.#I(a),h?c.__staleWhileFetching:c)}#V(t,e){this.#f[e]=t,this.#h[t]=e}#R(t){t!==this.#i&&(t===this.#c?this.#c=this.#h[t]:this.#V(this.#f[t],this.#h[t]),this.#V(this.#i,t),this.#i=t)}delete(t){return this.#T(t,"delete")}#T(t,e){let n=!1;if(this.#r!==0){const r=this.#s.get(t);if(r!==void 0)if(this.#m?.[r]&&(clearTimeout(this.#m?.[r]),this.#m[r]=void 0),n=!0,this.#r===1)this.#q(e);else{this.#D(r);const i=this.#t[r];if(this.#e(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#l)&&(this.#_&&this.#g?.(i,t,e),this.#l&&this.#o?.push([i,t,e])),this.#s.delete(t),this.#n[r]=void 0,this.#t[r]=void 0,r===this.#i)this.#i=this.#f[r];else if(r===this.#c)this.#c=this.#h[r];else{const o=this.#f[r];this.#h[o]=this.#h[r];const a=this.#h[r];this.#f[a]=this.#f[r]}this.#r--,this.#v.push(r)}}if(this.#l&&this.#o?.length){const r=this.#o;let i;for(;i=r?.shift();)this.#y?.(...i)}return n}clear(){return this.#q("delete")}#q(t){for(const e of this.#E({allowStale:!0})){const n=this.#t[e];if(this.#e(n))n.__abortController.abort(new Error("deleted"));else{const r=this.#n[e];this.#_&&this.#g?.(n,r,t),this.#l&&this.#o?.push([n,r,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#n.fill(void 0),this.#d&&this.#S){this.#d.fill(0),this.#S.fill(0);for(const e of this.#m??[])e!==void 0&&clearTimeout(e);this.#m?.fill(void 0)}if(this.#x&&this.#x.fill(0),this.#c=0,this.#i=0,this.#v.length=0,this.#w=0,this.#r=0,this.#l&&this.#o){const e=this.#o;let n;for(;n=e?.shift();)this.#y?.(...n)}}}class Fi{data;expirationMap=new Map;immortalKeys=new Set;expirations=Object.create(null);ttl;max;updateAgeOnGet;checkAgeOnGet;updateAgeOnHas;checkAgeOnHas;noUpdateTTL;dispose;noDisposeOnSet;timer;timerExpiration;constructor({ttl:t=1/0,max:e=1/0,updateAgeOnGet:n=!1,checkAgeOnGet:r=!1,updateAgeOnHas:i=!1,checkAgeOnHas:o=!1,noUpdateTTL:a=!1,dispose:c,noDisposeOnSet:h=!1}={},l=new Map){if(t!==void 0&&!Ai(t))throw new TypeError("ttl must be positive integer or Infinity if set");if(!Ai(e))throw new TypeError("max must be positive integer or Infinity");if(this.data=l,this.ttl=t,this.max=e,this.updateAgeOnGet=!!n,this.checkAgeOnGet=!!r,this.updateAgeOnHas=!!i,this.checkAgeOnHas=!!o,this.noUpdateTTL=!!a,this.noDisposeOnSet=!!h,c!==void 0){if(typeof c!="function")throw new TypeError("dispose must be function if set");this.dispose=c}else this.dispose=(u,d,f)=>{};this.timer=void 0,this.timerExpiration=void 0}get size(){return this.data.size}setTimer(t,e){if(this.timerExpiration&&this.timerExpiration<t)return;this.timer&&clearTimeout(this.timer);const n=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const r in this.expirations){const i=Number(r);this.setTimer(i,i-Et());break}},Math.min(Jd,Math.max(0,e)));n.unref&&n.unref(),this.timerExpiration=t,this.timer=n}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}clear(){const t=this.dispose!==Fi.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[e,n]of t)this.dispose(n,e,"delete")}setTTL(t,e=this.ttl){const n=this.expirationMap.get(t);if(n!==void 0){const r=this.expirations[n];!r||r.length<=1?delete this.expirations[n]:this.expirations[n]=r.filter(i=>i!==t)}if(e&&e!==1/0){this.immortalKeys.delete(t);const r=Math.floor(Et()+e);this.expirationMap.set(t,r),this.expirations[r]||(this.expirations[r]=[],this.setTimer(r,e)),this.expirations[r].push(t)}else this.immortalKeys.add(t),this.expirationMap.set(t,1/0)}set(t,e,{ttl:n=this.ttl,noUpdateTTL:r=this.noUpdateTTL,noDisposeOnSet:i=this.noDisposeOnSet}={}){if(!Ai(n))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(t)){r||this.setTTL(t,n);const o=this.data.get(t),a=!i&&this.data.has(t);o!==e&&(this.data.set(t,e),a&&this.dispose(o,t,"set"))}else this.setTTL(t,n),this.data.set(t,e);for(;this.size>this.max;)this.purgeToCapacity();return this}has(t,{checkAgeOnHas:e=this.checkAgeOnHas,ttl:n=this.ttl,updateAgeOnHas:r=this.updateAgeOnHas}={}){return this.data.has(t)?e&&this.getRemainingTTL(t)===0?(this.delete(t),!1):(r&&this.setTTL(t,n),!0):!1}getRemainingTTL(t){const e=this.expirationMap.get(t);return e===1/0?1/0:e!==void 0?Math.max(0,Math.ceil(e-Et())):0}get(t,{updateAgeOnGet:e=this.updateAgeOnGet,ttl:n=this.ttl,checkAgeOnGet:r=this.checkAgeOnGet}={}){const i=this.data.get(t);if(r&&this.getRemainingTTL(t)===0){this.delete(t);return}return e&&this.setTTL(t,n),i}delete(t){const e=this.expirationMap.get(t);if(e!==void 0){const n=this.data.get(t);this.data.delete(t),this.expirationMap.delete(t),this.immortalKeys.delete(t);const r=this.expirations[e];return r&&(r.length<=1?delete this.expirations[e]:this.expirations[e]=r.filter(i=>i!==t)),this.dispose(n,t,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){if(!(this.size<=this.max))for(const t in this.expirations){const e=this.expirations[t];if(this.size-e.length>=this.max){delete this.expirations[t];const n=[];for(const r of e)n.push([r,this.data.get(r)]),this.data.delete(r),this.expirationMap.delete(r);for(const[r,i]of n)this.dispose(i,r,"evict")}else{const n=this.size-this.max,r=[];for(const i of e.splice(0,n))r.push([i,this.data.get(i)]),this.data.delete(i),this.expirationMap.delete(i);for(const[i,o]of r)this.dispose(o,i,"evict")}}}purgeStale(){const t=Math.ceil(Et());for(const e in this.expirations){if(e==="Infinity"||Number(e)>t)return;const n=[...this.expirations[e]||[]],r=[];delete this.expirations[e];for(const i of n)r.push([i,this.data.get(i)]),this.data.delete(i),this.expirationMap.delete(i);for(const[i,o]of r)this.dispose(o,i,"expire")}this.size===0&&this.cancelTimer()}*entries(){for(const t in this.expirations)for(const e of this.expirations[t])yield[e,this.data.get(e)];for(const t of this.immortalKeys)yield[t,this.data.get(t)]}*keys(){for(const t in this.expirations)for(const e of this.expirations[t])yield e;for(const t of this.immortalKeys)yield t}*values(){for(const t in this.expirations)for(const e of this.expirations[t])yield this.data.get(e);for(const t of this.immortalKeys)yield this.data.get(t)}[Symbol.iterator](){return this.entries()}firstKey(){return this.keys().next().value}}class uh{cache;cacheKeyResolver;constructor(t){if(typeof AbortController>"u")throw new Error("AbortController not supported!");this.cache=t?.createCache?t.createCache():new Map,this.cacheKeyResolver=t?.cacheKeyResolver||((...e)=>String(e[0]))}set(...t){const e=this.cacheKeyResolver(...t),n=new AbortController;this.cache.set(e,n)}get(...t){const e=this.cacheKeyResolver(...t);return this.cache.get(e)}delete(...t){const e=this.cacheKeyResolver(...t);return this.cache.delete(e)}clear(){this.cache.clear()}}const hn={branch:"├",lastBranch:"└",line:"│",empty:" "};function Km(s,t={}){const{showValues:e=!0,hideFunctions:n=!1,lineBreak:r=`\r
52
+ `,maxDeep:i}=t,o=[],a=new WeakSet;function c(l,u="",d=0){if(typeof l=="string"){o.push(u+'"'+l+'"');return}if(typeof l!="object"||l===null){e&&o.push(u+String(l));return}if(i&&d>=i){Array.isArray(s)?o.push("[...OverMaxDeep]"):o.push("{...OverMaxDeep}");return}if(a.has(l)){o.push(u+"[Circular]");return}a.add(l);const f=Object.keys(l).filter(m=>!(n&&typeof l[m]=="function"));f.forEach((m,p)=>{const _=l[m],y=p===f.length-1,b=d===0&&p===0?"":u,v=y?hn.lastBranch:hn.branch,w=m.trim()===""?"":m;let E=b+v+(w?" "+w:"");const C=m.trim()!=="";if(_&&typeof _=="object"&&a.has(_))o.push(E+(C?": ":E?" ":"")+"[Circular]");else if(_&&typeof _=="object"&&!Array.isArray(_)){o.push(E);const D=y?hn.empty:hn.line,$=b+D+" ";c(_,$,d+1)}else if(Array.isArray(_)){o.push(E+(C?": ":E?" ":"")+"[Array("+_.length+")]");const D=y?hn.empty:hn.line,$=b+D+" ";c(_,$,d+1)}else if(e){const D=typeof _=="function"?"[Function]":typeof _=="string"?'"'+String(_)+'"':String(_);E+=(C?": ":E?" ":"")+D,o.push(E)}else o.push(E)})}const h=Object.keys(s);if(h.length===0)return"(empty)";if(h.length===1&&h[0]!==void 0&&h[0].trim()===""&&typeof s[h[0]]=="string"){const l=h[0],u=hn.lastBranch,d=s[l],f=typeof d=="function"?"[Function]":typeof d=="string"?'"'+d+'"':String(d);return u+" "+f}return c(s),r+o.join(r)}function fh(s){let t=s.initState||{},e=s.reducer;if(s.enhancer)return s.enhancer(fh)({reducer:e,initState:t});const n=oh(t),r=o=>{t=e(t,o),n.set(t)},i=o=>{e=o,r({type:"INIT"})};return r({type:"INIT"}),{getState:()=>t,dispatch:r,subscribe:n.subscribe,replaceReducer:i}}function nr(s,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,n=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function r(o,a=!1){return Pm(o)||Qc(o)||Jc(o)?{value:o,timestamp:kn()}:a&&Object.prototype.hasOwnProperty.call(o,"timestamp")?o:{...o,timestamp:kn()}}let i=r(s,!0);return{get:()=>{let o=!1;return(e>=0&&kn()>ae(i.timestamp,0)+e*1e3||n>=0&&kn()>n)&&(o=!0),o&&(i.value=void 0),i},set:o=>i=r(o,!1)}}class sr{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(n?e.bind(n):e),this}addListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n?e.bind(n):e),this}on(t,e,n){return this.addListener(t,e,n),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(n=>{n(...e)}),this}once(t,e,n){const r=(...i)=>{n?e.apply(n,i):e(...i),this.off(t,r)};return this.on(t,r),this}}const Zm=Ks(()=>typeof window=="object"&&typeof document=="object");Ks(()=>!Zm()),Ks(()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null);const Qm=typeof window<"u";!!(tt.Worker&&tt.Blob&&tt.Promise&&tt.OffscreenCanvas&&tt.OffscreenCanvasRenderingContext2D&&tt.HTMLCanvasElement&&tt.HTMLCanvasElement.prototype.transferControlToOffscreen&&tt.URL&&tt.URL.createObjectURL);const tp=(()=>{if(!tt.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");if(!t)return!1;t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0})(),dh=tt.crypto;dh?.subtle;function Bi(){try{return dh.randomUUID()}catch{let s=new Date().getTime();return"xxxxxxxx_xxxx_xxxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(t=="x"?e:e&3|8).toString(16)})}}function mh(s,t){return JSON.stringify(Rm(s))}const ep="\uFEFF";function np(s){return s.startsWith(ep)?s.slice(1):s}function sp(s){try{return{ok:!0,value:JSON.parse(np(s))}}catch{return{ok:!1}}}Ks(sp,{createCache:()=>new Ni({max:50}),cacheKeyResolver:s=>s});const Ui=10,ph=(s=0)=>t=>`\x1B[${t+s}m`,gh=(s=0)=>t=>`\x1B[${38+s};5;${t}m`,yh=(s=0)=>(t,e,n)=>`\x1B[${38+s};2;${t};${e};${n}m`,xt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(xt.modifier);const rp=Object.keys(xt.color),ip=Object.keys(xt.bgColor);[...rp,...ip];function op(){const s=new Map;for(const[t,e]of Object.entries(xt)){for(const[n,r]of Object.entries(e))xt[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[n]=xt[n],s.set(r[0],r[1]);Object.defineProperty(xt,t,{value:e,enumerable:!1})}return Object.defineProperty(xt,"codes",{value:s,enumerable:!1}),xt.color.close="\x1B[39m",xt.bgColor.close="\x1B[49m",xt.color.ansi=ph(),xt.color.ansi256=gh(),xt.color.ansi16m=yh(),xt.bgColor.ansi=ph(Ui),xt.bgColor.ansi256=gh(Ui),xt.bgColor.ansi16m=yh(Ui),Object.defineProperties(xt,{rgbToAnsi256:{value(t,e,n){return t===e&&e===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[n]=e;n.length===3&&(n=[...n].map(i=>i+i).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>xt.rgbToAnsi256(...xt.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,n,r;if(t>=232)e=((t-232)*10+8)/255,n=e,r=e;else{t-=16;const a=t%36;e=Math.floor(t/36)/5,n=Math.floor(a/6)/5,r=a%6/5}const i=Math.max(e,n,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(e));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,e,n)=>xt.ansi256ToAnsi(xt.rgbToAnsi256(t,e,n)),enumerable:!1},hexToAnsi:{value:t=>xt.ansi256ToAnsi(xt.hexToAnsi256(t)),enumerable:!1}}),xt}const cp=op(),hp=0;new Set(cp.codes.values()).delete(hp);const Qn={1:"rgb(10,194,210)",2:"rgb(123,183,250)",3:"rgb(96,215,169)",4:"rgb(253,193,98)",5:"rgb(253,106,98)",6:"rgb(246,141,187)",7:"rgb(38,204,255)",8:"rgb(162,90,253)",9:"rgb(255,94,126)",10:"rgb(136,255,90)",11:"rgb(252,255,66)",12:"rgb(255,166,45)",13:"rgb(255,54,255)",14:"rgb(220,73,22)",15:"rgb(104,113,177)",16:"rgb(209,185,53)",17:"rgb(27,188,155)",18:"rgb(255,127,80)",19:"rgb(75,191,195)",20:"rgb(255,153,0)",black:"rgb(0,0,0)",blue:"rgb(0,0,255)",brightblue:"rgb(59,142,234)",terminalblue:"rgb(36,114,200)",red:"rgb(255,0,0)",brightred:"rgb(241,76,76)",terminalred:"rgb(205,49,49)",white:"rgb(255,255,255)",terminalwhite:"rgb(229,229,229)",yellow:"rgb(255,255,0)",brightyellow:"rgb(245,245,67)",terminalyellow:"rgb(229,229,16)",yellowgreen:"rgb(154,205,50)",aliceblue:"rgb(240,248,255)",antiquewhite:"rgb(250,235,215)",aqua:"rgb(0,255,255)",aquamarine:"rgb(127,255,212)",azure:"rgb(240,255,255)",beige:"rgb(245,245,220)",bisque:"rgb(255,228,196)",blanchedalmond:"rgb(255,235,205)",blueviolet:"rgb(138,43,226)",brown:"rgb(165,42,42)",burlywood:"rgb(222,184,135)",cadetblue:"rgb(95,158,160)",chartreuse:"rgb(127,255,0)",chocolate:"rgb(210,105,30)",coral:"rgb(255,127,80)",cornflowerblue:"rgb(100,149,237)",cornsilk:"rgb(255,248,220)",crimson:"rgb(220,20,60)",cyan:"rgb(0,255,255)",brightcyan:"rgb(41,184,219)",terminalcyan:"rgb(17,168,205)",darkblue:"rgb(0,0,139)",darkcyan:"rgb(0,139,139)",darkgoldenrod:"rgb(184,134,11)",darkgray:"rgb(169,169,169)",darkgreen:"rgb(0,100,0)",darkgrey:"rgb(30,30,30)",darkkhaki:"rgb(189,183,107)",darkmagenta:"rgb(139,0,139)",darkolivegreen:"rgb(85,107,47)",darkorange:"rgb(255,140,0)",darkorchid:"rgb(153,50,204)",darkred:"rgb(139,0,0)",darksalmon:"rgb(233,150,122)",darkseagreen:"rgb(143,188,143)",darkslateblue:"rgb(72,61,139)",darkslategray:"rgb(47,79,79)",darkslategrey:"rgb(47,79,79)",darkturquoise:"rgb(0,206,209)",darkviolet:"rgb(148,0,211)",deeppink:"rgb(255,20,147)",deepskyblue:"rgb(0,191,255)",dimgray:"rgb(105,105,105)",dodgerblue:"rgb(30,144,255)",firebrick:"rgb(178,34,34)",floralwhite:"rgb(255,250,240)",forestgreen:"rgb(34,139,34)",fuchsia:"rgb(255,0,255)",gainsboro:"rgb(220,220,220)",ghostwhite:"rgb(248,248,255)",gold:"rgb(255,215,0)",goldenrod:"rgb(218,165,32)",grey:"rgb(128,128,128)",green:"rgb(0,128,0)",brightgreen:"rgb(35,209,139)",terminalgreen:"rgb(13,188,121)",greenyellow:"rgb(173,255,47)",honeydew:"rgb(240,255,240)",hotpink:"rgb(255,105,180)",indianred:"rgb(205,92,92)",indigo:"rgb(75,0,130)",ivory:"rgb(255,255,240)",khaki:"rgb(240,230,140)",lavender:"rgb(230,230,250)",lavenderblush:"rgb(255,240,245)",lawngreen:"rgb(124,252,0)",lemonchiffon:"rgb(255,250,205)",lightblue:"rgb(173,216,230)",lightcoral:"rgb(240,128,128)",lightcyan:"rgb(224,255,255)",lightgoldenrodyellow:"rgb(250,250,210)",lightgreen:"rgb(144,238,144)",lightgrey:"rgb(229,229,229)",lightpink:"rgb(255,182,193)",lightsalmon:"rgb(255,160,122)",lightseagreen:"rgb(32,178,170)",lightskyblue:"rgb(135,206,250)",lightslategray:"rgb(119,136,153)",lightslategrey:"rgb(119,136,153)",lightsteelblue:"rgb(176,196,222)",lightyellow:"rgb(255,255,224)",lime:"rgb(0,255,0)",limegreen:"rgb(50,205,50)",linen:"rgb(250,240,230)",magenta:"rgb(255,0,255)",brightmagenta:"rgb(214,112,214)",terminalmagenta:"rgb(188,63,188)",maroon:"rgb(128,0,0)",mediumaquamarine:"rgb(102,205,170)",mediumblue:"rgb(0,0,205)",mediumorchid:"rgb(186,85,211)",mediumpurple:"rgb(147,112,219)",mediumseagreen:"rgb(60,179,113)",mediumslateblue:"rgb(123,104,238)",mediumspringgreen:"rgb(0,250,154)",mediumturquoise:"rgb(72,209,204)",mediumvioletred:"rgb(199,21,133)",midnightblue:"rgb(25,25,112)",mintcream:"rgb(245,255,250)",mistyrose:"rgb(255,228,225)",moccasin:"rgb(255,228,181)",navajowhite:"rgb(255,222,173)",navy:"rgb(0,0,128)",oldlace:"rgb(253,245,230)",olive:"rgb(128,128,0)",olivedrab:"rgb(107,142,35)",orange:"rgb(255,165,0)",orangered:"rgb(255,69,0)",orchid:"rgb(218,112,214)",palegoldenrod:"rgb(238,232,170)",palegreen:"rgb(152,251,152)",paleturquoise:"rgb(175,238,238)",palevioletred:"rgb(219,112,147)",papayawhip:"rgb(255,239,213)",peachpuff:"rgb(255,218,185)",peru:"rgb(205,133,63)",pink:"rgb(255,192,203)",plum:"rgb(221,160,221)",powderblue:"rgb(176,224,230)",purple:"rgb(128,0,128)",rebeccapurple:"rgb(102,51,153)",rosybrown:"rgb(188,143,143)",royalblue:"rgb(65,105,225)",saddlebrown:"rgb(139,69,19)",salmon:"rgb(250,128,114)",sandybrown:"rgb(244,164,96)",seagreen:"rgb(46,139,87)",seashell:"rgb(255,245,238)",sienna:"rgb(160,82,45)",silver:"rgb(192,192,192)",skyblue:"rgb(135,206,235)",slateblue:"rgb(106,90,205)",slategray:"rgb(112,128,144)",slategrey:"rgb(112,128,144)",snow:"rgb(255,250,250)",springgreen:"rgb(0,255,127)",steelblue:"rgb(70,130,180)",tan:"rgb(210,180,140)",teal:"rgb(0,128,128)",thistle:"rgb(216,191,216)",tomato:"rgb(255,99,71)",turquoise:"rgb(64,224,208)",violet:"rgb(238,130,238)",wheat:"rgb(245,222,179)"},lp=Array.from(Object.values(Qn));function up(s){const[t,e,n]=s.replace("rgb(","").replace(")","").split(",").map(Number);return .2126*t+.7152*e+.0722*n}Object.entries(Qn).map(([s,t])=>{const e=t;return{name:s,rgb:e,brightness:up(e)}}).sort((s,t)=>s.brightness-t.brightness);class ue{_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 Set: Unknown color(${t}) type(${typeof t})`;if(t instanceof ue)this.setRGB(t.r,t.g,t.b,t.a);else if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let n;if(n=/^(\w+)\(([^)]*)\)/.exec(t)){const r=n[2];let i;switch(n[1]){case"rgb":case"rgba":(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))?(this.r=parseInt(i[1],10),this.g=parseInt(i[2],10),this.b=parseInt(i[3],10),this.a=i[4]?parseFloat(i[4]):1):(i=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))?(this.r=K(parseFloat(i[1]),0,100)*255/100,this.g=K(parseFloat(i[2]),0,100)*255/100,this.b=K(parseFloat(i[3]),0,100)*255/100,this.a=i[4]?parseFloat(i[4]):1):ce(e);break;case"hsl":case"hsla":(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))?this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,i[4]?parseFloat(i[4]):1):ce(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))?this.setHSV(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,i[4]?parseFloat(i[4]):1):ce(e);break;default:ce(e)}}else if(n=/#([A-Fa-f0-9]+)/.exec(t)){const r=n[1],i=r.length;i===3?this.setRGB(parseInt(r.charAt(0),16),parseInt(r.charAt(1),16),parseInt(r.charAt(2),16),1):i===6||i===8?this.setHEX(parseInt(r,16)):ce(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{ce(e)}else ce(e)}else 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):ce(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){this._color.r=K(Math.round(ae(t,this.r)),0,255)}get g(){return this._color.g}set g(t){this._color.g=K(Math.round(ae(t,this.g)),0,255)}get b(){return this._color.b}set b(t){this._color.b=K(Math.round(ae(t,this.b)),0,255)}get a(){return this._color.a}set a(t){this._color.a=K(ae(t,this.a),0,1)}setAlpha(t){return this.a=t,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},${Z(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()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new ue(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Yi(t.r),this.g=Yi(t.g),this.b=Yi(t.b),this}copyLinearToSRGB(t){return this.r=ji(t.r),this.g=ji(t.g),this.b=ji(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",n="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:n);{const{r,g:i,b:o}=this.color;return this.r=255-r,this.g=255-i,this.b=255-o,this}}closet(t="#000000",e="#ffffff"){return this.opposite(!0,t,e).opposite(!0,t,e)}lighten(t){t=K(t,0,1);const{r:e,g:n,b:r,a:i}=this.color;return i==0?this.a=t:(this.r=e+(255-e)*t,this.g=n+(255-n)*t,this.b=r+(255-r)*t),this}darken(t){t=K(t,0,1);const{r:e,g:n,b:r,a:i}=this.color;return i==0?this.a=t:(this.r=e*(1-t),this.g=n*(1-t),this.b=r*(1-t)),this}lerp(t,e){e=K(e,0,1);const{r:n,g:r,b:i}=this.color;return this.r=n+(t.r-n)*e,this.g=r+(t.g-r)*e,this.b=i+(t.b-i)*e,this}lerpColors(t,e,n){return n=K(n,0,1),this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}static gradient(t,e,n){try{return $i.lerpColors(new ue(t),new ue(e),n).toString()}catch{return e}}static random(){return $i.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=ue.nextIndex){ue.nextIndex=t;const e=Object.keys(Qn),n=e.length;return $i.set(Qn[e[ue.nextIndex++%n]]).toString()}setColorName(t){const e=Qn[t.toLowerCase()];return e!==void 0?this.set(e):t==="none"?this.a=0:(this.a=1,ce("Color.setColorName: Unknown color "+t)),this}setRGB(t,e,n,r=1){return this.r=t,this.g=e,this.b=n,this.a=r,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,n,r=1){const i=Qd(t,1),o=K(e,0,1),a=K(n,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const c=a<=.5?a*(1+o):a+o-a*o,h=2*a-c;this.r=Xi(h,c,i+1/3)*255,this.g=Xi(h,c,i)*255,this.b=Xi(h,c,i-1/3)*255}return this.a=r,this}getHSL(t){const e=this.r,n=this.g,r=this.b,i=Math.max(e,n,r)/255,o=Math.min(e,n,r)/255;let a,c;const h=(o+i)/2;if(o===i)a=0,c=0;else{const l=i-o;switch(c=h<=.5?l/(i+o):l/(2-i-o),i){case e:a=(n-r)/l+(n<r?6:0);break;case n:a=(r-e)/l+2;break;case r:default:a=(e-n)/l+4;break}a/=6}return t&&t.setHSL(a,c,h,this.a),{h:a,s:c,l:h,a:this.a}}offsetHSL(t,e,n){const r=this.getHSL();return this.setHSL(r.h+t,r.s+e,r.l+n)}lerpHSL(t,e){const n=this.getHSL(),r=t.getHSL(),i=Hs(n.h,r.h,e),o=Hs(n.s,r.s,e),a=Hs(n.l,r.l,e);return this.setHSL(i,o,a),this}setHSV(t,e,n,r=1){const i=K(t,0,1)*360,o=K(e,0,1),a=K(n,0,1),c=Math.floor(i/60)%6,h=i/60-Math.floor(i/60),l=a*(1-o),u=a*(1-h*o),d=a*(1-(1-h)*o),f=[[a,d,l],[u,a,l],[l,a,d],[l,u,a],[d,l,a],[a,l,u]][c];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=r,this}setHSB(t,e,n,r=1){this.setHSV(t,e,n,r)}getHSV(t){const{r:e,g:n,b:r,a:i}=this.color,o=Math.max(e,n,r),a=Math.min(e,n,r),c=o-a;let h;e===o?h=(n-r)/c:n===o?h=2+(r-e)/c:h=4+(e-n)/c,h/=6,h<0&&(h+=1);const l=c==0?0:h,u=o===0?0:c/o,d=o/255;return t&&t.setHSV(l,u,d,i),{h:l,s:u,v:d,a:i}}getHSB(t){const{h:e,s:n,v:r,a:i}=this.getHSV(t);return{h:e,s:n,b:r,a:i}}}const $i=new ue;function Yi(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function ji(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}function Xi(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+(t-s)*6*e:e<1/2?t:e<2/3?s+(t-s)*6*(2/3-e):s}function fp(s=window.location.href,t){try{return new URL(s,t)}catch{const e="(?<protocol>https?:)",n="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",r="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",o="(?<hash>(?:#.*)?)",a=new RegExp(`^${e}//${n}${r}${i}${o}$`).exec(s);return{href:s,protocol:a?.groups?.protocol||"",host:a?.groups?.host||"",hostname:a?.groups?.hostname||"",port:a?.groups?.port||"",pathname:a?.groups?.pathname||"",search:a?.groups?.search||"",hash:a?.groups?.hash||""}}}function dp(s=window.location.href){const t=fp(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function mp(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function pp(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function gp(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function bh(s,t){return function(){return s.apply(t,arguments)}}const{toString:yp}=Object.prototype,{getPrototypeOf:Gi}=Object,rr=(s=>t=>{const e=yp.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),fe=s=>(s=s.toLowerCase(),t=>rr(t)===s),ir=s=>t=>typeof t===s,{isArray:On}=Array,ts=ir("undefined");function bp(s){return s!==null&&!ts(s)&&s.constructor!==null&&!ts(s.constructor)&&ee(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const wh=fe("ArrayBuffer");function wp(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&wh(s.buffer),t}const vp=ir("string"),ee=ir("function"),vh=ir("number"),or=s=>s!==null&&typeof s=="object",xp=s=>s===!0||s===!1,ar=s=>{if(rr(s)!=="object")return!1;const t=Gi(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Sp=fe("Date"),_p=fe("File"),Cp=fe("Blob"),Ep=fe("FileList"),Tp=s=>or(s)&&ee(s.pipe),Pp=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||ee(s.append)&&((t=rr(s))==="formdata"||t==="object"&&ee(s.toString)&&s.toString()==="[object FormData]"))},Ap=fe("URLSearchParams"),[Mp,kp,Ip,Dp]=["ReadableStream","Request","Response","Headers"].map(fe),Op=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function es(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,r;if(typeof s!="object"&&(s=[s]),On(s))for(n=0,r=s.length;n<r;n++)t.call(null,s[n],n,s);else{const i=e?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,s[a],a,s)}}function xh(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,r;for(;n-- >0;)if(r=e[n],t===r.toLowerCase())return r;return null}const ln=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Sh=s=>!ts(s)&&s!==ln;function Vi(){const{caseless:s}=Sh(this)&&this||{},t={},e=(n,r)=>{const i=s&&xh(t,r)||r;ar(t[i])&&ar(n)?t[i]=Vi(t[i],n):ar(n)?t[i]=Vi({},n):On(n)?t[i]=n.slice():t[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&es(arguments[n],e);return t}const Rp=(s,t,e,{allOwnKeys:n}={})=>(es(t,(r,i)=>{e&&ee(r)?s[i]=bh(r,e):s[i]=r},{allOwnKeys:n}),s),Lp=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),zp=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},Np=(s,t,e,n)=>{let r,i,o;const a={};if(t=t||{},s==null)return t;do{for(r=Object.getOwnPropertyNames(s),i=r.length;i-- >0;)o=r[i],(!n||n(o,s,t))&&!a[o]&&(t[o]=s[o],a[o]=!0);s=e!==!1&&Gi(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},Fp=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},Bp=s=>{if(!s)return null;if(On(s))return s;let t=s.length;if(!vh(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},Up=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Gi(Uint8Array)),$p=(s,t)=>{const e=(s&&s[Symbol.iterator]).call(s);let n;for(;(n=e.next())&&!n.done;){const r=n.value;t.call(s,r[0],r[1])}},Yp=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},jp=fe("HTMLFormElement"),Xp=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),_h=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),Gp=fe("RegExp"),Ch=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};es(e,(r,i)=>{let o;(o=t(r,i,s))!==!1&&(n[i]=o||r)}),Object.defineProperties(s,n)},Vp=s=>{Ch(s,(t,e)=>{if(ee(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(ee(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},qp=(s,t)=>{const e={},n=r=>{r.forEach(i=>{e[i]=!0})};return On(s)?n(s):n(String(s).split(t)),e},Hp=()=>{},Wp=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function Jp(s){return!!(s&&ee(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Kp=s=>{const t=new Array(10),e=(n,r)=>{if(or(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const i=On(n)?[]:{};return es(n,(o,a)=>{const c=e(o,r+1);!ts(c)&&(i[a]=c)}),t[r]=void 0,i}}return n};return e(s,0)},Zp=fe("AsyncFunction"),Qp=s=>s&&(or(s)||ee(s))&&ee(s.then)&&ee(s.catch),Eh=((s,t)=>s?setImmediate:t?((e,n)=>(ln.addEventListener("message",({source:r,data:i})=>{r===ln&&i===e&&n.length&&n.shift()()},!1),r=>{n.push(r),ln.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",ee(ln.postMessage)),tg=typeof queueMicrotask<"u"?queueMicrotask.bind(ln):typeof process<"u"&&process.nextTick||Eh,R={isArray:On,isArrayBuffer:wh,isBuffer:bp,isFormData:Pp,isArrayBufferView:wp,isString:vp,isNumber:vh,isBoolean:xp,isObject:or,isPlainObject:ar,isReadableStream:Mp,isRequest:kp,isResponse:Ip,isHeaders:Dp,isUndefined:ts,isDate:Sp,isFile:_p,isBlob:Cp,isRegExp:Gp,isFunction:ee,isStream:Tp,isURLSearchParams:Ap,isTypedArray:Up,isFileList:Ep,forEach:es,merge:Vi,extend:Rp,trim:Op,stripBOM:Lp,inherits:zp,toFlatObject:Np,kindOf:rr,kindOfTest:fe,endsWith:Fp,toArray:Bp,forEachEntry:$p,matchAll:Yp,isHTMLForm:jp,hasOwnProperty:_h,hasOwnProp:_h,reduceDescriptors:Ch,freezeMethods:Vp,toObjectSet:qp,toCamelCase:Xp,noop:Hp,toFiniteNumber:Wp,findKey:xh,global:ln,isContextDefined:Sh,isSpecCompliantForm:Jp,toJSONObject:Kp,isAsyncFn:Zp,isThenable:Qp,setImmediate:Eh,asap:tg};function it(s,t,e,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}R.inherits(it,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:R.toJSONObject(this.config),code:this.code,status:this.status}}});const Th=it.prototype,Ph={};["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(s=>{Ph[s]={value:s}}),Object.defineProperties(it,Ph),Object.defineProperty(Th,"isAxiosError",{value:!0}),it.from=(s,t,e,n,r,i)=>{const o=Object.create(Th);return R.toFlatObject(s,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),it.call(o,s.message,t,e,n,r),o.cause=s,o.name=s.name,i&&Object.assign(o,i),o};const eg=null;function qi(s){return R.isPlainObject(s)||R.isArray(s)}function Ah(s){return R.endsWith(s,"[]")?s.slice(0,-2):s}function Mh(s,t,e){return s?s.concat(t).map(function(n,r){return n=Ah(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function ng(s){return R.isArray(s)&&!s.some(qi)}const sg=R.toFlatObject(R,{},null,function(s){return/^is[A-Z]/.test(s)});function cr(s,t,e){if(!R.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=R.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,m){return!R.isUndefined(m[f])});const n=e.metaTokens,r=e.visitor||h,i=e.dots,o=e.indexes,a=(e.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(t);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(R.isDate(f))return f.toISOString();if(!a&&R.isBlob(f))throw new it("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(f)||R.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function h(f,m,p){let _=f;if(f&&!p&&typeof f=="object"){if(R.endsWith(m,"{}"))m=n?m:m.slice(0,-2),f=JSON.stringify(f);else if(R.isArray(f)&&ng(f)||(R.isFileList(f)||R.endsWith(m,"[]"))&&(_=R.toArray(f)))return m=Ah(m),_.forEach(function(y,b){!(R.isUndefined(y)||y===null)&&t.append(o===!0?Mh([m],b,i):o===null?m:m+"[]",c(y))}),!1}return qi(f)?!0:(t.append(Mh(p,m,i),c(f)),!1)}const l=[],u=Object.assign(sg,{defaultVisitor:h,convertValue:c,isVisitable:qi});function d(f,m){if(!R.isUndefined(f)){if(l.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));l.push(f),R.forEach(f,function(p,_){(!(R.isUndefined(p)||p===null)&&r.call(t,p,R.isString(_)?_.trim():_,m,u))===!0&&d(p,m?m.concat(_):[_])}),l.pop()}}if(!R.isObject(s))throw new TypeError("data must be an object");return d(s),t}function kh(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Hi(s,t){this._pairs=[],s&&cr(s,this,t)}const Ih=Hi.prototype;Ih.append=function(s,t){this._pairs.push([s,t])},Ih.toString=function(s){const t=s?function(e){return s.call(this,e,kh)}:kh;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};function rg(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Dh(s,t,e){if(!t)return s;const n=e&&e.encode||rg;R.isFunction(e)&&(e={serialize:e});const r=e&&e.serialize;let i;if(r?i=r(t,e):i=R.isURLSearchParams(t)?t.toString():new Hi(t,e).toString(n),i){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+i}return s}class ig{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){R.forEach(this.handlers,function(e){e!==null&&t(e)})}}const Oh=ig,Rh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},og=typeof URLSearchParams<"u"?URLSearchParams:Hi,ag=typeof FormData<"u"?FormData:null,cg=typeof Blob<"u"?Blob:null,hg={isBrowser:!0,classes:{URLSearchParams:og,FormData:ag,Blob:cg},protocols:["http","https","file","blob","url","data"]},Wi=typeof window<"u"&&typeof document<"u",Ji=typeof navigator=="object"&&navigator||void 0,lg=Wi&&(!Ji||["ReactNative","NativeScript","NS"].indexOf(Ji.product)<0),ug=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),fg=Wi&&window.location.href||"http://localhost",dg=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wi,hasStandardBrowserEnv:lg,hasStandardBrowserWebWorkerEnv:ug,navigator:Ji,origin:fg},Symbol.toStringTag,{value:"Module"})),qt={...dg,...hg};function mg(s,t){return cr(s,new qt.classes.URLSearchParams,Object.assign({visitor:function(e,n,r,i){return qt.isNode&&R.isBuffer(e)?(this.append(n,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function pg(s){return R.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gg(s){const t={},e=Object.keys(s);let n;const r=e.length;let i;for(n=0;n<r;n++)i=e[n],t[i]=s[i];return t}function Lh(s){function t(e,n,r,i){let o=e[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=e.length;return o=!o&&R.isArray(r)?r.length:o,c?(R.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):((!r[o]||!R.isObject(r[o]))&&(r[o]=[]),t(e,n,r[o],i)&&R.isArray(r[o])&&(r[o]=gg(r[o])),!a)}if(R.isFormData(s)&&R.isFunction(s.entries)){const e={};return R.forEachEntry(s,(n,r)=>{t(pg(n),r,e,0)}),e}return null}function yg(s,t,e){if(R.isString(s))try{return(t||JSON.parse)(s),R.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const Ki={transitional:Rh,adapter:["xhr","http","fetch"],transformRequest:[function(s,t){const e=t.getContentType()||"",n=e.indexOf("application/json")>-1,r=R.isObject(s);if(r&&R.isHTMLForm(s)&&(s=new FormData(s)),R.isFormData(s))return n?JSON.stringify(Lh(s)):s;if(R.isArrayBuffer(s)||R.isBuffer(s)||R.isStream(s)||R.isFile(s)||R.isBlob(s)||R.isReadableStream(s))return s;if(R.isArrayBufferView(s))return s.buffer;if(R.isURLSearchParams(s))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let i;if(r){if(e.indexOf("application/x-www-form-urlencoded")>-1)return mg(s,this.formSerializer).toString();if((i=R.isFileList(s))||e.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return cr(i?{"files[]":s}:s,o&&new o,this.formSerializer)}}return r||n?(t.setContentType("application/json",!1),yg(s)):s}],transformResponse:[function(s){const t=this.transitional||Ki.transitional,e=t&&t.forcedJSONParsing,n=this.responseType==="json";if(R.isResponse(s)||R.isReadableStream(s))return s;if(s&&R.isString(s)&&(e&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(s)}catch(i){if(r)throw i.name==="SyntaxError"?it.from(i,it.ERR_BAD_RESPONSE,this,null,this.response):i}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qt.classes.FormData,Blob:qt.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],s=>{Ki.headers[s]={}});const Zi=Ki,bg=R.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"]),wg=s=>{const t={};let e,n,r;return s&&s.split(`
53
+ `).forEach(function(i){r=i.indexOf(":"),e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+1).trim(),!(!e||t[e]&&bg[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},zh=Symbol("internals");function ns(s){return s&&String(s).trim().toLowerCase()}function hr(s){return s===!1||s==null?s:R.isArray(s)?s.map(hr):String(s)}function vg(s){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(s);)t[n[1]]=n[2];return t}const xg=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function Qi(s,t,e,n,r){if(R.isFunction(n))return n.call(this,t,e);if(r&&(t=e),!!R.isString(t)){if(R.isString(n))return t.indexOf(n)!==-1;if(R.isRegExp(n))return n.test(t)}}function Sg(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function _g(s,t){const e=R.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+e,{value:function(r,i,o){return this[n].call(this,t,r,i,o)},configurable:!0})})}class lr{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(a,c,h){const l=ns(c);if(!l)throw new Error("header name must be a non-empty string");const u=R.findKey(r,l);(!u||r[u]===void 0||h===!0||h===void 0&&r[u]!==!1)&&(r[u||c]=hr(a))}const o=(a,c)=>R.forEach(a,(h,l)=>i(h,l,c));if(R.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(R.isString(t)&&(t=t.trim())&&!xg(t))o(wg(t),e);else if(R.isHeaders(t))for(const[a,c]of t.entries())i(c,a,n);else t!=null&&i(e,t,n);return this}get(t,e){if(t=ns(t),t){const n=R.findKey(this,t);if(n){const r=this[n];if(!e)return r;if(e===!0)return vg(r);if(R.isFunction(e))return e.call(this,r,n);if(R.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ns(t),t){const n=R.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Qi(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let r=!1;function i(o){if(o=ns(o),o){const a=R.findKey(n,o);a&&(!e||Qi(n,n[a],a,e))&&(delete n[a],r=!0)}}return R.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];(!t||Qi(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return R.forEach(this,(r,i)=>{const o=R.findKey(n,i);if(o){e[o]=hr(r),delete e[i];return}const a=t?Sg(i):String(i).trim();a!==i&&delete e[i],e[a]=hr(r),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(e[r]=t&&R.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
54
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(r=>n.set(r)),n}static accessor(t){const e=(this[zh]=this[zh]={accessors:{}}).accessors,n=this.prototype;function r(i){const o=ns(i);e[o]||(_g(n,i),e[o]=!0)}return R.isArray(t)?t.forEach(r):r(t),this}}lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(lr.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),R.freezeMethods(lr);const de=lr;function to(s,t){const e=this||Zi,n=t||e,r=de.from(n.headers);let i=n.data;return R.forEach(s,function(o){i=o.call(e,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Nh(s){return!!(s&&s.__CANCEL__)}function Rn(s,t,e){it.call(this,s??"canceled",it.ERR_CANCELED,t,e),this.name="CanceledError"}R.inherits(Rn,it,{__CANCEL__:!0});function Fh(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new it("Request failed with status code "+e.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Cg(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Eg(s,t){s=s||10;const e=new Array(s),n=new Array(s);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(a){const c=Date.now(),h=n[i];o||(o=c),e[r]=a,n[r]=c;let l=i,u=0;for(;l!==r;)u+=e[l++],l=l%s;if(r=(r+1)%s,r===i&&(i=(i+1)%s),c-o<t)return;const d=h&&c-h;return d?Math.round(u*1e3/d):void 0}}function Tg(s,t){let e=0,n=1e3/t,r,i;const o=(a,c=Date.now())=>{e=c,r=null,i&&(clearTimeout(i),i=null),s.apply(null,a)};return[(...a)=>{const c=Date.now(),h=c-e;h>=n?o(a,c):(r=a,i||(i=setTimeout(()=>{i=null,o(r)},n-h)))},()=>r&&o(r)]}const ur=(s,t,e=3)=>{let n=0;const r=Eg(50,250);return Tg(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-n,h=r(c),l=o<=a;n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:h||void 0,estimated:h&&a&&l?(a-o)/h:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(u)},e)},Bh=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},Uh=s=>(...t)=>R.asap(()=>s(...t)),Pg=qt.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,qt.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(qt.origin),qt.navigator&&/(msie|trident)/i.test(qt.navigator.userAgent)):()=>!0,Ag=qt.hasStandardBrowserEnv?{write(s,t,e,n,r,i){const o=[s+"="+encodeURIComponent(t)];R.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),R.isString(n)&&o.push("path="+n),R.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const t=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Mg(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function kg(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function $h(s,t,e){let n=!Mg(t);return s&&(n||e==!1)?kg(s,t):t}const Yh=s=>s instanceof de?{...s}:s;function un(s,t){t=t||{};const e={};function n(h,l,u,d){return R.isPlainObject(h)&&R.isPlainObject(l)?R.merge.call({caseless:d},h,l):R.isPlainObject(l)?R.merge({},l):R.isArray(l)?l.slice():l}function r(h,l,u,d){if(R.isUndefined(l)){if(!R.isUndefined(h))return n(void 0,h,u,d)}else return n(h,l,u,d)}function i(h,l){if(!R.isUndefined(l))return n(void 0,l)}function o(h,l){if(R.isUndefined(l)){if(!R.isUndefined(h))return n(void 0,h)}else return n(void 0,l)}function a(h,l,u){if(u in t)return n(h,l);if(u in s)return n(void 0,h)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(h,l,u)=>r(Yh(h),Yh(l),u,!0)};return R.forEach(Object.keys(Object.assign({},s,t)),function(h){const l=c[h]||r,u=l(s[h],t[h],h);R.isUndefined(u)&&l!==a||(e[h]=u)}),e}const jh=s=>{const t=un({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=de.from(o),t.url=Dh($h(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(R.isFormData(e)){if(qt.hasStandardBrowserEnv||qt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[h,...l]=c?c.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...l].join("; "))}}if(qt.hasStandardBrowserEnv&&(n&&R.isFunction(n)&&(n=n(t)),n||n!==!1&&Pg(t.url))){const h=r&&i&&Ag.read(i);h&&o.set(r,h)}return t},Ig=typeof XMLHttpRequest<"u",Dg=Ig&&function(s){return new Promise(function(t,e){const n=jh(s);let r=n.data;const i=de.from(n.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:c}=n,h,l,u,d,f;function m(){d&&d(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(h),n.signal&&n.signal.removeEventListener("abort",h)}let p=new XMLHttpRequest;p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout;function _(){if(!p)return;const b=de.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:b,config:s,request:p};Fh(function(w){t(w),m()},function(w){e(w),m()},v),p=null}"onloadend"in p?p.onloadend=_:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(_)},p.onabort=function(){p&&(e(new it("Request aborted",it.ECONNABORTED,s,p)),p=null)},p.onerror=function(){e(new it("Network Error",it.ERR_NETWORK,s,p)),p=null},p.ontimeout=function(){let b=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const v=n.transitional||Rh;n.timeoutErrorMessage&&(b=n.timeoutErrorMessage),e(new it(b,v.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,s,p)),p=null},r===void 0&&i.setContentType(null),"setRequestHeader"in p&&R.forEach(i.toJSON(),function(b,v){p.setRequestHeader(v,b)}),R.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),o&&o!=="json"&&(p.responseType=n.responseType),c&&([u,f]=ur(c,!0),p.addEventListener("progress",u)),a&&p.upload&&([l,d]=ur(a),p.upload.addEventListener("progress",l),p.upload.addEventListener("loadend",d)),(n.cancelToken||n.signal)&&(h=b=>{p&&(e(!b||b.type?new Rn(null,s,p):b),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(h),n.signal&&(n.signal.aborted?h():n.signal.addEventListener("abort",h)));const y=Cg(n.url);if(y&&qt.protocols.indexOf(y)===-1){e(new it("Unsupported protocol "+y+":",it.ERR_BAD_REQUEST,s));return}p.send(r||null)})},Og=(s,t)=>{const{length:e}=s=s?s.filter(Boolean):[];if(t||e){let n=new AbortController,r;const i=function(h){if(!r){r=!0,a();const l=h instanceof Error?h:this.reason;n.abort(l instanceof it?l:new Rn(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new it(`timeout ${t} of ms exceeded`,it.ETIMEDOUT))},t);const a=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),s=null)};s.forEach(h=>h.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>R.asap(a),c}},Rg=Og,Lg=function*(s,t){let e=s.byteLength;if(!t||e<t){yield s;return}let n=0,r;for(;n<e;)r=n+t,yield s.slice(n,r),n=r},zg=async function*(s,t){for await(const e of Ng(s))yield*Lg(e,t)},Ng=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const t=s.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Xh=(s,t,e,n)=>{const r=zg(s,t);let i=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:h,value:l}=await r.next();if(h){a(),c.close();return}let u=l.byteLength;if(e){let d=i+=u;e(d)}c.enqueue(new Uint8Array(l))}catch(h){throw a(h),h}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},fr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Gh=fr&&typeof ReadableStream=="function",Fg=fr&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),Vh=(s,...t)=>{try{return!!s(...t)}catch{return!1}},Bg=Gh&&Vh(()=>{let s=!1;const t=new Request(qt.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),qh=64*1024,eo=Gh&&Vh(()=>R.isReadableStream(new Response("").body)),dr={stream:eo&&(s=>s.body)};fr&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!dr[t]&&(dr[t]=R.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new it(`Response type '${t}' is not supported`,it.ERR_NOT_SUPPORT,n)})})})(new Response);const Ug=async s=>{if(s==null)return 0;if(R.isBlob(s))return s.size;if(R.isSpecCompliantForm(s))return(await new Request(qt.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(R.isArrayBufferView(s)||R.isArrayBuffer(s))return s.byteLength;if(R.isURLSearchParams(s)&&(s=s+""),R.isString(s))return(await Fg(s)).byteLength},$g=async(s,t)=>R.toFiniteNumber(s.getContentLength())??Ug(t),Yg=fr&&(async s=>{let{url:t,method:e,data:n,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:h,headers:l,withCredentials:u="same-origin",fetchOptions:d}=jh(s);h=h?(h+"").toLowerCase():"text";let f=Rg([r,i&&i.toAbortSignal()],o),m;const p=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let _;try{if(c&&Bg&&e!=="get"&&e!=="head"&&(_=await $g(l,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(R.isFormData(n)&&(C=E.headers.get("content-type"))&&l.setContentType(C),E.body){const[D,$]=Bh(_,ur(Uh(c)));n=Xh(E.body,qh,D,$)}}R.isString(u)||(u=u?"include":"omit");const y="credentials"in Request.prototype;m=new Request(t,{...d,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:y?u:void 0});let b=await fetch(m);const v=eo&&(h==="stream"||h==="response");if(eo&&(a||v&&p)){const E={};["status","statusText","headers"].forEach(O=>{E[O]=b[O]});const C=R.toFiniteNumber(b.headers.get("content-length")),[D,$]=a&&Bh(C,ur(Uh(a),!0))||[];b=new Response(Xh(b.body,qh,D,()=>{$&&$(),p&&p()}),E)}h=h||"text";let w=await dr[R.findKey(dr,h)||"text"](b,s);return!v&&p&&p(),await new Promise((E,C)=>{Fh(E,C,{data:w,headers:de.from(b.headers),status:b.status,statusText:b.statusText,config:s,request:m})})}catch(y){throw p&&p(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,s,m),{cause:y.cause||y}):it.from(y,y&&y.code,s,m)}}),no={http:eg,xhr:Dg,fetch:Yg};R.forEach(no,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const Hh=s=>`- ${s}`,jg=s=>R.isFunction(s)||s===null||s===!1,Wh={getAdapter:s=>{s=R.isArray(s)?s:[s];const{length:t}=s;let e,n;const r={};for(let i=0;i<t;i++){e=s[i];let o;if(n=e,!jg(e)&&(n=no[(o=String(e)).toLowerCase()],n===void 0))throw new it(`Unknown adapter '${o}'`);if(n)break;r[o||"#"+i]=n}if(!n){const i=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
55
+ `+i.map(Hh).join(`
56
+ `):" "+Hh(i[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:no};function so(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Rn(null,s)}function Jh(s){return so(s),s.headers=de.from(s.headers),s.data=to.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Wh.getAdapter(s.adapter||Zi.adapter)(s).then(function(t){return so(s),t.data=to.call(s,s.transformResponse,t),t.headers=de.from(t.headers),t},function(t){return Nh(t)||(so(s),t&&t.response&&(t.response.data=to.call(s,s.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)})}const Kh="1.8.4",mr={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{mr[s]=function(e){return typeof e===s||"a"+(t<1?"n ":" ")+s}});const Zh={};mr.transitional=function(s,t,e){function n(r,i){return"[Axios v"+Kh+"] Transitional option '"+r+"'"+i+(e?". "+e:"")}return(r,i,o)=>{if(s===!1)throw new it(n(i," has been removed"+(t?" in "+t:"")),it.ERR_DEPRECATED);return t&&!Zh[i]&&(Zh[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),s?s(r,i,o):!0}},mr.spelling=function(s){return(t,e)=>(console.warn(`${e} is likely a misspelling of ${s}`),!0)};function Xg(s,t,e){if(typeof s!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let r=n.length;for(;r-- >0;){const i=n[r],o=t[i];if(o){const a=s[i],c=a===void 0||o(a,i,s);if(c!==!0)throw new it("option "+i+" must be "+c,it.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new it("Unknown option "+i,it.ERR_BAD_OPTION)}}const pr={assertOptions:Xg,validators:mr},be=pr.validators;class gr{constructor(t){this.defaults=t,this.interceptors={request:new Oh,response:new Oh}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
57
+ `+i):n.stack=i}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=un(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;n!==void 0&&pr.assertOptions(n,{silentJSONParsing:be.transitional(be.boolean),forcedJSONParsing:be.transitional(be.boolean),clarifyTimeoutError:be.transitional(be.boolean)},!1),r!=null&&(R.isFunction(r)?e.paramsSerializer={serialize:r}:pr.assertOptions(r,{encode:be.function,serialize:be.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),pr.assertOptions(e,{baseUrl:be.spelling("baseURL"),withXsrfToken:be.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=i&&R.merge(i.common,i[e.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),e.headers=de.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(e)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const h=[];this.interceptors.response.forEach(function(m){h.push(m.fulfilled,m.rejected)});let l,u=0,d;if(!c){const m=[Jh.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,h),d=m.length,l=Promise.resolve(e);u<d;)l=l.then(m[u++],m[u++]);return l}d=a.length;let f=e;for(u=0;u<d;){const m=a[u++],p=a[u++];try{f=m(f)}catch(_){p.call(this,_);break}}try{l=Jh.call(this,f)}catch(m){return Promise.reject(m)}for(u=0,d=h.length;u<d;)l=l.then(h[u++],h[u++]);return l}getUri(t){t=un(this.defaults,t);const e=$h(t.baseURL,t.url,t.allowAbsoluteUrls);return Dh(e,t.params,t.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(s){gr.prototype[s]=function(t,e){return this.request(un(e||{},{method:s,url:t,data:(e||{}).data}))}}),R.forEach(["post","put","patch"],function(s){function t(e){return function(n,r,i){return this.request(un(i||{},{method:s,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}gr.prototype[s]=t(),gr.prototype[s+"Form"]=t(!0)});const yr=gr;class ro{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 n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},t(function(r,i,o){n.reason||(n.reason=new Rn(r,i,o),e(n.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=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ro(function(e){t=e}),cancel:t}}}const Gg=ro;function Vg(s){return function(t){return s.apply(null,t)}}function qg(s){return R.isObject(s)&&s.isAxiosError===!0}const io={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(io).forEach(([s,t])=>{io[t]=s});const Hg=io;function Qh(s){const t=new yr(s),e=bh(yr.prototype.request,t);return R.extend(e,yr.prototype,t,{allOwnKeys:!0}),R.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Qh(un(s,n))},e}const Dt=Qh(Zi);Dt.Axios=yr,Dt.CanceledError=Rn,Dt.CancelToken=Gg,Dt.isCancel=Nh,Dt.VERSION=Kh,Dt.toFormData=cr,Dt.AxiosError=it,Dt.Cancel=Dt.CanceledError,Dt.all=function(s){return Promise.all(s)},Dt.spread=Vg,Dt.isAxiosError=qg,Dt.mergeConfig=un,Dt.AxiosHeaders=de,Dt.formToJSON=s=>Lh(R.isHTMLForm(s)?new FormData(s):s),Dt.getAdapter=Wh.getAdapter,Dt.HttpStatusCode=Hg,Dt.default=Dt;const Wg=Dt;class tl{instance;canceler;constructor(t){this.instance=Wg.create(t),this.canceler=new uh({cacheKeyResolver:e=>{const{method:n,url:r,params:i,data:o}=e;return mh({method:n,url:r,params:i,data:o})}}),this.instance.interceptors.request.use(e=>(this.canceler.set(e),t?.interceptor?.request?.(e),e),e=>(e.config&&this.canceler.delete(e.config),t?.interceptor?.requestError?.(e),Promise.reject(e))),this.instance.interceptors.response.use(e=>(this.canceler.delete(e.config),t?.interceptor?.response?.(e),e.status==200,Promise.resolve(e)),e=>(this.canceler.delete(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e)))}request(t){const e=this.instance.request;return e({...t,signal:this.canceler.get(t)?.signal})}cancel(t){this.canceler.get(t)?.abort(),this.canceler.delete(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,n){return this.request({...n,method:"post",url:t,data:e})}postFormData(t,e,n){return n={...n,headers:{...n?.headers,"Content-Type":"multipart/form-data"}},this.request({...n,method:"post",url:t,data:e})}postForm(t,e,n){return this.instance.postForm(t,e,{...n})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}new uh({cacheKeyResolver:s=>mh(s)});function Jg(s,t=(e,n)=>e<=n){const e=s.length;let n=Math.floor(e/2);for(;n>0;){for(let r=n;r<e;r++){const i=s[r];let o=r;for(;o>=n&&!t(s[o-n],i);)s[o]=s[o-n],o-=n;s[o]=i}n=Math.floor(n/2)}}function el(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var nl={exports:{}};(function(s,t){(function(e){s.exports=e()})(function(e){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(y,b){var v=y[0],w=y[1],E=y[2],C=y[3];v+=(w&E|~w&C)+b[0]-680876936|0,v=(v<<7|v>>>25)+w|0,C+=(v&w|~v&E)+b[1]-389564586|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&w)+b[2]+606105819|0,E=(E<<17|E>>>15)+C|0,w+=(E&C|~E&v)+b[3]-1044525330|0,w=(w<<22|w>>>10)+E|0,v+=(w&E|~w&C)+b[4]-176418897|0,v=(v<<7|v>>>25)+w|0,C+=(v&w|~v&E)+b[5]+1200080426|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&w)+b[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,w+=(E&C|~E&v)+b[7]-45705983|0,w=(w<<22|w>>>10)+E|0,v+=(w&E|~w&C)+b[8]+1770035416|0,v=(v<<7|v>>>25)+w|0,C+=(v&w|~v&E)+b[9]-1958414417|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&w)+b[10]-42063|0,E=(E<<17|E>>>15)+C|0,w+=(E&C|~E&v)+b[11]-1990404162|0,w=(w<<22|w>>>10)+E|0,v+=(w&E|~w&C)+b[12]+1804603682|0,v=(v<<7|v>>>25)+w|0,C+=(v&w|~v&E)+b[13]-40341101|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&w)+b[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,w+=(E&C|~E&v)+b[15]+1236535329|0,w=(w<<22|w>>>10)+E|0,v+=(w&C|E&~C)+b[1]-165796510|0,v=(v<<5|v>>>27)+w|0,C+=(v&E|w&~E)+b[6]-1069501632|0,C=(C<<9|C>>>23)+v|0,E+=(C&w|v&~w)+b[11]+643717713|0,E=(E<<14|E>>>18)+C|0,w+=(E&v|C&~v)+b[0]-373897302|0,w=(w<<20|w>>>12)+E|0,v+=(w&C|E&~C)+b[5]-701558691|0,v=(v<<5|v>>>27)+w|0,C+=(v&E|w&~E)+b[10]+38016083|0,C=(C<<9|C>>>23)+v|0,E+=(C&w|v&~w)+b[15]-660478335|0,E=(E<<14|E>>>18)+C|0,w+=(E&v|C&~v)+b[4]-405537848|0,w=(w<<20|w>>>12)+E|0,v+=(w&C|E&~C)+b[9]+568446438|0,v=(v<<5|v>>>27)+w|0,C+=(v&E|w&~E)+b[14]-1019803690|0,C=(C<<9|C>>>23)+v|0,E+=(C&w|v&~w)+b[3]-187363961|0,E=(E<<14|E>>>18)+C|0,w+=(E&v|C&~v)+b[8]+1163531501|0,w=(w<<20|w>>>12)+E|0,v+=(w&C|E&~C)+b[13]-1444681467|0,v=(v<<5|v>>>27)+w|0,C+=(v&E|w&~E)+b[2]-51403784|0,C=(C<<9|C>>>23)+v|0,E+=(C&w|v&~w)+b[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,w+=(E&v|C&~v)+b[12]-1926607734|0,w=(w<<20|w>>>12)+E|0,v+=(w^E^C)+b[5]-378558|0,v=(v<<4|v>>>28)+w|0,C+=(v^w^E)+b[8]-2022574463|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^w)+b[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,w+=(E^C^v)+b[14]-35309556|0,w=(w<<23|w>>>9)+E|0,v+=(w^E^C)+b[1]-1530992060|0,v=(v<<4|v>>>28)+w|0,C+=(v^w^E)+b[4]+1272893353|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^w)+b[7]-155497632|0,E=(E<<16|E>>>16)+C|0,w+=(E^C^v)+b[10]-1094730640|0,w=(w<<23|w>>>9)+E|0,v+=(w^E^C)+b[13]+681279174|0,v=(v<<4|v>>>28)+w|0,C+=(v^w^E)+b[0]-358537222|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^w)+b[3]-722521979|0,E=(E<<16|E>>>16)+C|0,w+=(E^C^v)+b[6]+76029189|0,w=(w<<23|w>>>9)+E|0,v+=(w^E^C)+b[9]-640364487|0,v=(v<<4|v>>>28)+w|0,C+=(v^w^E)+b[12]-421815835|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^w)+b[15]+530742520|0,E=(E<<16|E>>>16)+C|0,w+=(E^C^v)+b[2]-995338651|0,w=(w<<23|w>>>9)+E|0,v+=(E^(w|~C))+b[0]-198630844|0,v=(v<<6|v>>>26)+w|0,C+=(w^(v|~E))+b[7]+1126891415|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~w))+b[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,w+=(C^(E|~v))+b[5]-57434055|0,w=(w<<21|w>>>11)+E|0,v+=(E^(w|~C))+b[12]+1700485571|0,v=(v<<6|v>>>26)+w|0,C+=(w^(v|~E))+b[3]-1894986606|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~w))+b[10]-1051523|0,E=(E<<15|E>>>17)+C|0,w+=(C^(E|~v))+b[1]-2054922799|0,w=(w<<21|w>>>11)+E|0,v+=(E^(w|~C))+b[8]+1873313359|0,v=(v<<6|v>>>26)+w|0,C+=(w^(v|~E))+b[15]-30611744|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~w))+b[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,w+=(C^(E|~v))+b[13]+1309151649|0,w=(w<<21|w>>>11)+E|0,v+=(E^(w|~C))+b[4]-145523070|0,v=(v<<6|v>>>26)+w|0,C+=(w^(v|~E))+b[11]-1120210379|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~w))+b[2]+718787259|0,E=(E<<15|E>>>17)+C|0,w+=(C^(E|~v))+b[9]-343485551|0,w=(w<<21|w>>>11)+E|0,y[0]=v+y[0]|0,y[1]=w+y[1]|0,y[2]=E+y[2]|0,y[3]=C+y[3]|0}function i(y){var b=[],v;for(v=0;v<64;v+=4)b[v>>2]=y.charCodeAt(v)+(y.charCodeAt(v+1)<<8)+(y.charCodeAt(v+2)<<16)+(y.charCodeAt(v+3)<<24);return b}function o(y){var b=[],v;for(v=0;v<64;v+=4)b[v>>2]=y[v]+(y[v+1]<<8)+(y[v+2]<<16)+(y[v+3]<<24);return b}function a(y){var b=y.length,v=[1732584193,-271733879,-1732584194,271733878],w,E,C,D,$,O;for(w=64;w<=b;w+=64)r(v,i(y.substring(w-64,w)));for(y=y.substring(w-64),E=y.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=0;w<E;w+=1)C[w>>2]|=y.charCodeAt(w)<<(w%4<<3);if(C[w>>2]|=128<<(w%4<<3),w>55)for(r(v,C),w=0;w<16;w+=1)C[w]=0;return D=b*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),$=parseInt(D[2],16),O=parseInt(D[1],16)||0,C[14]=$,C[15]=O,r(v,C),v}function c(y){var b=y.length,v=[1732584193,-271733879,-1732584194,271733878],w,E,C,D,$,O;for(w=64;w<=b;w+=64)r(v,o(y.subarray(w-64,w)));for(y=w-64<b?y.subarray(w-64):new Uint8Array(0),E=y.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=0;w<E;w+=1)C[w>>2]|=y[w]<<(w%4<<3);if(C[w>>2]|=128<<(w%4<<3),w>55)for(r(v,C),w=0;w<16;w+=1)C[w]=0;return D=b*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),$=parseInt(D[2],16),O=parseInt(D[1],16)||0,C[14]=$,C[15]=O,r(v,C),v}function h(y){var b="",v;for(v=0;v<4;v+=1)b+=n[y>>v*8+4&15]+n[y>>v*8&15];return b}function l(y){var b;for(b=0;b<y.length;b+=1)y[b]=h(y[b]);return y.join("")}l(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function y(b,v){return b=b|0||0,b<0?Math.max(b+v,0):Math.min(b,v)}ArrayBuffer.prototype.slice=function(b,v){var w=this.byteLength,E=y(b,w),C=w,D,$,O,U;return v!==e&&(C=y(v,w)),E>C?new ArrayBuffer(0):(D=C-E,$=new ArrayBuffer(D),O=new Uint8Array($),U=new Uint8Array(this,E,D),O.set(U),$)}}();function u(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function d(y,b){var v=y.length,w=new ArrayBuffer(v),E=new Uint8Array(w),C;for(C=0;C<v;C+=1)E[C]=y.charCodeAt(C);return b?E:w}function f(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function m(y,b,v){var w=new Uint8Array(y.byteLength+b.byteLength);return w.set(new Uint8Array(y)),w.set(new Uint8Array(b),y.byteLength),v?w:w.buffer}function p(y){var b=[],v=y.length,w;for(w=0;w<v-1;w+=2)b.push(parseInt(y.substr(w,2),16));return String.fromCharCode.apply(String,b)}function _(){this.reset()}return _.prototype.append=function(y){return this.appendBinary(u(y)),this},_.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.length;var b=this._buff.length,v;for(v=64;v<=b;v+=64)r(this._hash,i(this._buff.substring(v-64,v)));return this._buff=this._buff.substring(v-64),this},_.prototype.end=function(y){var b=this._buff,v=b.length,w,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(w=0;w<v;w+=1)E[w>>2]|=b.charCodeAt(w)<<(w%4<<3);return this._finish(E,v),C=l(this._hash),y&&(C=p(C)),this.reset(),C},_.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},_.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},_.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},_.prototype._finish=function(y,b){var v=b,w,E,C;if(y[v>>2]|=128<<(v%4<<3),v>55)for(r(this._hash,y),v=0;v<16;v+=1)y[v]=0;w=this._length*8,w=w.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(w[2],16),C=parseInt(w[1],16)||0,y[14]=E,y[15]=C,r(this._hash,y)},_.hash=function(y,b){return _.hashBinary(u(y),b)},_.hashBinary=function(y,b){var v=a(y),w=l(v);return b?p(w):w},_.ArrayBuffer=function(){this.reset()},_.ArrayBuffer.prototype.append=function(y){var b=m(this._buff.buffer,y,!0),v=b.length,w;for(this._length+=y.byteLength,w=64;w<=v;w+=64)r(this._hash,o(b.subarray(w-64,w)));return this._buff=w-64<v?new Uint8Array(b.buffer.slice(w-64)):new Uint8Array(0),this},_.ArrayBuffer.prototype.end=function(y){var b=this._buff,v=b.length,w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<v;E+=1)w[E>>2]|=b[E]<<(E%4<<3);return this._finish(w,v),C=l(this._hash),y&&(C=p(C)),this.reset(),C},_.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.ArrayBuffer.prototype.getState=function(){var y=_.prototype.getState.call(this);return y.buff=f(y.buff),y},_.ArrayBuffer.prototype.setState=function(y){return y.buff=d(y.buff,!0),_.prototype.setState.call(this,y)},_.ArrayBuffer.prototype.destroy=_.prototype.destroy,_.ArrayBuffer.prototype._finish=_.prototype._finish,_.ArrayBuffer.hash=function(y,b){var v=c(new Uint8Array(y)),w=l(v);return b?p(w):w},_})})(nl);var Kg=nl.exports;const Zg=el(Kg),Qg=Qm&&window.File&&window.FileReader&&window.FileList&&window.Blob;function t0(s='script[type="text/js-worker"]'){return Array.prototype.map.call(document.querySelectorAll(s),t=>t.textContent)}const oo=s=>new XMLSerializer().serializeToString(s),e0=(s,t="text/html")=>new DOMParser().parseFromString(s,t),ao=(s,t={mime:ye["image/svg+xml"],encode:Fs.utf8})=>Pi(oo(s),t);async function co(s=["*"],t){let e=[];const n=document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),n.addEventListener("click",r=>{n.value=""},!1),new Promise((r,i)=>{n.addEventListener("change",o=>{e=Array.from(o.target.files||[]),e.length===0?i(new Error("Cancel")):r(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&i(new Error("Cancel"))},1e3)},{once:!0}),n.click()}).then(r=>(n.remove(),r)).catch(r=>{throw n.remove(),r})}function ss(s,t=ie.text,e){return new Promise((n,r)=>{const i=new FileReader;switch(i.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),i.addEventListener("load",o=>{n(o.target?.result)}),i.addEventListener("error",o=>{r(o)}),t){case ie.dataURL:i.readAsDataURL(s);break;case ie.binaryString:i.readAsBinaryString(s);break;case ie.arraybuffer:i.readAsArrayBuffer(s);break;case ie.text:default:i.readAsText(s)}})}async function n0(s){const t=await ss(s,ie.arraybuffer);return qd(t)}function sl(s,t,e,n,r,i,o){const a=new FileReader;a.addEventListener("load",c=>{if(!c.target||!c.target.result)return t(c);if(e.append(c.target.result),o<n.size)sl(s,t,e,n,r,o,Math.min(o+r,n.size));else return s(e.end())}),a.addEventListener("error",c=>t(c)),a.readAsArrayBuffer(n.slice(i,o))}async function rl(s,t=1*1024*1024){return await new Promise((e,n)=>sl(e,n,new Zg.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class s0{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 tl({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||1*1024*1024,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 rl(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.postFormData(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{um(this.time,1),this.onTime?.(cm(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var il={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
19
58
  * http://hammerjs.github.io/
20
59
  *
21
60
  * Copyright (c) 2016 Jorik Tangelder;
22
- * Licensed under the MIT license */(function(s){(function(t,e,n,i){var r=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",h=Math.round,c=Math.abs,l=Date.now;function u(w,S,P){return setTimeout(b(w,P),S)}function m(w,S,P){return Array.isArray(w)?(f(w,P[S],P),!0):!1}function f(w,S,P){var M;if(w)if(w.forEach)w.forEach(S,P);else if(w.length!==i)for(M=0;M<w.length;)S.call(P,w[M],M,w),M++;else for(M in w)w.hasOwnProperty(M)&&S.call(P,w[M],M,w)}function p(w,S,P){var M="DEPRECATED METHOD: "+S+`
23
- `+P+` AT
24
- `;return function(){var D=new Error("get-stack-trace"),z=D&&D.stack?D.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",q=t.console&&(t.console.warn||t.console.log);return q&&q.call(t.console,M,z),w.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(S),M=1;M<arguments.length;M++){var D=arguments[M];if(D!==i&&D!==null)for(var z in D)D.hasOwnProperty(z)&&(P[z]=D[z])}return P}:g=Object.assign;var C=p(function(S,P,M){for(var D=Object.keys(P),z=0;z<D.length;)(!M||M&&S[D[z]]===i)&&(S[D[z]]=P[D[z]]),z++;return S},"extend","Use `assign`."),y=p(function(S,P){return C(S,P,!0)},"merge","Use `assign`.");function v(w,S,P){var M=S.prototype,D;D=w.prototype=Object.create(M),D.constructor=w,D._super=M,P&&g(D,P)}function b(w,S){return function(){return w.apply(S,arguments)}}function x(w,S){return typeof w==a?w.apply(S&&S[0]||i,S):w}function E(w,S){return w===i?S:w}function _(w,S,P){f(G(S),function(M){w.addEventListener(M,P,!1)})}function L(w,S,P){f(G(S),function(M){w.removeEventListener(M,P,!1)})}function N(w,S){for(;w;){if(w==S)return!0;w=w.parentNode}return!1}function Y(w,S){return w.indexOf(S)>-1}function G(w){return w.trim().split(/\s+/g)}function V(w,S,P){if(w.indexOf&&!P)return w.indexOf(S);for(var M=0;M<w.length;){if(P&&w[M][P]==S||!P&&w[M]===S)return M;M++}return-1}function J(w){return Array.prototype.slice.call(w,0)}function rt(w,S,P){for(var M=[],D=[],z=0;z<w.length;){var q=S?w[z][S]:w[z];V(D,q)<0&&M.push(w[z]),D[z]=q,z++}return P&&(S?M=M.sort(function(vt,It){return vt[S]>It[S]}):M=M.sort()),M}function tt(w,S){for(var P,M,D=S[0].toUpperCase()+S.slice(1),z=0;z<r.length;){if(P=r[z],M=P?P+D:S,M in w)return M;z++}return i}var te=1;function Xt(){return te++}function jt(w){var S=w.ownerDocument||w;return S.defaultView||S.parentWindow||t}var ee=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,k=tt(t,"PointerEvent")!==i,$=R&&ee.test(navigator.userAgent),Z="touch",At="pen",ne="mouse",yi="kinect",wi=25,yt=1,he=2,ot=4,Ct=8,Pn=1,rn=2,on=4,Fe=8,I=16,at=rn|on,an=Fe|I,Ru=at|an,Ou=["x","y"],bi=["clientX","clientY"];function qt(w,S){var P=this;this.manager=w,this.callback=S,this.element=w.element,this.target=w.options.inputTarget,this.domHandler=function(M){x(w.options.enable,[w])&&P.handler(M)},this.init()}qt.prototype={handler:function(){},init:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(jt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(jt(this.element),this.evWin,this.domHandler)}};function bx(w){var S,P=w.options.inputClass;return P?S=P:k?S=ga:$?S=Si:R?S=ya:S=vi,new S(w,xx)}function xx(w,S,P){var M=P.pointers.length,D=P.changedPointers.length,z=S&yt&&M-D===0,q=S&(ot|Ct)&&M-D===0;P.isFirst=!!z,P.isFinal=!!q,z&&(w.session={}),P.eventType=S,vx(w,P),w.emit("hammer.input",P),w.recognize(P),w.session.prevInput=P}function vx(w,S){var P=w.session,M=S.pointers,D=M.length;P.firstInput||(P.firstInput=zu(S)),D>1&&!P.firstMultiple?P.firstMultiple=zu(S):D===1&&(P.firstMultiple=!1);var z=P.firstInput,q=P.firstMultiple,wt=q?q.center:z.center,vt=S.center=Nu(M);S.timeStamp=l(),S.deltaTime=S.timeStamp-z.timeStamp,S.angle=pa(wt,vt),S.distance=xi(wt,vt),Sx(P,S),S.offsetDirection=Fu(S.deltaX,S.deltaY);var It=Bu(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=It.x,S.overallVelocityY=It.y,S.overallVelocity=c(It.x)>c(It.y)?It.x:It.y,S.scale=q?Ex(q.pointers,M):1,S.rotation=q?Cx(q.pointers,M):0,S.maxPointers=P.prevInput?S.pointers.length>P.prevInput.maxPointers?S.pointers.length:P.prevInput.maxPointers:S.pointers.length,_x(P,S);var le=w.element;N(S.srcEvent.target,le)&&(le=S.srcEvent.target),S.target=le}function Sx(w,S){var P=S.center,M=w.offsetDelta||{},D=w.prevDelta||{},z=w.prevInput||{};(S.eventType===yt||z.eventType===ot)&&(D=w.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=w.offsetDelta={x:P.x,y:P.y}),S.deltaX=D.x+(P.x-M.x),S.deltaY=D.y+(P.y-M.y)}function _x(w,S){var P=w.lastInterval||S,M=S.timeStamp-P.timeStamp,D,z,q,wt;if(S.eventType!=Ct&&(M>wi||P.velocity===i)){var vt=S.deltaX-P.deltaX,It=S.deltaY-P.deltaY,le=Bu(M,vt,It);z=le.x,q=le.y,D=c(le.x)>c(le.y)?le.x:le.y,wt=Fu(vt,It),w.lastInterval=S}else D=P.velocity,z=P.velocityX,q=P.velocityY,wt=P.direction;S.velocity=D,S.velocityX=z,S.velocityY=q,S.direction=wt}function zu(w){for(var S=[],P=0;P<w.pointers.length;)S[P]={clientX:h(w.pointers[P].clientX),clientY:h(w.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:S,center:Nu(S),deltaX:w.deltaX,deltaY:w.deltaY}}function Nu(w){var S=w.length;if(S===1)return{x:h(w[0].clientX),y:h(w[0].clientY)};for(var P=0,M=0,D=0;D<S;)P+=w[D].clientX,M+=w[D].clientY,D++;return{x:h(P/S),y:h(M/S)}}function Bu(w,S,P){return{x:S/w||0,y:P/w||0}}function Fu(w,S){return w===S?Pn:c(w)>=c(S)?w<0?rn:on:S<0?Fe:I}function xi(w,S,P){P||(P=Ou);var M=S[P[0]]-w[P[0]],D=S[P[1]]-w[P[1]];return Math.sqrt(M*M+D*D)}function pa(w,S,P){P||(P=Ou);var M=S[P[0]]-w[P[0]],D=S[P[1]]-w[P[1]];return Math.atan2(D,M)*180/Math.PI}function Cx(w,S){return pa(S[1],S[0],bi)+pa(w[1],w[0],bi)}function Ex(w,S){return xi(S[0],S[1],bi)/xi(w[0],w[1],bi)}var Px={mousedown:yt,mousemove:he,mouseup:ot},Tx="mousedown",Mx="mousemove mouseup";function vi(){this.evEl=Tx,this.evWin=Mx,this.pressed=!1,qt.apply(this,arguments)}v(vi,qt,{handler:function(S){var P=Px[S.type];P&yt&&S.button===0&&(this.pressed=!0),P&he&&S.which!==1&&(P=ot),this.pressed&&(P&ot&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[S],changedPointers:[S],pointerType:ne,srcEvent:S}))}});var Ax={pointerdown:yt,pointermove:he,pointerup:ot,pointercancel:Ct,pointerout:Ct},Ix={2:Z,3:At,4:ne,5:yi},Yu="pointerdown",Xu="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Yu="MSPointerDown",Xu="MSPointerMove MSPointerUp MSPointerCancel");function ga(){this.evEl=Yu,this.evWin=Xu,qt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(ga,qt,{handler:function(S){var P=this.store,M=!1,D=S.type.toLowerCase().replace("ms",""),z=Ax[D],q=Ix[S.pointerType]||S.pointerType,wt=q==Z,vt=V(P,S.pointerId,"pointerId");z&yt&&(S.button===0||wt)?vt<0&&(P.push(S),vt=P.length-1):z&(ot|Ct)&&(M=!0),!(vt<0)&&(P[vt]=S,this.callback(this.manager,z,{pointers:P,changedPointers:[S],pointerType:q,srcEvent:S}),M&&P.splice(vt,1))}});var Dx={touchstart:yt,touchmove:he,touchend:ot,touchcancel:Ct},kx="touchstart",Lx="touchstart touchmove touchend touchcancel";function Uu(){this.evTarget=kx,this.evWin=Lx,this.started=!1,qt.apply(this,arguments)}v(Uu,qt,{handler:function(S){var P=Dx[S.type];if(P===yt&&(this.started=!0),!!this.started){var M=Rx.call(this,S,P);P&(ot|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:S})}}});function Rx(w,S){var P=J(w.touches),M=J(w.changedTouches);return S&(ot|Ct)&&(P=rt(P.concat(M),"identifier",!0)),[P,M]}var Ox={touchstart:yt,touchmove:he,touchend:ot,touchcancel:Ct},zx="touchstart touchmove touchend touchcancel";function Si(){this.evTarget=zx,this.targetIds={},qt.apply(this,arguments)}v(Si,qt,{handler:function(S){var P=Ox[S.type],M=Nx.call(this,S,P);M&&this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:S})}});function Nx(w,S){var P=J(w.touches),M=this.targetIds;if(S&(yt|he)&&P.length===1)return M[P[0].identifier]=!0,[P,P];var D,z,q=J(w.changedTouches),wt=[],vt=this.target;if(z=P.filter(function(It){return N(It.target,vt)}),S===yt)for(D=0;D<z.length;)M[z[D].identifier]=!0,D++;for(D=0;D<q.length;)M[q[D].identifier]&&wt.push(q[D]),S&(ot|Ct)&&delete M[q[D].identifier],D++;if(wt.length)return[rt(z.concat(wt),"identifier",!0),wt]}var Bx=2500,$u=25;function ya(){qt.apply(this,arguments);var w=b(this.handler,this);this.touch=new Si(this.manager,w),this.mouse=new vi(this.manager,w),this.primaryTouch=null,this.lastTouches=[]}v(ya,qt,{handler:function(S,P,M){var D=M.pointerType==Z,z=M.pointerType==ne;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(D)Fx.call(this,P,M);else if(z&&Yx.call(this,M))return;this.callback(S,P,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Fx(w,S){w&yt?(this.primaryTouch=S.changedPointers[0].identifier,Gu.call(this,S)):w&(ot|Ct)&&Gu.call(this,S)}function Gu(w){var S=w.changedPointers[0];if(S.identifier===this.primaryTouch){var P={x:S.clientX,y:S.clientY};this.lastTouches.push(P);var M=this.lastTouches,D=function(){var z=M.indexOf(P);z>-1&&M.splice(z,1)};setTimeout(D,Bx)}}function Yx(w){for(var S=w.srcEvent.clientX,P=w.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var D=this.lastTouches[M],z=Math.abs(S-D.x),q=Math.abs(P-D.y);if(z<=$u&&q<=$u)return!0}return!1}var Vu=tt(o.style,"touchAction"),ju=Vu!==i,qu="compute",Hu="auto",wa="manipulation",hn="none",ds="pan-x",ms="pan-y",_i=Ux();function ba(w,S){this.manager=w,this.set(S)}ba.prototype={set:function(w){w==qu&&(w=this.compute()),ju&&this.manager.element.style&&_i[w]&&(this.manager.element.style[Vu]=w),this.actions=w.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var w=[];return f(this.manager.recognizers,function(S){x(S.options.enable,[S])&&(w=w.concat(S.getTouchAction()))}),Xx(w.join(" "))},preventDefaults:function(w){var S=w.srcEvent,P=w.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var M=this.actions,D=Y(M,hn)&&!_i[hn],z=Y(M,ms)&&!_i[ms],q=Y(M,ds)&&!_i[ds];if(D){var wt=w.pointers.length===1,vt=w.distance<2,It=w.deltaTime<250;if(wt&&vt&&It)return}if(!(q&&z)&&(D||z&&P&at||q&&P&an))return this.preventSrc(S)},preventSrc:function(w){this.manager.session.prevented=!0,w.preventDefault()}};function Xx(w){if(Y(w,hn))return hn;var S=Y(w,ds),P=Y(w,ms);return S&&P?hn:S||P?S?ds:ms:Y(w,wa)?wa:Hu}function Ux(){if(!ju)return!1;var w={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){w[P]=S?t.CSS.supports("touch-action",P):!0}),w}var Ci=1,Ht=2,Tn=4,Ye=8,ve=Ye,ps=16,ce=32;function Se(w){this.options=g({},this.defaults,w||{}),this.id=Xt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=Ci,this.simultaneous={},this.requireFail=[]}Se.prototype={defaults:{},set:function(w){return g(this.options,w),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(w){if(m(w,"recognizeWith",this))return this;var S=this.simultaneous;return w=Ei(w,this),S[w.id]||(S[w.id]=w,w.recognizeWith(this)),this},dropRecognizeWith:function(w){return m(w,"dropRecognizeWith",this)?this:(w=Ei(w,this),delete this.simultaneous[w.id],this)},requireFailure:function(w){if(m(w,"requireFailure",this))return this;var S=this.requireFail;return w=Ei(w,this),V(S,w)===-1&&(S.push(w),w.requireFailure(this)),this},dropRequireFailure:function(w){if(m(w,"dropRequireFailure",this))return this;w=Ei(w,this);var S=V(this.requireFail,w);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(w){return!!this.simultaneous[w.id]},emit:function(w){var S=this,P=this.state;function M(D){S.manager.emit(D,w)}P<Ye&&M(S.options.event+Wu(P)),M(S.options.event),w.additionalEvent&&M(w.additionalEvent),P>=Ye&&M(S.options.event+Wu(P))},tryEmit:function(w){if(this.canEmit())return this.emit(w);this.state=ce},canEmit:function(){for(var w=0;w<this.requireFail.length;){if(!(this.requireFail[w].state&(ce|Ci)))return!1;w++}return!0},recognize:function(w){var S=g({},w);if(!x(this.options.enable,[this,S])){this.reset(),this.state=ce;return}this.state&(ve|ps|ce)&&(this.state=Ci),this.state=this.process(S),this.state&(Ht|Tn|Ye|ps)&&this.tryEmit(S)},process:function(w){},getTouchAction:function(){},reset:function(){}};function Wu(w){return w&ps?"cancel":w&Ye?"end":w&Tn?"move":w&Ht?"start":""}function Ju(w){return w==I?"down":w==Fe?"up":w==rn?"left":w==on?"right":""}function Ei(w,S){var P=S.manager;return P?P.get(w):w}function se(){Se.apply(this,arguments)}v(se,Se,{defaults:{pointers:1},attrTest:function(w){var S=this.options.pointers;return S===0||w.pointers.length===S},process:function(w){var S=this.state,P=w.eventType,M=S&(Ht|Tn),D=this.attrTest(w);return M&&(P&Ct||!D)?S|ps:M||D?P&ot?S|Ye:S&Ht?S|Tn:Ht:ce}});function Pi(){se.apply(this,arguments),this.pX=null,this.pY=null}v(Pi,se,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ru},getTouchAction:function(){var w=this.options.direction,S=[];return w&at&&S.push(ms),w&an&&S.push(ds),S},directionTest:function(w){var S=this.options,P=!0,M=w.distance,D=w.direction,z=w.deltaX,q=w.deltaY;return D&S.direction||(S.direction&at?(D=z===0?Pn:z<0?rn:on,P=z!=this.pX,M=Math.abs(w.deltaX)):(D=q===0?Pn:q<0?Fe:I,P=q!=this.pY,M=Math.abs(w.deltaY))),w.direction=D,P&&M>S.threshold&&D&S.direction},attrTest:function(w){return se.prototype.attrTest.call(this,w)&&(this.state&Ht||!(this.state&Ht)&&this.directionTest(w))},emit:function(w){this.pX=w.deltaX,this.pY=w.deltaY;var S=Ju(w.direction);S&&(w.additionalEvent=this.options.event+S),this._super.emit.call(this,w)}});function xa(){se.apply(this,arguments)}v(xa,se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[hn]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.scale-1)>this.options.threshold||this.state&Ht)},emit:function(w){if(w.scale!==1){var S=w.scale<1?"in":"out";w.additionalEvent=this.options.event+S}this._super.emit.call(this,w)}});function va(){Se.apply(this,arguments),this._timer=null,this._input=null}v(va,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Hu]},process:function(w){var S=this.options,P=w.pointers.length===S.pointers,M=w.distance<S.threshold,D=w.deltaTime>S.time;if(this._input=w,!M||!P||w.eventType&(ot|Ct)&&!D)this.reset();else if(w.eventType&yt)this.reset(),this._timer=u(function(){this.state=ve,this.tryEmit()},S.time,this);else if(w.eventType&ot)return ve;return ce},reset:function(){clearTimeout(this._timer)},emit:function(w){this.state===ve&&(w&&w.eventType&ot?this.manager.emit(this.options.event+"up",w):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Sa(){se.apply(this,arguments)}v(Sa,se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[hn]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.rotation)>this.options.threshold||this.state&Ht)}});function _a(){se.apply(this,arguments)}v(_a,se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|an,pointers:1},getTouchAction:function(){return Pi.prototype.getTouchAction.call(this)},attrTest:function(w){var S=this.options.direction,P;return S&(at|an)?P=w.overallVelocity:S&at?P=w.overallVelocityX:S&an&&(P=w.overallVelocityY),this._super.attrTest.call(this,w)&&S&w.offsetDirection&&w.distance>this.options.threshold&&w.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&w.eventType&ot},emit:function(w){var S=Ju(w.offsetDirection);S&&this.manager.emit(this.options.event+S,w),this.manager.emit(this.options.event,w)}});function Ti(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Ti,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wa]},process:function(w){var S=this.options,P=w.pointers.length===S.pointers,M=w.distance<S.threshold,D=w.deltaTime<S.time;if(this.reset(),w.eventType&yt&&this.count===0)return this.failTimeout();if(M&&D&&P){if(w.eventType!=ot)return this.failTimeout();var z=this.pTime?w.timeStamp-this.pTime<S.interval:!0,q=!this.pCenter||xi(this.pCenter,w.center)<S.posThreshold;this.pTime=w.timeStamp,this.pCenter=w.center,!q||!z?this.count=1:this.count+=1,this._input=w;var wt=this.count%S.taps;if(wt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=ve,this.tryEmit()},S.interval,this),Ht):ve}return ce},failTimeout:function(){return this._timer=u(function(){this.state=ce},this.options.interval,this),ce},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function _e(w,S){return S=S||{},S.recognizers=E(S.recognizers,_e.defaults.preset),new Ca(w,S)}_e.VERSION="2.0.7",_e.defaults={domEvents:!1,touchAction:qu,enable:!0,inputTarget:null,inputClass:null,preset:[[Sa,{enable:!1}],[xa,{enable:!1},["rotate"]],[_a,{direction:at}],[Pi,{direction:at},["swipe"]],[Ti],[Ti,{event:"doubletap",taps:2},["tap"]],[va]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var $x=1,Zu=2;function Ca(w,S){this.options=g({},_e.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||w,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=w,this.input=bx(this),this.touchAction=new ba(this,this.options.touchAction),Ku(this,!0),f(this.options.recognizers,function(P){var M=this.add(new P[0](P[1]));P[2]&&M.recognizeWith(P[2]),P[3]&&M.requireFailure(P[3])},this)}Ca.prototype={set:function(w){return g(this.options,w),w.touchAction&&this.touchAction.update(),w.inputTarget&&(this.input.destroy(),this.input.target=w.inputTarget,this.input.init()),this},stop:function(w){this.session.stopped=w?Zu:$x},recognize:function(w){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(w);var P,M=this.recognizers,D=S.curRecognizer;(!D||D&&D.state&ve)&&(D=S.curRecognizer=null);for(var z=0;z<M.length;)P=M[z],S.stopped!==Zu&&(!D||P==D||P.canRecognizeWith(D))?P.recognize(w):P.reset(),!D&&P.state&(Ht|Tn|Ye)&&(D=S.curRecognizer=P),z++}},get:function(w){if(w instanceof Se)return w;for(var S=this.recognizers,P=0;P<S.length;P++)if(S[P].options.event==w)return S[P];return null},add:function(w){if(m(w,"add",this))return this;var S=this.get(w.options.event);return S&&this.remove(S),this.recognizers.push(w),w.manager=this,this.touchAction.update(),w},remove:function(w){if(m(w,"remove",this))return this;if(w=this.get(w),w){var S=this.recognizers,P=V(S,w);P!==-1&&(S.splice(P,1),this.touchAction.update())}return this},on:function(w,S){if(w!==i&&S!==i){var P=this.handlers;return f(G(w),function(M){P[M]=P[M]||[],P[M].push(S)}),this}},off:function(w,S){if(w!==i){var P=this.handlers;return f(G(w),function(M){S?P[M]&&P[M].splice(V(P[M],S),1):delete P[M]}),this}},emit:function(w,S){this.options.domEvents&&Gx(w,S);var P=this.handlers[w]&&this.handlers[w].slice();if(!(!P||!P.length)){S.type=w,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var M=0;M<P.length;)P[M](S),M++}},destroy:function(){this.element&&Ku(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ku(w,S){var P=w.element;if(P.style){var M;f(w.options.cssProps,function(D,z){M=tt(P.style,z),S?(w.oldCssProps[M]=P.style[M],P.style[M]=D):P.style[M]=w.oldCssProps[M]||""}),S||(w.oldCssProps={})}}function Gx(w,S){var P=e.createEvent("Event");P.initEvent(w,!0,!0),P.gesture=S,S.target.dispatchEvent(P)}g(_e,{INPUT_START:yt,INPUT_MOVE:he,INPUT_END:ot,INPUT_CANCEL:Ct,STATE_POSSIBLE:Ci,STATE_BEGAN:Ht,STATE_CHANGED:Tn,STATE_ENDED:Ye,STATE_RECOGNIZED:ve,STATE_CANCELLED:ps,STATE_FAILED:ce,DIRECTION_NONE:Pn,DIRECTION_LEFT:rn,DIRECTION_RIGHT:on,DIRECTION_UP:Fe,DIRECTION_DOWN:I,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:an,DIRECTION_ALL:Ru,Manager:Ca,Input:qt,TouchAction:ba,TouchInput:Si,MouseInput:vi,PointerEventInput:ga,TouchMouseInput:ya,SingleTouchInput:Uu,Recognizer:Se,AttrRecognizer:se,Tap:Ti,Pan:Pi,Swipe:_a,Pinch:xa,Rotate:Sa,Press:va,on:_,off:L,each:f,merge:y,extend:C,assign:g,inherit:v,bindFn:b,prefixed:tt});var Vx=typeof t<"u"?t:typeof self<"u"?self:{};Vx.Hammer=_e,typeof i=="function"&&i.amd?i(function(){return _e}):s.exports?s.exports=_e:t[n]=_e})(window,document,"Hammer")})(Hh);var cp=Hh.exports;const nt=Gh(cp);var yr=function(s,t){return yr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},yr(s,t)};function oe(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yr(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function lp(s,t,e,n){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(l){try{c(n.next(l))}catch(u){o(u)}}function h(l){try{c(n.throw(l))}catch(u){o(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,h)}c((n=n.apply(s,t||[])).next())})}function Wh(s,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return h([c,l])}}function h(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(n=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(s,e)}catch(l){c=[6,l],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ge(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Pe(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function dn(s){return this instanceof dn?(this.v=s,this):new dn(s)}function up(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(s,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(p){return Promise.resolve(p).then(f,u)}}function a(f,p){n[f]&&(i[f]=function(g){return new Promise(function(C,y){r.push([f,g,C,y])>1||h(f,g)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(n[f](p))}catch(g){m(r[0][3],g)}}function c(f){f.value instanceof dn?Promise.resolve(f.value.v).then(l,u):m(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function m(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function fp(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof Ge=="function"?Ge(s):s[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=s[r]&&function(o){return new Promise(function(a,h){o=s[r](o),i(a,h,o.done,o.value)})}}function i(r,o,a,h){Promise.resolve(h).then(function(c){r({value:c,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function H(s){return typeof s=="function"}function wr(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var br=wr(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
25
- `+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
26
- `):"",this.name="UnsubscriptionError",this.errors=e}});function Yn(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var mn=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Ge(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(g){t={error:g}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(H(l))try{l()}catch(g){r=g instanceof br?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=Ge(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Kh(p)}catch(g){r=r??[],g instanceof br?r=Pe(Pe([],de(r)),de(g.errors)):r.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new br(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Kh(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Yn(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Yn(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),Jh=mn.EMPTY;function Zh(s){return s instanceof mn||s&&"closed"in s&&H(s.remove)&&H(s.add)&&H(s.unsubscribe)}function Kh(s){H(s)?s():s.unsubscribe()}var Qh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},xr={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=xr.delegate;return i?.setTimeout?i.setTimeout.apply(i,Pe([s,t],de(e))):setTimeout.apply(void 0,Pe([s,t],de(e)))},clearTimeout:function(s){var t=xr.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function tc(s){xr.setTimeout(function(){throw s})}function Xn(){}function Us(s){s()}var vr=function(s){oe(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Zh(e)&&e.add(n)):n.destination=gp,n}return t.create=function(e,n,i){return new pn(e,n,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,s.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}(mn),dp=Function.prototype.bind;function Sr(s,t){return dp.call(s,t)}var mp=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){$s(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){$s(n)}else $s(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){$s(e)}},s}(),pn=function(s){oe(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(H(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Qh.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Sr(e.next,a),error:e.error&&Sr(e.error,a),complete:e.complete&&Sr(e.complete,a)}):o=e}return r.destination=new mp(o),r}return t}(vr);function $s(s){tc(s)}function pp(s){throw s}var gp={closed:!0,next:Xn,error:pp,complete:Xn},_r=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ve(s){return s}function yp(s){return s.length===0?Ve:s.length===1?s[0]:function(e){return s.reduce(function(n,i){return i(n)},e)}}var st=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=bp(t)?t:new pn(t,e,n);return Us(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=ec(e),new e(function(i,r){var o=new pn({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[_r]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yp(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=ec(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s}();function ec(s){var t;return(t=s??Qh.Promise)!==null&&t!==void 0?t:Promise}function wp(s){return s&&H(s.next)&&H(s.error)&&H(s.complete)}function bp(s){return s&&s instanceof vr||wp(s)&&Zh(s)}function xp(s){return H(s?.lift)}function Dt(s){return function(t){if(xp(t))return t.lift(function(e){try{return s(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ut(s,t,e,n,i){return new vp(s,t,e,n,i)}var vp=function(s){oe(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(l){e.error(l)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(vr),Sp=wr(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Te=function(s){oe(t,s);function t(){var e=s.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 n=new nc(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Sp},t.prototype.next=function(e){var n=this;Us(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Ge(n.currentObservers),a=o.next();!a.done;a=o.next()){var h=a.value;h.next(e)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var n=this;Us(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Us(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.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(),s.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 n=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Jh:(this.currentObservers=null,a.push(e),new mn(function(){n.currentObservers=null,Yn(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,r=n.thrownError,o=n.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new st;return e.source=this,e},t.create=function(e,n){return new nc(e,n)},t}(st),nc=function(s){oe(t,s);function t(e,n){var i=s.call(this)||this;return i.destination=e,i.source=n,i}return t.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},t.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:Jh},t}(Te),sc=function(s){oe(t,s);function t(e){var n=s.call(this)||this;return n._value=e,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var n=s.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},t.prototype.getValue=function(){var e=this,n=e.hasError,i=e.thrownError,r=e._value;if(n)throw i;return this._throwIfClosed(),r},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(Te),Cr={now:function(){return(Cr.delegate||Date).now()},delegate:void 0},_p=function(s){oe(t,s);function t(e,n,i){e===void 0&&(e=1/0),n===void 0&&(n=1/0),i===void 0&&(i=Cr);var r=s.call(this)||this;return r._bufferSize=e,r._windowTime=n,r._timestampProvider=i,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=n===1/0,r._bufferSize=Math.max(1,e),r._windowTime=Math.max(1,n),r}return t.prototype.next=function(e){var n=this,i=n.isStopped,r=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,h=n._windowTime;i||(r.push(e),!o&&r.push(a.now()+h)),this._trimBuffer(),s.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),i=this,r=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),h=0;h<a.length&&!e.closed;h+=r?1:2)e.next(a[h]);return this._checkFinalizedStatuses(e),n},t.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,i=e._timestampProvider,r=e._buffer,o=e._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<r.length&&r.splice(0,r.length-a),!o){for(var h=i.now(),c=0,l=1;l<r.length&&r[l]<=h;l+=2)c=l;c&&r.splice(0,c+1)}},t}(Te),Cp=function(s){oe(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(mn),Gs={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=Gs.delegate;return i?.setInterval?i.setInterval.apply(i,Pe([s,t],de(e))):setInterval.apply(void 0,Pe([s,t],de(e)))},clearInterval:function(s){var t=Gs.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},Ep=function(s){oe(t,s);function t(e,n){var i=s.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),Gs.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Gs.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Yn(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(Cp),ic=function(){function s(t,e){e===void 0&&(e=s.now),this.schedulerActionCtor=t,this.now=e}return s.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},s.now=Cr.now,s}(),Pp=function(s){oe(t,s);function t(e,n){n===void 0&&(n=ic.now);var i=s.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},t}(ic),Er=new Pp(Ep),Tp=Er,rc=new st(function(s){return s.complete()});function oc(s){return s&&H(s.schedule)}function Pr(s){return s[s.length-1]}function Mp(s){return H(Pr(s))?s.pop():void 0}function Un(s){return oc(Pr(s))?s.pop():void 0}function Ap(s,t){return typeof Pr(s)=="number"?s.pop():t}var Tr=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function ac(s){return H(s?.then)}function hc(s){return H(s[_r])}function cc(s){return Symbol.asyncIterator&&H(s?.[Symbol.asyncIterator])}function lc(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ip(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var uc=Ip();function fc(s){return H(s?.[uc])}function dc(s){return up(this,arguments,function(){var e,n,i,r;return Wh(this,function(o){switch(o.label){case 0:e=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,dn(e.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,dn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,dn(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function mc(s){return H(s?.getReader)}function mt(s){if(s instanceof st)return s;if(s!=null){if(hc(s))return Dp(s);if(Tr(s))return kp(s);if(ac(s))return Lp(s);if(cc(s))return pc(s);if(fc(s))return Rp(s);if(mc(s))return Op(s)}throw lc(s)}function Dp(s){return new st(function(t){var e=s[_r]();if(H(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function kp(s){return new st(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function Lp(s){return new st(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,tc)})}function Rp(s){return new st(function(t){var e,n;try{for(var i=Ge(s),r=i.next();!r.done;r=i.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function pc(s){return new st(function(t){zp(s,t).catch(function(e){return t.error(e)})})}function Op(s){return pc(dc(s))}function zp(s,t){var e,n,i,r;return lp(this,void 0,void 0,function(){var o,a;return Wh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=fp(s),h.label=1;case 1:return[4,e.next()];case 2:if(n=h.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=h.sent(),i={error:a},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.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 me(s,t,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(r),!i)return r}function gc(s,t){return t===void 0&&(t=0),Dt(function(e,n){e.subscribe(ut(n,function(i){return me(n,s,function(){return n.next(i)},t)},function(){return me(n,s,function(){return n.complete()},t)},function(i){return me(n,s,function(){return n.error(i)},t)}))})}function Mr(s,t){return t===void 0&&(t=0),Dt(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function Np(s,t){return mt(s).pipe(Mr(t),gc(t))}function Bp(s,t){return mt(s).pipe(Mr(t),gc(t))}function Fp(s,t){return new st(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function Yp(s,t){return new st(function(e){var n;return me(e,t,function(){n=s[uc](),me(e,t,function(){var i,r,o;try{i=n.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return H(n?.return)&&n.return()}})}function yc(s,t){if(!s)throw new Error("Iterable cannot be null");return new st(function(e){me(e,t,function(){var n=s[Symbol.asyncIterator]();me(e,t,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function Xp(s,t){return yc(dc(s),t)}function Up(s,t){if(s!=null){if(hc(s))return Np(s,t);if(Tr(s))return Fp(s,t);if(ac(s))return Bp(s,t);if(cc(s))return yc(s,t);if(fc(s))return Yp(s,t);if(mc(s))return Xp(s,t)}throw lc(s)}function $n(s,t){return t?Up(s,t):mt(s)}function $p(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Un(s);return $n(s,e)}var Gp=wr(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function Vp(s,t){var e=typeof t=="object";return new Promise(function(n,i){var r=new pn({next:function(o){n(o),r.unsubscribe()},error:i,complete:function(){e?n(t.defaultValue):i(new Gp)}});s.subscribe(r)})}function jp(s){return s instanceof Date&&!isNaN(s)}function it(s,t){return Dt(function(e,n){var i=0;e.subscribe(ut(n,function(r){n.next(s.call(t,r,i++))}))})}var qp=Array.isArray;function Hp(s,t){return qp(t)?s.apply(void 0,Pe([],de(t))):s(t)}function Ar(s){return it(function(t){return Hp(s,t)})}var Wp=Array.isArray,Jp=Object.getPrototypeOf,Zp=Object.prototype,Kp=Object.keys;function Qp(s){if(s.length===1){var t=s[0];if(Wp(t))return{args:t,keys:null};if(tg(t)){var e=Kp(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function tg(s){return s&&typeof s=="object"&&Jp(s)===Zp}function eg(s,t){return s.reduce(function(e,n,i){return e[n]=t[i],e},{})}function ng(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Un(s),n=Mp(s),i=Qp(s),r=i.args,o=i.keys;if(r.length===0)return $n([],e);var a=new st(sg(r,e,o?function(h){return eg(o,h)}:Ve));return n?a.pipe(Ar(n)):a}function sg(s,t,e){return e===void 0&&(e=Ve),function(n){wc(t,function(){for(var i=s.length,r=new Array(i),o=i,a=i,h=function(l){wc(t,function(){var u=$n(s[l],t),m=!1;u.subscribe(ut(n,function(f){r[l]=f,m||(m=!0,a--),a||n.next(e(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<i;c++)h(c)},n)}}function wc(s,t,e){s?me(e,s,t):t()}function ig(s,t,e,n,i,r,o,a){var h=[],c=0,l=0,u=!1,m=function(){u&&!h.length&&!c&&t.complete()},f=function(g){return c<n?p(g):h.push(g)},p=function(g){r&&t.next(g),c++;var C=!1;mt(e(g,l++)).subscribe(ut(t,function(y){i?.(y),r?f(y):t.next(y)},function(){C=!0},void 0,function(){if(C)try{c--;for(var y=function(){var v=h.shift();o?me(t,o,function(){return p(v)}):p(v)};h.length&&c<n;)y();m()}catch(v){t.error(v)}}))};return s.subscribe(ut(t,f,function(){u=!0,m()})),function(){a?.()}}function Ir(s,t,e){return e===void 0&&(e=1/0),H(t)?Ir(function(n,i){return it(function(r,o){return t(n,r,i,o)})(mt(s(n,i)))},e):(typeof t=="number"&&(e=t),Dt(function(n,i){return ig(n,i,s,e)}))}function bc(s){return s===void 0&&(s=1/0),Ir(Ve,s)}function rg(){return bc(1)}function xc(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return rg()($n(s,Un(s)))}var og=["addListener","removeListener"],ag=["addEventListener","removeEventListener"],hg=["on","off"];function Dr(s,t,e,n){if(H(e)&&(n=e,e=void 0),n)return Dr(s,t,e).pipe(Ar(n));var i=de(ug(s)?ag.map(function(a){return function(h){return s[a](t,h,e)}}):cg(s)?og.map(vc(s,t)):lg(s)?hg.map(vc(s,t)):[],2),r=i[0],o=i[1];if(!r&&Tr(s))return Ir(function(a){return Dr(a,t,e)})(mt(s));if(!r)throw new TypeError("Invalid event target");return new st(function(a){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function vc(s,t){return function(e){return function(n){return s[e](t,n)}}}function cg(s){return H(s.addListener)&&H(s.removeListener)}function lg(s){return H(s.on)&&H(s.off)}function ug(s){return H(s.addEventListener)&&H(s.removeEventListener)}function et(s,t,e){return e?et(s,t).pipe(Ar(e)):new st(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},r=s(i);return H(t)?function(){return t(i,r)}:void 0})}function fg(s,t,e){s===void 0&&(s=0),e===void 0&&(e=Tp);var n=-1;return t!=null&&(oc(t)?e=t:n=t),new st(function(i){var r=jp(s)?+s-e.now():s;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},r)})}function Sc(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Un(s),n=Ap(s,1/0),i=s;return i.length?i.length===1?mt(i[0]):bc(n)($n(i,e)):rc}var dg=Array.isArray;function mg(s){return s.length===1&&dg(s[0])?s[0]:s}function _c(s,t){return Dt(function(e,n){var i=0;e.subscribe(ut(n,function(r){return s.call(t,r,i++)&&n.next(r)}))})}function Vs(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=mg(s),s.length===1?mt(s[0]):new st(pg(s))}function pg(s){return function(t){for(var e=[],n=function(r){e.push(mt(s[r]).subscribe(ut(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},i=0;e&&!t.closed&&i<s.length;i++)n(i)}}function Me(s,t){return t===void 0&&(t=Ve),s=s??gg,Dt(function(e,n){var i,r=!0;e.subscribe(ut(n,function(o){var a=t(o);(r||!s(i,a))&&(r=!1,i=a,n.next(o))}))})}function gg(s,t){return s===t}function Cc(s,t){return t?function(e){return e.pipe(Cc(function(n,i){return mt(s(n,i)).pipe(it(function(r,o){return t(n,r,i,o)}))}))}:Dt(function(e,n){var i=0,r=null,o=!1;e.subscribe(ut(n,function(a){r||(r=ut(n,void 0,function(){r=null,o&&n.complete()}),mt(s(a,i++)).subscribe(r))},function(){o=!0,!r&&n.complete()}))})}function yg(s){s===void 0&&(s={});var t=s.connector,e=t===void 0?function(){return new Te}:t,n=s.resetOnError,i=n===void 0?!0:n,r=s.resetOnComplete,o=r===void 0?!0:r,a=s.resetOnRefCountZero,h=a===void 0?!0:a;return function(c){var l,u,m,f=0,p=!1,g=!1,C=function(){u?.unsubscribe(),u=void 0},y=function(){C(),l=m=void 0,p=g=!1},v=function(){var b=l;y(),b?.unsubscribe()};return Dt(function(b,x){f++,!g&&!p&&C();var E=m=m??e();x.add(function(){f--,f===0&&!g&&!p&&(u=kr(v,h))}),E.subscribe(x),!l&&f>0&&(l=new pn({next:function(_){return E.next(_)},error:function(_){g=!0,C(),u=kr(y,i,_),E.error(_)},complete:function(){p=!0,C(),u=kr(y,o),E.complete()}}),mt(b).subscribe(l))})(c)}}function kr(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];if(t===!0){s();return}if(t!==!1){var i=new pn({next:function(){i.unsubscribe(),s()}});return mt(t.apply(void 0,Pe([],de(e)))).subscribe(i)}}function wg(s,t,e){var n,i,r,o,a=!1;return s&&typeof s=="object"?(n=s.bufferSize,o=n===void 0?1/0:n,i=s.windowTime,t=i===void 0?1/0:i,r=s.refCount,a=r===void 0?!1:r,e=s.scheduler):o=s??1/0,yg({connector:function(){return new _p(o,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function je(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Un(s);return Dt(function(n,i){(e?xc(s,n,e):xc(s,n)).subscribe(i)})}function js(s,t){return Dt(function(e,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};e.subscribe(ut(n,function(h){i?.unsubscribe();var c=0,l=r++;mt(s(h,l)).subscribe(i=ut(n,function(u){return n.next(t?t(h,u,l,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function bg(){return js(Ve)}function Lr(s){return Dt(function(t,e){mt(s).subscribe(ut(e,function(){return e.complete()},Xn)),!e.closed&&t.subscribe(e)})}function qe(s,t,e){var n=H(s)||t||e?{next:s,error:t,complete:e}:s;return n?Dt(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(ut(r,function(h){var c;(c=n.next)===null||c===void 0||c.call(n,h),r.next(h)},function(){var h;a=!1,(h=n.complete)===null||h===void 0||h.call(n),r.complete()},function(h){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,h),r.error(h)},function(){var h,c;a&&((h=n.unsubscribe)===null||h===void 0||h.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Ve}function xg(s,t){return Dt(function(e,n){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,h=a===void 0?!1:a,c=!1,l=null,u=null,m=!1,f=function(){u?.unsubscribe(),u=null,h&&(C(),m&&n.complete())},p=function(){u=null,m&&n.complete()},g=function(y){return u=mt(s(y)).subscribe(ut(n,f,p))},C=function(){if(c){c=!1;var y=l;l=null,n.next(y),!m&&g(y)}};e.subscribe(ut(n,function(y){c=!0,l=y,!(u&&!u.closed)&&(o?C():g(y))},function(){m=!0,!(h&&c&&u&&!u.closed)&&n.complete()}))})}function vg(s,t,e){t===void 0&&(t=Er);var n=fg(s,t);return xg(function(){return n},e)}function Sg(s,t){return Dt(function(e,n){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};mt(s).subscribe(ut(n,function(o){var a=new Te;i.push(a);var h=new mn,c=function(){Yn(i,a),a.complete(),h.unsubscribe()},l;try{l=mt(t(o))}catch(u){r(u);return}n.next(a.asObservable()),h.add(l.subscribe(ut(n,c,Xn,r)))},Xn)),e.subscribe(ut(n,function(o){var a,h,c=i.slice();try{for(var l=Ge(c),u=l.next();!u.done;u=l.next()){var m=u.value;m.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function _g(s){return s.toElement?s.toElement:s.currentTarget?s.currentTarget:s.srcElement?s.srcElement:null}function W(s,t,e,n=!1){const i=async r=>{await e(r)};try{s.addEventListener(t,i,n)}catch{s.attachEvent("on"+t,i)}return()=>{try{s.removeEventListener(t,i,n)}catch{s.detachEvent("on"+t,i)}}}function Cg(s,t,e,n,i=!1){return W(s||document.body,e,r=>{r.target===t&&n(r)},i)}function Eg(s){s.replaceWith(s.cloneNode(!0))}function X(s,t,e=!1){return Dr(s,t,{capture:e})}function Pg(s){const t=et(e=>s.register(e),(e,n)=>{s.unregister?.(e,...n||[])},(...e)=>[...e]);return s.share?t.pipe(wg({bufferSize:s.bufferSize||1,refCount:!0})):t}function Ae(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function Rr(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const Tg=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Mg=["keydown","keyup","keypress"],Ag=["touchstart","touchend","touchcancel","touchmove"],Ig=["pointerdown","pointerup","pointercancel","pointermove"],Dg=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],kg=["change"];function qs(s,t={bubbles:!0,detail:{}}){let e;try{const n=Object.assign({bubbles:!0,cancelable:!0,view:window,detail:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},t);Tg.includes(s)?e=new MouseEvent(s,n):Mg.includes(s)?e=new KeyboardEvent(s,n):Ag.includes(s)?e=new TouchEvent(s,n):Ig.includes(s)?e=new PointerEvent(s,n):Dg.includes(s)?e=new DragEvent(s,n):kg.includes(s)?e=new Event(s,n):e=new CustomEvent(s,n)}catch{document.createEvent?e=document.createEvent("Event").initEvent(s,!0,!0):document.createEventObject&&(e=document.createEventObject())}return e}function Or(s,t,e){if(s)if(s.dispatchEvent)s.dispatchEvent(e);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,e);else throw new Error(`Can't dispatch event : ${t}`)}function Lg(s,t){const e=s.target,n=qs(t);Or(e,t,n)}function Rg(s){const t=s.target,e="click";if(!/(SELECT|INPUT|TEXTAREA)/i.test(t.tagName)){const n=qs(e);n.view=s.view||window,n.detail=1,n.screenX=t.screenX||0,n.screenY=t.screenY||0,n.clientX=t.clientX||0,n.clientY=t.clientY||0,n.pageX=s.pageX,n.pageY=s.pageY,n.ctrlKey=!!s.ctrlKey,n.altKey=!!s.altKey,n.shiftKey=!!s.shiftKey,n.metaKey=!!s.metaKey,n.button=0,n.relatedTarget=null,n._constructed=!0,Or(t,e,n)}}function Og(s,t){const e=s.changedTouches[0];return qs(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})}if(d.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,d.cAF=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame,!d.rAF){let s=lt();d.rAF=t=>{const e=lt(),n=Math.max(0,16-(e-s)),i=window.setTimeout(()=>{t(e+n)},n);return s=e+n,i}}d.cAF||(d.cAF=s=>{window.clearTimeout(s)});function zr(s){let t=!1,e=d.rAF(function n(i){!t&&s(i)&&(e=d.rAF(n))});return()=>{d.cAF(e),t=!0}}function Nr(s,t=0){if(t==0)return s(lt()),()=>{};{const e=lt();return zr(n=>n-e>=t?(s(n),!1):!0)}}function zg(s,t=0){let e=!1,n=0;const i=lt();let r=Nr(function o(a){if(e)return;n++;const h=a-i-n*t;s(a,n,t<=h),r=Nr(o,Math.max(0,t-h))},t);return()=>{r(),e=!0}}function Ng(s,t=20){const e=1e3/t;let n=0,i;return()=>(lt()-n>=e&&(n=lt(),i=s()),i)}window.requestIdleCallback=window.requestIdleCallback||function(s,t){const e=lt();return setTimeout(()=>{const n=lt()-e;s({didTimeout:!0,timeRemaining:()=>Math.max(0,50-n)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};function Ec(s,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?s():Ec(s,t)},{timeout:t?.timeout})}let Hs=0,Br=0,He=33,Ie=33,Fr,Yr=-1;const Pc=new MessageChannel,Bg=Pc.port2;Pc.port1.onmessage=s=>{Fr&&Fr({didTimeout:Yr==-1?!1:lt()-Hs>Yr,timeRemaining:()=>Math.max(0,Br-lt())})};function Fg(s,t){return Fr=s,Yr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{Hs=e;let n=Ie+Hs-Br;n<Ie&&He<Ie?(n<8&&(n=8),Ie=n<He?He:n):n>Ie&&He>Ie?Ie=n<He?He:n:He=n,Br=Hs+Ie,Bg.postMessage(null)})}const Tc=new rh({concurrency:1,timeRemaining:0});let Xr=!1;function Mc(s,t){const e=ih({fn:s,name:t?.name,deadline:typeof t?.timeout=="number"?$t()+t.timeout:void 0});Tc.addTask(e),!Xr&&(Xr=!0,Fg(n=>{Xr=!1,Tc.idleCallback(n)}))}class Gn{static _nextId=0;static nextId(){return Gn._nextId++}}const O={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)},style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)},style:"cubic-bezier(0.1, 0.57, 0.1, 1)"},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)},style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"},Bounce:{In:function(s){return 1-O.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?O.Bounce.In(s*2)*.5:O.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}};function Ac(s){switch(s){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return s}}const Yg=4,Xg=.001,Ug=1e-7,$g=10,Vn=11,Ws=1/(Vn-1),Gg=typeof Float32Array=="function";function Ic(s,t){return 1-3*t+3*s}function Dc(s,t){return 3*t-6*s}function kc(s){return 3*s}function Js(s,t,e){return((Ic(t,e)*s+Dc(t,e))*s+kc(t))*s}function Lc(s,t,e){return 3*Ic(t,e)*s*s+2*Dc(t,e)*s+kc(t)}function Vg(s,t,e,n,i){let r,o,a=0;do o=t+(e-t)/2,r=Js(o,n,i)-s,r>0?e=o:t=o;while(Math.abs(r)>Ug&&++a<$g);return o}function jg(s,t,e,n){for(let i=0;i<Yg;++i){const r=Lc(t,e,n);if(r===0)return t;const o=Js(t,e,n)-s;t-=o/r}return t}function qg(s){return s}function Ur(s,t,e,n){if(!(0<=s&&s<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(s===t&&e===n)return qg;const i=Gg?new Float32Array(Vn):new Array(Vn);for(let o=0;o<Vn;++o)i[o]=Js(o*Ws,s,e);function r(o){let a=0,h=1;const c=Vn-1;for(;h!==c&&i[h]<=o;++h)a+=Ws;--h;const l=(o-i[h])/(i[h+1]-i[h]),u=a+l*Ws,m=Lc(u,s,e);return m>=Xg?jg(o,u,s,e):m===0?u:Vg(o,a,a+Ws,s,e)}return o=>o===0||o===1?o:Js(r(o),t,n)}function $r(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Rc(s){const[t,e,n,i]=$r(s);return[1-n,1-i,1-t,1-e]}function Hg(s){return Ur(...$r(s))}function Wg(s){return Ur(...Rc(s))}const pe={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=pe.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,o=(n-t)*.5,a=i*i,h=i*a;return(2*t-2*e+r+o)*h+(-3*t+3*e-2*r-o)*a+r*i+t},QuadraticBezier:(s,t,e,n)=>{const i=1-n;return i*i*s+2*i*n*t+n*n*e},CubicBezier:(s,t,e,n,i)=>{const r=1-i;return r*r*r*s+3*r*r*i*t+3*r*i*i*e+i*i*i*n}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=pe.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=pe.Utils.Bernstein;for(let o=0;o<=n;o++)e+=i(1-t,n-o)*i(t,o)*s[o]*r(n,o);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=pe.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}};class Oc{_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=lt(),e=!1){const n=Object.keys(this._tweens);for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[n[i]]}return!!Object.keys(this._tweens).length}}const Gt=new Oc;class Gr{constructor(t,e=Gt){this._object=t,this._group=e}_id=Gn.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=O.Linear.None;_interpolationFunction=pe.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=lt()){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,n,i){for(const r in n){const o=t[r],a=Array.isArray(o),h=a?"array":typeof o,c=!a&&Array.isArray(n[r]);if(!(h==="undefined"||h==="function")){if(c){let l=n[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(l)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const l in o)e[r][l]=o[l];i[r]=a?[]:{},this._setupProperties(o,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),c?i[r]=n[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=lt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=lt()){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=Gt){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=O.Linear.None){return this._easingFunction=t,this}interpolation(t=pe.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=lt(),e=!0){if(this._isPaused)return!0;let n,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 o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];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 a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const o=e[r]||0;let a=n[r];const h=Array.isArray(t[r]),c=Array.isArray(a);!h&&c?t[r]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(t[r],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*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],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const Jg=Gn.nextId,Zg=Gt.getAll.bind(Gt),Kg=Gt.removeAll.bind(Gt),Qg=Gt.add.bind(Gt),t0=Gt.remove.bind(Gt),e0=Gt.update.bind(Gt),n0={now:lt,Sequence:Gn,Easing:O,Interpolation:pe,Group:Oc,Tween:Gr,nextId:Jg,getAll:Zg,removeAll:Kg,add:Qg,remove:t0,update:e0};class Vr{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=lt(),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=lt();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class jn{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){cd(this.tweens,(e,n)=>t?e.delay>n.delay:e.delay<=n.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(n=>{const i={...n};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,n){const i={fromValues:t,toValues:e,frames:typeof n?.frames=="number"?n.frames:1,delay:typeof n?.delay=="number"?n.delay:this.tweens.length,easeFunction:n?.easeFunction||O.Linear.None,interpolationFunction:n?.interpolationFunction||pe.Linear,repeat:typeof n?.repeat=="number"?n.repeat:0,yoyo:n?.yoyo||!1,onStart:n?.onStart||(()=>{}),onUpdate:n?.onUpdate||(()=>{}),onComplete:n?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Vr,n=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=zr(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*n<=h).forEach(c=>{c.tween||(c.tween=new Gr({...c.fromValues}).to({...c.toValues},c.frames*n).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(a)),(c.delay+c.frames*(c.repeat+1))*n>h?c.tween.update(a):(c.tween.isPlaying()&&c.tween.end(),Fa(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Vr;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(n=>{e=Math.max(e,n.delay+n.frames),n.easeFunction=Ac(n.easeFunction);const i={...n.toValues};n.toValues={...n.fromValues},n.fromValues={...i}}),t.forEach(n=>{n.delay=e-n.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const qn=new Gf({objectSignature:s=>s.name});function jr(s,t=qn){let e=t?.find(n=>n.el==s);return e||(e=di(s),t.put(e),e)}function Zs(s,t,e=qn){const n=jr(s,e);n.alternate||(n.alternate=di(s),cn(n.alternate.props,n.props,!0)),t(n.alternate)}function zc(s=qn){s.update(t=>{const e=t.alternate;return e&&(mi(t,e),t.props=e.props,t.alternate=void 0),!0})}function s0(s=qn){zc(s)}function qr(s=qn){Mc(()=>zc(s),{name:"PATCH_VNODES",timeout:50})}function i0(s,t,e,n,i){const r=t/e;let o=0,a=0;switch(s){case"aspectFit":r>=1?(o=n,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>n&&(o=n,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=n,a=o/r);break;case"widthFix":o=n,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=n,a=i;break}return{width:o,height:a}}function Nc(s){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(s.width,s.height)}}const r0=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],o=[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,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,h=s.data;let c="";const l=t<<2;let u=e;const m=String.fromCharCode;do{const p=l*(u-1);let g="";for(let C=0;C<t;C++){const y=C<<2;g+=m(h[p+y+2])+m(h[p+y+1])+m(h[p+y])}for(let C=0;C<a;C++)g+=String.fromCharCode(0);c+=g}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let g="";if(typeof p=="string")g=p;else for(let C=0;C<p.length;C++)g+=String.fromCharCode(p[C]);return btoa(g)}return f(r.concat(o))+f(c)};function o0(s){const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")}const a0=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=i,o.putImageData(s,0,0,0,0,n,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},a,1)};function h0(s,t){return createImageBitmap(s,t)}function c0(s){const t=[],e=[],n=[];let i=0;for(let h=0,c=s.data.length;h<c;h+=4)t[i]=s.data[h],e[i]=s.data[h+1],n[i]=s.data[h+2],i+=1;const r=Hr(t),o=Hr(e),a=Hr(n);return"rgb("+r+","+o+","+a+")"}function Hr(s){const t={},e=[],n=[];for(let a=0;a<s.length;a++)t[s[a]]?e.push(s[a]):t[s[a]]=1;let i=0;for(let a=0;a<e.length;a++){i=0;for(let h=0;h<e.length;h++)e[a]===e[h]&&(i+=1),n[a]=i}const r=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===r)return;return e[o]}const l0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,e,n)},u0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[((n-o-1)*e+a)*4],i[h+1]=t[((n-o-1)*e+a)*4+1],i[h+2]=t[((n-o-1)*e+a)*4+2],i[h+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,e,n)},f0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*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,n,e)},d0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;i[h]=t[((n-a-1)*e+o)*4],i[h+1]=t[((n-a-1)*e+o)*4+1],i[h+2]=t[((n-a-1)*e+o)*4+2],i[h+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,n,e)},m0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},p0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},g0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},y0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},w0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,n)},b0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},x0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},v0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},S0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},_0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},C0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},E0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},P0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},T0=s=>Bc(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),M0=s=>Bc(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),A0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},I0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Fc([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,n)};function D0(s,t,e,n,i,r=!1,o){const{data:a,width:h,height:c}=s;let l=i,u=n,m=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),m<1?m=1:m>h&&(m=h),f<1?f=1:f>c&&(f=c),l+m>h&&(m=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(a.length);for(let C=0;C<c;C++)for(let y=0;y<h;y++){const v=(C*h+y)*4;y>=l&&y<=l+m&&C>=u&&C<=u+f?(p[v]=a[v],p[v+1]=a[v+1],p[v+2]=a[v+2],p[v+3]=a[v+3]):(p[v]=255,p[v+1]=255,p[v+2]=255,p[v+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(m*f*4);for(let C=u;C<=u+f;C++)for(let y=l;y<=l+m;y++){const v=((C-u)*m+y-l)*4,b=(C*h+y)*4;p[v]=a[b],p[v+1]=a[b+1],p[v+2]=a[b+2],p[v+3]=a[b+3]}return new ImageData(p,m,f)}}function k0(s,t,e,n){const{data:i,width:r,height:o}=s;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const h=new Uint8ClampedArray(i.length);for(let l=0;l<o;l++)for(let u=0;u<r;u++){const m=(l*r+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>r-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(h[m]=255,h[m+1]=255,h[m+2]=255,h[m+3]=n||e.toUpperCase()==="PNG"?0:255):(h[m]=i[m],h[m+1]=i[m+1],h[m+2]=i[m+2],h[m+3]=n||e.toUpperCase()==="PNG"?i[m+3]:255)}return new ImageData(h,r,o)}function L0(s,t,e,n,i,r=1e4){const o=new Image;o.src=s;const a=document.createElement("canvas"),h=a.getContext("2d");return a.width=r,a.height=r,h.drawImage(o,0,0,t,e,0,0,n,i),h.getImageData(0,0,n,i)}function R0(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+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,n,i)}function O0(s,t,e=!1){const{data:n,width:i,height:r}=s,o=new Uint8ClampedArray(n.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;n[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=n[l],o[l+1]=n[l+1],o[l+2]=n[l+2]);let u=n[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),o[l+3]=u}return new ImageData(o,i,r)}function z0(s,t,e,n){const{data:i,width:r,height:o}=s,{data:a,width:h,height:c}=t;let l=e,u=n;e+c>o&&(l=o-c),n+h>r&&(u=r-h);const m=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let g=0;g<r;g++){const C=(p*r+g)*4;if(g<u||g>u+h||p<=l||p>=l+c)m[C]=i[C],m[C+1]=i[C+1],m[C+2]=i[C+2],m[C+3]=i[C+3];else{const y=(p*r+g-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,v=[a[y],a[y+1],a[y+2],a[y+3]],b=[i[C],i[C+1],i[C+2],i[C+3]],x=Fc(v,b);m[C]=x[0],m[C+1]=x[1],m[C+2]=x[2],m[C+3]=x[3]}}return new ImageData(m,r,o)}function N0(s,t,e,n,i,r=10){const{data:o,width:a,height:h}=s;let c=i,l=n,u=t,m=e;c<0?c=0:c>a&&(c=a),l<0?l=0:l>h&&(l=h),u<1?u=1:u>a&&(u=a),m<1?m=1:m>h&&(m=h),c+u>a&&(u=a-c),l+m>h&&(m=h-l);const f=new Uint8ClampedArray(o.length);for(let g=0;g<h;g++)for(let C=0;C<a;C++){const y=(g*a+C)*4;if(C>=c&&C<=c+u&&g>=l&&g<=l+m){const v=Math.floor((C-c)/r),b=Math.floor((g-l)/r);let x=Math.floor(r*(v+1)-r/2+c),E=Math.floor(r*(b+1)-r/2+l);x>a-1&&(x=a-1),E>h-1&&(E=h-1);const _=(E*a+x)*4;f[y]=o[_],f[y+1]=o[_+1],f[y+2]=o[_+2],f[y+3]=o[_+3]}else f[y]=o[y],f[y+1]=o[y+1],f[y+2]=o[y+2],f[y+3]=o[y+3]}return new ImageData(f,a,h)}function B0(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:n,width:i,height:r}=s,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:h,changeIntoColor:c}=e;for(let u=0;u<r;u++)for(let m=0;m<i;m++){const f=(u*i+m)*4,p=o[f],g=o[f+1],C=o[f+2],y=o[f+3];p===h.r&&g===h.g&&C===h.b&&y===h.a&&c.a!==0?(a[f]=c.r,a[f+1]=c.g,a[f+2]=c.b,a[f+3]=c.a):(a[f]=n[f],a[f+1]=n[f+1],a[f+2]=n[f+2],a[f+3]=n[f+3])}return new ImageData(a,i,r)}return s}function Bc(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+h)*4;for(let l=0;l<3;l++){const u=c+l;h===0||h===n-1||a===0||a===i-1?r[u]=e[u]:r[u]=t[0]*e[u-n*4-4]+t[1]*e[u-n*4]+t[2]*e[u-n*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+n*4-4]+t[7]*e[u+n*4]+t[8]*e[u+n*4+4]}r[c+3]=e[c+3]}return new ImageData(r,n,i)}function Fc(s,t){if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,o=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,h,c]}}return[255,255,255,255]}const Wr=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},Yc=function(){let s=0,t=0,e=0,n="";const i=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){n+=String.fromCharCode(i(o&63))};return{writeByte(o){for(s=s<<8|o&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}},Xc=function(s,t,e){const n=new Array(s*s),i=function(a){const h=a;let c=0,l=0;return{write(u,m){if(u>>>m)throw new Error("length over");for(;c+m>=8;)h.writeByte(255&(u<<c|l)),m-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+m},flush(){c>0&&h.writeByte(l)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let l=a+1;const u=o();for(let C=0;C<h;C++)u.add(String.fromCharCode(C));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const m=Wr(),f=i(m);f.write(h,l);let p=0,g=String.fromCharCode(n[p]);for(p+=1;p<n.length;){const C=String.fromCharCode(n[p]);p+=1,u.contains(g+C)?g=g+C:(f.write(u.indexOf(g),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(g+C)),g=C)}return f.write(u.indexOf(g),l),f.write(c,l),f.flush(),m.toByteArray()},o=function(){const a={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);a[c]=h,h+=1},size(){return h},indexOf(c){return a[c]},contains(c){return typeof a[c]<"u"}}};return{setPixel(a,h,c){n[h*s+a]=c},write(a){a.writeString("GIF87a"),a.writeShort(s),a.writeShort(s),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(ln("0x"+t[1]+t[2])),a.writeByte(ln("0x"+t[3]+t[4])),a.writeByte(ln("0x"+t[5]+t[6])),a.writeByte(ln("0x"+e[1]+e[2])),a.writeByte(ln("0x"+e[3]+e[4])),a.writeByte(ln("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(s),a.writeShort(s),a.writeByte(0);const h=2,c=r(h);a.writeByte(h);let l=0;for(;c.length-l>255;)a.writeByte(255),a.writeBytes(c,l,255),l+=255;a.writeByte(c.length-l),a.writeBytes(c,l,c.length-l),a.writeByte(0),a.writeString(";")}}},Uc=function(s,t,e,n){const i=Xc(s,t,e);for(let c=0;c<s;c++)for(let l=0;l<s;l++)i.setPixel(l,c,n(l,c));const r=Wr();i.write(r);const o=Yc(),a=r.toByteArray();for(let c=0,l=a.length;c<l;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},zt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Hn={M:0,L:1,H:2,Q:3},De={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},pt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return pt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return pt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)pt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)pt.EXP_TABLE[s]=pt.EXP_TABLE[s-4]^pt.EXP_TABLE[s-5]^pt.EXP_TABLE[s-6]^pt.EXP_TABLE[s-8];for(let s=0;s<255;s++)pt.LOG_TABLE[pt.EXP_TABLE[s]]=s;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(s){let t=s<<10;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(s<<10|t)^K.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return K.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case De.PATTERN000:return(t+e)%2==0;case De.PATTERN001:return t%2==0;case De.PATTERN010:return e%3==0;case De.PATTERN011:return(t+e)%3==0;case De.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case De.PATTERN101:return t*e%2+t*e%3==0;case De.PATTERN110:return(t*e%2+t*e%3)%2==0;case De.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new gn([1],0);for(let e=0;e<s;e++)t=t.multiply(new gn([1,pt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case zt.MODE_NUMBER:return 10;case zt.MODE_ALPHA_NUM:return 9;case zt.MODE_8BIT_BYTE:return 8;case zt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case zt.MODE_NUMBER:return 12;case zt.MODE_ALPHA_NUM:return 11;case zt.MODE_8BIT_BYTE:return 16;case zt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case zt.MODE_NUMBER:return 14;case zt.MODE_ALPHA_NUM:return 13;case zt.MODE_8BIT_BYTE:return 16;case zt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const h=s.isDark(r,o);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)o+l<0||t<=o+l||c==0&&l==0||h==s.isDark(r+c,o+l)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;s.isDark(r,o)&&a++,s.isDark(r+1,o)&&a++,s.isDark(r,o+1)&&a++,s.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(r,o)&&!s.isDark(r,o+1)&&s.isDark(r,o+2)&&s.isDark(r,o+3)&&s.isDark(r,o+4)&&!s.isDark(r,o+5)&&s.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(o,r)&&!s.isDark(o+1,r)&&s.isDark(o+2,r)&&s.isDark(o+3,r)&&s.isDark(o+4,r)&&!s.isDark(o+5,r)&&s.isDark(o+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)s.isDark(o,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class gn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=pt.gexp(pt.glog(this.get(n))+pt.glog(t.get(i)));return new gn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=pt.glog(this.get(0))-pt.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=pt.gexp(pt.glog(t.get(i))+e);return new gn(n,0).mod(t)}}class ge{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 n=ge.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let o=0;o<i;o++){const a=n[o*3+0],h=n[o*3+1],c=n[o*3+2];for(let l=0;l<a;l++)r.push(new ge(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Hn.L:return ge.RS_BLOCK_TABLE[(t-1)*4+0];case Hn.M:return ge.RS_BLOCK_TABLE[(t-1)*4+1];case Hn.Q:return ge.RS_BLOCK_TABLE[(t-1)*4+2];case Hn.H:return ge.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class $c{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 n=0;n<e;n++)this.putBit((t>>>e-n-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 F0{mode;data;constructor(t){this.mode=zt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class ke{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Hn[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new F0(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=ge.getRSBlocks(t,this.errorCorrectLevel),n=new $c;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 o=this.dataList[r];n.put(o.mode,4),n.put(o.getLength(),K.getLengthInBits(o.mode,t)),o.write(n)}if(n.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 n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][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=ke.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=K.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let h=0;h<this.modules[o].length;h++){const c=h*r;this.modules[o][h]&&(i.beginFill(0,100),i.moveTo(c,a),i.lineTo(c+r,a),i.lineTo(c+r,a+r),i.lineTo(c,a+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 n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[i+o][r+a]=!0:this.modules[i+o][r+a]=!1}}setupTypeNumber(t){const e=K.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=K.getBCHTypeInfo(n);for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let h=0;h<2;h++)if(this.modules[i][a-h]==null){let c=!1;o<t.length&&(c=(t[o]>>>r&1)==1),K.getMask(e,i,a-h)&&(c=!c),this.modules[i][a-h]=c,r--,r==-1&&(o++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=ge.getRSBlocks(t,e),r=new $c;for(let a=0;a<n.length;a++){const h=n[a];r.put(h.mode,4),r.put(h.getLength(),K.getLengthInBits(h.mode,t)),h.write(r)}let o=0;for(let a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(ke.PAD0,8),r.getLengthInBits()>=o*8));)r.put(ke.PAD1,8);return ke.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let u=0;u<e.length;u++){const m=e[u].dataCount,f=e[u].totalCount-m;i=Math.max(i,m),r=Math.max(r,f),o[u]=new Array(m);for(let y=0;y<o[u].length;y++)o[u][y]=255&t.buffer[y+n];n+=m;const p=K.getErrorCorrectPolynomial(f),C=new gn(o[u],p.getLength()-1).mod(p);a[u]=new Array(p.getLength()-1);for(let y=0;y<a[u].length;y++){const v=y+C.getLength()-a[u].length;a[u][y]=v>=0?C.get(v):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 m=0;m<e.length;m++)u<o[m].length&&(c[l++]=o[m][u]);for(let u=0;u<r;u++)for(let m=0;m<e.length;m++)u<a[m].length&&(c[l++]=a[m][u]);return c}}const Gc=Math.ceil,Wn=Math.floor,Vc=Math.round;function Y0(s,t){const e=ka(s),n=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",c=new ke(r,n);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-o*2)/l,m=o,f=i-o;return Uc(i,a,h,function(p,g){if(m<=p&&p<f&&m<=g&&g<f){const C=Wn((p-m)/u),y=Wn((g-m)/u);return c.isDark(y,C)?0:1}else return 1})}function X0(s,t){const e=t.x||0,n=t.y||0,i=ka(s),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Wn(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",m=new ke(c,o);m.addData(i),m.make();const f=m.getModuleCount(),p=(a-h*2)/f;r.fillStyle=u,r.fillRect(e,n,a,a);for(let g=0;g<f;g++)for(let C=0;C<f;C++){const y=Gc((C+1)*p)-Wn(C*p),v=Gc((g+1)*p)-Wn(g*p);r.fillStyle=m.isDark(g,C)?l:u,r.fillRect(e+Vc(C*p)+h,n+Vc(g*p)+h,y,v)}}function j(s){return s*Math.PI/180}function gt(s){return s*180/Math.PI}function yn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Le(s,t,e,n){return yn(e-s,n-t)}function Nt(s,t,e,n){let i=Math.atan2(n-t,e-s);return i<0&&(i+=Math.PI*2),i}function Re(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function U0(s,t,e){if(typeof e=="number"){const n=yn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=yn(s,t);return{x:s/=n,y:t/=n}}}function $0(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=gt(Nt(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}class Jr{_x;_y;_z;_w;constructor(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,a){let h=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3];const m=r[o+0],f=r[o+1],p=r[o+2],g=r[o+3];if(a===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(a===1){t[e+0]=m,t[e+1]=f,t[e+2]=p,t[e+3]=g;return}if(u!==g||h!==m||c!==f||l!==p){let C=1-a;const y=h*m+c*f+l*p+u*g,v=y>=0?1:-1,b=1-y*y;if(b>Number.EPSILON){const E=Math.sqrt(b),_=Math.atan2(E,y*v);C=Math.sin(C*_)/E,a=Math.sin(a*_)/E}const x=a*v;if(h=h*C+m*x,c=c*C+f*x,l=l*C+p*x,u=u*C+g*x,C===1-a){const E=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=E,c*=E,l*=E,u*=E}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],h=n[i+1],c=n[i+2],l=n[i+3],u=r[o],m=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+l*u+h*f-c*m,t[e+1]=h*p+l*m+c*u-a*f,t[e+2]=c*p+l*f+a*m-h*u,t[e+3]=l*p-a*u-h*m-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,n=this._z,i=this._w){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new Jr(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 n=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,h=Math.sin,c=a(n/2),l=a(i/2),u=a(r/2),m=h(n/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"YXZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"ZXY":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"ZYX":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"YZX":this._x=m*l*u+c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u-m*f*p;break;case"XZY":this._x=m*l*u-c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u+m*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,n=e[0],i=e[4],r=e[8],o=e[1],a=e[5],h=e[9],c=e[2],l=e[6],u=e[10],m=n+a+u;if(m>0){const f=.5/Math.sqrt(m+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(n>a&&n>u){const f=2*Math.sqrt(1+n-a-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>u){const f=2*Math.sqrt(1+a-n-u);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-n-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+l)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(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=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(B(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);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 n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,h=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+i*c-r*h,this._y=i*l+o*h+r*a-n*c,this._z=r*l+o*c+n*h-i*a,this._w=o*l-n*a-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const h=1-a*a;if(h<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+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,a),u=Math.sin((1-e)*l)/c,m=Math.sin(e*l)/c;return this._w=o*u+this._w*m,this._x=n*u+this._x*m,this._y=i*u+this._y*m,this._z=r*u+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);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 Jn{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 Jn(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,n=this.y;return this.x=t.m11*e+t.m21*n+t.m31,this.y=t.m12*e+t.m22*n+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=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,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 n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return jc.copy(this).projectOnVector(t),this.sub(jc)}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 n=this.dot(t)/e;return Math.acos(B(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,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 n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Bt{x=0;y=0;z=0;constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t=0,e=0,n=0){return this.x=t,this.y=e,this.z=n,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 Bt(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(qc.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(qc.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,h=t.w,c=2*(o*i-a*n),l=2*(a*e-r*i),u=2*(r*n-o*e);return this.x=e+h*c+o*u-a*l,this.y=n+h*l+a*c-r*u,this.z=i+h*u+r*l-o*c,this}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+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=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this.z=B(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this.z=B(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,h=e.z;return this.x=i*h-r*a,this.y=r*o-n*h,this.z=n*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Kr.copy(this).projectOnVector(t),this.sub(Kr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Kr.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 n=this.dot(t)/e;return Math.acos(B(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+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(),n=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=n,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,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Zr{x=0;y=0;z=0;w=1;constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,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,n=0,i=1){return this.x=t,this.y=e,this.z=n,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 Zr(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,n=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[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,n,i,r;const h=t.value,c=h[0],l=h[4],u=h[8],m=h[1],f=h[5],p=h[9],g=h[2],C=h[6],y=h[10];if(Math.abs(l-m)<.01&&Math.abs(u-g)<.01&&Math.abs(p-C)<.01){if(Math.abs(l+m)<.1&&Math.abs(u+g)<.1&&Math.abs(p+C)<.1&&Math.abs(c+f+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,x=(f+1)/2,E=(y+1)/2,_=(l+m)/4,L=(u+g)/4,N=(p+C)/4;return b>x&&b>E?b<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(b),i=_/n,r=L/n):x>E?x<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(x),n=_/i,r=N/i):E<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(E),n=L/r,i=N/r),this.set(n,i,r,e),this}let v=Math.sqrt((C-p)*(C-p)+(u-g)*(u-g)+(m-l)*(m-l));return Math.abs(v)<.001&&(v=1),this.x=(C-p)/v,this.y=(u-g)/v,this.z=(m-l)/v,this.w=Math.acos((c+f+y-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=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this.z=B(this.z,t.z,e.z),this.w=B(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this.z=B(this.z,t,e),this.w=B(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,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 n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,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 jc=new Jn,Kr=new Bt,qc=new Jr,Hc=G0("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 G0(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Pt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Ks(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function V0(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function j0(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Zn={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 Qs=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.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&&(n.setAttribute("stop-color",Pt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}},Qr=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Wc=class Ea{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=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=n),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(Zn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Zn[i].canvas}}__getStyleState(){const t={},e=Object.keys(Zn);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Zn);for(let r=0;r<i.length;r++){const o=Zn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Qr){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Qs)e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Pt("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(o.svgAttr+"-opacity",""+l)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__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(Hc);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Hc[a],c=new RegExp(a,"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 n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Pt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Pt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Pt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Pt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(Pt("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(Pt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Pt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Pt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,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,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-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)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],g=e+f*m[1],C=[-h[1],h[0]],y=[c[1],-c[0]],v=function(E){const _=E[0];return E[1]>=0?Math.acos(_):-Math.acos(_)},b=v(C),x=v(y);this.lineTo(p+C[0]*r,g+C[1]*r),this.arc(p,g,r,b,x)}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,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:Ks(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Qs(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:Ks(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Qs(a,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),n={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"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=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:n,"text-anchor":V0(this.textAlign),"dominant-baseline":j0(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),l=e+n*Math.sin(i),u=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Ks(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Pt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,l,u,m,f,p,g,C;if(t.length===3)n=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+n+", "+i+")";if(e instanceof Ea){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)C=m.childNodes[0].getAttribute("id"),this.__ids[C]=C,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const b=f.getAttribute("transform");let x;b?x=b+" "+v:x=v,f.setAttribute("transform",x),y.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||l!==e.height)&&(g=this.__document.createElement("canvas"),g.width=r,g.height=o,g.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=g),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Ks(this.__ids);let r;return n.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")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Ea&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Qr(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},to=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Wc({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}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,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-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,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).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 n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,n,i,r,o,a,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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}},eo=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=Nt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-n)/(h-c),u=h*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const q0=class extends eo{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,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-n)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*m,g=f*f/(r*r)+p*p/(o*o);if(g>1){const V=Math.sqrt(g);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const C=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),y=h!=c?1:-1,v=y*C*r*p/o,b=y*C*-o*f/r,x=(t+n)/2,E=(e+i)/2,_=Math.cos(l)*v-Math.sin(l)*b+x,L=Math.sin(l)*v+Math.cos(l)*b+E,N=(V,J,rt,tt)=>(V*tt>=J*rt?1:-1)*Math.acos((V*rt+J*tt)/(Math.sqrt(V*V+J*J)*Math.sqrt(rt*rt+tt*tt))),Y=N(1,0,t-_,e-L)-l,G=N(t-_,e-L,n-_,i-L);return[_,L,r,o,l,Y,Y+G]}},H0=class extends eo{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,i,r,o;for(let c=0;c<2;++c)n=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(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][c].push(n*o*o+i*o+r));const a={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:a.x,y:a.y,width:h.x-a.x,height:h.y-a.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}}},Oe=class gs extends eo{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),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[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),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.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),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.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 g=p+1;g<u;g++)c[p].X===c[g].X&&c[p].Y===c[g].Y&&(g=++p);l.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.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,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,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],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const g=l*u[p]+l,C=this.base3(g,t,n,r,a),y=this.base3(g,e,i,o,h);f+=m[p]*Math.sqrt(C*C+y*y)}return l*f}length(t=1){return gs.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||gs.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=gs.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=gs.bezlen(e,n,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,g=n*this.y+e*this.c1y,C=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y:g},end:{x:C,y},alpha:v}}},Kn=Math.PI*2;function Jc(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function W0(s,t,e,n,i,r,o,a,h,c){const l=c*(s-e)/2+h*(t-n)/2,u=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=l*l,g=u*u;let C=m*f-m*g-f*p;C<0&&(C=0),C/=m*g+f*p,C=Math.sqrt(C)*(i===r?-1:1);const y=C*o/a*u,v=C*-a/o*l,b=c*y-h*v+(s+e)/2,x=h*y+c*v+(t+n)/2,E=(l-y)/o,_=(u-v)/a,L=(-l-y)/o,N=(-u-v)/a,Y=Jc(1,0,E,_);let G=Jc(E,_,L,N);return r===0&&G>0&&(G-=Kn),r===1&&G<0&&(G+=Kn),[b,x,Y,G]}function J0(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function Zc(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*Kn/360),l=Math.cos(h*Kn/360),u=l*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+l*(t-n)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=W0(s,t,e,n,i,r,o,a,c,l),g=[];let C=p[2],y=p[3];const v=Math.max(Math.ceil(Math.abs(y)/(Kn/4)),1);y/=v;for(let b=0;b<v;b++)g.push(J0(C,y)),C+=y;return g.map(b=>{for(let x=0;x<b.length;x+=2){let E=b[x+0],_=b[x+1];E*=o,_*=a;const L=l*E-c*_,N=c*E+l*_;b[x+0]=L+p[0],b[x+1]=N+p[1]}return b})}function no(s,t,e,n,i,r){return[s/3+2/3*e,t/3+2/3*n,i/3+2/3*e,r/3+2/3*n,i,r]}function Qn(s,t,e,n){return[s,t,e,n,e,n]}const ts={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class We{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&we(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Dn()})}static downloadFromSVGElement(t,e="shape"){return si(pr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return si(Fi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return mr(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 We.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let o=i.toLowerCase();const a=Ni(r);for(o=="m"&&a.length>ts[o]&&(e.push([i,...a.splice(0,ts[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<ts[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,ts[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toUpperCase();if(a!=h)switch(o[0]=h,a){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(let c=1;c<o.length;)o[c++]+=i,o[c++]+=r}switch(h){case"Z":i=e,r=n;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=n=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toLowerCase();if(a!=h)switch(o[0]=h,a){case"A":o[6]-=i,o[7]-=r;break;case"V":o[1]-=r;break;case"H":o[1]-=i;break;default:for(let c=1;c<o.length;)o[c++]-=i,o[c++]-=r}switch(h){case"z":i=e,r=n;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],n+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let n=0,i=0,r=0,o=0,a=0,h=0,c=0,l=0,u;for(let m=0,f=t.length;m<f;m++){let p=t[m];const g=p[0];switch(g){case"M":n=p[1],i=p[2];break;case"A":const C=Zc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!C.length)continue;C.forEach((b,x)=>{const[E,_,L,N,Y,G,V,J]=b;p=["C",L,N,Y,G,V,J],x<C.length-1&&e.push(p)});break;case"S":let y=r,v=o;(u=="C"||u=="S")&&(y+=y-c,v+=v-l),p=["C",y,v,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...no(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...no(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Qn(r,o,p[1],p[2])];break;case"H":p=["C",...Qn(r,o,p[1],o)];break;case"V":p=["C",...Qn(r,o,r,p[1])];break;case"Z":p=["C",...Qn(r,o,n,i)];break}u=g,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const o=[{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",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let n=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":n=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",a[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let o=0,a=t.length;o<a;o++){const h=t[o],c=e[h[0]];c&&(h[0]=c.to,n&&(n[0]===c.to?(i=2*Number(n[c.x+2])-Number(n[c.x]),r=2*Number(n[c.x+3])-Number(n[c.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),h.splice(1,0,i,r)),n=h}return t}}let Z0=class Ce{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(We.parseSVGPath(t),e):t instanceof Ce?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=We.normalizeSVGPath(We.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];if(a[0]=="M"){i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new Oe({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[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 Ce;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e.appendLine(new Oe({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new Ce;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e.appendLine(t[n]);return e}appendLine(t){if(t instanceof q0){Zc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,g,C,y]=c;this.normalizedLines.push(new Oe({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:g,toX:C,toY:y})),this.prevPathX=C,this.prevPathY=y});return}let e,n,i,r,o,a;t instanceof Oe?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof H0?[e,n,i,r,o,a]=no(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Qn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new Oe({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=n.length;r<o;r++)i.push(...n[r].toSVGPathData());return i}toSVGPathD(){return We.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,n),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],n=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,n),o=Math.max.apply(0,e),a=Math.max.apply(0,n);return{x:i,y:r,width:o-i,height:a-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 bt;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,n=this.startPathY;({x:e,y:n}=t.transformPoint({x:e,y:n}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,h=r.c1x,c=r.c1y,l=r.c2x,u=r.c2y,m=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:m,y:f}=t.transformPoint({x:m,y:f}),i.push(new Oe({x:o,y:a,c1x:h,c1y:c,c2x:l,c2y:u,toX:m,toY:f}))}),{startPathX:e,startPathY:n,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,n)=>e+=n.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let n=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(n+a>=t)return o.getPointAtSegmentLength(t-n);n+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:n};if(r===1)return i[0].interpolate(t);{let o=t*r,a=i[0];if(o--,o>1)for(let h=1;h<r&&(a=i[h],o>1);h++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}getSubpathsAtLength(t,e,n){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,h=0;const c=new Ce;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=o.length;l<u;l++){const m=o[l],f=m.length();if(h+f>e&&!a){const p=m.getPointAtSegmentLength(e-h);if(c.appendLine(new Oe({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),n)return c;a=c,c.appendLine(new Oe({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:m.x,toY:m.y})),h+=f;continue}h+=f,c.appendLine(m)}return c}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const l=this.getPointAtLength(c),u=Math.pow(Le(l.x,l.y,t,e),2);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=Math.pow(Le(l.x,l.y,t,e),2),m=r+a,f=this.getPointAtLength(m),p=Math.pow(Le(f.x,f.y,t,e),2);c>=0&&u<o?(i=l,r=c,o=u):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Nt(h.x,h.y,i.x,i.y):Nt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform();return[t,e].concat(n.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 n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Le(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const h=e[a++],c=e[a++],l=e[a++],u=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,l,u,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return o}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=F(t[o]+(e[o]-t[o])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t:Math.abs(n-1)<Number.EPSILON?e:Ce.fromPolymorphPoints(Ce.mixPoints(new Ce({d:t}).polymorphPoints,new Ce({d:e}).polymorphPoints,n)).toSVGPathData()}},K0=class extends Ts{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=Dn(),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 n=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",n),this.strokeDashTotalLength=Ni(n).reduce((i,r)=>i+r,0)}return Ki(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Z0,Ee(()=>{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(n=>{const i=n.originMatrix?n.originMatrix.clone():new bt;i.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new bt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof to)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.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,n){if(n instanceof to)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Na(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([n,i])=>[dt(n),i]))):e&&(this.attrs[dt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[dt(t)]}distance(t){return Le(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=gt(Nt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:i}=Re(j(this.degree),e);this.vx=n,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:i}=Re(j(this.degree),e);this.ax=n,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=Wt(t?.gravity,0);this.vy+=e;const n=Wt(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=Wt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*n,this.vy=r*n,this.run(e)}runSpringTo(t,e){const n=Wt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,o=i.y-this.cY-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const n=Wt(e?.springLength,100),i=Wt(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}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 n=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*n),this.getPointAtLength(e*n)}strokeDashTween(t=1e3,e){const n=this.initPathD(),i=F(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new jn({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+F(a.offset,2)),r?.(a,h)}})),o.play()}};class Q0 extends K0{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,n){this.cX=t,this.cY=e,this.cZ=n}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 yn(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,n=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+n*n+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 n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y,i=this.z;return{x:n*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-n*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 ti=Q0,es=2e3,so=2001,Kc=[1,0,0,1],Qc=[1,0,0,1,0,0],tl=[1,0,0,0,1,0,0,0,1],el=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class io{value;constructor(t=Kc){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,n=0,i=1){return this.m11=t,this.m21=e,this.m12=n,this.m22=i,this}identity(){return this.value=Array.from(Kc),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 io(this.value)}fromArray(t,e=0){for(let n=0;n<4;n++)this.value[n]=t[n+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 n=t.value,i=e.value,r=this.value,o=n[0],a=n[2],h=n[1],c=n[3],l=i[0],u=i[2],m=i[1],f=i[3];return r[0]=o*l+a*m,r[2]=o*u+a*f,r[1]=h*l+c*m,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 wn{value;constructor(t=tl){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,n=0,i=0,r=1,o=0,a=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=h,l[6]=n,l[7]=o,l[8]=c,this}identity(){return this.value=Array.from(tl),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 wn(this.value)}fromArray(t,e=0){for(let n=0;n<9;n++)this.value[n]=t[n+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,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.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 n=t.value,i=e.value,r=this.value,o=n[0],a=n[3],h=n[6],c=n[1],l=n[4],u=n[7],m=n[2],f=n[5],p=n[8],g=i[0],C=i[3],y=i[6],v=i[1],b=i[4],x=i[7],E=i[2],_=i[5],L=i[8];return r[0]=o*g+a*v+h*E,r[3]=o*C+a*b+h*_,r[6]=o*y+a*x+h*L,r[1]=c*g+l*v+u*E,r[4]=c*C+l*b+u*_,r[7]=c*y+l*x+u*L,r[2]=m*g+f*v+p*E,r[5]=m*C+f*b+p*_,r[8]=m*y+f*x+p*L,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],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*r*l+n*a*h+i*r*c-i*o*h}inverse(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=l*o-a*c,m=a*h-l*r,f=c*r-o*h,p=e*u+n*m+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return t[0]=u*g,t[1]=(i*c-l*n)*g,t[2]=(a*n-i*o)*g,t[3]=m*g,t[4]=(l*e-i*h)*g,t[5]=(i*r-a*e)*g,t[6]=f*g,t[7]=(n*h-c*e)*g,t[8]=(o*e-n*r)*g,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).inverse().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,n,i,r,o,a){const h=Math.cos(r),c=Math.sin(r);return this.set(n*h,n*c,-n*(h*o+c*a)+o+t,-i*c,i*h,-i*(-c*o+h*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ro.makeScale(t,e)),this}rotate(t){return this.premultiply(ro.makeRotation(-t)),this}translate(t,e){return this.premultiply(ro.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),n=Math.sin(t);return this.set(e,-n,0,n,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 kt{value;is3dSpecial=!1;constructor(t=el){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,n=0,i=0,r=0,o=1,a=0,h=0,c=0,l=0,u=1,m=0,f=0,p=0,g=0,C=1){const y=this.value;return y[0]=t,y[4]=e,y[8]=n,y[12]=i,y[1]=r,y[5]=o,y[9]=a,y[13]=h,y[2]=c,y[6]=l,y[10]=u,y[14]=m,y[3]=f,y[7]=p,y[11]=g,y[15]=C,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(el),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 kt(this.value)}static fromString(t){const e=new kt,n=Aa("number",t);return n.length===16&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let n=0;n<16;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.value;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}copyPosition(t){const e=this.value,n=t.value;return e[12]=n[12],e[13]=n[13],e[14]=n[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,n){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),n.setFromMatrix4Column(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,n=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+n*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+n*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+n*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+n*this.m44}}toMatrix(t){const{scalarX:e,scalarY:n,skewX:i,skewY:r,x:o,y:a}=this.split(),h=[e,r,i,n,o,a];return t?(t.value=h,t):new bt(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=>F(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),n=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=gt(B(Math.asin(-this.m13),-1,1));let r=gt(Math.atan2(this.m23,this.m33));Math.cos(j(i))===0&&(r=gt(Math.atan2(-this.m31,this.m22)));let o=gt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:n,degreeX:r,degreeY:i,degreeZ:o,skewX:gt(this.m14),skewY:gt(this.m24),skewZ:gt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,i=1/bn.setFromMatrix4Column(t,0).length(),r=1/bn.setFromMatrix4Column(t,1).length(),o=1/bn.setFromMatrix4Column(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),h=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const m=o*l,f=o*u,p=a*l,g=a*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=f+p*c,e[5]=m-g*c,e[9]=-a*h,e[2]=g-m*c,e[6]=p+f*c,e[10]=o*h}else if(t.order==="YXZ"){const m=h*l,f=h*u,p=c*l,g=c*u;e[0]=m+g*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=f*a-p,e[6]=g+m*a,e[10]=o*h}else if(t.order==="ZXY"){const m=h*l,f=h*u,p=c*l,g=c*u;e[0]=m-g*a,e[4]=-o*u,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*l,e[9]=g-m*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const m=o*l,f=o*u,p=a*l,g=a*u;e[0]=h*l,e[4]=p*c-f,e[8]=m*c+g,e[1]=h*u,e[5]=g*c+m,e[9]=f*c-p,e[2]=-c,e[6]=a*h,e[10]=o*h}else if(t.order==="YZX"){const m=o*h,f=o*c,p=a*h,g=a*c;e[0]=h*l,e[4]=g-m*u,e[8]=p*u+f,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=f*u+p,e[10]=m-g*u}else if(t.order==="XZY"){const m=o*h,f=o*c,p=a*h,g=a*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=m*u+g,e[5]=o*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=a*l,e[10]=g*u+m}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(ty,t,ey)}lookAt(t,e,n){const i=this.value;return Ft.subVectors(t,e),Ft.lengthSq()===0&&(Ft.z=1),Ft.normalize(),ze.crossVectors(n,Ft),ze.lengthSq()===0&&(Math.abs(n.z)===1?Ft.x+=1e-4:Ft.z+=1e-4,Ft.normalize(),ze.crossVectors(n,Ft)),ze.normalize(),ei.crossVectors(Ft,ze),i[0]=ze.x,i[4]=ei.x,i[8]=Ft.x,i[1]=ze.y,i[5]=ei.y,i[9]=Ft.y,i[2]=ze.z,i[6]=ei.z,i[10]=Ft.z,this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[4],h=n[8],c=n[12],l=n[1],u=n[5],m=n[9],f=n[13],p=n[2],g=n[6],C=n[10],y=n[14],v=n[3],b=n[7],x=n[11],E=n[15],_=i[0],L=i[4],N=i[8],Y=i[12],G=i[1],V=i[5],J=i[9],rt=i[13],tt=i[2],te=i[6],Xt=i[10],jt=i[14],ee=i[3],R=i[7],k=i[11],$=i[15];return r[0]=o*_+a*G+h*tt+c*ee,r[4]=o*L+a*V+h*te+c*R,r[8]=o*N+a*J+h*Xt+c*k,r[12]=o*Y+a*rt+h*jt+c*$,r[1]=l*_+u*G+m*tt+f*ee,r[5]=l*L+u*V+m*te+f*R,r[9]=l*N+u*J+m*Xt+f*k,r[13]=l*Y+u*rt+m*jt+f*$,r[2]=p*_+g*G+C*tt+y*ee,r[6]=p*L+g*V+C*te+y*R,r[10]=p*N+g*J+C*Xt+y*k,r[14]=p*Y+g*rt+C*jt+y*$,r[3]=v*_+b*G+x*tt+E*ee,r[7]=v*L+b*V+x*te+E*R,r[11]=v*N+b*J+x*Xt+E*k,r[15]=v*Y+b*rt+x*jt+E*$,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],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],h=t[9],c=t[13],l=t[2],u=t[6],m=t[10],f=t[14],p=t[3],g=t[7],C=t[11],y=t[15];return p*(+r*h*u-i*c*u-r*a*m+n*c*m+i*a*f-n*h*f)+g*(+e*h*f-e*c*m+r*o*m-i*o*f+i*c*l-r*h*l)+C*(+e*c*u-e*a*f-r*o*u+n*o*f+r*a*l-n*c*l)+y*(-i*a*l-e*h*u+e*a*m+i*o*u-n*o*m+n*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,n){const i=this.value;return t instanceof Bt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&(i[12]=t,i[13]=e,i[14]=n),this}inverse(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=t[9],m=t[10],f=t[11],p=t[12],g=t[13],C=t[14],y=t[15],v=u*C*c-g*m*c+g*h*f-a*C*f-u*h*y+a*m*y,b=p*m*c-l*C*c-p*h*f+o*C*f+l*h*y-o*m*y,x=l*g*c-p*u*c+p*a*f-o*g*f-l*a*y+o*u*y,E=p*u*h-l*g*h-p*a*m+o*g*m+l*a*C-o*u*C,_=e*v+n*b+i*x+r*E;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/_;return t[0]=v*L,t[1]=(g*m*r-u*C*r-g*i*f+n*C*f+u*i*y-n*m*y)*L,t[2]=(a*C*r-g*h*r+g*i*c-n*C*c-a*i*y+n*h*y)*L,t[3]=(u*h*r-a*m*r-u*i*c+n*m*c+a*i*f-n*h*f)*L,t[4]=b*L,t[5]=(l*C*r-p*m*r+p*i*f-e*C*f-l*i*y+e*m*y)*L,t[6]=(p*h*r-o*C*r-p*i*c+e*C*c+o*i*y-e*h*y)*L,t[7]=(o*m*r-l*h*r+l*i*c-e*m*c-o*i*f+e*h*f)*L,t[8]=x*L,t[9]=(p*u*r-l*g*r-p*n*f+e*g*f+l*n*y-e*u*y)*L,t[10]=(o*g*r-p*a*r+p*n*c-e*g*c-o*n*y+e*a*y)*L,t[11]=(l*a*r-o*u*r-l*n*c+e*u*c+o*n*f-e*a*f)*L,t[12]=E*L,t[13]=(l*g*i-p*u*i+p*n*m-e*g*m-l*n*C+e*u*C)*L,t[14]=(p*a*i-o*g*i-p*n*h+e*g*h+o*n*C-e*a*C)*L,t[15]=(o*u*i-l*a*i+l*n*h-e*u*h-o*n*m+e*a*m)*L,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=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,n,i))}makeTranslation(t,e,n){return t instanceof Bt?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,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,h=t.z,c=r*o,l=r*a;return this.set(c*o+n,c*a-i*h,c*h+i*a,0,c*a+i*h,l*a+n,l*h-i*o,0,c*h-i*a,l*h+i*o,r*h*h+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,n,i,r,o,a=es){const h=this.value,c=2*r/(e-t),l=2*r/(n-i),u=(e+t)/(e-t),m=(n+i)/(n-i);let f,p;if(a===es)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===so)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=m,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,n,i,r,o,a=es){const h=this.value,c=1/(e-t),l=1/(n-i),u=1/(o-r),m=(e+t)*c,f=(n+i)*l;let p,g;if(a===es)p=(o+r)*u,g=-2*u;else if(a===so)p=r*u,g=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-m,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=g,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,n){const i=this.value,r=e.x,o=e.y,a=e.z,h=e.w,c=r+r,l=o+o,u=a+a,m=r*c,f=r*l,p=r*u,g=o*l,C=o*u,y=a*u,v=h*c,b=h*l,x=h*u,E=n.x,_=n.y,L=n.z;return i[0]=(1-(g+y))*E,i[1]=(f+x)*E,i[2]=(p-b)*E,i[3]=0,i[4]=(f-x)*_,i[5]=(1-(m+y))*_,i[6]=(C+v)*_,i[7]=0,i[8]=(p+b)*L,i[9]=(C-v)*L,i[10]=(1-(m+g))*L,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.value;let r=bn.set(i[0],i[1],i[2]).length();const o=bn.set(i[4],i[5],i[6]).length(),a=bn.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],Kt.copy(this);const c=1/r,l=1/o,u=1/a;return Kt.value[0]*=c,Kt.value[1]*=c,Kt.value[2]*=c,Kt.value[4]*=l,Kt.value[5]*=l,Kt.value[6]*=l,Kt.value[8]*=u,Kt.value[9]*=u,Kt.value[10]*=u,e.setFromRotationMatrix4(Kt),n.x=r,n.y=o,n.z=a,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,n=0){return this.multiply(new kt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new kt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}scaleVector3(t){const e=this.value,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}rotateX(t){const e=j(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([1,0,0,0,0,n,i,0,0,-i,n,0,0,0,0,1]))}rotateY(t){const e=j(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([n,0,-i,0,0,1,0,0,i,0,n,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=j(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([n,i,0,0,-i,n,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,n=0){return this.multiply(new kt([1,0,0,j(t),0,1,0,j(e),0,0,1,j(n),0,0,0,1]))}perspective(t){return this.multiply(new kt([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,n=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,o=e+this.m31,a=n+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,n/=r,i/=r,c==0&&(c=1e-4),o/=c,a/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:n,z:i,mass:r};const u=-i/l;return e+=u*(o-e),n+=u*(a-n),{x:e,y:n,z:i,mass:r}}project(t){const e=t.z;let n=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),n/=r,i/=r,r<0&&(n-=this.m41,i-=this.m42,n*=1/r,i*=1/r,n+=this.m41,i+=this.m42),{x:n,y:i,z:e,mass:r}}bounds(t,e,n,i){const r=new ti({x:t,y:e}),o=new ti({x:t+n,y:e}),a=new ti({x:t+n,y:e+i}),h=new ti({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,o.x,a.x,h.x),l=Math.min(r.y,o.y,a.y,h.y),u=Math.max(r.x,o.x,a.x,h.x)-c,m=Math.max(r.y,o.y,a.y,h.y)-l;return{x:c,y:l,width:u,height:m}}}class bt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Qc){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 bt,n=Aa("number",t);return n.length===6&&n.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 kt(e)}identity(){return this.value=Array.from(Qc),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 bt(this.value)}multiply(t){const e=this.clone(),n=t instanceof bt?t:new bt(t);return this.m11=n.m11*e.m11+n.m12*e.m21+n.m13*e.m31,this.m12=n.m11*e.m12+n.m12*e.m22+n.m13*e.m32,this.m13=n.m11*e.m13+n.m12*e.m23+n.m13*e.m33,this.m21=n.m21*e.m11+n.m22*e.m21+n.m23*e.m31,this.m22=n.m21*e.m12+n.m22*e.m22+n.m23*e.m32,this.m23=n.m21*e.m13+n.m22*e.m23+n.m23*e.m33,this.m31=n.m31*e.m11+n.m32*e.m21+n.m33*e.m31,this.m32=n.m31*e.m12+n.m32*e.m22+n.m33*e.m32,this.m33=n.m31*e.m13+n.m32*e.m23+n.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,n=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,h=this.m32,c=this.m33,l=c*r-o*h,u=-c*i+o*a,m=h*i-r*a;let f=t*l+e*u+n*m;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+n*h)*f,this.m13=(o*e-n*r)*f,this.m21=u*f,this.m22=(c*t-n*a)*f,this.m23=(-o*t+n*i)*f,this.m31=m*f,this.m32=(-h*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new bt;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=gt(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:gt(Math.atan2(-this.m21,this.m22)),skewY:gt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],m=t.value[4],f=t.value[5],p=h*u,g=c*l,C=(l*n-e*u)/(g-p),y=(h*n-e*c)/(p-g),v=(l*r-i*u)/(g-p),b=(h*r-i*c)/(p-g),x=(l*(a-f)+u*(m-o))/(g-p),E=(h*(a-f)+c*(m-o))/(p-g),_=[C,y,v,b,x,E];return new bt(_)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>F(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,n){return this.matrix4.translate(t,e,n),this.matrix4.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,n-this.matrix4.m43),this}rotate(t,e=0,n=0){const i=j(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,n),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-n),this.toMatrix4(),this}rotateTo(t,e=0,n=0){const{degree:i}=this.split();return this.rotate(t-i,e,n),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,n){return this.matrix4.rotateX(t).rotateY(e).rotateZ(n),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,n){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,n-o),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix4(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,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,n=t){return this.matrix4.scale(t,e,n),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,n/o),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:n,skewY:i}=this.split();return this.skew(t-n,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,n){return this}skew3dTo(t,e,n){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const ty=new Bt(0,0,0),ey=new Bt(1,1,1),ze=new Bt,ei=new Bt,Ft=new Bt,bn=new Bt,ro=new wn,Kt=new kt;function nl(s){const t=new bt;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(n.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 kt(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(s,t,e){const n=new bt;return n.rotate(gt(s)),n.transformPoint({x:t,y:e})}function oo(s){const t=typeof s?.x=="number"?s?.x:0,e=typeof s?.y=="number"?s?.y:0,n=typeof s?.degree=="number"?s?.degree:0,i=typeof s?.scalarX=="number"?s?.scalarX:1,r=typeof s?.scalarY=="number"?s?.scalarY:1,o=j(n),a=Math.cos(o),h=Math.sin(o),c=new DOMMatrix([a*i,h*i,-h*r,a*r,t,e]);return c.multiplySelf(new DOMMatrix(s?.originMatrix||"")),c}function ny(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,oo(t)),n}const ni=new Jn,ct=new Bt;function ns(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Lt(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}class ye{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,n=!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=n,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=hf(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)ni.fromBufferAttribute(this,e),ni.applyMatrix3(t),this.setXY(e,ni.x,ni.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix3(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix4(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyNormalMatrix(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.transformDirection(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=ns(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Lt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ns(e,this.array)),e}setX(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ns(e,this.array)),e}setY(t,e){return this.normalized&&(e=Lt(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=ns(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Lt(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=ns(e,this.array)),e}setW(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array),i=Lt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array),i=Lt(i,this.array),r=Lt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return Na(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 sy extends ye{constructor(t,e,n=!1){super(new Int8Array(t),e,n)}}class iy extends ye{constructor(t,e,n=!1){super(new Uint8Array(t),e,n)}}class ry extends ye{constructor(t,e,n=!1){super(new Uint8ClampedArray(t),e,n)}}class oy extends ye{constructor(t,e,n=!1){super(new Int16Array(t),e,n)}}class ay extends ye{constructor(t,e,n=!1){super(new Uint16Array(t),e,n)}}class hy extends ye{constructor(t,e,n=!1){super(new Int32Array(t),e,n)}}class cy extends ye{constructor(t,e,n=!1){super(new Uint32Array(t),e,n)}}class ly extends ye{constructor(t,e,n=!1){super(new Float32Array(t),e,n)}}const sl={map:new Map,transform:function(s){if(Ff)return s;if(this.map.has(s))return this.map.get(s);const t=new OffscreenCanvas(s.width,s.height);return t.getContext("2d")?.drawImage(s,0,0),this.map.set(s,t),t},clear:function(){this.map.clear()}};function uy(s,t,e){const n=new OffscreenCanvas(s,t),i=n.getContext("2d");if(i)return e(i),n.transferToImageBitmap()}function fy(s,t,e){const n=s.createPattern(sl.transform(t),"no-repeat");if(n){const i=oo(e);n.setTransform(i),s.fillStyle=n}}const ao=["","-webkit-","-moz-","-o-","-ms-"];function ho(s,t){const e=t.x||0,n=t.y||0,i=t.z||0;rs(s,"transform",`translate(${e}px, ${n}px) translateZ(${i}px)`)}function dy(s,t){const e=t?.easingFn||O.Linear.None,n=t?.duration||0,i=t?.delay||0,r=$t(),o=r+n;let a=0,h=0;const c=t.deltaX,l=t.deltaY;function u(){const m=$t();if(m>=o){ho(s,{x:c-a,y:l-h});return}const f=(m-r)/n,p=e(f),g=c*p,C=l*p;ho(s,{x:g-a,y:C-h}),a=g,h=C,d.rAF(u)}setTimeout(()=>{u()},i)}const my=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"};function il(s){return window.URL.createObjectURL(s)}function py(s){return window.URL.revokeObjectURL(s)}function co(s){let t=!1;function e(){/loaded|complete/.test(document.readyState)&&!t&&(o(),s(),t=!0)}const n=W(document,"DOMContentLoaded",e),i=W(window,"load",e),r=setInterval(e,100),o=()=>{clearInterval(r),n?.(),i?.()};return o}function rl(s){return W(window,"beforeunload",t=>{s(t)})}async function gy(s,t=6e4){return new Promise((e,n)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=o=>{clearTimeout(r),e(o),i.onerror=i.onload=null},i.onerror=o=>{clearTimeout(r),n(o)},i.src=s;const r=setTimeout(()=>{n("Timeout!")},t);document.body.appendChild(i)})}function si(s,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click()}async function yy(s,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((n,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),n(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",s);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function wy(){return new Promise(s=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const n=()=>e>=t.length?(s(),!0):!1;n()||t.forEach(i=>{i.onload=()=>{e+=1,n()}})})}const ol=new Rn;async function al(s,t=6e4){return new Promise((e,n)=>{const i=typeof s=="string"?s:il(s),r=ol.get(i);if(r)return e(r);const o=setTimeout(()=>{n("Timeout!")},t),a=document.createElement("img");a.onload=()=>{clearTimeout(o),a.onerror=a.onload=null;const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:Nc(a)};ol.set(i,l),e(l)},a.onerror=h=>{clearTimeout(o),n(h)},a.src=i})}async function hl(s=Ut.text,t=["*"]){const n=(await gr(t))[0],i=await Fn(n,s);return{type:n.type,name:n.name,size:n.size,data:i}}async function by(s=["image/*"]){const e=(await gr(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await Fn(e,Ut.arraybuffer),i=Fi(n),r=await al(i);return{type:e.type,name:e.name,size:e.size,data:n,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function xy(){return window.getSelection()?.toString()||""}function vy(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function Sy(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function _y(s){if(navigator.clipboard)return await navigator.clipboard.writeText(s);{const t=document.createElement("textarea");return t.value=s,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function Cy(s=0,t=0){window.scrollTo(s,t)}function Ey(){let s=qa,t=qa;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=rl(()=>{window.history.scrollRestoration="auto"}),t=co(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function Py(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const Ty=s=>s===document.activeElement&&(s.type||s.href);function lo(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}function My(s){return s*lo()}function Ay(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):lo()}const Iy=s=>{let t=s;for(;t&&t.nodeType!==1;){const e=t.parentElement||s.parentNode;if(!e)break;t=e}return t},Dy=s=>s.parentElement,uo=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:uo(s.parentElement,t.concat([s]));function ky(s){const t=uo(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test(is(t[e],"overflow")+is(t[e],"overflow-y")+is(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const Ly=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),Ry=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),Oy=s=>s.nextElementSibling,zy=s=>s.previousElementSibling,Ny=(s,t)=>s.closest(t),By=s=>s.shadowRoot,ss=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,fo=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,Fy=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,mo=s=>ss(s)&&s.getAttribute("type")==="checkbox",po=s=>ss(s)&&s.getAttribute("type")==="radio",Yy=s=>ss(s)&&s.getAttribute("type")==="text",Xy=s=>ss(s)&&s.getAttribute("type")==="number";function Uy(s,t){if(fo(s)){const e=s.options;for(let n=0,i=e.length;n<i;n++)e[n].selected=e[n].value==t}}function $y(s,t){if(po(s)){const e=document.getElementsByName(s.name);for(let n=0,i=e.length;n<i;n++){const r=e[n];r.checked=r.value==t}}}function Gy(s,t){mo(s)&&(s.checked=t)}function xn(s,t,e="append"){typeof t=="string"?s[e](dl(t)):s[e](t)}function cl(s,t){if(typeof t=="string"){s.innerHTML=t;const e=pl(s);e!=s&&(s=e)}else xn(t,"replaceWith")}const ll=function(s){cl(s,"")},Vy=(s,t)=>{s.textContent=t},jy=s=>{if(s instanceof SVGElement)return"";let t=s.innerText;if(!t){const e=s.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!t&&n<=e.length-1;)"innerText"in e[n]&&(t=e[n].innerText),n++}return t},qy=s=>s.remove();function Hy(s,t){is(s,"display")=="none"&&t===void 0||t===!0?ul(s):fl(s)}function ul(s){vn(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function fl(s){vn(s,"display","none")}function go(s,t,e="toggle"){const n=t.split(/[,\s]+/);if(s.classList)n.forEach(i=>{const r=i.trim();r!==""&&s.classList[e](r)});else{const i=s.className.split(/ +/);let r=!1;n.forEach(o=>{const a=o.trim();if(a!==""){const h=i.indexOf(a);switch(e){case"add":h===-1&&(i.push(a),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(a):i.splice(h,1),r=!0;break}}}),r&&Je(s,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Wy(s,t){go(s,t,"add")}function Jy(s,t){go(s,t,"remove")}function Zy(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)}function dl(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const i=pl(n);i!=n&&e.content.replaceChild(i,n)}),e.content}function ml(s){return document.createElement.call(document,s)}function Ky(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Qy(s){return document.createTextNode.call(document,s)}function pl(s){return s.tagName=="SCRIPT"&&(s=gl(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(gl(t),t)}),s}function gl(s){const t=s.ownerDocument.createElement("script");t.text=s.text;const e=s.attributes;for(let n=0,i=e.length;n<i;n++)t.setAttribute(e[n].name,e[n].value);return t}function t1(s,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(s,t)},4e3),setTimeout(function(){e.remove()},6e3)}function e1(s){const t=new Proxy(window,{get(e,n,i){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?t:Reflect.get(e,n,i)},set(e,n,i,r){return Reflect.set(e,n,i,r)}});new Function("window",`with(window) { ${s} }`)(t,null)}function yl(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,n=t.length;e<n;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function wl(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:u=3e4}=t||{},m=yl();m.timeout=u,m.responseType=l,m.onreadystatechange=function(v){m.readyState===4&&(m.status===200?e(m.response):n(m.statusText))},m.ontimeout=()=>{n(`${s} is timed out for ${u}ms.`)},m.addEventListener("load",v=>t?.load?.(v,m),!1),m.addEventListener("loadstart",v=>t?.loadstart?.(v,m),!1),m.addEventListener("loadend",v=>t?.loadend?.(v,m),!1),m.addEventListener("progress",v=>{if(v.lengthComputable){const b=Math.round(v.loaded*100/v.total);t?.progress?.(v,m,b)}},!1),m.addEventListener("error",v=>t?.error?.(v,m),!1),m.addEventListener("abort",v=>t?.abort?.(v,m),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,g=!1,C=!1;function y(){m.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"),c&&(m.withCredentials=!0);for(const v in h)dt(v).toLowerCase()=="content-type"&&h[v].toLowerCase()=="multipart/form-data"?(p=!0,m.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(dt(v).toLowerCase()=="content-type"&&(h[v].toLowerCase().indexOf("text/plain")>=0?g=!0:h[v].toLowerCase().indexOf("application/json")>=0&&(C=!0)),m.setRequestHeader(v,h[v]))}switch(f){case"GET":let v="";r instanceof FormData?v=wd(r):v=yd(r),m.open("GET",gd(s,v),!0),y(),m.send(null);break;default:m.open(f,s,!0),y(),p?m.sendAsBinary(o):C?m.send(JSON.stringify(r)):g?m.send(Object.entries(r).map(([b,x])=>`${b}=${x}`).join(`\r
27
- `)):m.send(Object.entries(r).map(([b,x])=>`${encodeURIComponent(b)}=${encodeURIComponent(x)}`).join("&"));break}})}async function n1(s){const t={url:s.action||"",data:{},contentType:s.method.toLowerCase()==="post"&&s.enctype?s.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],n=t.contentType=="multipart/form-data";for(let i=0;i<s.elements.length;i++){const r=s.elements[i];if(!r.hasAttribute("name"))continue;const o=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const h=r;if(n)for(let u=0,m=h.files?.length||0;u<m;u++){const f=h.files?.[u];if(f){const p=await Fn(f,Ut.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
61
+ * Licensed under the MIT license */(function(s){(function(t,e,n,r){var i=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",c=Math.round,h=Math.abs,l=Date.now;function u(S,P,M){return setTimeout(v(S,M),P)}function d(S,P,M){return Array.isArray(S)?(f(S,M[P],M),!0):!1}function f(S,P,M){var I;if(S)if(S.forEach)S.forEach(P,M);else if(S.length!==r)for(I=0;I<S.length;)P.call(M,S[I],I,S),I++;else for(I in S)S.hasOwnProperty(I)&&P.call(M,S[I],I,S)}function m(S,P,M){var I="DEPRECATED METHOD: "+P+`
62
+ `+M+` AT
63
+ `;return function(){var F=new Error("get-stack-trace"),G=F&&F.stack?F.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",dt=t.console&&(t.console.warn||t.console.log);return dt&&dt.call(t.console,I,G),S.apply(this,arguments)}}var p;typeof Object.assign!="function"?p=function(P){if(P===r||P===null)throw new TypeError("Cannot convert undefined or null to object");for(var M=Object(P),I=1;I<arguments.length;I++){var F=arguments[I];if(F!==r&&F!==null)for(var G in F)F.hasOwnProperty(G)&&(M[G]=F[G])}return M}:p=Object.assign;var _=m(function(P,M,I){for(var F=Object.keys(M),G=0;G<F.length;)(!I||I&&P[F[G]]===r)&&(P[F[G]]=M[F[G]]),G++;return P},"extend","Use `assign`."),y=m(function(P,M){return _(P,M,!0)},"merge","Use `assign`.");function b(S,P,M){var I=P.prototype,F;F=S.prototype=Object.create(I),F.constructor=S,F._super=I,M&&p(F,M)}function v(S,P){return function(){return S.apply(P,arguments)}}function w(S,P){return typeof S==a?S.apply(P&&P[0]||r,P):S}function E(S,P){return S===r?P:S}function C(S,P,M){f(U(P),function(I){S.addEventListener(I,M,!1)})}function D(S,P,M){f(U(P),function(I){S.removeEventListener(I,M,!1)})}function $(S,P){for(;S;){if(S==P)return!0;S=S.parentNode}return!1}function O(S,P){return S.indexOf(P)>-1}function U(S){return S.trim().split(/\s+/g)}function V(S,P,M){if(S.indexOf&&!M)return S.indexOf(P);for(var I=0;I<S.length;){if(M&&S[I][M]==P||!M&&S[I]===P)return I;I++}return-1}function q(S){return Array.prototype.slice.call(S,0)}function ft(S,P,M){for(var I=[],F=[],G=0;G<S.length;){var dt=P?S[G][P]:S[G];V(F,dt)<0&&I.push(S[G]),F[G]=dt,G++}return M&&(P?I=I.sort(function(Vt,Kt){return Vt[P]>Kt[P]}):I=I.sort()),I}function pt(S,P){for(var M,I,F=P[0].toUpperCase()+P.slice(1),G=0;G<i.length;){if(M=i[G],I=M?M+F:P,I in S)return I;G++}return r}var zt=1;function wt(){return zt++}function It(S){var P=S.ownerDocument||S;return P.defaultView||P.parentWindow||t}var Xt=/mobile|tablet|ip(ad|hone|od)|android/i,Y="ontouchstart"in t,N=pt(t,"PointerEvent")!==r,A=Y&&Xt.test(navigator.userAgent),L="touch",H="pen",W="mouse",ht="kinect",mt=25,Q=1,Pt=2,at=4,Ct=8,Ue=1,Se=2,_e=4,pe=8,z=16,vt=Se|_e,Ot=pe|z,As=vt|Ot,Vr=["x","y"],rt=["clientX","clientY"];function Gt(S,P){var M=this;this.manager=S,this.callback=P,this.element=S.element,this.target=S.options.inputTarget,this.domHandler=function(I){w(S.options.enable,[S])&&M.handler(I)},this.init()}Gt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(It(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(It(this.element),this.evWin,this.domHandler)}};function qr(S){var P,M=S.options.inputClass;return M?P=M:N?P=ct:A?P=Qr:Y?P=Ka:P=x,new P(S,Hr)}function Hr(S,P,M){var I=M.pointers.length,F=M.changedPointers.length,G=P&Q&&I-F===0,dt=P&(at|Ct)&&I-F===0;M.isFirst=!!G,M.isFinal=!!dt,G&&(S.session={}),M.eventType=P,Wr(S,M),S.emit("hammer.input",M),S.recognize(M),S.session.prevInput=M}function Wr(S,P){var M=S.session,I=P.pointers,F=I.length;M.firstInput||(M.firstInput=Kr(P)),F>1&&!M.firstMultiple?M.firstMultiple=Kr(P):F===1&&(M.firstMultiple=!1);var G=M.firstInput,dt=M.firstMultiple,$t=dt?dt.center:G.center,Vt=P.center=Ms(I);P.timeStamp=l(),P.deltaTime=P.timeStamp-G.timeStamp,P.angle=rn($t,Vt),P.distance=xn($t,Vt),Jr(M,P),P.offsetDirection=Is(P.deltaX,P.deltaY);var Kt=ks(P.deltaTime,P.deltaX,P.deltaY);P.overallVelocityX=Kt.x,P.overallVelocityY=Kt.y,P.overallVelocity=h(Kt.x)>h(Kt.y)?Kt.x:Kt.y,P.scale=dt?Vn(dt.pointers,I):1,P.rotation=dt?Gn(dt.pointers,I):0,P.maxPointers=M.prevInput?P.pointers.length>M.prevInput.maxPointers?P.pointers.length:M.prevInput.maxPointers:P.pointers.length,Ha(M,P);var Te=S.element;$(P.srcEvent.target,Te)&&(Te=P.srcEvent.target),P.target=Te}function Jr(S,P){var M=P.center,I=S.offsetDelta||{},F=S.prevDelta||{},G=S.prevInput||{};(P.eventType===Q||G.eventType===at)&&(F=S.prevDelta={x:G.deltaX||0,y:G.deltaY||0},I=S.offsetDelta={x:M.x,y:M.y}),P.deltaX=F.x+(M.x-I.x),P.deltaY=F.y+(M.y-I.y)}function Ha(S,P){var M=S.lastInterval||P,I=P.timeStamp-M.timeStamp,F,G,dt,$t;if(P.eventType!=Ct&&(I>mt||M.velocity===r)){var Vt=P.deltaX-M.deltaX,Kt=P.deltaY-M.deltaY,Te=ks(I,Vt,Kt);G=Te.x,dt=Te.y,F=h(Te.x)>h(Te.y)?Te.x:Te.y,$t=Is(Vt,Kt),S.lastInterval=P}else F=M.velocity,G=M.velocityX,dt=M.velocityY,$t=M.direction;P.velocity=F,P.velocityX=G,P.velocityY=dt,P.direction=$t}function Kr(S){for(var P=[],M=0;M<S.pointers.length;)P[M]={clientX:c(S.pointers[M].clientX),clientY:c(S.pointers[M].clientY)},M++;return{timeStamp:l(),pointers:P,center:Ms(P),deltaX:S.deltaX,deltaY:S.deltaY}}function Ms(S){var P=S.length;if(P===1)return{x:c(S[0].clientX),y:c(S[0].clientY)};for(var M=0,I=0,F=0;F<P;)M+=S[F].clientX,I+=S[F].clientY,F++;return{x:c(M/P),y:c(I/P)}}function ks(S,P,M){return{x:P/S||0,y:M/S||0}}function Is(S,P){return S===P?Ue:h(S)>=h(P)?S<0?Se:_e:P<0?pe:z}function xn(S,P,M){M||(M=Vr);var I=P[M[0]]-S[M[0]],F=P[M[1]]-S[M[1]];return Math.sqrt(I*I+F*F)}function rn(S,P,M){M||(M=Vr);var I=P[M[0]]-S[M[0]],F=P[M[1]]-S[M[1]];return Math.atan2(F,I)*180/Math.PI}function Gn(S,P){return rn(P[1],P[0],rt)+rn(S[1],S[0],rt)}function Vn(S,P){return xn(P[0],P[1],rt)/xn(S[0],S[1],rt)}var Ds={mousedown:Q,mousemove:Pt,mouseup:at},Zr="mousedown",Sn="mousemove mouseup";function x(){this.evEl=Zr,this.evWin=Sn,this.pressed=!1,Gt.apply(this,arguments)}b(x,Gt,{handler:function(P){var M=Ds[P.type];M&Q&&P.button===0&&(this.pressed=!0),M&Pt&&P.which!==1&&(M=at),this.pressed&&(M&at&&(this.pressed=!1),this.callback(this.manager,M,{pointers:[P],changedPointers:[P],pointerType:W,srcEvent:P}))}});var k={pointerdown:Q,pointermove:Pt,pointerup:at,pointercancel:Ct,pointerout:Ct},B={2:L,3:H,4:W,5:ht},j="pointerdown",J="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(j="MSPointerDown",J="MSPointerMove MSPointerUp MSPointerCancel");function ct(){this.evEl=j,this.evWin=J,Gt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}b(ct,Gt,{handler:function(P){var M=this.store,I=!1,F=P.type.toLowerCase().replace("ms",""),G=k[F],dt=B[P.pointerType]||P.pointerType,$t=dt==L,Vt=V(M,P.pointerId,"pointerId");G&Q&&(P.button===0||$t)?Vt<0&&(M.push(P),Vt=M.length-1):G&(at|Ct)&&(I=!0),!(Vt<0)&&(M[Vt]=P,this.callback(this.manager,G,{pointers:M,changedPointers:[P],pointerType:dt,srcEvent:P}),I&&M.splice(Vt,1))}});var ot={touchstart:Q,touchmove:Pt,touchend:at,touchcancel:Ct},bt="touchstart",lt="touchstart touchmove touchend touchcancel";function Ce(){this.evTarget=bt,this.evWin=lt,this.started=!1,Gt.apply(this,arguments)}b(Ce,Gt,{handler:function(P){var M=ot[P.type];if(M===Q&&(this.started=!0),!!this.started){var I=_n.call(this,P,M);M&(at|Ct)&&I[0].length-I[1].length===0&&(this.started=!1),this.callback(this.manager,M,{pointers:I[0],changedPointers:I[1],pointerType:L,srcEvent:P})}}});function _n(S,P){var M=q(S.touches),I=q(S.changedTouches);return P&(at|Ct)&&(M=ft(M.concat(I),"identifier",!0)),[M,I]}var Wa={touchstart:Q,touchmove:Pt,touchend:at,touchcancel:Ct},Ja="touchstart touchmove touchend touchcancel";function Qr(){this.evTarget=Ja,this.targetIds={},Gt.apply(this,arguments)}b(Qr,Gt,{handler:function(P){var M=Wa[P.type],I=q2.call(this,P,M);I&&this.callback(this.manager,M,{pointers:I[0],changedPointers:I[1],pointerType:L,srcEvent:P})}});function q2(S,P){var M=q(S.touches),I=this.targetIds;if(P&(Q|Pt)&&M.length===1)return I[M[0].identifier]=!0,[M,M];var F,G,dt=q(S.changedTouches),$t=[],Vt=this.target;if(G=M.filter(function(Kt){return $(Kt.target,Vt)}),P===Q)for(F=0;F<G.length;)I[G[F].identifier]=!0,F++;for(F=0;F<dt.length;)I[dt[F].identifier]&&$t.push(dt[F]),P&(at|Ct)&&delete I[dt[F].identifier],F++;if($t.length)return[ft(G.concat($t),"identifier",!0),$t]}var H2=2500,$f=25;function Ka(){Gt.apply(this,arguments);var S=v(this.handler,this);this.touch=new Qr(this.manager,S),this.mouse=new x(this.manager,S),this.primaryTouch=null,this.lastTouches=[]}b(Ka,Gt,{handler:function(P,M,I){var F=I.pointerType==L,G=I.pointerType==W;if(!(G&&I.sourceCapabilities&&I.sourceCapabilities.firesTouchEvents)){if(F)W2.call(this,M,I);else if(G&&J2.call(this,I))return;this.callback(P,M,I)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function W2(S,P){S&Q?(this.primaryTouch=P.changedPointers[0].identifier,Yf.call(this,P)):S&(at|Ct)&&Yf.call(this,P)}function Yf(S){var P=S.changedPointers[0];if(P.identifier===this.primaryTouch){var M={x:P.clientX,y:P.clientY};this.lastTouches.push(M);var I=this.lastTouches,F=function(){var G=I.indexOf(M);G>-1&&I.splice(G,1)};setTimeout(F,H2)}}function J2(S){for(var P=S.srcEvent.clientX,M=S.srcEvent.clientY,I=0;I<this.lastTouches.length;I++){var F=this.lastTouches[I],G=Math.abs(P-F.x),dt=Math.abs(M-F.y);if(G<=$f&&dt<=$f)return!0}return!1}var jf=pt(o.style,"touchAction"),Xf=jf!==r,Gf="compute",Vf="auto",Za="manipulation",Cn="none",Os="pan-x",Rs="pan-y",ti=Z2();function Qa(S,P){this.manager=S,this.set(P)}Qa.prototype={set:function(S){S==Gf&&(S=this.compute()),Xf&&this.manager.element.style&&ti[S]&&(this.manager.element.style[jf]=S),this.actions=S.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var S=[];return f(this.manager.recognizers,function(P){w(P.options.enable,[P])&&(S=S.concat(P.getTouchAction()))}),K2(S.join(" "))},preventDefaults:function(S){var P=S.srcEvent,M=S.offsetDirection;if(this.manager.session.prevented){P.preventDefault();return}var I=this.actions,F=O(I,Cn)&&!ti[Cn],G=O(I,Rs)&&!ti[Rs],dt=O(I,Os)&&!ti[Os];if(F){var $t=S.pointers.length===1,Vt=S.distance<2,Kt=S.deltaTime<250;if($t&&Vt&&Kt)return}if(!(dt&&G)&&(F||G&&M&vt||dt&&M&Ot))return this.preventSrc(P)},preventSrc:function(S){this.manager.session.prevented=!0,S.preventDefault()}};function K2(S){if(O(S,Cn))return Cn;var P=O(S,Os),M=O(S,Rs);return P&&M?Cn:P||M?P?Os:Rs:O(S,Za)?Za:Vf}function Z2(){if(!Xf)return!1;var S={},P=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(M){S[M]=P?t.CSS.supports("touch-action",M):!0}),S}var ei=1,le=2,qn=4,on=8,$e=on,Ls=16,Ee=32;function Ye(S){this.options=p({},this.defaults,S||{}),this.id=wt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=ei,this.simultaneous={},this.requireFail=[]}Ye.prototype={defaults:{},set:function(S){return p(this.options,S),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(S){if(d(S,"recognizeWith",this))return this;var P=this.simultaneous;return S=ni(S,this),P[S.id]||(P[S.id]=S,S.recognizeWith(this)),this},dropRecognizeWith:function(S){return d(S,"dropRecognizeWith",this)?this:(S=ni(S,this),delete this.simultaneous[S.id],this)},requireFailure:function(S){if(d(S,"requireFailure",this))return this;var P=this.requireFail;return S=ni(S,this),V(P,S)===-1&&(P.push(S),S.requireFailure(this)),this},dropRequireFailure:function(S){if(d(S,"dropRequireFailure",this))return this;S=ni(S,this);var P=V(this.requireFail,S);return P>-1&&this.requireFail.splice(P,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(S){return!!this.simultaneous[S.id]},emit:function(S){var P=this,M=this.state;function I(F){P.manager.emit(F,S)}M<on&&I(P.options.event+qf(M)),I(P.options.event),S.additionalEvent&&I(S.additionalEvent),M>=on&&I(P.options.event+qf(M))},tryEmit:function(S){if(this.canEmit())return this.emit(S);this.state=Ee},canEmit:function(){for(var S=0;S<this.requireFail.length;){if(!(this.requireFail[S].state&(Ee|ei)))return!1;S++}return!0},recognize:function(S){var P=p({},S);if(!w(this.options.enable,[this,P])){this.reset(),this.state=Ee;return}this.state&($e|Ls|Ee)&&(this.state=ei),this.state=this.process(P),this.state&(le|qn|on|Ls)&&this.tryEmit(P)},process:function(S){},getTouchAction:function(){},reset:function(){}};function qf(S){return S&Ls?"cancel":S&on?"end":S&qn?"move":S&le?"start":""}function Hf(S){return S==z?"down":S==pe?"up":S==Se?"left":S==_e?"right":""}function ni(S,P){var M=P.manager;return M?M.get(S):S}function ge(){Ye.apply(this,arguments)}b(ge,Ye,{defaults:{pointers:1},attrTest:function(S){var P=this.options.pointers;return P===0||S.pointers.length===P},process:function(S){var P=this.state,M=S.eventType,I=P&(le|qn),F=this.attrTest(S);return I&&(M&Ct||!F)?P|Ls:I||F?M&at?P|on:P&le?P|qn:le:Ee}});function si(){ge.apply(this,arguments),this.pX=null,this.pY=null}b(si,ge,{defaults:{event:"pan",threshold:10,pointers:1,direction:As},getTouchAction:function(){var S=this.options.direction,P=[];return S&vt&&P.push(Rs),S&Ot&&P.push(Os),P},directionTest:function(S){var P=this.options,M=!0,I=S.distance,F=S.direction,G=S.deltaX,dt=S.deltaY;return F&P.direction||(P.direction&vt?(F=G===0?Ue:G<0?Se:_e,M=G!=this.pX,I=Math.abs(S.deltaX)):(F=dt===0?Ue:dt<0?pe:z,M=dt!=this.pY,I=Math.abs(S.deltaY))),S.direction=F,M&&I>P.threshold&&F&P.direction},attrTest:function(S){return ge.prototype.attrTest.call(this,S)&&(this.state&le||!(this.state&le)&&this.directionTest(S))},emit:function(S){this.pX=S.deltaX,this.pY=S.deltaY;var P=Hf(S.direction);P&&(S.additionalEvent=this.options.event+P),this._super.emit.call(this,S)}});function tc(){ge.apply(this,arguments)}b(tc,ge,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Cn]},attrTest:function(S){return this._super.attrTest.call(this,S)&&(Math.abs(S.scale-1)>this.options.threshold||this.state&le)},emit:function(S){if(S.scale!==1){var P=S.scale<1?"in":"out";S.additionalEvent=this.options.event+P}this._super.emit.call(this,S)}});function ec(){Ye.apply(this,arguments),this._timer=null,this._input=null}b(ec,Ye,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Vf]},process:function(S){var P=this.options,M=S.pointers.length===P.pointers,I=S.distance<P.threshold,F=S.deltaTime>P.time;if(this._input=S,!I||!M||S.eventType&(at|Ct)&&!F)this.reset();else if(S.eventType&Q)this.reset(),this._timer=u(function(){this.state=$e,this.tryEmit()},P.time,this);else if(S.eventType&at)return $e;return Ee},reset:function(){clearTimeout(this._timer)},emit:function(S){this.state===$e&&(S&&S.eventType&at?this.manager.emit(this.options.event+"up",S):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function nc(){ge.apply(this,arguments)}b(nc,ge,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Cn]},attrTest:function(S){return this._super.attrTest.call(this,S)&&(Math.abs(S.rotation)>this.options.threshold||this.state&le)}});function sc(){ge.apply(this,arguments)}b(sc,ge,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:vt|Ot,pointers:1},getTouchAction:function(){return si.prototype.getTouchAction.call(this)},attrTest:function(S){var P=this.options.direction,M;return P&(vt|Ot)?M=S.overallVelocity:P&vt?M=S.overallVelocityX:P&Ot&&(M=S.overallVelocityY),this._super.attrTest.call(this,S)&&P&S.offsetDirection&&S.distance>this.options.threshold&&S.maxPointers==this.options.pointers&&h(M)>this.options.velocity&&S.eventType&at},emit:function(S){var P=Hf(S.offsetDirection);P&&this.manager.emit(this.options.event+P,S),this.manager.emit(this.options.event,S)}});function ri(){Ye.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}b(ri,Ye,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Za]},process:function(S){var P=this.options,M=S.pointers.length===P.pointers,I=S.distance<P.threshold,F=S.deltaTime<P.time;if(this.reset(),S.eventType&Q&&this.count===0)return this.failTimeout();if(I&&F&&M){if(S.eventType!=at)return this.failTimeout();var G=this.pTime?S.timeStamp-this.pTime<P.interval:!0,dt=!this.pCenter||xn(this.pCenter,S.center)<P.posThreshold;this.pTime=S.timeStamp,this.pCenter=S.center,!dt||!G?this.count=1:this.count+=1,this._input=S;var $t=this.count%P.taps;if($t===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=$e,this.tryEmit()},P.interval,this),le):$e}return Ee},failTimeout:function(){return this._timer=u(function(){this.state=Ee},this.options.interval,this),Ee},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==$e&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function je(S,P){return P=P||{},P.recognizers=E(P.recognizers,je.defaults.preset),new rc(S,P)}je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:Gf,enable:!0,inputTarget:null,inputClass:null,preset:[[nc,{enable:!1}],[tc,{enable:!1},["rotate"]],[sc,{direction:vt}],[si,{direction:vt},["swipe"]],[ri],[ri,{event:"doubletap",taps:2},["tap"]],[ec]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Q2=1,Wf=2;function rc(S,P){this.options=p({},je.defaults,P||{}),this.options.inputTarget=this.options.inputTarget||S,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=S,this.input=qr(this),this.touchAction=new Qa(this,this.options.touchAction),Jf(this,!0),f(this.options.recognizers,function(M){var I=this.add(new M[0](M[1]));M[2]&&I.recognizeWith(M[2]),M[3]&&I.requireFailure(M[3])},this)}rc.prototype={set:function(S){return p(this.options,S),S.touchAction&&this.touchAction.update(),S.inputTarget&&(this.input.destroy(),this.input.target=S.inputTarget,this.input.init()),this},stop:function(S){this.session.stopped=S?Wf:Q2},recognize:function(S){var P=this.session;if(!P.stopped){this.touchAction.preventDefaults(S);var M,I=this.recognizers,F=P.curRecognizer;(!F||F&&F.state&$e)&&(F=P.curRecognizer=null);for(var G=0;G<I.length;)M=I[G],P.stopped!==Wf&&(!F||M==F||M.canRecognizeWith(F))?M.recognize(S):M.reset(),!F&&M.state&(le|qn|on)&&(F=P.curRecognizer=M),G++}},get:function(S){if(S instanceof Ye)return S;for(var P=this.recognizers,M=0;M<P.length;M++)if(P[M].options.event==S)return P[M];return null},add:function(S){if(d(S,"add",this))return this;var P=this.get(S.options.event);return P&&this.remove(P),this.recognizers.push(S),S.manager=this,this.touchAction.update(),S},remove:function(S){if(d(S,"remove",this))return this;if(S=this.get(S),S){var P=this.recognizers,M=V(P,S);M!==-1&&(P.splice(M,1),this.touchAction.update())}return this},on:function(S,P){if(S!==r&&P!==r){var M=this.handlers;return f(U(S),function(I){M[I]=M[I]||[],M[I].push(P)}),this}},off:function(S,P){if(S!==r){var M=this.handlers;return f(U(S),function(I){P?M[I]&&M[I].splice(V(M[I],P),1):delete M[I]}),this}},emit:function(S,P){this.options.domEvents&&tx(S,P);var M=this.handlers[S]&&this.handlers[S].slice();if(!(!M||!M.length)){P.type=S,P.preventDefault=function(){P.srcEvent.preventDefault()};for(var I=0;I<M.length;)M[I](P),I++}},destroy:function(){this.element&&Jf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Jf(S,P){var M=S.element;if(M.style){var I;f(S.options.cssProps,function(F,G){I=pt(M.style,G),P?(S.oldCssProps[I]=M.style[I],M.style[I]=F):M.style[I]=S.oldCssProps[I]||""}),P||(S.oldCssProps={})}}function tx(S,P){var M=e.createEvent("Event");M.initEvent(S,!0,!0),M.gesture=P,P.target.dispatchEvent(M)}p(je,{INPUT_START:Q,INPUT_MOVE:Pt,INPUT_END:at,INPUT_CANCEL:Ct,STATE_POSSIBLE:ei,STATE_BEGAN:le,STATE_CHANGED:qn,STATE_ENDED:on,STATE_RECOGNIZED:$e,STATE_CANCELLED:Ls,STATE_FAILED:Ee,DIRECTION_NONE:Ue,DIRECTION_LEFT:Se,DIRECTION_RIGHT:_e,DIRECTION_UP:pe,DIRECTION_DOWN:z,DIRECTION_HORIZONTAL:vt,DIRECTION_VERTICAL:Ot,DIRECTION_ALL:As,Manager:rc,Input:Gt,TouchAction:Qa,TouchInput:Qr,MouseInput:x,PointerEventInput:ct,TouchMouseInput:Ka,SingleTouchInput:Ce,Recognizer:Ye,AttrRecognizer:ge,Tap:ri,Pan:si,Swipe:sc,Pinch:tc,Rotate:nc,Press:ec,on:C,off:D,each:f,merge:y,extend:_,assign:p,inherit:b,bindFn:v,prefixed:pt});var ex=typeof t<"u"?t:typeof self<"u"?self:{};ex.Hammer=je,typeof r=="function"&&r.amd?r(function(){return je}):s.exports?s.exports=je:t[n]=je})(window,document,"Hammer")})(il);var r0=il.exports;const At=el(r0);var ho=function(s,t){return ho=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])},ho(s,t)};function we(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ho(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function i0(s,t,e,n){function r(i){return i instanceof e?i:new e(function(o){o(i)})}return new(e||(e=Promise))(function(i,o){function a(l){try{h(n.next(l))}catch(u){o(u)}}function c(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((n=n.apply(s,t||[])).next())})}function ol(s,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return c([h,l])}}function c(h){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(e=0)),e;)try{if(n=1,r&&(i=h[0]&2?r.return:h[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,h[1])).done)return i;switch(r=0,i&&(h=[h[0]&2,i.value]),h[0]){case 0:case 1:i=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,r=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(h[0]===6||h[0]===2)){e=0;continue}if(h[0]===3&&(!i||h[1]>i[0]&&h[1]<i[3])){e.label=h[1];break}if(h[0]===6&&e.label<i[1]){e.label=i[1],i=h;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(h);break}i[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(s,e)}catch(l){h=[6,l],r=0}finally{n=i=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function fn(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),r,i=[],o;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)i.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return i}function Ve(s,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,i;n<r;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return s.concat(i||Array.prototype.slice.call(t))}function Ln(s){return this instanceof Ln?(this.v=s,this):new Ln(s)}function o0(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(s,t||[]),r,i=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),r[Symbol.asyncIterator]=function(){return this},r;function o(f){return function(m){return Promise.resolve(m).then(f,u)}}function a(f,m){n[f]&&(r[f]=function(p){return new Promise(function(_,y){i.push([f,p,_,y])>1||c(f,p)})},m&&(r[f]=m(r[f])))}function c(f,m){try{h(n[f](m))}catch(p){d(i[0][3],p)}}function h(f){f.value instanceof Ln?Promise.resolve(f.value.v).then(l,u):d(i[0][2],f)}function l(f){c("next",f)}function u(f){c("throw",f)}function d(f,m){f(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function a0(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof fn=="function"?fn(s):s[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=s[i]&&function(o){return new Promise(function(a,c){o=s[i](o),r(a,c,o.done,o.value)})}}function r(i,o,a,c){Promise.resolve(c).then(function(h){i({value:h,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function gt(s){return typeof s=="function"}function lo(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var uo=lo(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
64
+ `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
65
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function rs(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var zn=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=fn(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(gt(l))try{l()}catch(p){i=p instanceof uo?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=fn(u),f=d.next();!f.done;f=d.next()){var m=f.value;try{hl(m)}catch(p){i=i??[],p instanceof uo?i=Ve(Ve([],Oe(i)),Oe(p.errors)):i.push(p)}}}catch(p){n={error:p}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(i)throw new uo(i)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)hl(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&rs(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&rs(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),al=zn.EMPTY;function cl(s){return s instanceof zn||s&&"closed"in s&&gt(s.remove)&&gt(s.add)&&gt(s.unsubscribe)}function hl(s){gt(s)?s():s.unsubscribe()}var ll={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},fo={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var r=fo.delegate;return r?.setTimeout?r.setTimeout.apply(r,Ve([s,t],Oe(e))):setTimeout.apply(void 0,Ve([s,t],Oe(e)))},clearTimeout:function(s){var t=fo.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function ul(s){fo.setTimeout(function(){throw s})}function is(){}function br(s){s()}var mo=function(s){we(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,cl(e)&&e.add(n)):n.destination=u0,n}return t.create=function(e,n,r){return new Nn(e,n,r)},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,s.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}(zn),c0=Function.prototype.bind;function po(s,t){return c0.call(s,t)}var h0=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){wr(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){wr(n)}else wr(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){wr(e)}},s}(),Nn=function(s){we(t,s);function t(e,n,r){var i=s.call(this)||this,o;if(gt(e)||!e)o={next:e??void 0,error:n??void 0,complete:r??void 0};else{var a;i&&ll.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return i.unsubscribe()},o={next:e.next&&po(e.next,a),error:e.error&&po(e.error,a),complete:e.complete&&po(e.complete,a)}):o=e}return i.destination=new h0(o),i}return t}(mo);function wr(s){ul(s)}function l0(s){throw s}var u0={closed:!0,next:is,error:l0,complete:is},go=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function dn(s){return s}function f0(s){return s.length===0?dn:s.length===1?s[0]:function(e){return s.reduce(function(n,r){return r(n)},e)}}var Mt=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var r=this,i=m0(t)?t:new Nn(t,e,n);return br(function(){var o=r,a=o.operator,c=o.source;i.add(a?a.call(i,c):c?r._subscribe(i):r._trySubscribe(i))}),i},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=fl(e),new e(function(r,i){var o=new Nn({next:function(a){try{t(a)}catch(c){i(c),o.unsubscribe()}},error:i,complete:r});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[go]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return f0(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=fl(t),new t(function(n,r){var i;e.subscribe(function(o){return i=o},function(o){return r(o)},function(){return n(i)})})},s.create=function(t){return new s(t)},s}();function fl(s){var t;return(t=s??ll.Promise)!==null&&t!==void 0?t:Promise}function d0(s){return s&&gt(s.next)&&gt(s.error)&&gt(s.complete)}function m0(s){return s&&s instanceof mo||d0(s)&&cl(s)}function p0(s){return gt(s?.lift)}function Zt(s){return function(t){if(p0(t))return t.lift(function(e){try{return s(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Rt(s,t,e,n,r){return new g0(s,t,e,n,r)}var g0=function(s){we(t,s);function t(e,n,r,i,o,a){var c=s.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(h){try{n(h)}catch(l){e.error(l)}}:s.prototype._next,c._error=i?function(h){try{i(h)}catch(l){e.error(l)}finally{this.unsubscribe()}}:s.prototype._error,c._complete=r?function(){try{r()}catch(h){e.error(h)}finally{this.unsubscribe()}}:s.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(mo),y0=lo(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),qe=function(s){we(t,s);function t(){var e=s.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 n=new dl(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new y0},t.prototype.next=function(e){var n=this;br(function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=fn(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var n=this;br(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var r=n.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;br(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.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(),s.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 n=this,r=this,i=r.hasError,o=r.isStopped,a=r.observers;return i||o?al:(this.currentObservers=null,a.push(e),new zn(function(){n.currentObservers=null,rs(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,r=n.hasError,i=n.thrownError,o=n.isStopped;r?e.error(i):o&&e.complete()},t.prototype.asObservable=function(){var e=new Mt;return e.source=this,e},t.create=function(e,n){return new dl(e,n)},t}(Mt),dl=function(s){we(t,s);function t(e,n){var r=s.call(this)||this;return r.destination=e,r.source=n,r}return t.prototype.next=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,e)},t.prototype.error=function(e){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&r!==void 0?r:al},t}(qe),ml=function(s){we(t,s);function t(e){var n=s.call(this)||this;return n._value=e,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var n=s.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},t.prototype.getValue=function(){var e=this,n=e.hasError,r=e.thrownError,i=e._value;if(n)throw r;return this._throwIfClosed(),i},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(qe),yo={now:function(){return(yo.delegate||Date).now()},delegate:void 0},b0=function(s){we(t,s);function t(e,n,r){e===void 0&&(e=1/0),n===void 0&&(n=1/0),r===void 0&&(r=yo);var i=s.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(a.now()+c)),this._trimBuffer(),s.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),r=this,i=r._infiniteTimeWindow,o=r._buffer,a=o.slice(),c=0;c<a.length&&!e.closed;c+=i?1:2)e.next(a[c]);return this._checkFinalizedStatuses(e),n},t.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,r=e._timestampProvider,i=e._buffer,o=e._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var c=r.now(),h=0,l=1;l<i.length&&i[l]<=c;l+=2)h=l;h&&i.splice(0,h+1)}},t}(qe),w0=function(s){we(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(zn),vr={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var r=vr.delegate;return r?.setInterval?r.setInterval.apply(r,Ve([s,t],Oe(e))):setInterval.apply(void 0,Ve([s,t],Oe(e)))},clearInterval:function(s){var t=vr.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},v0=function(s){we(t,s);function t(e,n){var r=s.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,n){var r;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(e,n,r){return r===void 0&&(r=0),vr.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,n,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return n;n!=null&&vr.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,n);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var r=!1,i;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,r=e.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,rs(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(w0),pl=function(){function s(t,e){e===void 0&&(e=s.now),this.schedulerActionCtor=t,this.now=e}return s.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},s.now=yo.now,s}(),x0=function(s){we(t,s);function t(e,n){n===void 0&&(n=pl.now);var r=s.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}},t}(pl),bo=new x0(v0),S0=bo,gl=new Mt(function(s){return s.complete()});function yl(s){return s&&gt(s.schedule)}function wo(s){return s[s.length-1]}function _0(s){return gt(wo(s))?s.pop():void 0}function os(s){return yl(wo(s))?s.pop():void 0}function C0(s,t){return typeof wo(s)=="number"?s.pop():t}var vo=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function bl(s){return gt(s?.then)}function wl(s){return gt(s[go])}function vl(s){return Symbol.asyncIterator&&gt(s?.[Symbol.asyncIterator])}function xl(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function E0(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Sl=E0();function _l(s){return gt(s?.[Sl])}function Cl(s){return o0(this,arguments,function(){var e,n,r,i;return ol(this,function(o){switch(o.label){case 0:e=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ln(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Ln(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ln(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function El(s){return gt(s?.getReader)}function Ft(s){if(s instanceof Mt)return s;if(s!=null){if(wl(s))return T0(s);if(vo(s))return P0(s);if(bl(s))return A0(s);if(vl(s))return Tl(s);if(_l(s))return M0(s);if(El(s))return k0(s)}throw xl(s)}function T0(s){return new Mt(function(t){var e=s[go]();if(gt(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function P0(s){return new Mt(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function A0(s){return new Mt(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,ul)})}function M0(s){return new Mt(function(t){var e,n;try{for(var r=fn(s),i=r.next();!i.done;i=r.next()){var o=i.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}t.complete()})}function Tl(s){return new Mt(function(t){I0(s,t).catch(function(e){return t.error(e)})})}function k0(s){return Tl(Cl(s))}function I0(s,t){var e,n,r,i;return i0(this,void 0,void 0,function(){var o,a;return ol(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=a0(s),c.label=1;case 1:return[4,e.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),r={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=e.return)?[4,i.call(e)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Re(s,t,e,n,r){n===void 0&&(n=0),r===void 0&&(r=!1);var i=t.schedule(function(){e(),r?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(i),!r)return i}function Pl(s,t){return t===void 0&&(t=0),Zt(function(e,n){e.subscribe(Rt(n,function(r){return Re(n,s,function(){return n.next(r)},t)},function(){return Re(n,s,function(){return n.complete()},t)},function(r){return Re(n,s,function(){return n.error(r)},t)}))})}function xo(s,t){return t===void 0&&(t=0),Zt(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function D0(s,t){return Ft(s).pipe(xo(t),Pl(t))}function O0(s,t){return Ft(s).pipe(xo(t),Pl(t))}function R0(s,t){return new Mt(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function L0(s,t){return new Mt(function(e){var n;return Re(e,t,function(){n=s[Sl](),Re(e,t,function(){var r,i,o;try{r=n.next(),i=r.value,o=r.done}catch(a){e.error(a);return}o?e.complete():e.next(i)},0,!0)}),function(){return gt(n?.return)&&n.return()}})}function Al(s,t){if(!s)throw new Error("Iterable cannot be null");return new Mt(function(e){Re(e,t,function(){var n=s[Symbol.asyncIterator]();Re(e,t,function(){n.next().then(function(r){r.done?e.complete():e.next(r.value)})},0,!0)})})}function z0(s,t){return Al(Cl(s),t)}function N0(s,t){if(s!=null){if(wl(s))return D0(s,t);if(vo(s))return R0(s,t);if(bl(s))return O0(s,t);if(vl(s))return Al(s,t);if(_l(s))return L0(s,t);if(El(s))return z0(s,t)}throw xl(s)}function as(s,t){return t?N0(s,t):Ft(s)}function F0(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=os(s);return as(s,e)}var B0=lo(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function U0(s,t){var e=typeof t=="object";return new Promise(function(n,r){var i=new Nn({next:function(o){n(o),i.unsubscribe()},error:r,complete:function(){e?n(t.defaultValue):r(new B0)}});s.subscribe(i)})}function $0(s){return s instanceof Date&&!isNaN(s)}function kt(s,t){return Zt(function(e,n){var r=0;e.subscribe(Rt(n,function(i){n.next(s.call(t,i,r++))}))})}var Y0=Array.isArray;function j0(s,t){return Y0(t)?s.apply(void 0,Ve([],Oe(t))):s(t)}function So(s){return kt(function(t){return j0(s,t)})}var X0=Array.isArray,G0=Object.getPrototypeOf,V0=Object.prototype,q0=Object.keys;function H0(s){if(s.length===1){var t=s[0];if(X0(t))return{args:t,keys:null};if(W0(t)){var e=q0(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function W0(s){return s&&typeof s=="object"&&G0(s)===V0}function J0(s,t){return s.reduce(function(e,n,r){return e[n]=t[r],e},{})}function K0(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=os(s),n=_0(s),r=H0(s),i=r.args,o=r.keys;if(i.length===0)return as([],e);var a=new Mt(Z0(i,e,o?function(c){return J0(o,c)}:dn));return n?a.pipe(So(n)):a}function Z0(s,t,e){return e===void 0&&(e=dn),function(n){Ml(t,function(){for(var r=s.length,i=new Array(r),o=r,a=r,c=function(l){Ml(t,function(){var u=as(s[l],t),d=!1;u.subscribe(Rt(n,function(f){i[l]=f,d||(d=!0,a--),a||n.next(e(i.slice()))},function(){--o||n.complete()}))},n)},h=0;h<r;h++)c(h)},n)}}function Ml(s,t,e){s?Re(e,s,t):t()}function Q0(s,t,e,n,r,i,o,a){var c=[],h=0,l=0,u=!1,d=function(){u&&!c.length&&!h&&t.complete()},f=function(p){return h<n?m(p):c.push(p)},m=function(p){i&&t.next(p),h++;var _=!1;Ft(e(p,l++)).subscribe(Rt(t,function(y){r?.(y),i?f(y):t.next(y)},function(){_=!0},void 0,function(){if(_)try{h--;for(var y=function(){var b=c.shift();o?Re(t,o,function(){return m(b)}):m(b)};c.length&&h<n;)y();d()}catch(b){t.error(b)}}))};return s.subscribe(Rt(t,f,function(){u=!0,d()})),function(){a?.()}}function _o(s,t,e){return e===void 0&&(e=1/0),gt(t)?_o(function(n,r){return kt(function(i,o){return t(n,i,r,o)})(Ft(s(n,r)))},e):(typeof t=="number"&&(e=t),Zt(function(n,r){return Q0(n,r,s,e)}))}function kl(s){return s===void 0&&(s=1/0),_o(dn,s)}function ty(){return kl(1)}function Il(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return ty()(as(s,os(s)))}var ey=["addListener","removeListener"],ny=["addEventListener","removeEventListener"],sy=["on","off"];function Co(s,t,e,n){if(gt(e)&&(n=e,e=void 0),n)return Co(s,t,e).pipe(So(n));var r=Oe(oy(s)?ny.map(function(a){return function(c){return s[a](t,c,e)}}):ry(s)?ey.map(Dl(s,t)):iy(s)?sy.map(Dl(s,t)):[],2),i=r[0],o=r[1];if(!i&&vo(s))return _o(function(a){return Co(a,t,e)})(Ft(s));if(!i)throw new TypeError("Invalid event target");return new Mt(function(a){var c=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];return a.next(1<h.length?h:h[0])};return i(c),function(){return o(c)}})}function Dl(s,t){return function(e){return function(n){return s[e](t,n)}}}function ry(s){return gt(s.addListener)&&gt(s.removeListener)}function iy(s){return gt(s.on)&&gt(s.off)}function oy(s){return gt(s.addEventListener)&&gt(s.removeEventListener)}function Tt(s,t,e){return e?Tt(s,t).pipe(So(e)):new Mt(function(n){var r=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},i=s(r);return gt(t)?function(){return t(r,i)}:void 0})}function ay(s,t,e){s===void 0&&(s=0),e===void 0&&(e=S0);var n=-1;return t!=null&&(yl(t)?e=t:n=t),new Mt(function(r){var i=$0(s)?+s-e.now():s;i<0&&(i=0);var o=0;return e.schedule(function(){r.closed||(r.next(o++),0<=n?this.schedule(void 0,n):r.complete())},i)})}function Ol(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=os(s),n=C0(s,1/0),r=s;return r.length?r.length===1?Ft(r[0]):kl(n)(as(r,e)):gl}var cy=Array.isArray;function hy(s){return s.length===1&&cy(s[0])?s[0]:s}function Rl(s,t){return Zt(function(e,n){var r=0;e.subscribe(Rt(n,function(i){return s.call(t,i,r++)&&n.next(i)}))})}function xr(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=hy(s),s.length===1?Ft(s[0]):new Mt(ly(s))}function ly(s){return function(t){for(var e=[],n=function(i){e.push(Ft(s[i]).subscribe(Rt(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==i&&e[a].unsubscribe();e=null}t.next(o)})))},r=0;e&&!t.closed&&r<s.length;r++)n(r)}}function He(s,t){return t===void 0&&(t=dn),s=s??uy,Zt(function(e,n){var r,i=!0;e.subscribe(Rt(n,function(o){var a=t(o);(i||!s(r,a))&&(i=!1,r=a,n.next(o))}))})}function uy(s,t){return s===t}function Ll(s,t){return t?function(e){return e.pipe(Ll(function(n,r){return Ft(s(n,r)).pipe(kt(function(i,o){return t(n,i,r,o)}))}))}:Zt(function(e,n){var r=0,i=null,o=!1;e.subscribe(Rt(n,function(a){i||(i=Rt(n,void 0,function(){i=null,o&&n.complete()}),Ft(s(a,r++)).subscribe(i))},function(){o=!0,!i&&n.complete()}))})}function fy(s){s===void 0&&(s={});var t=s.connector,e=t===void 0?function(){return new qe}:t,n=s.resetOnError,r=n===void 0?!0:n,i=s.resetOnComplete,o=i===void 0?!0:i,a=s.resetOnRefCountZero,c=a===void 0?!0:a;return function(h){var l,u,d,f=0,m=!1,p=!1,_=function(){u?.unsubscribe(),u=void 0},y=function(){_(),l=d=void 0,m=p=!1},b=function(){var v=l;y(),v?.unsubscribe()};return Zt(function(v,w){f++,!p&&!m&&_();var E=d=d??e();w.add(function(){f--,f===0&&!p&&!m&&(u=Eo(b,c))}),E.subscribe(w),!l&&f>0&&(l=new Nn({next:function(C){return E.next(C)},error:function(C){p=!0,_(),u=Eo(y,r,C),E.error(C)},complete:function(){m=!0,_(),u=Eo(y,o),E.complete()}}),Ft(v).subscribe(l))})(h)}}function Eo(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];if(t===!0){s();return}if(t!==!1){var r=new Nn({next:function(){r.unsubscribe(),s()}});return Ft(t.apply(void 0,Ve([],Oe(e)))).subscribe(r)}}function dy(s,t,e){var n,r,i,o,a=!1;return s&&typeof s=="object"?(n=s.bufferSize,o=n===void 0?1/0:n,r=s.windowTime,t=r===void 0?1/0:r,i=s.refCount,a=i===void 0?!1:i,e=s.scheduler):o=s??1/0,fy({connector:function(){return new b0(o,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function mn(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=os(s);return Zt(function(n,r){(e?Il(s,n,e):Il(s,n)).subscribe(r)})}function Sr(s,t){return Zt(function(e,n){var r=null,i=0,o=!1,a=function(){return o&&!r&&n.complete()};e.subscribe(Rt(n,function(c){r?.unsubscribe();var h=0,l=i++;Ft(s(c,l)).subscribe(r=Rt(n,function(u){return n.next(t?t(c,u,l,h++):u)},function(){r=null,a()}))},function(){o=!0,a()}))})}function my(){return Sr(dn)}function To(s){return Zt(function(t,e){Ft(s).subscribe(Rt(e,function(){return e.complete()},is)),!e.closed&&t.subscribe(e)})}function pn(s,t,e){var n=gt(s)||t||e?{next:s,error:t,complete:e}:s;return n?Zt(function(r,i){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;r.subscribe(Rt(i,function(c){var h;(h=n.next)===null||h===void 0||h.call(n,c),i.next(c)},function(){var c;a=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var h;a=!1,(h=n.error)===null||h===void 0||h.call(n,c),i.error(c)},function(){var c,h;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(h=n.finalize)===null||h===void 0||h.call(n)}))}):dn}function py(s,t){return Zt(function(e,n){var r=t??{},i=r.leading,o=i===void 0?!0:i,a=r.trailing,c=a===void 0?!1:a,h=!1,l=null,u=null,d=!1,f=function(){u?.unsubscribe(),u=null,c&&(_(),d&&n.complete())},m=function(){u=null,d&&n.complete()},p=function(y){return u=Ft(s(y)).subscribe(Rt(n,f,m))},_=function(){if(h){h=!1;var y=l;l=null,n.next(y),!d&&p(y)}};e.subscribe(Rt(n,function(y){h=!0,l=y,!(u&&!u.closed)&&(o?_():p(y))},function(){d=!0,!(c&&h&&u&&!u.closed)&&n.complete()}))})}function gy(s,t,e){t===void 0&&(t=bo);var n=ay(s,t);return py(function(){return n},e)}function yy(s,t){return Zt(function(e,n){var r=[],i=function(o){for(;0<r.length;)r.shift().error(o);n.error(o)};Ft(s).subscribe(Rt(n,function(o){var a=new qe;r.push(a);var c=new zn,h=function(){rs(r,a),a.complete(),c.unsubscribe()},l;try{l=Ft(t(o))}catch(u){i(u);return}n.next(a.asObservable()),c.add(l.subscribe(Rt(n,h,is,i)))},is)),e.subscribe(Rt(n,function(o){var a,c,h=r.slice();try{for(var l=fn(h),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}},function(){for(;0<r.length;)r.shift().complete();n.complete()},i,function(){for(;0<r.length;)r.shift().unsubscribe()}))})}function by(s){return s.toElement?s.toElement:s.currentTarget?s.currentTarget:s.srcElement?s.srcElement:null}function yt(s,t,e,n=!1){const r=async i=>{await e(i)};try{s.addEventListener(t,r,n)}catch{s.attachEvent("on"+t,r)}return()=>{try{s.removeEventListener(t,r,n)}catch{s.detachEvent("on"+t,r)}}}function wy(s,t,e,n,r=!1){return yt(s||document.body,e,i=>{i.target===t&&n(i)},r)}function vy(s){s.replaceWith(s.cloneNode(!0))}function st(s,t,e=!1){return Co(s,t,{capture:e})}function xy(s){const t=Tt(e=>s.register(e),(e,n)=>{s.unregister?.(e,...n||[])},(...e)=>[...e]);return s.share?t.pipe(dy({bufferSize:s.bufferSize||1,refCount:!0})):t}function We(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function zl(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const Sy=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],_y=["keydown","keyup","keypress"],Cy=["touchstart","touchend","touchcancel","touchmove"],Ey=["pointerdown","pointerup","pointercancel","pointermove"],Ty=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Py=["change"];function _r(s,t={bubbles:!0,detail:{}}){let e;try{const n=Object.assign({bubbles:!0,cancelable:!0,view:window,detail:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},t);Sy.includes(s)?e=new MouseEvent(s,n):_y.includes(s)?e=new KeyboardEvent(s,n):Cy.includes(s)?e=new TouchEvent(s,n):Ey.includes(s)?e=new PointerEvent(s,n):Ty.includes(s)?e=new DragEvent(s,n):Py.includes(s)?e=new Event(s,n):e=new CustomEvent(s,n)}catch{document.createEvent?e=document.createEvent("Event").initEvent(s,!0,!0):document.createEventObject&&(e=document.createEventObject())}return e}function Po(s,t,e){if(s)if(s.dispatchEvent)s.dispatchEvent(e);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,e);else throw new Error(`Can't dispatch event : ${t}`)}function Ay(s,t){const e=s.target,n=_r(t);Po(e,t,n)}function My(s){const t=s.target,e="click";if(!/(SELECT|INPUT|TEXTAREA)/i.test(t.tagName)){const n=_r(e);n.view=s.view||window,n.detail=1,n.screenX=t.screenX||0,n.screenY=t.screenY||0,n.clientX=t.clientX||0,n.clientY=t.clientY||0,n.pageX=s.pageX,n.pageY=s.pageY,n.ctrlKey=!!s.ctrlKey,n.altKey=!!s.altKey,n.shiftKey=!!s.shiftKey,n.metaKey=!!s.metaKey,n.button=0,n.relatedTarget=null,n._constructed=!0,Po(t,e,n)}}function ky(s,t){const e=s.changedTouches[0];return _r(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 Iy(s,t,e,n,r){const i=t/e;let o=0,a=0;switch(s){case"aspectFit":i>=1?(o=n,a=o/i,a>r&&(a=r,o=a*i)):(a=r,o=a*i,o>n&&(o=n,a=o/i));break;case"aspectFill":i>=1?(a=r,o=a*i):(o=n,a=o/i);break;case"widthFix":o=n,a=o/i;break;case"heightFix":a=r,o=a*i;break;case"scaleToFill":default:o=n,a=r;break}return{width:o,height:a}}function Nl(s){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(s.width,s.height)}}const Dy=s=>{const t=s.width,e=s.height,n=t*e*3,r=n+54,i=[66,77,r&255,r>>8&255,r>>16&255,r>>24&255,0,0,0,0,54,0,0,0],o=[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,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,c=s.data;let h="";const l=t<<2;let u=e;const d=String.fromCharCode;do{const m=l*(u-1);let p="";for(let _=0;_<t;_++){const y=_<<2;p+=d(c[m+y+2])+d(c[m+y+1])+d(c[m+y])}for(let _=0;_<a;_++)p+=String.fromCharCode(0);h+=p}while(--u);function f(m){if(!window.btoa)throw"btoa undefined";let p="";if(typeof m=="string")p=m;else for(let _=0;_<m.length;_++)p+=String.fromCharCode(m[_]);return btoa(p)}return f(i.concat(o))+f(h)};function Oy(s){const{width:t,height:e}=s,n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")}const Ry=(s,t,e)=>{const{width:n,height:r}=s,i=document.createElement("canvas"),o=i.getContext("2d");i.width=n,i.height=r,o.putImageData(s,0,0,0,0,n,r);const a=`image/${t?t.toLowerCase():"png"}`;i.toBlob(c=>{e?.(null,c)},a,1)};function Ly(s,t){return createImageBitmap(s,t)}function zy(s){const t=[],e=[],n=[];let r=0;for(let c=0,h=s.data.length;c<h;c+=4)t[r]=s.data[c],e[r]=s.data[c+1],n[r]=s.data[c+2],r+=1;const i=Ao(t),o=Ao(e),a=Ao(n);return"rgb("+i+","+o+","+a+")"}function Ao(s){const t={},e=[],n=[];for(let a=0;a<s.length;a++)t[s[a]]?e.push(s[a]):t[s[a]]=1;let r=0;for(let a=0;a<e.length;a++){r=0;for(let c=0;c<e.length;c++)e[a]===e[c]&&(r+=1),n[a]=r}const i=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===i)return;return e[o]}const Ny=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[(o*e+e-a-1)*4],r[c+1]=t[(o*e+e-a-1)*4+1],r[c+2]=t[(o*e+e-a-1)*4+2],r[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,e,n)},Fy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[((n-o-1)*e+a)*4],r[c+1]=t[((n-o-1)*e+a)*4+1],r[c+2]=t[((n-o-1)*e+a)*4+2],r[c+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(r,e,n)},By=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const c=(o*n+a)*4;r[c]=t[(a*e+e-o-1)*4],r[c+1]=t[(a*e+e-o-1)*4+1],r[c+2]=t[(a*e+e-o-1)*4+2],r[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,n,e)},Uy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const c=(o*n+a)*4;r[c]=t[((n-a-1)*e+o)*4],r[c+1]=t[((n-a-1)*e+o)*4+1],r[c+2]=t[((n-a-1)*e+o)*4+2],r[c+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(r,n,e)},$y=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1]+t[c+2])/3;r[c]=h,r[c+1]=h,r[c+2]=h,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Yy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];r[c]=h,r[c+1]=h,r[c+2]=h,r[c+3]=t[c+3]}return new ImageData(r,e,n)},jy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,l=(t[c]+t[c+1]+t[c+2])/3>127?255:0;r[c]=l,r[c+1]=l,r[c+2]=l,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Xy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=255-t[c],r[c+1]=255-t[c+1],r[c+2]=255-t[c+2],r[c+3]=t[c+3]}return new ImageData(r,e,n)},Gy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[c],r[c+1]=0,r[c+2]=0,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Vy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=0,r[c+1]=t[c+1],r[c+2]=0,r[c+3]=t[c+3]}return new ImageData(r,e,n)},qy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=0,r[c+1]=0,r[c+2]=t[c+2],r[c+3]=t[c+3]}return new ImageData(r,e,n)},Hy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[c],r[c+1]=t[c+1],r[c+2]=0,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Wy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[c],r[c+1]=0,r[c+2]=t[c+1],r[c+3]=t[c+3]}return new ImageData(r,e,n)},Jy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=0,r[c+1]=t[c+1],r[c+2]=t[c+1],r[c+3]=t[c+3]}return new ImageData(r,e,n)},Ky=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c+1]+t[c+2])/2;r[c]=t[c],r[c+1]=h,r[c+2]=h,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Zy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+2])/2;r[c]=h,r[c+1]=t[c+1],r[c+2]=h,r[c+3]=t[c+3]}return new ImageData(r,e,n)},Qy=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1])/2;r[c]=h,r[c+1]=h,r[c+2]=t[c+2],r[c+3]=t[c+3]}return new ImageData(r,e,n)},t1=s=>Fl(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),e1=s=>Fl(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),n1=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;r[c]=t[c],r[c+1]=t[c+1],r[c+2]=t[c+2],r[c+3]=255}return new ImageData(r,e,n)},s1=s=>{const{data:t,width:e,height:n}=s,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;if(t[c+3]===0)r[c]=255,r[c+1]=255,r[c+2]=255,r[c+3]=255;else{const h=Bl([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);r[c]=h[0],r[c+1]=h[1],r[c+2]=h[2],r[c+3]=h[3]}}return new ImageData(r,e,n)};function r1(s,t,e,n,r,i=!1,o){const{data:a,width:c,height:h}=s;let l=r,u=n,d=t,f=e;if(l<0?l=0:l>c&&(l=c),u<0?u=0:u>h&&(u=h),d<1?d=1:d>c&&(d=c),f<1?f=1:f>h&&(f=h),l+d>c&&(d=c-l),u+f>h&&(f=h-u),i){const m=new Uint8ClampedArray(a.length);for(let _=0;_<h;_++)for(let y=0;y<c;y++){const b=(_*c+y)*4;y>=l&&y<=l+d&&_>=u&&_<=u+f?(m[b]=a[b],m[b+1]=a[b+1],m[b+2]=a[b+2],m[b+3]=a[b+3]):(m[b]=255,m[b+1]=255,m[b+2]=255,m[b+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(m,c,h)}else{const m=new Uint8ClampedArray(d*f*4);for(let _=u;_<=u+f;_++)for(let y=l;y<=l+d;y++){const b=((_-u)*d+y-l)*4,v=(_*c+y)*4;m[b]=a[v],m[b+1]=a[v+1],m[b+2]=a[v+2],m[b+3]=a[v+3]}return new ImageData(m,d,f)}}function i1(s,t,e,n){const{data:r,width:i,height:o}=s;let a=t;a>Math.floor(i/2)&&(a=Math.floor(i/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const c=new Uint8ClampedArray(r.length);for(let l=0;l<o;l++)for(let u=0;u<i;u++){const d=(l*i+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>i-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(i-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(i-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(c[d]=255,c[d+1]=255,c[d+2]=255,c[d+3]=n||e.toUpperCase()==="PNG"?0:255):(c[d]=r[d],c[d+1]=r[d+1],c[d+2]=r[d+2],c[d+3]=n||e.toUpperCase()==="PNG"?r[d+3]:255)}return new ImageData(c,i,o)}function o1(s,t,e,n,r,i=1e4){const o=new Image;o.src=s;const a=document.createElement("canvas"),c=a.getContext("2d");return a.width=i,a.height=i,c.drawImage(o,0,0,t,e,0,0,n,r),c.getImageData(0,0,n,r)}function a1(s,t){const{data:e,width:n,height:r}=s,i=new Uint8ClampedArray(e.length);for(let a=0;a<r;a++)for(let c=0;c<n;c++){const h=(a*n+c)*4;i[h]=Math.max(Math.min(e[h]+t,255),0),i[h+1]=Math.max(Math.min(e[h+1]+t,255),0),i[h+2]=Math.max(Math.min(e[h+2]+t,255),0),i[h+3]=e[h+3]}return new ImageData(i,n,r)}function c1(s,t,e=!1){const{data:n,width:r,height:i}=s,o=new Uint8ClampedArray(n.length);for(let c=0;c<i;c++)for(let h=0;h<r;h++){const l=(c*r+h)*4;n[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=n[l],o[l+1]=n[l+1],o[l+2]=n[l+2]);let u=n[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),o[l+3]=u}return new ImageData(o,r,i)}function h1(s,t,e,n){const{data:r,width:i,height:o}=s,{data:a,width:c,height:h}=t;let l=e,u=n;e+h>o&&(l=o-h),n+c>i&&(u=i-c);const d=new Uint8ClampedArray(r.length);for(let m=0;m<o;m++)for(let p=0;p<i;p++){const _=(m*i+p)*4;if(p<u||p>u+c||m<=l||m>=l+h)d[_]=r[_],d[_+1]=r[_+1],d[_+2]=r[_+2],d[_+3]=r[_+3];else{const y=(m*i+p-((l+1)*i+(m-(l+1))*(i-c))+c-u-1)*4,b=[a[y],a[y+1],a[y+2],a[y+3]],v=[r[_],r[_+1],r[_+2],r[_+3]],w=Bl(b,v);d[_]=w[0],d[_+1]=w[1],d[_+2]=w[2],d[_+3]=w[3]}}return new ImageData(d,i,o)}function l1(s,t,e,n,r,i=10){const{data:o,width:a,height:c}=s;let h=r,l=n,u=t,d=e;h<0?h=0:h>a&&(h=a),l<0?l=0:l>c&&(l=c),u<1?u=1:u>a&&(u=a),d<1?d=1:d>c&&(d=c),h+u>a&&(u=a-h),l+d>c&&(d=c-l);const f=new Uint8ClampedArray(o.length);for(let p=0;p<c;p++)for(let _=0;_<a;_++){const y=(p*a+_)*4;if(_>=h&&_<=h+u&&p>=l&&p<=l+d){const b=Math.floor((_-h)/i),v=Math.floor((p-l)/i);let w=Math.floor(i*(b+1)-i/2+h),E=Math.floor(i*(v+1)-i/2+l);w>a-1&&(w=a-1),E>c-1&&(E=c-1);const C=(E*a+w)*4;f[y]=o[C],f[y+1]=o[C+1],f[y+2]=o[C+2],f[y+3]=o[C+3]}else f[y]=o[y],f[y+1]=o[y+1],f[y+2]=o[y+2],f[y+3]=o[y+3]}return new ImageData(f,a,c)}function u1(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:n,width:r,height:i}=s,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:c,changeIntoColor:h}=e;for(let u=0;u<i;u++)for(let d=0;d<r;d++){const f=(u*r+d)*4,m=o[f],p=o[f+1],_=o[f+2],y=o[f+3];m===c.r&&p===c.g&&_===c.b&&y===c.a&&h.a!==0?(a[f]=h.r,a[f+1]=h.g,a[f+2]=h.b,a[f+3]=h.a):(a[f]=n[f],a[f+1]=n[f+1],a[f+2]=n[f+2],a[f+3]=n[f+3])}return new ImageData(a,r,i)}return s}function Fl(s,t){const{data:e,width:n,height:r}=s,i=new Uint8ClampedArray(e.length);for(let a=0;a<r;a++)for(let c=0;c<n;c++){const h=(a*n+c)*4;for(let l=0;l<3;l++){const u=h+l;c===0||c===n-1||a===0||a===r-1?i[u]=e[u]:i[u]=t[0]*e[u-n*4-4]+t[1]*e[u-n*4]+t[2]*e[u-n*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+n*4-4]+t[7]*e[u+n*4]+t[8]*e[u+n*4+4]}i[h+3]=e[h+3]}return new ImageData(i,n,r)}function Bl(s,t){if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const r=e/255,i=n/255,o=Math.max(Math.min(Math.floor(s[0]*r+t[0]*i*(1-r)),255),0),a=Math.max(Math.min(Math.floor(s[1]*r+t[1]*i*(1-r)),255),0),c=Math.max(Math.min(Math.floor(s[2]*r+t[2]*i*(1-r)),255),0),h=Math.max(Math.min(Math.floor((r+i*(1-r))*255),255),0);return[o,a,c,h]}}return[255,255,255,255]}const Mo=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let r=0;r<n;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},Ul=function(){let s=0,t=0,e=0,n="";const r=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},i=function(o){n+=String.fromCharCode(r(o&63))};return{writeByte(o){for(s=s<<8|o&255,t+=8,e+=1;t>=6;)i(s>>>t-6),t-=6},flush(){if(t>0&&(i(s<<6-t),s=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}},$l=function(s,t,e){const n=new Array(s*s),r=function(a){const c=a;let h=0,l=0;return{write(u,d){if(u>>>d)throw new Error("length over");for(;h+d>=8;)c.writeByte(255&(u<<h|l)),d-=8-h,u>>>=8-h,l=0,h=0;l=u<<h|l,h=h+d},flush(){h>0&&c.writeByte(l)}}},i=function(a){const c=1<<a,h=(1<<a)+1;let l=a+1;const u=o();for(let _=0;_<c;_++)u.add(String.fromCharCode(_));u.add(String.fromCharCode(c)),u.add(String.fromCharCode(h));const d=Mo(),f=r(d);f.write(c,l);let m=0,p=String.fromCharCode(n[m]);for(m+=1;m<n.length;){const _=String.fromCharCode(n[m]);m+=1,u.contains(p+_)?p=p+_:(f.write(u.indexOf(p),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(p+_)),p=_)}return f.write(u.indexOf(p),l),f.write(h,l),f.flush(),d.toByteArray()},o=function(){const a={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);a[h]=c,c+=1},size(){return c},indexOf(h){return a[h]},contains(h){return typeof a[h]<"u"}}};return{setPixel(a,c,h){n[c*s+a]=h},write(a){a.writeString("GIF87a"),a.writeShort(s),a.writeShort(s),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(Mn("0x"+t[1]+t[2])),a.writeByte(Mn("0x"+t[3]+t[4])),a.writeByte(Mn("0x"+t[5]+t[6])),a.writeByte(Mn("0x"+e[1]+e[2])),a.writeByte(Mn("0x"+e[3]+e[4])),a.writeByte(Mn("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(s),a.writeShort(s),a.writeByte(0);const c=2,h=i(c);a.writeByte(c);let l=0;for(;h.length-l>255;)a.writeByte(255),a.writeBytes(h,l,255),l+=255;a.writeByte(h.length-l),a.writeBytes(h,l,h.length-l),a.writeByte(0),a.writeString(";")}}},Yl=function(s,t,e,n){const r=$l(s,t,e);for(let h=0;h<s;h++)for(let l=0;l<s;l++)r.setPixel(l,h,n(l,h));const i=Mo();r.write(i);const o=Ul(),a=i.toByteArray();for(let h=0,l=a.length;h<l;h++)o.writeByte(a[h]);o.flush();let c="";return c+="data:image/gif;base64,",c+=o,c},ne={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},cs={M:0,L:1,H:2,Q:3},Je={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Bt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return Bt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return Bt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)Bt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)Bt.EXP_TABLE[s]=Bt.EXP_TABLE[s-4]^Bt.EXP_TABLE[s-5]^Bt.EXP_TABLE[s-6]^Bt.EXP_TABLE[s-8];for(let s=0;s<255;s++)Bt.LOG_TABLE[Bt.EXP_TABLE[s]]=s;const St={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;St.getBCHDigit(t)-St.getBCHDigit(St.G15)>=0;)t^=St.G15<<St.getBCHDigit(t)-St.getBCHDigit(St.G15);return(s<<10|t)^St.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;St.getBCHDigit(t)-St.getBCHDigit(St.G18)>=0;)t^=St.G18<<St.getBCHDigit(t)-St.getBCHDigit(St.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return St.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case Je.PATTERN000:return(t+e)%2==0;case Je.PATTERN001:return t%2==0;case Je.PATTERN010:return e%3==0;case Je.PATTERN011:return(t+e)%3==0;case Je.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Je.PATTERN101:return t*e%2+t*e%3==0;case Je.PATTERN110:return(t*e%2+t*e%3)%2==0;case Je.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new Fn([1],0);for(let e=0;e<s;e++)t=t.multiply(new Fn([1,Bt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case ne.MODE_NUMBER:return 10;case ne.MODE_ALPHA_NUM:return 9;case ne.MODE_8BIT_BYTE:return 8;case ne.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case ne.MODE_NUMBER:return 12;case ne.MODE_ALPHA_NUM:return 11;case ne.MODE_8BIT_BYTE:return 16;case ne.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case ne.MODE_NUMBER:return 14;case ne.MODE_ALPHA_NUM:return 13;case ne.MODE_8BIT_BYTE:return 16;case ne.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let i=0;i<t;i++)for(let o=0;o<t;o++){let a=0;const c=s.isDark(i,o);for(let h=-1;h<=1;h++)if(!(i+h<0||t<=i+h))for(let l=-1;l<=1;l++)o+l<0||t<=o+l||h==0&&l==0||c==s.isDark(i+h,o+l)&&a++;a>5&&(e+=3+a-5)}for(let i=0;i<t-1;i++)for(let o=0;o<t-1;o++){let a=0;s.isDark(i,o)&&a++,s.isDark(i+1,o)&&a++,s.isDark(i,o+1)&&a++,s.isDark(i+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let i=0;i<t;i++)for(let o=0;o<t-6;o++)s.isDark(i,o)&&!s.isDark(i,o+1)&&s.isDark(i,o+2)&&s.isDark(i,o+3)&&s.isDark(i,o+4)&&!s.isDark(i,o+5)&&s.isDark(i,o+6)&&(e+=40);for(let i=0;i<t;i++)for(let o=0;o<t-6;o++)s.isDark(o,i)&&!s.isDark(o+1,i)&&s.isDark(o+2,i)&&s.isDark(o+3,i)&&s.isDark(o+4,i)&&!s.isDark(o+5,i)&&s.isDark(o+6,i)&&(e+=40);let n=0;for(let i=0;i<t;i++)for(let o=0;o<t;o++)s.isDark(o,i)&&n++;const r=Math.abs(100*n/t/t-50)/5;return e+=r*10,e}};class Fn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let r=0;r<t.length-n;r++)this.num[r]=t[r+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let r=0;r<t.getLength();r++)e[n+r]^=Bt.gexp(Bt.glog(this.get(n))+Bt.glog(t.get(r)));return new Fn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Bt.glog(this.get(0))-Bt.glog(t.get(0)),n=new Array(this.getLength());for(let r=0;r<this.getLength();r++)n[r]=this.get(r);for(let r=0;r<t.getLength();r++)n[r]^=Bt.gexp(Bt.glog(t.get(r))+e);return new Fn(n,0).mod(t)}}class Le{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 n=Le.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=n.length/3,i=[];for(let o=0;o<r;o++){const a=n[o*3+0],c=n[o*3+1],h=n[o*3+2];for(let l=0;l<a;l++)i.push(new Le(c,h))}return i}static getRsBlockTable(t,e){switch(e){case cs.L:return Le.RS_BLOCK_TABLE[(t-1)*4+0];case cs.M:return Le.RS_BLOCK_TABLE[(t-1)*4+1];case cs.Q:return Le.RS_BLOCK_TABLE[(t-1)*4+2];case cs.H:return Le.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class jl{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 n=0;n<e;n++)this.putBit((t>>>e-n-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 f1{mode;data;constructor(t){this.mode=ne.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class Ke{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=cs[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new f1(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=Le.getRSBlocks(t,this.errorCorrectLevel),n=new jl;let r=0;for(let i=0;i<e.length;i++)r+=e[i].dataCount;for(let i=0;i<this.dataList.length;i++){const o=this.dataList[i];n.put(o.mode,4),n.put(o.getLength(),St.getLengthInBits(o.mode,t)),o.write(n)}if(n.getLengthInBits()<=r*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Ke.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const r=St.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e}createMovieClip(t,e,n){const r=t.createEmptyMovieClip(e,n),i=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*i;for(let c=0;c<this.modules[o].length;c++){const h=c*i;this.modules[o][c]&&(r.beginFill(0,100),r.moveTo(h,a),r.lineTo(h+i,a),r.lineTo(h+i,a+i),r.lineTo(h,a+i),r.endFill())}}return r}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=St.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const r=t[e],i=t[n];if(this.modules[r][i]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[r+o][i+a]=!0:this.modules[r+o][i+a]=!1}}setupTypeNumber(t){const e=St.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,r=St.getBCHTypeInfo(n);for(let i=0;i<15;i++){const o=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(let i=0;i<15;i++){const o=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,r=this.moduleCount-1,i=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let c=0;c<2;c++)if(this.modules[r][a-c]==null){let h=!1;o<t.length&&(h=(t[o]>>>i&1)==1),St.getMask(e,r,a-c)&&(h=!h),this.modules[r][a-c]=h,i--,i==-1&&(o++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}static createData(t,e,n){const r=Le.getRSBlocks(t,e),i=new jl;for(let a=0;a<n.length;a++){const c=n[a];i.put(c.mode,4),i.put(c.getLength(),St.getLengthInBits(c.mode,t)),c.write(i)}let o=0;for(let a=0;a<r.length;a++)o+=r[a].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(Ke.PAD0,8),i.getLengthInBits()>=o*8));)i.put(Ke.PAD1,8);return Ke.createBytes(i,r)}static createBytes(t,e){let n=0,r=0,i=0;const o=new Array(e.length),a=new Array(e.length);for(let u=0;u<e.length;u++){const d=e[u].dataCount,f=e[u].totalCount-d;r=Math.max(r,d),i=Math.max(i,f),o[u]=new Array(d);for(let y=0;y<o[u].length;y++)o[u][y]=255&t.buffer[y+n];n+=d;const m=St.getErrorCorrectPolynomial(f),_=new Fn(o[u],m.getLength()-1).mod(m);a[u]=new Array(m.getLength()-1);for(let y=0;y<a[u].length;y++){const b=y+_.getLength()-a[u].length;a[u][y]=b>=0?_.get(b):0}}let c=0;for(let u=0;u<e.length;u++)c+=e[u].totalCount;const h=new Array(c);let l=0;for(let u=0;u<r;u++)for(let d=0;d<e.length;d++)u<o[d].length&&(h[l++]=o[d][u]);for(let u=0;u<i;u++)for(let d=0;d<e.length;d++)u<a[d].length&&(h[l++]=a[d][u]);return h}}const Xl=Math.ceil,hs=Math.floor,Gl=Math.round;function d1(s,t){const e=Gc(s),n=t?.ecc||"H",r=t?.size||256,i=-1,o=t?.padding||0,a=t?.color||"#000000",c=t?.background||"#ffffff",h=new Ke(i,n);h.addData(e),h.make();const l=h.getModuleCount(),u=(r-o*2)/l,d=o,f=r-o;return Yl(r,a,c,function(m,p){if(d<=m&&m<f&&d<=p&&p<f){const _=hs((m-d)/u),y=hs((p-d)/u);return h.isDark(y,_)?0:1}else return 1})}function m1(s,t){const e=t.x||0,n=t.y||0,r=Gc(s),i=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?hs(t.size):256,c=t.padding||0,h=-1,l=t.color||"#000000",u=t.background||"#ffffff",d=new Ke(h,o);d.addData(r),d.make();const f=d.getModuleCount(),m=(a-c*2)/f;i.fillStyle=u,i.fillRect(e,n,a,a);for(let p=0;p<f;p++)for(let _=0;_<f;_++){const y=Xl((_+1)*m)-hs(_*m),b=Xl((p+1)*m)-hs(p*m);i.fillStyle=d.isDark(p,_)?l:u,i.fillRect(e+Gl(_*m)+c,n+Gl(p*m)+c,y,b)}}function ut(s){return s*Math.PI/180}function Ut(s){return s*180/Math.PI}function Bn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Ze(s,t,e,n){return Bn(e-s,n-t)}function se(s,t,e,n){let r=Math.atan2(n-t,e-s);return r<0&&(r+=Math.PI*2),r}function Qe(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function p1(s,t,e){if(typeof e=="number"){const n=Bn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=Bn(s,t);return{x:s/=n,y:t/=n}}}function g1(s,t,e,n,r=10){if(Math.abs(e-s)<r&&Math.abs(n-t)<r)return"no";const i=Ut(se(s,t,e,n));return i>=-135&&i<=-45?"up":i>45&&i<135?"down":i>=135&&i<=180||i>=-180&&i<-135?"left":"right"}class Cr{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 Cr(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,n=this.y;return this.x=t.m11*e+t.m21*n+t.m31,this.y=t.m12*e+t.m22*n+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=K(this.x,t.x,e.x),this.y=K(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=K(this.x,t,e),this.y=K(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(K(n,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 n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Vl.copy(this).projectOnVector(t),this.sub(Vl)}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 n=this.dot(t)/e;return Math.acos(K(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,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}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ve{x=0;y=0;z=0;constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t=0,e=0,n=0){return this.x=t,this.y=e,this.z=n,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 ve(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}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.value;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.value,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.value;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,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=K(this.x,t.x,e.x),this.y=K(this.y,t.y,e.y),this.z=K(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=K(this.x,t,e),this.y=K(this.y,t,e),this.z=K(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(K(n,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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,c=e.z;return this.x=r*c-i*a,this.y=i*o-n*c,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Io.copy(this).projectOnVector(t),this.sub(Io)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Io.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 n=this.dot(t)/e;return Math.acos(K(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}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(),n=this.setFromMatrix4Column(t,1).length(),r=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}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}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,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class ko{x=0;y=0;z=0;w=1;constructor(t=0,e=0,n=0,r=1){this.x=t,this.y=e,this.z=n,this.w=r}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,n=0,r=1){return this.x=t,this.y=e,this.z=n,this.w=r,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 ko(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,n=this.y,r=this.z,i=this.w,o=t.value;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,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)}setAxisAngleFromRotationMatrix4(t){let e,n,r,i;const c=t.value,h=c[0],l=c[4],u=c[8],d=c[1],f=c[5],m=c[9],p=c[2],_=c[6],y=c[10];if(Math.abs(l-d)<.01&&Math.abs(u-p)<.01&&Math.abs(m-_)<.01){if(Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(m+_)<.1&&Math.abs(h+f+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const v=(h+1)/2,w=(f+1)/2,E=(y+1)/2,C=(l+d)/4,D=(u+p)/4,$=(m+_)/4;return v>w&&v>E?v<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(v),r=C/n,i=D/n):w>E?w<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(w),n=C/r,i=$/r):E<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(E),n=D/i,r=$/i),this.set(n,r,i,e),this}let b=Math.sqrt((_-m)*(_-m)+(u-p)*(u-p)+(d-l)*(d-l));return Math.abs(b)<.001&&(b=1),this.x=(_-m)/b,this.y=(u-p)/b,this.z=(d-l)/b,this.w=Math.acos((h+f+y-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=K(this.x,t.x,e.x),this.y=K(this.y,t.y,e.y),this.z=K(this.z,t.z,e.z),this.w=K(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=K(this.x,t,e),this.y=K(this.y,t,e),this.z=K(this.z,t,e),this.w=K(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(K(n,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 n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,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}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 Vl=new Cr,Io=new ve,ql=y1("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 y1(s,t=10){const e={},n=s.split(",");for(let r=0;r<n.length;r+=2){const i="&"+n[r+1]+";",o=parseInt(n[r],t);e[i]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Ht(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Er(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function b1(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function w1(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const ls={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 Tr=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);i&&(n.setAttribute("stop-color",Ht("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}},Do=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Hl=class ic{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=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=n),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(ls);for(let e=0,n=t.length;e<n;e++){const r=t[e];this[r]=ls[r].canvas}}__getStyleState(){const t={},e=Object.keys(ls);for(let n=0,r=e.length;n<r;n++){const i=e[n];t[i]=this[i]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const i=e[n];this[i]=t[i]}}__createElement(t,e={},n=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),i=Object.keys(e);n&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let o=0;o<i.length;o++){const a=i[o];r.setAttribute(a,e[a])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(i=>{i.setAttribute(t,"")}));const r=Object.keys(ls);for(let i=0;i<r.length;i++){const o=ls[r[i]],a=this[r[i]];if(o.apply){if(a instanceof Do){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Ht("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Tr)e.setAttribute(o.apply,Ht("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(h){e.setAttribute(o.svgAttr,Ht("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}else{let c=o.svgAttr;if(r[i]==="globalAlpha"&&(c=t+"-"+o.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const r=Object.keys(ql);for(let i=0,o=r.length;i<o;i++){const a=r[i],c=ql[a],h=new RegExp(a,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,r,i,o){this.__addTransform(Ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:r,e:i,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Ht("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,r,i,o){this.__currentPosition={x:i,y:o},this.__addPathCommand(Ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:r,x:i,y:o}))}quadraticCurveTo(t,e,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(Ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,r,i){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(i<0)throw new Error("IndexSizeError: The radius provided ("+i+") is negative.");if(o===t&&a===e||t===n&&e===r||i===0){this.lineTo(t,e);return}const c=this.normalize([o-t,a-e]),h=this.normalize([n-t,r-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],u=Math.acos(Math.abs(l)),d=this.normalize([c[0]+h[0],c[1]+h[1]]),f=i/Math.sin(u/2),m=t+f*d[0],p=e+f*d[1],_=[-c[1],c[0]],y=[h[1],-h[0]],b=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},v=b(_),w=b(y);this.lineTo(m+_[0]*i,p+_[1]*i),this.arc(m,p,i,v,w)}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,n,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,r){const i=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,r){const i=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],r=n.childNodes;for(let i=r.length-1;i>=0;i--)r[i]&&n.removeChild(r[i]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,r){if(t===0&&e===0&&n===this.width&&r===this.height){this.__clearCanvas();return}const i=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:r,fill:"#FFFFFF"},!0);i.appendChild(o)}createLinearGradient(t,e,n,r){const i=this.__createElement("linearGradient",{id:Er(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(i),new Tr(i,this)}createRadialGradient(t,e,n,r,i,o){const a=this.__createElement("radialGradient",{id:Er(this.__ids),cx:r+"px",cy:i+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Tr(a,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),n={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"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,r){const i=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":i.family,"font-size":i.size,"font-style":i.style,"font-weight":i.weight,"text-decoration":i.decoration,x:e,y:n,"text-anchor":b1(this.textAlign),"dominant-baseline":w1(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(r),o.appendChild(this.__wrapTextLink(i,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,r,i,o){if(r===i)return;r=r%(2*Math.PI),i=i%(2*Math.PI),r===i&&(i=(i+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(i),c=e+n*Math.sin(i),h=t+n*Math.cos(r),l=e+n*Math.sin(r),u=o?0:1;let d=0,f=i-r;f<0&&(f+=2*Math.PI),o?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(Ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Er(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Ht("url(#{id})",{id:n})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],n,r,i,o,a=0,c=0,h,l,u,d,f,m,p,_;if(t.length===3)n=t[1],r=t[2],h=e.width,l=e.height,i=h,o=l;else if(t.length===5)n=t[1],r=t[2],i=t[3],o=t[4],h=e.width,l=e.height;else if(t.length===9)a=t[1],c=t[2],h=t[3],l=t[4],n=t[5],r=t[6],i=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const b="translate("+n+", "+r+")";if(e instanceof ic){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)_=d.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let w;v?w=v+" "+b:w=b,f.setAttribute("transform",w),y.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",i),m.setAttribute("height",o),m.setAttribute("preserveAspectRatio","none"),(a||c||h!==e.width||l!==e.height)&&(p=this.__document.createElement("canvas"),p.width=i,p.height=o,p.getContext("2d")?.drawImage(e,a,c,h,l,0,0,i,o),e=p),m.setAttribute("transform",b),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(m))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=Er(this.__ids);let i;return n.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(i=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(i),this.__SVGdefs.appendChild(n)):t instanceof ic&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Do(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Oo=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,r=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),r&&(this.customContext=new Hl({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,r){return this.context.fillRect(t,e,n,r),this.customContext&&this.customContext.fillRect(t,e,n,r),this}fillText(t,e,n,r){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,r),this.customContext&&this.customContext.fillText(t,e,n),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,n,r){return this.context.strokeText(t,e,n,r),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,r){return this.context.strokeRect(t,e,n,r),this.customContext&&this.customContext.strokeRect(t,e,n,r),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,n,r),this.customContext&&this.customContext.clearRect(t,e,n,r),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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}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,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,r=0){return this.translate(n,r),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-r),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,n,r,i,o){return this.context.arc(t,e,n,r,i,o),this.customContext&&this.customContext.arc(t,e,n,r,i,o?-1:1),this.currentPath2D.arc(t,e,n,r,i,o),this}arcTo(t,e,n,r,i){return this.context.arcTo(t,e,n,r,i),this.customContext&&this.customContext.arcTo(t,e,n,r,i),this.currentPath2D.arcTo(t,e,n,r,i),this}ellipse(t,e,n,r,i,o,a,c){return this.context.ellipse(t,e,n,r,i,o,a,c),this.currentPath2D.ellipse(t,e,n,r,i,o,a,c),this}quadraticCurveTo(t,e,n,r){return this.context.quadraticCurveTo(t,e,n,r),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,r),this.currentPath2D.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,o){return this.context.bezierCurveTo(t,e,n,r,i,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,r,i,o),this.currentPath2D.bezierCurveTo(t,e,n,r,i,o),this}rect(t,e,n,r){return this.context.rect(t,e,n,r),this.customContext&&this.customContext.rect(t,e,n,r),this.currentPath2D.rect(t,e,n,r),this}createLinearGradient(t,e,n,r,i){const o=this.context.createLinearGradient(t,e,n,r);return i&&Object.entries(i).forEach(([a,c])=>{o.addColorStop(parseFloat(a),c)}),o}createRadialGradient(t,e,n,r,i,o,a){const c=this.context.createRadialGradient(t,e,n,r,i,o);return a&&Object.entries(a).forEach(([h,l])=>{c.addColorStop(parseFloat(h),l)}),c}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],r=e[1];this.context.drawImage(t,n,r)}else if(e.length===4){const n=e[0],r=e[1],i=e[2],o=e[3];this.context.drawImage(t,n,r,i,o)}else if(e.length===8){const n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,n,r,i,o,a,c,h,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,n=this.canvas.width,r=this.canvas.height,i){return this.context.getImageData(t,e,n,r,i)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}},Ro=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=se(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),r=Math.max(this.x,this.toX),i=Math.max(this.y,this.toY);return{x:e,y:n,width:r-e,height:i-n}}else{const e=Math.sin(t),n=Math.cos(t),r=n*this.x-e*this.y,i=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(r,i),y:Math.min(o,a),width:Math.max(r,i)-Math.min(r,i),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,r=t.toX,i=t.toY,o=this.toX-e,a=t.x-r;if(!o&&!a)return null;const c=(this.toY-n)/o,h=(t.y-i)/a;if(o){if(!a)return{x:r,y:c*(r-e)+n}}else return{x:e,y:h*(e-r)+i};const l=(-h*r+i+c*e-n)/(c-h),u=c*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const v1=class extends Ro{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,n,r,i,o,a,c]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,r,i,o,a,c,!this.sweepFlag)}convert(t,e,n,r,i,o,a,c,h){const l=a/180*Math.PI,u=(t-n)/2,d=(e-r)/2,f=Math.cos(l)*u+Math.sin(l)*d,m=-Math.sin(l)*u+Math.cos(l)*d,p=f*f/(i*i)+m*m/(o*o);if(p>1){const V=Math.sqrt(p);throw i=V*i,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${i}/${o}.`)}const _=Math.sqrt((i*i*o*o-i*i*m*m-o*o*f*f)/(i*i*m*m+o*o*f*f)),y=c!=h?1:-1,b=y*_*i*m/o,v=y*_*-o*f/i,w=(t+n)/2,E=(e+r)/2,C=Math.cos(l)*b-Math.sin(l)*v+w,D=Math.sin(l)*b+Math.cos(l)*v+E,$=(V,q,ft,pt)=>(V*pt>=q*ft?1:-1)*Math.acos((V*ft+q*pt)/(Math.sqrt(V*V+q*q)*Math.sqrt(ft*ft+pt*pt))),O=$(1,0,t-C,e-D)-l,U=$(t-C,e-D,n-C,r-D);return[C,D,i,o,l,O,O+U]}},x1=class extends Ro{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,r,i,o;for(let h=0;h<2;++h)n=h==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,r=h==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,i=h==0?this.x:this.y,Math.abs(n)>1e-12&&(o=-r/(2*n),0<o&&o<1&&[t,e][h].push(n*o*o+r*o+i));const a={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},c={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:a.x,y:a.y,width:c.x-a.x,height:c.y-a.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}}},tn=class zs extends Ro{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),n=this.x-this.c1x,r=(-e+Math.sqrt(e*e-4*t*n))/2/t,i=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let c;const h=[];Math.abs(r)>1e12&&(r=.5),Math.abs(i)>1e12&&(i=.5),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.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),n=this.y-this.c1y,r=(-e+Math.sqrt(e*e-4*t*n))/2/t,i=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(r)>1e12&&(r=.5),Math.abs(i)>1e12&&(i=.5),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y}));const l=[],u=h.length;for(let m=0;m<u;m++){for(let p=m+1;p<u;p++)h[m].X===h[p].X&&h[m].Y===h[p].Y&&(p=++m);l.push({X:h[m].X,Y:h[m].Y})}const d={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};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,n,r,i){const o=-3*e+9*n-9*r+3*i,a=t*o+6*e-12*n+6*r;return t*a-3*e+3*n}static bezlen(t,e,n,r,i,o,a,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/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 m=0;m<12;m++){const p=l*u[m]+l,_=this.base3(p,t,n,i,a),y=this.base3(p,e,r,o,c);f+=d[m]*Math.sqrt(_*_+y*y)}return l*f}length(t=1){return zs.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,r=this.c1x,i=this.c1y,o=this.c2x,a=this.c2y,c=this.toX,h=this.toY;if(t<0||zs.bezlen(e,n,r,i,o,a,c,h)<t)return 0;const l=1;let u=l/2,d=l-u,f=zs.bezlen(e,n,r,i,o,a,c,h,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=zs.bezlen(e,n,r,i,o,a,c,h,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,r=Math.pow(n,3),i=Math.pow(n,2),o=e*e,a=o*e,c=r*this.x+i*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,h=r*this.y+i*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),m=n*this.x+e*this.c1x,p=n*this.y+e*this.c1y,_=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,b=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:c,y:h,m:{x:l,y:u},n:{x:d,y:f},start:{x:m,y:p},end:{x:_,y},alpha:b}}},us=Math.PI*2;function Wl(s,t,e,n){const r=s*n-t*e<0?-1:1;let i=s*e+t*n;return i>1&&(i=1),i<-1&&(i=-1),r*Math.acos(i)}function S1(s,t,e,n,r,i,o,a,c,h){const l=h*(s-e)/2+c*(t-n)/2,u=-c*(s-e)/2+h*(t-n)/2,d=o*o,f=a*a,m=l*l,p=u*u;let _=d*f-d*p-f*m;_<0&&(_=0),_/=d*p+f*m,_=Math.sqrt(_)*(r===i?-1:1);const y=_*o/a*u,b=_*-a/o*l,v=h*y-c*b+(s+e)/2,w=c*y+h*b+(t+n)/2,E=(l-y)/o,C=(u-b)/a,D=(-l-y)/o,$=(-u-b)/a,O=Wl(1,0,E,C);let U=Wl(E,C,D,$);return i===0&&U>0&&(U-=us),i===1&&U<0&&(U+=us),[v,w,O,U]}function _1(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),r=Math.sin(s),i=Math.cos(s+t),o=Math.sin(s+t);return[n,r,n-r*e,r+n*e,i+o*e,o-i*e,i,o]}function Jl(s,t,e,n,r,i,o,a,c){const h=Math.sin(c*us/360),l=Math.cos(c*us/360),u=l*(s-e)/2+h*(t-n)/2,d=-h*(s-e)/2+l*(t-n)/2;if(u===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const m=S1(s,t,e,n,r,i,o,a,h,l),p=[];let _=m[2],y=m[3];const b=Math.max(Math.ceil(Math.abs(y)/(us/4)),1);y/=b;for(let v=0;v<b;v++)p.push(_1(_,y)),_+=y;return p.map(v=>{for(let w=0;w<v.length;w+=2){let E=v[w+0],C=v[w+1];E*=o,C*=a;const D=l*E-h*C,$=h*E+l*C;v[w+0]=D+m[0],v[w+1]=$+m[1]}return v})}function Lo(s,t,e,n,r,i){return[s/3+2/3*e,t/3+2/3*n,r/3+2/3*e,i/3+2/3*n,r,i]}function fs(s,t,e,n){return[s,t,e,n,e,n]}const ds={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class gn{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&Ne(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Bi()})}static downloadFromSVGElement(t,e="shape"){return Dr(ao(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Dr(Pi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return oo(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 gn.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,r,i)=>{let o=r.toLowerCase();const a=Ii(i);for(o=="m"&&a.length>ds[o]&&(e.push([r,...a.splice(0,ds[o])]),o="l",r=r=="m"?"l":"L");a.length;){if(a.length<ds[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${r} } args:{ ${a} }`);e.push([r,...a.splice(0,ds[o])])}return o=="z"&&e.push([r]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,r=0,i=0;return t.map(function(o){const a=o[0],c=a.toUpperCase();if(a!=c)switch(o[0]=c,a){case"a":o[6]+=r,o[7]+=i;break;case"v":o[1]+=i;break;case"h":o[1]+=r;break;default:for(let h=1;h<o.length;)o[h++]+=r,o[h++]+=i}switch(c){case"Z":r=e,i=n;break;case"H":r=o[1];break;case"V":i=o[1];break;case"M":r=e=o[1],i=n=o[2];break;default:r=o[o.length-2],i=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,n=0,r=0,i=0;return t.map(function(o){const a=o[0],c=a.toLowerCase();if(a!=c)switch(o[0]=c,a){case"A":o[6]-=r,o[7]-=i;break;case"V":o[1]-=i;break;case"H":o[1]-=r;break;default:for(let h=1;h<o.length;)o[h++]-=r,o[h++]-=i}switch(c){case"z":r=e,i=n;break;case"h":r+=o[1];break;case"v":i+=o[1];break;case"m":r+=o[1],i+=o[2],e+=o[1],n+=o[2];break;default:r+=o[o.length-2],i+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let n=0,r=0,i=0,o=0,a=0,c=0,h=0,l=0,u;for(let d=0,f=t.length;d<f;d++){let m=t[d];const p=m[0];switch(p){case"M":n=m[1],r=m[2];break;case"A":const _=Jl(i,o,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!_.length)continue;_.forEach((v,w)=>{const[E,C,D,$,O,U,V,q]=v;m=["C",D,$,O,U,V,q],w<_.length-1&&e.push(m)});break;case"S":let y=i,b=o;(u=="C"||u=="S")&&(y+=y-h,b+=b-l),m=["C",y,b,m[1],m[2],m[3],m[4]];break;case"T":u=="Q"||u=="T"?(a=i*2-a,c=o*2-c):(a=i,c=o),m=["C",...Lo(i,o,a,c,m[1],m[2])];break;case"Q":a=m[1],c=m[2],m=["C",...Lo(i,o,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...fs(i,o,m[1],m[2])];break;case"H":m=["C",...fs(i,o,m[1],o)];break;case"V":m=["C",...fs(i,o,i,m[1])];break;case"Z":m=["C",...fs(i,o,n,r)];break}u=p,i=m[m.length-2],o=m[m.length-1],m.length>4?(h=m[m.length-4],l=m[m.length-3]):(h=i,l=o),e.push(m)}return e}static catmullRom2bezier(t){const e=[];for(let n=0,r=t.length;r-2>n;n+=2){let i;n==0?i=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:r-4==n?i=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:i=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const o=[{x:i[1].x,y:i[1].y},{x:(-i[0].x+6*i[1].x+i[2].x)/6,y:(-i[0].y+6*i[1].y+i[2].y)/6},{x:(i[1].x+6*i[2].x-i[3].x)/6,y:(i[1].y+6*i[2].y-i[3].y)/6},{x:i[2].x,y:i[2].y}];e.push(["C",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let n=["L",0,0],r;for(let i=0,o=t.length;i<o;i++){const a=t[i];switch(a[0]){case"M":n=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(n);break;case"H":r=e[e.length-1]||["L",0,0],e.push(["L",a[1],r[r.length-1]]);break;case"V":r=e[e.length-1]||["L",0,0],e.push(["L",r[r.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,r=0,i=0;for(let o=0,a=t.length;o<a;o++){const c=t[o],h=e[c[0]];h&&(c[0]=h.to,n&&(n[0]===h.to?(r=2*Number(n[h.x+2])-Number(n[h.x]),i=2*Number(n[h.x+3])-Number(n[h.x+1])):(r=Number(n[n.length-2]),i=Number(n[n.length-1]))),c.splice(1,0,r,i)),n=c}return t}}let C1=class Xe{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(gn.parseSVGPath(t),e):t instanceof Xe?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=gn.normalizeSVGPath(gn.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let r=!1;for(let i=0,o=n.length;i<o;i++){const a=n[i];if(a[0]=="M"){r||(r=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new tn({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[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(i=>{({x:i.x,y:i.y}=e.transformPoint({x:i.x,y:i.y})),{x:i.c1x,y:i.c1y}=e.transformPoint({x:i.c1x,y:i.c1y}),{x:i.c2x,y:i.c2y}=e.transformPoint({x:i.c2x,y:i.c2y}),{x:i.toX,y:i.toY}=e.transformPoint({x:i.toX,y:i.toY})}))}static fromPolymorphPoints(t){const e=new Xe;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,r=t.length;n+5<r;n+=6)e.appendLine(new tn({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new Xe;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,r=t.length;n<r;n++)e.appendLine(t[n]);return e}appendLine(t){if(t instanceof v1){Jl(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[l,u,d,f,m,p,_,y]=h;this.normalizedLines.push(new tn({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:m,c2y:p,toX:_,toY:y})),this.prevPathX=_,this.prevPathY=y});return}let e,n,r,i,o,a;t instanceof tn?(e=t.c1x,n=t.c1y,r=t.c2x,i=t.c2y,o=t.toX,a=t.toY):t instanceof x1?[e,n,r,i,o,a]=Lo(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,r,i,o,a]=fs(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new tn({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:r,c2y:i,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform(),r=[];r.push(["M",t,e]);for(let i=0,o=n.length;i<o;i++)r.push(...n[i].toSVGPathData());return r}toSVGPathD(){return gn.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:n,normalizedLines:r}=this.updateTransform();t.beginPath(),t.moveTo(e,n),r.forEach(i=>{i.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],n=[];if(t.forEach(c=>{const h=c.getBoundingClientRect();e.push(h.x,h.x+h.width),n.push(h.y,h.y+h.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const r=Math.min.apply(0,e),i=Math.min.apply(0,n),o=Math.max.apply(0,e),a=Math.max.apply(0,n);return{x:r,y:i,width:o-r,height:a-i}}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 Yt;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,n=this.startPathY;({x:e,y:n}=t.transformPoint({x:e,y:n}));const r=[];return this.normalizedLines.forEach(i=>{let o=i.x,a=i.y,c=i.c1x,h=i.c1y,l=i.c2x,u=i.c2y,d=i.toX,f=i.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:c,y:h}=t.transformPoint({x:c,y:h}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:d,y:f}=t.transformPoint({x:d,y:f}),r.push(new tn({x:o,y:a,c1x:c,c1y:h,c2x:l,c2y:u,toX:d,toY:f}))}),{startPathX:e,startPathY:n,normalizedLines:r}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,n)=>e+=n.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let n=0;const r=e.length;for(let i=0;i<r;i++){const o=e[i],a=o.length();if(n+a>=t)return o.getPointAtSegmentLength(t-n);n+=a}return e[r-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:n,normalizedLines:r}=this.updateTransform(),i=r.length;if(i===0)return{x:e,y:n};if(i===1)return r[0].interpolate(t);{let o=t*i,a=r[0];if(o--,o>1)for(let c=1;c<i&&(a=r[c],o>1);c++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}getSubpathsAtLength(t,e,n){const{startPathX:r,startPathY:i,normalizedLines:o}=t.updateTransform();let a=null,c=0;const h=new Xe;h.prevPathX=h.startPathX=r,h.prevPathY=h.startPathY=i;for(let l=0,u=o.length;l<u;l++){const d=o[l],f=d.length();if(c+f>e&&!a){const m=d.getPointAtSegmentLength(e-c);if(h.appendLine(new tn({c1x:m.start.x,c1y:m.start.y,c2x:m.m.x,c2y:m.m.y,toX:m.x,toY:m.y})),n)return h;a=h,h.appendLine(new tn({c1x:m.n.x,c1y:m.n.y,c2x:m.end.x,c2y:m.end.y,toX:d.x,toY:d.y})),c+=f;continue}c+=f,h.appendLine(d)}return h}closestPoint(t,e){const n=this.getTotalLength();let r={x:t,y:e},i=0,o=1/0,a=8;for(let h=0;h<=n;h+=a){const l=this.getPointAtLength(h),u=Math.pow(Ze(l.x,l.y,t,e),2);u<o&&(r=l,i=h,o=u)}for(a/=2;a>.5;){const h=i-a,l=this.getPointAtLength(h),u=Math.pow(Ze(l.x,l.y,t,e),2),d=i+a,f=this.getPointAtLength(d),m=Math.pow(Ze(f.x,f.y,t,e),2);h>=0&&u<o?(r=l,i=h,o=u):d<=n&&m<o?(r=f,i=d,o=m):a/=2}const c=this.getPointAtLength(i+(i===n?-.1:.1));return{point:r,rotation:i>=n?se(c.x,c.y,r.x,r.y):se(r.x,r.y,c.x,c.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform();return[t,e].concat(n.reduce((r,i)=>r.concat([i.c1x,i.c1y,i.c2x,i.c2y,i.toX,i.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let n=t[e-2],r=t[e-1],i=0;for(let o=0;o<e;o+=6)i+=Ze(t[o],t[o+1],n,r),n=t[o],r=t[o+1];return Math.floor(i)}expendFill(t){const e=this.polymorphPoints,n=e.length;let r=t-n;const i=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const c=e[a++],h=e[a++],l=e[a++],u=e[a++],d=e[a++],f=e[a++];o.push(["C",c,h,l,u,d,f]);let m=0;for(;m<i&&r>0;)o.push(["C",d,f,d,f,d,f]),r-=6,m++}return o}static mixPoints(t,e,n){const r=t.length,i=new Array(r);for(let o=0;o<r;o++)i[o]=Z(t[o]+(e[o]-t[o])*n,6);return i}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t:Math.abs(n-1)<Number.EPSILON?e:Xe.fromPolymorphPoints(Xe.mixPoints(new Xe({d:t}).polymorphPoints,new Xe({d:e}).polymorphPoints,n)).toSVGPathData()}};class ms{static _nextId=0;static nextId(){return ms._nextId++}}const X={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)},style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)},style:"cubic-bezier(0.1, 0.57, 0.1, 1)"},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)},style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"},Bounce:{In:function(s){return 1-X.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?X.Bounce.In(s*2)*.5:X.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}};function Kl(s){switch(s){case X.Quadratic.In:return X.Quadratic.Out;case X.Quadratic.Out:return X.Quadratic.In;case X.Quadratic.InOut:return X.Quadratic.InOut;case X.Cubic.In:return X.Cubic.Out;case X.Cubic.Out:return X.Cubic.In;case X.Cubic.InOut:return X.Cubic.InOut;case X.Quartic.In:return X.Quartic.Out;case X.Quartic.Out:return X.Quartic.In;case X.Quartic.InOut:return X.Quartic.InOut;case X.Quintic.In:return X.Quintic.Out;case X.Quintic.Out:return X.Quintic.In;case X.Quintic.InOut:return X.Quintic.InOut;case X.Sinusoidal.In:return X.Sinusoidal.Out;case X.Sinusoidal.Out:return X.Sinusoidal.In;case X.Sinusoidal.InOut:return X.Sinusoidal.InOut;case X.Exponential.In:return X.Exponential.Out;case X.Exponential.Out:return X.Exponential.In;case X.Exponential.InOut:return X.Exponential.InOut;case X.Circular.In:return X.Circular.Out;case X.Circular.Out:return X.Circular.In;case X.Circular.InOut:return X.Circular.InOut;case X.Elastic.In:return X.Elastic.Out;case X.Elastic.Out:return X.Elastic.In;case X.Elastic.InOut:return X.Elastic.InOut;case X.Back.In:return X.Back.Out;case X.Back.Out:return X.Back.In;case X.Back.InOut:return X.Back.InOut;case X.Bounce.In:return X.Bounce.Out;case X.Bounce.Out:return X.Bounce.In;case X.Bounce.InOut:return X.Bounce.InOut;default:return s}}const E1=4,T1=.001,P1=1e-7,A1=10,ps=11,Pr=1/(ps-1),M1=typeof Float32Array=="function";function Zl(s,t){return 1-3*t+3*s}function Ql(s,t){return 3*t-6*s}function tu(s){return 3*s}function Ar(s,t,e){return((Zl(t,e)*s+Ql(t,e))*s+tu(t))*s}function eu(s,t,e){return 3*Zl(t,e)*s*s+2*Ql(t,e)*s+tu(t)}function k1(s,t,e,n,r){let i,o,a=0;do o=t+(e-t)/2,i=Ar(o,n,r)-s,i>0?e=o:t=o;while(Math.abs(i)>P1&&++a<A1);return o}function I1(s,t,e,n){for(let r=0;r<E1;++r){const i=eu(t,e,n);if(i===0)return t;const o=Ar(t,e,n)-s;t-=o/i}return t}function D1(s){return s}function zo(s,t,e,n){if(!(0<=s&&s<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(s===t&&e===n)return D1;const r=M1?new Float32Array(ps):new Array(ps);for(let o=0;o<ps;++o)r[o]=Ar(o*Pr,s,e);function i(o){let a=0,c=1;const h=ps-1;for(;c!==h&&r[c]<=o;++c)a+=Pr;--c;const l=(o-r[c])/(r[c+1]-r[c]),u=a+l*Pr,d=eu(u,s,e);return d>=T1?I1(o,u,s,e):d===0?u:k1(o,a,a+Pr,s,e)}return o=>o===0||o===1?o:Ar(i(o),t,n)}function No(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function nu(s){const[t,e,n,r]=No(s);return[1-n,1-r,1-t,1-e]}function O1(s){return zo(...No(s))}function R1(s){return zo(...nu(s))}const ze={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=ze.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,r){const i=(e-s)*.5,o=(n-t)*.5,a=r*r,c=r*a;return(2*t-2*e+i+o)*c+(-3*t+3*e-2*i-o)*a+i*r+t},QuadraticBezier:(s,t,e,n)=>{const r=1-n;return r*r*s+2*r*n*t+n*n*e},CubicBezier:(s,t,e,n,r)=>{const i=1-r;return i*i*i*s+3*i*i*r*t+3*i*r*r*e+r*r*r*n}},Linear:function(s,t){const e=s.length-1,n=e*t,r=Math.floor(n),i=ze.Utils.Linear;return t<0?i(s[0],s[1],n):t>1?i(s[e],s[e-1],e-n):i(s[r],s[r+1>e?e:r+1],n-r)},Bezier:function(s,t){let e=0;const n=s.length-1,r=Math.pow,i=ze.Utils.Bernstein;for(let o=0;o<=n;o++)e+=r(1-t,n-o)*r(t,o)*s[o]*i(n,o);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,r=Math.floor(n);const i=ze.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(r=Math.floor(n=e*(1+t))),i(s[(r-1+e)%e],s[r],s[(r+1)%e],s[(r+2)%e],n-r)):t<0?s[0]-(i(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(i(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):i(s[r?r-1:0],s[r],s[e<r+1?e:r+1],s[e<r+2?e:r+2],n-r)}};class su{_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=Et(),e=!1){const n=Object.keys(this._tweens);for(let r=0;r<n.length;r++){const i=this._tweens[n[r]],o=!e;i&&i.update(t,o)===!1&&!e&&delete this._tweens[n[r]]}return!!Object.keys(this._tweens).length}}const he=new su;class Fo{constructor(t,e=he){this._object=t,this._group=e}_id=ms.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=X.Linear.None;_interpolationFunction=ze.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=Et()){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,n,r){for(const i in n){const o=t[i],a=Array.isArray(o),c=a?"array":typeof o,h=!a&&Array.isArray(n[i]);if(!(c==="undefined"||c==="function")){if(h){let l=n[i];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),n[i]=[o].concat(l)}if((c==="object"||a)&&o&&!h){e[i]=a?[]:{};for(const l in o)e[i][l]=o[l];r[i]=a?[]:{},this._setupProperties(o,e[i],n[i],r[i])}else typeof e[i]>"u"&&(e[i]=o),a||(e[i]*=1),h?r[i]=n[i].slice().reverse():r[i]=e[i]||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=Et()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Et()){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=he){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=X.Linear.None){return this._easingFunction=t,this}interpolation(t=ze.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=Et(),e=!0){if(this._isPaused)return!0;let n,r;const i=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>i)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];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 a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,r){for(const i in n){if(e[i]===void 0)continue;const o=e[i]||0;let a=n[i];const c=Array.isArray(t[i]),h=Array.isArray(a);!c&&h?t[i]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[i],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[i]=o+(a-o)*r))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const L1=ms.nextId,z1=he.getAll.bind(he),N1=he.removeAll.bind(he),F1=he.add.bind(he),B1=he.remove.bind(he),U1=he.update.bind(he),$1={now:Et,Sequence:ms,Easing:X,Interpolation:ze,Group:su,Tween:Fo,nextId:L1,getAll:z1,removeAll:N1,add:F1,remove:B1,update:U1};class Bo{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=Et(),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=Et();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class gs{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Jg(this.tweens,(e,n)=>t?e.delay>n.delay:e.delay<=n.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(n=>{const r={...n};delete r.tween,r.fromValues={...r.fromValues},r.toValues={...r.toValues},e.push(r)}),e}addTween(t,e,n){const r={fromValues:t,toValues:e,frames:typeof n?.frames=="number"?n.frames:1,delay:typeof n?.delay=="number"?n.delay:this.tweens.length,easeFunction:n?.easeFunction||X.Linear.None,interpolationFunction:n?.interpolationFunction||ze.Linear,repeat:typeof n?.repeat=="number"?n.repeat:0,yoyo:n?.yoyo||!1,onStart:n?.onStart||(()=>{}),onUpdate:n?.onUpdate||(()=>{}),onComplete:n?.onComplete||(()=>{})};return this.tweens.push(r),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Bo,n=this.frameDuration;return new Promise(r=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Fm(i=>{if(!this.isPaused){const a=Math.max(0,i-this.pausedDuration),c=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(h=>h.delay*n<=c).forEach(h=>{h.tween||(h.tween=new Fo({...h.fromValues}).to({...h.toValues},h.frames*n).easing(h.easeFunction).interpolation(h.interpolationFunction).repeat(h.repeat).yoyo(h.yoyo).onStart(h.onStart).onUpdate(h.onUpdate).onComplete(h.onComplete),h.tween.start(a)),(h.delay+h.frames*(h.repeat+1))*n>c?h.tween.update(a):(h.tween.isPlaying()&&h.tween.end(),Di(t,h))})}const o=!!t.length;return o||(this.onGroupComplete?.(),r()),o})})}isPaused=!1;pausedClock=new Bo;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(n=>{e=Math.max(e,n.delay+n.frames),n.easeFunction=Kl(n.easeFunction);const r={...n.toValues};n.toValues={...n.fromValues},n.fromValues={...r}}),t.forEach(n=>{n.delay=e-n.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}let Y1=class extends sr{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=[];state;constructor(t){if(super(),this.id=Bi(),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 e=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",e),this.strokeDashTotalLength=Ii(e).reduce((n,r)=>n+r,0)}this.state=oh(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new C1,this.state.subscribe(()=>{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(n=>{const r=n.originMatrix?n.originMatrix.clone():new Yt;r.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=r});const e=this.originMatrix?this.originMatrix.clone():new Yt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof Oo)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let r;try{r=new SVGPoint(t,e)}catch{r=n.createSVGPoint(),r.x=t,r.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(r);{const i=this.getBoundingClientRect();if(i)return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height}return!1}isPointInStroke(t,e,n){if(n instanceof Oo)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let r;try{r=new SVGPoint(t,e)}catch{r=n.createSVGPoint(),r.x=t,r.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(r):!1}clone(){return Im(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(([n,r])=>[Nt(n),r]))):e&&(this.attrs[Nt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[Nt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[Nt(t)]}distance(t){return Ze(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=Ut(se(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:r}=Qe(ut(this.degree),e);this.vx=n,this.vy=r,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:r}=Qe(ut(this.degree),e);this.ax=n,this.ay=r,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,r=e*e+n*n,i=Math.sqrt(r),o=this.mass*t.mass/r,a=o*e/i,c=o*n/i;this.vx+=a/this.mass,this.vy+=c/this.mass,t.vx-=a/t.mass,t.vy-=c/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=ae(t?.gravity,0);this.vy+=e;const n=ae(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=ae(e?.easing,.05),r=t.x-this.cX-this.x,i=t.y-this.cY-this.y;this.vx=r*n,this.vy=i*n,this.run(e)}runSpringTo(t,e){const n=ae(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(r=>{const i=r.x-this.cX-this.x,o=r.y-this.cY-this.y,a=i*n,c=o*n;this.vx+=a,this.vy+=c}),this.run({friction:.9,...e})}springMassTo(t,e){const n=ae(e?.springLength,100),r=ae(e?.spring,1e-4),i=t.x-this.x,o=t.y-this.y,a=Math.sqrt(i*i+o*o);if(a<n){const c=i*r,h=o*r;return this.vx+=c/this.mass,this.vy+=h/this.mass,t.vx-=c/t.mass,t.vy-=h/t.mass,1-a/n}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 n=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*n),this.getPointAtLength(e*n)}strokeDashTween(t=1e3,e){const n=this.initPathD(),r=Z(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${r} ${r}`,strokeDashoffset:`${r}`});const i=e?.onUpdate,o=new gs({frameDuration:t});o.addTween({offset:r},{offset:0},Object.assign(e||{},{onUpdate:(a,c)=>{this.setAttr("strokeDashoffset",""+Z(a.offset,2)),i?.(a,c)}})),o.play()}};class j1 extends Y1{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,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=me(ut(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=me(ut(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=me(ut(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 Bn(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,n=t.y-this.y,r=t.z-this.z;return Math.sqrt(e*e+n*n+r*r)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y,r=this.z;return{x:n*t.z-r*t.y,y:r*t.x-e*t.z,z:e*t.y-n*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 Mr=j1,ys=2e3,Uo=2001,ru=[1,0,0,1],iu=[1,0,0,1,0,0],ou=[1,0,0,0,1,0,0,0,1],au=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class $o{value;constructor(t=ru){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,n=0,r=1){return this.m11=t,this.m21=e,this.m12=n,this.m22=r,this}identity(){return this.value=Array.from(ru),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 $o(this.value)}fromArray(t,e=0){for(let n=0;n<4;n++)this.value[n]=t[n+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 n=t.value,r=e.value,i=this.value,o=n[0],a=n[2],c=n[1],h=n[3],l=r[0],u=r[2],d=r[1],f=r[3];return i[0]=o*l+a*d,i[2]=o*u+a*f,i[1]=c*l+h*d,i[3]=c*u+h*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 kr{value;constructor(t=ou){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,n=0,r=0,i=1,o=0,a=0,c=0,h=1){const l=this.value;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=i,l[5]=c,l[6]=n,l[7]=o,l[8]=h,this}identity(){return this.value=Array.from(ou),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 kr(this.value)}fromArray(t,e=0){for(let n=0;n<9;n++)this.value[n]=t[n+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,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.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 n=t.value,r=e.value,i=this.value,o=n[0],a=n[3],c=n[6],h=n[1],l=n[4],u=n[7],d=n[2],f=n[5],m=n[8],p=r[0],_=r[3],y=r[6],b=r[1],v=r[4],w=r[7],E=r[2],C=r[5],D=r[8];return i[0]=o*p+a*b+c*E,i[3]=o*_+a*v+c*C,i[6]=o*y+a*w+c*D,i[1]=h*p+l*b+u*E,i[4]=h*_+l*v+u*C,i[7]=h*y+l*w+u*D,i[2]=d*p+f*b+m*E,i[5]=d*_+f*v+m*C,i[8]=d*y+f*w+m*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],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8];return e*o*l-e*a*h-n*i*l+n*a*c+r*i*h-r*o*c}inverse(){const t=this.value,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=l*o-a*h,d=a*c-l*i,f=h*i-o*c,m=e*u+n*d+r*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/m;return t[0]=u*p,t[1]=(r*h-l*n)*p,t[2]=(a*n-r*o)*p,t[3]=d*p,t[4]=(l*e-r*c)*p,t[5]=(r*i-a*e)*p,t[6]=f*p,t[7]=(n*c-h*e)*p,t[8]=(o*e-n*i)*p,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).inverse().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,n,r,i,o,a){const c=Math.cos(i),h=Math.sin(i);return this.set(n*c,n*h,-n*(c*o+h*a)+o+t,-r*h,r*c,-r*(-h*o+c*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(jo.makeScale(t,e)),this}rotate(t){return this.premultiply(jo.makeRotation(-t)),this}translate(t,e){return this.premultiply(jo.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),n=Math.sin(t);return this.set(e,-n,0,n,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 Qt{value;is3dSpecial=!1;constructor(t=au){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,n=0,r=0,i=0,o=1,a=0,c=0,h=0,l=0,u=1,d=0,f=0,m=0,p=0,_=1){const y=this.value;return y[0]=t,y[4]=e,y[8]=n,y[12]=r,y[1]=i,y[5]=o,y[9]=a,y[13]=c,y[2]=h,y[6]=l,y[10]=u,y[14]=d,y[3]=f,y[7]=m,y[11]=p,y[15]=_,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(au),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 Qt(this.value)}static fromString(t){const e=new Qt,n=$c("number",t);return n.length===16&&n.forEach((r,i)=>{r.fullMatch&&(e.value[i]=parseFloat(r.fullMatch))}),e}fromArray(t,e=0){for(let n=0;n<16;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.value;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}copyPosition(t){const e=this.value,n=t.value;return e[12]=n[12],e[13]=n[13],e[14]=n[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,n){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),n.setFromMatrix4Column(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,n=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+n*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+n*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+n*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+n*this.m44}}toMatrix(t){const{scalarX:e,scalarY:n,skewX:r,skewY:i,x:o,y:a}=this.split(),c=[e,i,r,n,o,a];return t?(t.value=c,t):new Yt(c)}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=>Z(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),n=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),r=Ut(K(Math.asin(-this.m13),-1,1));let i=Ut(Math.atan2(this.m23,this.m33));Math.cos(ut(r))===0&&(i=Ut(Math.atan2(-this.m31,this.m22)));let o=Ut(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:n,degreeX:i,degreeY:r,degreeZ:o,skewX:Ut(this.m14),skewY:Ut(this.m24),skewZ:Ut(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,r=1/Yo.setFromMatrix4Column(t,0).length(),i=1/Yo.setFromMatrix4Column(t,1).length(),o=1/Yo.setFromMatrix4Column(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}lookAt(t,e,n){const r=this.value;return re.subVectors(t,e),re.lengthSq()===0&&(re.z=1),re.normalize(),en.crossVectors(n,re),en.lengthSq()===0&&(Math.abs(n.z)===1?re.x+=1e-4:re.z+=1e-4,re.normalize(),en.crossVectors(n,re)),en.normalize(),Ir.crossVectors(re,en),r[0]=en.x,r[4]=Ir.x,r[8]=re.x,r[1]=en.y,r[5]=Ir.y,r[9]=re.y,r[2]=en.z,r[6]=Ir.z,r[10]=re.z,this}multiplyMatrices(t,e){const n=t.value,r=e.value,i=this.value,o=n[0],a=n[4],c=n[8],h=n[12],l=n[1],u=n[5],d=n[9],f=n[13],m=n[2],p=n[6],_=n[10],y=n[14],b=n[3],v=n[7],w=n[11],E=n[15],C=r[0],D=r[4],$=r[8],O=r[12],U=r[1],V=r[5],q=r[9],ft=r[13],pt=r[2],zt=r[6],wt=r[10],It=r[14],Xt=r[3],Y=r[7],N=r[11],A=r[15];return i[0]=o*C+a*U+c*pt+h*Xt,i[4]=o*D+a*V+c*zt+h*Y,i[8]=o*$+a*q+c*wt+h*N,i[12]=o*O+a*ft+c*It+h*A,i[1]=l*C+u*U+d*pt+f*Xt,i[5]=l*D+u*V+d*zt+f*Y,i[9]=l*$+u*q+d*wt+f*N,i[13]=l*O+u*ft+d*It+f*A,i[2]=m*C+p*U+_*pt+y*Xt,i[6]=m*D+p*V+_*zt+y*Y,i[10]=m*$+p*q+_*wt+y*N,i[14]=m*O+p*ft+_*It+y*A,i[3]=b*C+v*U+w*pt+E*Xt,i[7]=b*D+v*V+w*zt+E*Y,i[11]=b*$+v*q+w*wt+E*N,i[15]=b*O+v*ft+w*It+E*A,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],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],c=t[9],h=t[13],l=t[2],u=t[6],d=t[10],f=t[14],m=t[3],p=t[7],_=t[11],y=t[15];return m*(+i*c*u-r*h*u-i*a*d+n*h*d+r*a*f-n*c*f)+p*(+e*c*f-e*h*d+i*o*d-r*o*f+r*h*l-i*c*l)+_*(+e*h*u-e*a*f-i*o*u+n*o*f+i*a*l-n*h*l)+y*(-r*a*l-e*c*u+e*a*d+r*o*u-n*o*d+n*c*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,n){const r=this.value;return t instanceof ve?(r[12]=t.x,r[13]=t.y,r[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&(r[12]=t,r[13]=e,r[14]=n),this}inverse(){const t=this.value,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],f=t[11],m=t[12],p=t[13],_=t[14],y=t[15],b=u*_*h-p*d*h+p*c*f-a*_*f-u*c*y+a*d*y,v=m*d*h-l*_*h-m*c*f+o*_*f+l*c*y-o*d*y,w=l*p*h-m*u*h+m*a*f-o*p*f-l*a*y+o*u*y,E=m*u*c-l*p*c-m*a*d+o*p*d+l*a*_-o*u*_,C=e*b+n*v+r*w+i*E;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/C;return t[0]=b*D,t[1]=(p*d*i-u*_*i-p*r*f+n*_*f+u*r*y-n*d*y)*D,t[2]=(a*_*i-p*c*i+p*r*h-n*_*h-a*r*y+n*c*y)*D,t[3]=(u*c*i-a*d*i-u*r*h+n*d*h+a*r*f-n*c*f)*D,t[4]=v*D,t[5]=(l*_*i-m*d*i+m*r*f-e*_*f-l*r*y+e*d*y)*D,t[6]=(m*c*i-o*_*i-m*r*h+e*_*h+o*r*y-e*c*y)*D,t[7]=(o*d*i-l*c*i+l*r*h-e*d*h-o*r*f+e*c*f)*D,t[8]=w*D,t[9]=(m*u*i-l*p*i-m*n*f+e*p*f+l*n*y-e*u*y)*D,t[10]=(o*p*i-m*a*i+m*n*h-e*p*h-o*n*y+e*a*y)*D,t[11]=(l*a*i-o*u*i-l*n*h+e*u*h+o*n*f-e*a*f)*D,t[12]=E*D,t[13]=(l*p*r-m*u*r+m*n*d-e*p*d-l*n*_+e*u*_)*D,t[14]=(m*a*r-o*p*r-m*n*c+e*p*c+o*n*_-e*a*_)*D,t[15]=(o*u*r-l*a*r+l*n*c-e*u*c-o*n*d+e*a*d)*D,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t instanceof ve?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,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,c=t.z,h=i*o,l=i*a;return this.set(h*o+n,h*a-r*c,h*c+r*a,0,h*a+r*c,l*a+n,l*c-r*o,0,h*c-r*a,l*c+r*o,i*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,o){return this.set(1,n,i,0,t,1,o,0,e,r,1,0,0,0,0,1),this}makePerspective(t,e,n,r,i,o,a=ys){const c=this.value,h=2*i/(e-t),l=2*i/(n-r),u=(e+t)/(e-t),d=(n+r)/(n-r);let f,m;if(a===ys)f=-(o+i)/(o-i),m=-2*o*i/(o-i);else if(a===Uo)f=-o/(o-i),m=-o*i/(o-i);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=l,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,e,n,r,i,o,a=ys){const c=this.value,h=1/(e-t),l=1/(n-r),u=1/(o-i),d=(e+t)*h,f=(n+r)*l;let m,p;if(a===ys)m=(o+i)*u,p=-2*u;else if(a===Uo)m=i*u,p=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*l,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=p,c[14]=-m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,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,n=0){return this.multiply(new Qt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new Qt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}scaleVector3(t){const e=this.value,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}rotateX(t){const e=ut(t),n=Math.cos(e),r=Math.sin(e);return this.multiply(new Qt([1,0,0,0,0,n,r,0,0,-r,n,0,0,0,0,1]))}rotateY(t){const e=ut(t),n=Math.cos(e),r=Math.sin(e);return this.multiply(new Qt([n,0,-r,0,0,1,0,0,r,0,n,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=ut(t),n=Math.cos(e),r=Math.sin(e);return this.multiply(new Qt([n,r,0,0,-r,n,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,n=0){return this.multiply(new Qt([1,0,0,ut(t),0,1,0,ut(e),0,0,1,ut(n),0,0,0,1]))}perspective(t){return this.multiply(new Qt([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,n=t.x*this.m12+t.y*this.m22+this.m42,r=t.x*this.m13+t.y*this.m23+this.m43,i=t.x*this.m14+t.y*this.m24+this.m44,o=e+this.m31,a=n+this.m32,c=r+this.m33,h=i+this.m34;i==0&&(i=1e-4),e/=i,n/=i,r/=i,h==0&&(h=1e-4),o/=h,a/=h,c/=h;const l=c-r;if(l==0)return{x:e,y:n,z:r,mass:i};const u=-r/l;return e+=u*(o-e),n+=u*(a-n),{x:e,y:n,z:r,mass:i}}project(t){const e=t.z;let n=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,r=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,i=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return i==0&&(i=1e-4),n/=i,r/=i,i<0&&(n-=this.m41,r-=this.m42,n*=1/i,r*=1/i,n+=this.m41,r+=this.m42),{x:n,y:r,z:e,mass:i}}bounds(t,e,n,r){const i=new Mr({x:t,y:e}),o=new Mr({x:t+n,y:e}),a=new Mr({x:t+n,y:e+r}),c=new Mr({x:t,y:e+r});({x:i.x,y:i.y,z:i.z,mass:i.mass}=this.project(i)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:c.x,y:c.y,z:c.z,mass:c.mass}=this.project(c);const h=Math.min(i.x,o.x,a.x,c.x),l=Math.min(i.y,o.y,a.y,c.y),u=Math.max(i.x,o.x,a.x,c.x)-h,d=Math.max(i.y,o.y,a.y,c.y)-l;return{x:h,y:l,width:u,height:d}}}class Yt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=iu){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 Yt,n=$c("number",t);return n.length===6&&n.forEach((r,i)=>{r.fullMatch&&(e.value[i]=parseFloat(r.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 Qt(e)}identity(){return this.value=Array.from(iu),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 Yt(this.value)}multiply(t){const e=this.clone(),n=t instanceof Yt?t:new Yt(t);return this.m11=n.m11*e.m11+n.m12*e.m21+n.m13*e.m31,this.m12=n.m11*e.m12+n.m12*e.m22+n.m13*e.m32,this.m13=n.m11*e.m13+n.m12*e.m23+n.m13*e.m33,this.m21=n.m21*e.m11+n.m22*e.m21+n.m23*e.m31,this.m22=n.m21*e.m12+n.m22*e.m22+n.m23*e.m32,this.m23=n.m21*e.m13+n.m22*e.m23+n.m23*e.m33,this.m31=n.m31*e.m11+n.m32*e.m21+n.m33*e.m31,this.m32=n.m31*e.m12+n.m32*e.m22+n.m33*e.m32,this.m33=n.m31*e.m13+n.m32*e.m23+n.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,n=this.m13,r=this.m21,i=this.m22,o=this.m23,a=this.m31,c=this.m32,h=this.m33,l=h*i-o*c,u=-h*r+o*a,d=c*r-i*a;let f=t*l+e*u+n*d;return f?(f=1/f,this.m11=l*f,this.m12=(-h*e+n*c)*f,this.m13=(o*e-n*i)*f,this.m21=u*f,this.m22=(h*t-n*a)*f,this.m23=(-o*t+n*r)*f,this.m31=d*f,this.m32=(-c*t+e*a)*f,this.m33=(i*t-e*r)*f,this):null}adjugate(){const t=new Yt;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=Ut(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:Ut(Math.atan2(-this.m21,this.m22)),skewY:Ut(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],n=this.value[1],r=this.value[2],i=this.value[3],o=this.value[4],a=this.value[5],c=t.value[0],h=t.value[1],l=t.value[2],u=t.value[3],d=t.value[4],f=t.value[5],m=c*u,p=h*l,_=(l*n-e*u)/(p-m),y=(c*n-e*h)/(m-p),b=(l*i-r*u)/(p-m),v=(c*i-r*h)/(m-p),w=(l*(a-f)+u*(d-o))/(p-m),E=(c*(a-f)+h*(d-o))/(m-p),C=[_,y,b,v,w,E];return new Yt(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>Z(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,n){return this.matrix4.translate(t,e,n),this.matrix4.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,n-this.matrix4.m43),this}rotate(t,e=0,n=0){const r=ut(t),i=Math.cos(r),o=Math.sin(r);return this.translate(e,n),this.multiply([i,o,-o,i,0,0]),this.translate(-e,-n),this.toMatrix4(),this}rotateTo(t,e=0,n=0){const{degree:r}=this.split();return this.rotate(t-r,e,n),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,n){return this.matrix4.rotateX(t).rotateY(e).rotateZ(n),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,n){const{degreeX:r,degreeY:i,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-r,e-i,n-o),this}scale(t,e=t,n=0,r=0){return this.translate(n,r),this.multiply([t,0,0,e,0,0]),this.translate(-n,-r),this.toMatrix4(),this}scaleTo(t,e=t,n=0,r=0){return this.scale(t/this.m11,e/this.m22,n,r)}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,n=t){return this.matrix4.scale(t,e,n),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scalarX:r,scalarY:i,scalarZ:o}=this.matrix4.split();return this.scale3d(t/r,e/i,n/o),this}skew(t,e=t){return this.multiply([Math.cos(ut(e)),Math.sin(ut(e)),-Math.sin(ut(t)),Math.cos(ut(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:n,skewY:r}=this.split();return this.skew(t-n,e-r)}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,n){return this}skew3dTo(t,e,n){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const en=new ve,Ir=new ve,re=new ve,Yo=new ve,jo=new kr;new Qt;function cu(s){const t=new Yt;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,r){r.indexOf(",")>=0?r=r.split(/\s*,\s*/):r=r.split(/\s+/);const i=[];for(let o=0,a=r.length;o<a;o++)r[o].trim()&&i.push(parseFloat(""+r[o]));switch(n.toLowerCase()){case"t":case"translate":t.translate(i[0],i[1]);break;case"translatex":t.translateX(i[0]);break;case"translatey":t.translateY(i[0]);break;case"translatez":t.translateZ(i[0]);break;case"translate3d":t.translate3d(i[0],i[1],i[2]);break;case"r":case"rotate":t.rotate(i[0],i[1]??0,i[2]??0);break;case"rotatex":t.rotateX(i[0]);break;case"rotatey":t.rotateY(i[0]);break;case"rotatez":t.rotateZ(i[0]);break;case"rotate3d":t.rotate3d(i[0],i[1],i[2]);break;case"s":case"scale":t.scale(i[0],i[1]??i[0]);break;case"scalex":t.scaleX(i[0]);break;case"scaley":t.scaleY(i[0]);break;case"scalez":t.scaleZ(i[0]);break;case"scale3d":t.scale3d(i[0],i[1],i[2]);break;case"skew":t.skew(i[0],i[1]??0);break;case"skewx":t.skewX(i[0]);break;case"skewy":t.skewY(i[0]);break;case"skewz":t.skewZ(i[0]);break;case"skew3d":t.skew3d(i[0],i[1],i[2]);break;case"m":case"matrix":t.multiply([i[0],i[1],i[2],i[3],i[4],i[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new Qt(i)),t.matrix4.toMatrix(t);break}return""}),t}function me(s,t,e){const n=new Yt;return n.rotate(Ut(s)),n.transformPoint({x:t,y:e})}function Xo(s){const t=typeof s?.x=="number"?s?.x:0,e=typeof s?.y=="number"?s?.y:0,n=typeof s?.degree=="number"?s?.degree:0,r=typeof s?.scalarX=="number"?s?.scalarX:1,i=typeof s?.scalarY=="number"?s?.scalarY:1,o=ut(n),a=Math.cos(o),c=Math.sin(o),h=new DOMMatrix([a*r,c*r,-c*i,a*i,t,e]);return h.multiplySelf(new DOMMatrix(s?.originMatrix||"")),h}function X1(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,Xo(t)),n}const hu={map:new Map,transform:function(s){if(tp)return s;if(this.map.has(s))return this.map.get(s);const t=new OffscreenCanvas(s.width,s.height);return t.getContext("2d")?.drawImage(s,0,0),this.map.set(s,t),t},clear:function(){this.map.clear()}};function G1(s,t,e){const n=new OffscreenCanvas(s,t),r=n.getContext("2d");if(r)return e(r),n.transferToImageBitmap()}function V1(s,t,e){const n=s.createPattern(hu.transform(t),"no-repeat");if(n){const r=Xo(e);n.setTransform(r),s.fillStyle=n}}const Go=["","-webkit-","-moz-","-o-","-ms-"];function Vo(s,t){const e=t.x||0,n=t.y||0,r=t.z||0;vs(s,"transform",`translate(${e}px, ${n}px) translateZ(${r}px)`)}function q1(s,t){const e=t?.easingFn||X.Linear.None,n=t?.duration||0,r=t?.delay||0,i=kn(),o=i+n;let a=0,c=0;const h=t.deltaX,l=t.deltaY;function u(){const d=kn();if(d>=o){Vo(s,{x:h-a,y:l-c});return}const f=(d-i)/n,m=e(f),p=h*m,_=l*m;Vo(s,{x:p-a,y:_-c}),a=p,c=_,Qs(u)}setTimeout(()=>{u()},r)}const H1=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"};function lu(s){return window.URL.createObjectURL(s)}function W1(s){return window.URL.revokeObjectURL(s)}function qo(s){let t=!1;function e(){/loaded|complete/.test(document.readyState)&&!t&&(o(),s(),t=!0)}const n=yt(document,"DOMContentLoaded",e),r=yt(window,"load",e),i=setInterval(e,100),o=()=>{clearInterval(i),n?.(),r?.()};return o}function uu(s){return yt(window,"beforeunload",t=>{s(t)})}async function J1(s,t=6e4){return new Promise((e,n)=>{const r=document.createElement("script");r.type="text/javascript",r.async=!1,r.onload=o=>{clearTimeout(i),e(o),r.onerror=r.onload=null},r.onerror=o=>{clearTimeout(i),n(o)},r.src=s;const i=setTimeout(()=>{n("Timeout!")},t);document.body.appendChild(r)})}function Dr(s,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click()}async function K1(s,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((n,r)=>{const i=document.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.onload=a=>{clearTimeout(o),n(a),i.onerror=i.onload=null},i.onerror=a=>{clearTimeout(o),r(a)},i.setAttribute("href",s);const o=setTimeout(()=>{r("Timeout!")},e);t.appendChild(i)})}function Z1(){return new Promise(s=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const n=()=>e>=t.length?(s(),!0):!1;n()||t.forEach(r=>{r.onload=()=>{e+=1,n()}})})}const fu=new Fi({max:1e3});async function du(s,t=6e4){return new Promise((e,n)=>{const r=typeof s=="string"?s:lu(s),i=fu.get(r);if(i)return e(i);const o=setTimeout(()=>{n("Timeout!")},t),a=document.createElement("img");a.onload=()=>{clearTimeout(o),a.onerror=a.onload=null;const c=a.naturalWidth||a.width,h=a.naturalHeight||a.height,l={width:c,height:h,aspectRatio:c/h,element:a,imageData:Nl(a)};fu.set(r,l),e(l)},a.onerror=c=>{clearTimeout(o),n(c)},a.src=r})}async function mu(s=ie.text,t=["*"]){const n=(await co(t))[0],r=await ss(n,s);return{type:n.type,name:n.name,size:n.size,data:r}}async function Q1(s=["image/*"]){const e=(await co(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await ss(e,ie.arraybuffer),r=Pi(n),i=await du(r);return{type:e.type,name:e.name,size:e.size,data:n,width:i.width,height:i.height,aspectRatio:i.aspectRatio,imageData:i.imageData}}function tb(){return window.getSelection()?.toString()||""}function eb(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function nb(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function sb(s){if(navigator.clipboard)return await navigator.clipboard.writeText(s);{const t=document.createElement("textarea");return t.value=s,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function rb(s=0,t=0){window.scrollTo(s,t)}function ib(){let s=Hc,t=Hc;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=uu(()=>{window.history.scrollRestoration="auto"}),t=qo(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function ob(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const ab=s=>s===document.activeElement&&(s.type||s.href);function Ho(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}function cb(s){return s*Ho()}function hb(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):Ho()}const lb=s=>{let t=s;for(;t&&t.nodeType!==1;){const e=t.parentElement||s.parentNode;if(!e)break;t=e}return t},ub=s=>s.parentElement,Wo=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:Wo(s.parentElement,t.concat([s]));function fb(s){const t=Wo(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test(ws(t[e],"overflow")+ws(t[e],"overflow-y")+ws(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const db=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),mb=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),pb=s=>s.nextElementSibling,gb=s=>s.previousElementSibling,yb=(s,t)=>s.closest(t),bb=s=>s.shadowRoot,bs=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,Jo=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,wb=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,Ko=s=>bs(s)&&s.getAttribute("type")==="checkbox",Zo=s=>bs(s)&&s.getAttribute("type")==="radio",vb=s=>bs(s)&&s.getAttribute("type")==="text",xb=s=>bs(s)&&s.getAttribute("type")==="number";function Sb(s,t){if(Jo(s)){const e=s.options;for(let n=0,r=e.length;n<r;n++)e[n].selected=e[n].value==t}}function _b(s,t){if(Zo(s)){const e=document.getElementsByName(s.name);for(let n=0,r=e.length;n<r;n++){const i=e[n];i.checked=i.value==t}}}function Cb(s,t){Ko(s)&&(s.checked=t)}function Un(s,t,e="append"){typeof t=="string"?s[e](wu(t)):s[e](t)}function pu(s,t){if(typeof t=="string"){s.innerHTML=t;const e=xu(s);e!=s&&(s=e)}else Un(t,"replaceWith")}const gu=function(s){pu(s,"")},Eb=(s,t)=>{s.textContent=t},Tb=s=>{if(s instanceof SVGElement)return"";let t=s.innerText;if(!t){const e=s.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!t&&n<=e.length-1;)"innerText"in e[n]&&(t=e[n].innerText),n++}return t},Pb=s=>s.remove();function Ab(s,t){ws(s,"display")=="none"&&t===void 0||t===!0?yu(s):bu(s)}function yu(s){$n(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function bu(s){$n(s,"display","none")}function Qo(s,t,e="toggle"){const n=t.split(/[,\s]+/);if(s.classList)n.forEach(r=>{const i=r.trim();i!==""&&s.classList[e](i)});else{const r=s.className.split(/ +/);let i=!1;n.forEach(o=>{const a=o.trim();if(a!==""){const c=r.indexOf(a);switch(e){case"add":c===-1&&(r.push(a),i=!0);break;case"remove":c!==-1&&(r.splice(c,1),i=!0);break;case"toggle":c===-1?r.push(a):r.splice(c,1),i=!0;break}}}),i&&yn(s,"class",r.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Mb(s,t){Qo(s,t,"add")}function kb(s,t){Qo(s,t,"remove")}function Ib(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)}function wu(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const r=xu(n);r!=n&&e.content.replaceChild(r,n)}),e.content}function vu(s){return document.createElement.call(document,s)}function Db(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Ob(s){return document.createTextNode.call(document,s)}function xu(s){return s.tagName=="SCRIPT"&&(s=Su(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Su(t),t)}),s}function Su(s){const t=s.ownerDocument.createElement("script");t.text=s.text;const e=s.attributes;for(let n=0,r=e.length;n<r;n++)t.setAttribute(e[n].name,e[n].value);return t}function Rb(s,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(s,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Lb(s){const t=new Proxy(window,{get(e,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?t:Reflect.get(e,n,r)},set(e,n,r,i){return Reflect.set(e,n,r,i)}});new Function("window",`with(window) { ${s} }`)(t,null)}function zb(s){return s=s.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),s="echo(`"+s+"`);",`(function parse(data){
66
+ let output = "";
67
+ function echo(html){
68
+ output += html;
69
+ }
70
+ ${s}
71
+ return output;
72
+ })`}function _u(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,n=t.length;e<n;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function Cu(s,t){return new Promise((e,n)=>{const{method:r="GET",data:i={},multipartFormDataString:o="",boundary:a="",headers:c={},withCredentials:h=!1,responseType:l="json",timeout:u=3e4}=t||{},d=_u();d.timeout=u,d.responseType=l,d.onreadystatechange=function(b){d.readyState===4&&(d.status===200?e(d.response):n(d.statusText))},d.ontimeout=()=>{n(`${s} is timed out for ${u}ms.`)},d.addEventListener("load",b=>t?.load?.(b,d),!1),d.addEventListener("loadstart",b=>t?.loadstart?.(b,d),!1),d.addEventListener("loadend",b=>t?.loadend?.(b,d),!1),d.addEventListener("progress",b=>{if(b.lengthComputable){const v=Math.round(b.loaded*100/b.total);t?.progress?.(b,d,v)}},!1),d.addEventListener("error",b=>t?.error?.(b,d),!1),d.addEventListener("abort",b=>t?.abort?.(b,d),!1);const f=r.toUpperCase();Object.assign(c,{Accept:"*/*"});let m=!1,p=!1,_=!1;function y(){d.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"),h&&(d.withCredentials=!0);for(const b in c)Nt(b).toLowerCase()=="content-type"&&c[b].toLowerCase()=="multipart/form-data"?(m=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(Nt(b).toLowerCase()=="content-type"&&(c[b].toLowerCase().indexOf("text/plain")>=0?p=!0:c[b].toLowerCase().indexOf("application/json")>=0&&(_=!0)),d.setRequestHeader(b,c[b]))}switch(f){case"GET":let b="";i instanceof FormData?b=gp(i):b=pp(i),d.open("GET",mp(s,b),!0),y(),d.send(null);break;default:d.open(f,s,!0),y(),m?d.sendAsBinary(o):_?d.send(JSON.stringify(i)):p?d.send(Object.entries(i).map(([v,w])=>`${v}=${w}`).join(`\r
73
+ `)):d.send(Object.entries(i).map(([v,w])=>`${encodeURIComponent(v)}=${encodeURIComponent(w)}`).join("&"));break}})}async function Nb(s){const t={url:s.action||"",data:{},contentType:s.method.toLowerCase()==="post"&&s.enctype?s.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],n=t.contentType=="multipart/form-data";for(let r=0;r<s.elements.length;r++){const i=s.elements[r];if(!i.hasAttribute("name"))continue;const o=i.getAttribute("type");switch(i.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const c=i;if(n)for(let u=0,d=c.files?.length||0;u<d;u++){const f=c.files?.[u];if(f){const m=await ss(f,ie.binaryString);e.push('Content-Disposition: form-data; name="'+c.name+'"; filename="'+f.name+`"\r
28
74
  Content-Type: `+f.type+`\r
29
75
  \r
30
- `+p+`\r
31
- `)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const l=r;n?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
76
+ `+m+`\r
77
+ `)}}break;case"RADIO":case"CHECKBOX":if(!i.checked)break;default:const l=i;n?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
32
78
  \r
33
79
  `+l.value+`\r
34
80
  `):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
35
81
  `+e.join("--"+t.boundary+`\r
36
82
  `)+"--"+t.boundary+`--\r
37
- `,t}function bl(s){const t=[];for(let e=0,n=ao.length;e<n;e++){const i=dt(ao[e]+s);t.push(i)}return t}function is(s,t,e){const n=jr(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[Da(t)]||n.props.style[dt(t)]||"":n.props.style}function vn(s,t,e){Zs(s,n=>{n.props.style=n.props.style||{},typeof t=="string"&&e?n.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{n.props.style[i]=t[i]})}),qr()}function yo(s,t=!1){const e={};if(!t)if(getComputedStyle){const n=getComputedStyle(s);for(let i=0,r=n.length;i<r;i++){const o=n[i];e[o]=n.getPropertyValue(o)}}else{const n=s.style||s.currentStyle;for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return s.style.cssText&&s.style.cssText.split(";").filter(n=>!!n).forEach(n=>{const[i,r]=n.split(":").map(o=>o.trim());i&&r&&(e[i]=r)}),e}function s1(s,t){const e=bl(t),n=e.length;let i="";for(let r=0;r<n;r++){const o=e[r];if(i=s[o]||"",i)return i}return i}function i1(s,t,e){const n=bl(t),i=n.length;let r="";for(let o=0;o<i;o++){const a=n[o];if(r="style"in s&&s.style[a]||"currentStyle"in s&&s.currentStyle[a]||"",r)return r}if(getComputedStyle){const o=getComputedStyle(s,e);for(let a=0;a<i;a++){const h=n[a];if(r=o.getPropertyValue(h).trim(),r)return r}}return r}function rs(s,t,e){if(t)if(typeof t=="string"&&e)try{s.style.setProperty(t,e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":"")}catch{s.style[t]=e}else t instanceof Object&&Object.keys(t).forEach(n=>{rs(s,n,t[n])})}function wo(s,t){typeof t=="string"?s.style.removeProperty(dt(t)):Object.keys(t).forEach(e=>{wo(s,e)})}function xl(s,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const n=document.createElement("style");return n.innerHTML=s,e.appendChild(n),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(n)}}else{const n=document.styleSheets[0].insertRule(s);return()=>{document.styleSheets[0].deleteRule(n)}}}class r1{selector;name;value;constructor(t,e,n){this.selector=t,this.name=e,this.value=n}toString(){return`${this.selector} { ${this.name}: ${this.value} }`}}class o1{propertyName;values=[];constructor(t){this.propertyName=t}add(t,e){this.values.push(new r1(t,this.propertyName,e))}}async function vl(){const s=[],t=document.querySelectorAll("style, link");for(let e=0,n=t.length;e<n;e++){const i=t[e];let r=i.innerHTML;switch(i.nodeName.toLowerCase()){case"style":break;case"link":r=await wl(i.href,{method:"GET",responseType:"text"});break}r=r.replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g,"").replace(/@[^{};]*;|@[^{};]*\{[^}]*\}/g,"").replace(/[\\n\n]+(?<=[\\n\n]+)\s+/g,""),s.push(r)}return s}async function a1(){const s={},t=await vl();for(let e=0,n=t.length;e<n;e++){const r=t[e].match(/[^{]*{[^}]*}/g);if(r)for(let o=0,a=r.length;o<a;o++){const h=r[o].split(/[{}]/g),c=h[0].trim(),u=h[1].split(";");for(let m=0;m<u.length;m++)if(u[m].trim()!=""){const f=u[m].split(":"),p=f[0].trim().toLowerCase(),g=f[1];s[p]||(s[p]=new o1(p)),g&&s[p].add(c,g.trim())}}}return s}function we(s,t,e){if(t===void 0&&e===void 0)return bo(s);if(typeof t=="string"&&e===void 0)return Sl(s,t);typeof t=="object"?Zs(s,n=>{for(const i in t)i=="style"?vn(s,i,t[i]):Object.prototype.hasOwnProperty.call(t,i)&&(n.props[i]=""+t[i])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?vn(s,t,e):Zs(s,n=>{n.props[t]=""+e})),qr()}function bo(s){const t={};for(let e=0,n=s.attributes,i=n.length;e<i;e++){const r=n[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=yo(s,!0):t[r.nodeName]=r.nodeValue)}return t}function Sl(s,t){return t==="style"?yo(s,!0):s.getAttribute(dt(t))}function Je(s,t,e){return s.setAttribute(dt(t),""+e)}function h1(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=dt(e.trim());n!=""&&s.removeAttribute(n)})}function _l(s,t){for(const e in t){const n=t[e];switch(e){case"fill":n!=="none"&&(s.fillStyle=n);break;case"stroke":n!=="none"&&(s.strokeStyle=n);break;case"stroke-width":case"strokeWidth":s.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":s.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":s.lineJoin=n;break;default:s.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":s.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":s.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&s.setLineDash(n.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof n=="string"&&(s.font=n);break;case"font-size":case"fontSize":s.font+=` ${n}`;break;case"font-family":case"fontFamily":s.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":s.textAlign="center";break;case"end":s.textAlign="end";break;case"start":s.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":s.textBaseline=n;break;default:s.textBaseline="alphabetic";break}break}}}function c1(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}function l1(){return!!window.PointerEvent}function u1(s,t){let e=document.createElement(s);t="on"+t;let n=t in e;return n||(e.setAttribute(t,"return;"),n=typeof e[t]=="function"),e=null,n}function xo(){return{x:0,y:0,isDown:!1}}function Ze(){const s=xo(),t=xo();return{start:s,current:t,setStart:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,n)},setCurrent:(e,n)=>{t.x=e.x,t.y=e.y,t.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1}}}function ii(s=document.documentElement,t=!1){return X(s,"mousemove",t)}function Cl(s=document.documentElement,t=!1){return X(s,"mousedown",t)}function El(s=document.documentElement,t=!1){return X(s,"mouseup",t)}function f1(s=document.documentElement,t=!1){return X(s,"mouseover",t)}function d1(s=document.documentElement,t=!1){return X(s,"mouseout",t)}function m1(s=document.documentElement,t=!1){return X(s,"mouseenter",t)}function p1(s=document.documentElement,t=!1){return X(s,"mouseleave",t)}function g1(s=document.documentElement,t=!1){return X(s,"click",t)}function y1(s=document.documentElement,t=!1){return X(s,"dblclick",t)}function w1(s=document.documentElement,t=!1){return X(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function b1(s=document.documentElement,t=!1){return X(s,"contextmenu",t)}function Pl(s=document.documentElement,t=!1){return X(s,"touchmove",t)}function Tl(s=document.documentElement,t=!1){return X(s,"touchstart",t)}function Ml(s=document.documentElement,t=!1){return X(s,"touchend",t)}function Al(s=document.documentElement,t=!1){return X(s,"touchcancel",t)}function vo(s=document.documentElement,t=!1){return X(s,"pointermove",t)}function So(s=document.documentElement,t=!1){return X(s,"pointerdown",t)}function _o(s=document.documentElement,t=!1){return X(s,"pointerup",t)}function Co(s=document.documentElement,t=!1){return X(s,"pointercancel",t)}function x1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function v1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function S1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function _1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function C1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function E1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function P1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function T1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function M1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function A1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function I1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function D1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function k1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("press",e)},e=>{t.off("press",e)})}function L1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function R1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function O1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function z1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function N1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function B1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function Il(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function F1(s=document.documentElement){const t=new nt(document.documentElement);return et(e=>{const n=i=>{!i.target||s==i.target||s.contains(i.target)||e(i)};return t.on("tap",n),n},(e,n)=>{t.off("tap",n)})}function Y1(s=document.documentElement,t=!1){return X(s,"transitionstart",t)}function X1(s=document.documentElement,t=!1){return Sc(X(s,"transitionend",t),X(s,"webkitTransitionEnd",t),X(s,"oTransitionEnd",t),X(s,"MSTransitionEnd",t))}function U1(s=document.documentElement,t=!1){return X(s,"animationstart",t)}function $1(s=document.documentElement,t=!1){return X(s,"animationend",t)}function Dl(s=document.documentElement,t=!1){return X(s,"drag",t)}function kl(s=document.documentElement,t=!1){return X(s,"dragstart",t)}function Ll(s=document.documentElement,t=!1){return X(s,"dragend",t)}function Rl(s=document.documentElement,t=!1){return X(s,"drop",t)}function Ol(s=document.documentElement,t=!1){return X(s,"dragenter",t)}function zl(s=document.documentElement,t=!1){return X(s,"dragleave",t)}function Nl(s=document.documentElement,t=!1){return X(s,"dragover",t)}function Bl(s=document.documentElement,t=!1){return X(s,"keydown",t)}function Fl(s=document.documentElement,t=!1){return X(s,"keyup",t)}function G1(s=document.documentElement,t=!1){return X(s,"keypress",t)}function V1(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return ii(s).pipe(it(n=>(e.setCurrent(ft(n,s)),e)))}function Yl(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return ii(s).pipe(Sg(Cl(s).pipe(qe(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)})),()=>El(s).pipe(qe(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))),bg(),it(n=>(e.setCurrent(ft(n,s),!0),e)))}function Xl(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return Tl(s).pipe(qe(n=>{const i=n.changedTouches[0];e.setStart(ft(i,s),!0),t?.start?.(i,e)}),js(()=>Pl(s).pipe(Lr(Vs(Ml(s),Al(s)).pipe(qe(n=>{const i=n.changedTouches[0];e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))),it(n=>{const i=n.changedTouches[0];return e.setCurrent(ft(i,s),!0),e}))}function ri(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return So(s).pipe(qe(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)}),js(()=>vo(s).pipe(Lr(Vs(_o(s),Co(s)).pipe(qe(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))))),it(n=>(e.setCurrent(ft(n,s),!0),e)))}function j1(s=document.documentElement,t){return Vs(Yl(s,t),Xl(s,t))}function Ul(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return Sc(ii(s),So(s)).pipe(Cc(n=>n instanceof PointerEvent?(e.setStart(ft(n,s),!0),t?.start?.(n,e),vo(s).pipe(Lr(Vs(_o(s),Co(s)).pipe(qe(i=>{e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))):n instanceof MouseEvent?$p(n):rc),it(n=>(e.setCurrent(ft(n,s),n instanceof PointerEvent),e)))}function q1(s){return new st(t=>ri(s,{start:()=>{t.next(0)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(Me())}function H1(s,t){Je(s,"draggable","true");const e=kl(s,!0).subscribe(r=>{Ae(r),Rr(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),n=Dl(s).subscribe(r=>{Ae(r),t?.onDrag?.(r)}),i=Ll(s).subscribe(r=>{Ae(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe()}}function W1(s,t){const e=Ol(s).subscribe(o=>{Ae(o),t?.onEnter?.(o)}),n=Nl(s).subscribe(o=>{Ae(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=zl(s).subscribe(o=>{Ae(o),t?.onLeave?.(o)}),r=Rl(s).subscribe(o=>{Ae(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function $l(s=10){return X(window,"scroll",!0).pipe(vg(s))}function J1(){return X(document,"visibilitychange",!0).pipe(it(()=>document.visibilityState==="visible"),Me())}function Z1(){return X(window,"storage",!1)}function K1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,innerWidth:window.innerWidth,innerHeight:window.innerHeight,screenX:window.screenX,screenY:window.screenY,pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset}}function Sn(){const s=document.documentElement||document.body;return{el:s,clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function Eo(){const{clientWidth:s,clientHeight:t,scrollLeft:e,scrollTop:n}=Sn();return{width:window.innerWidth||s,height:window.innerHeight||t,x:window.pageXOffset||e,y:window.pageYOffset||n}}function Q1(){const{scrollWidth:s,scrollHeight:t,scrollLeft:e,scrollTop:n}=Sn();return{width:s,height:t,scrollX:window.pageXOffset||e,scrollY:window.pageYOffset||n}}function Po(s){return s.getBoundingClientRect()}function tw(s){return{x:s.offsetLeft,y:s.offsetTop,width:s.offsetWidth,height:s.offsetHeight}}function To(s){const{top:t,left:e,width:n,height:i}=s.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=Sn();return{x:e+r,y:t+o,width:n,height:i}}function ew(s){let t=s,e=0,n=0;for(;t!==null;)e+=t.offsetLeft,n+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:n,width:s.offsetWidth,height:s.offsetHeight}}function nw(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Sn(),n=e-s;return n<=0?0:t/n*100}function sw(s){const t=Eo(),e=Po(s);return e.bottom>=0&&e.top<=t.height&&e.right>=0&&e.left<=t.width}function iw(s){if("center"in s){const t=s.center,e=Po(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function Mo(s){if("center"in s)return s.center;if(typeof s.pageX=="number"&&typeof s.pageY=="number")return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Sn();return{x:s.clientX+t,y:s.clientY+e}}function ft(s,t){const e={x:0,y:0};if(t){const n=Mo(s),i=To(t);e.x=B(n.x-i.x,0,i.width),e.y=B(n.y-i.y,0,i.height)}else{let n=0,i=0;if("currentTarget"in s&&s.currentTarget&&s.target&&s.currentTarget!=s.target){const r=s.currentTarget.getBoundingClientRect(),o=s.target.getBoundingClientRect();n=o.left-r.left,i=o.top-r.top}if("offsetX"in s)e.x=s.offsetX+n,e.y=s.offsetY+i;else{const r=Mo(s),o=To(s.target);e.x=B(r.x-o.x+n,0,o.width),e.y=B(r.y-o.y+i,0,o.height)}}return e}function rw(s){let t=0;return s||(s=window.event),s.wheelDelta?(t=s.wheelDelta/120,window.opera&&(t=-t)):s.detail&&(t=-s.detail/3),t}function ow(s){if(document.implementation.hasFeature("MouseEvents","2.0"))return s.button;switch(s.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const aw={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},hw={NULL:"",CANCEL:"",HELP:"",BACK_SPACE:"",TAB:"",CLEAR:"",RETURN:"",ENTER:"",SHIFT:"",CONTROL:"",ALT:"",PAUSE:"",ESCAPE:"",SPACE:"",PAGE_UP:"",PAGE_DOWN:"",END:"",HOME:"",ARROW_LEFT:"",LEFT:"",ARROW_UP:"",UP:"",ARROW_RIGHT:"",RIGHT:"",ARROW_DOWN:"",DOWN:"",INSERT:"",DELETE:"",SEMICOLON:"",EQUALS:"",NUMPAD0:"",NUMPAD1:"",NUMPAD2:"",NUMPAD3:"",NUMPAD4:"",NUMPAD5:"",NUMPAD6:"",NUMPAD7:"",NUMPAD8:"",NUMPAD9:"",MULTIPLY:"",ADD:"",SEPARATOR:"",SUBTRACT:"",DECIMAL:"",DIVIDE:"",F1:"",F2:"",F3:"",F4:"",F5:"",F6:"",F7:"",F8:"",F9:"",F10:"",F11:"",F12:"",COMMAND:"",META:"",ZENKAKU_HANKAKU:""};function cw(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function Gl(s,t){const e=t.ctrl||!1,n=t.shift||!1,i=t.alt||!1;return(e===s.metaKey||e===s.ctrlKey)&&n===s.shiftKey&&i===s.altKey&&t.keys.map(r=>r.toLowerCase()).includes(s.key.toLowerCase())}function Vl(s){return Bl(s.target||document||window).pipe(_c(t=>Gl(t,s)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function lw(s){return Fl(s.target||document||window).pipe(_c(t=>Gl(t,s)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function jl(s={keys:["o"]},t=Ut.text){return Vl(s).pipe(js(async()=>await hl(t)))}async function uw(s={keys:["o"]},t=Ut.text){return Vp(jl(s,t))}async function ql(s,t){return new Promise(e=>{const n=new ResizeObserver(i=>{const r=s.getBoundingClientRect();t(r),e(()=>{n.unobserve(s)})});n.observe(s)})}function Ao(s=document.documentElement,t){return new st(e=>{const n=s.getBoundingClientRect();let i=n.x,r=n.y,o=n.width,a=n.height;e.next(n);const h=new ResizeObserver(c=>{const l=s.getBoundingClientRect();(i!=l.x||r!=l.y||o!=l.width||a!=l.height)&&(i=l.x,r=l.y,o=l.width,a=l.height,e.next(l))});return h.observe(s,t),()=>{h.unobserve(s),h.disconnect()}})}function fw(){return X(window,"orientationchange"in window?"orientationchange":"resize").pipe(it(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),je({width:window.innerWidth,height:window.innerHeight}))}function dw(){const s={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,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:!1,this.setCurrentMousePoint(e,n)},setCurrentMousePoint:(e,n)=>{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-s.x,t.dStartY=t.y-s.y,t.isDown=typeof n=="boolean"?n:!1}}}function mw(s=document.documentElement){const t=new Ts,e=new nt(s);let n=[];const i=dw(),r=i.mousePoint,o=I=>{t.emit("mouseDown",I)},a=I=>{t.emit("mouseUp",I)},h=I=>{r.isDown||i.setCurrentMousePoint(ft(I,s)),t.emit("mouseMove",I)},c=I=>{t.emit("mouseOver",I)},l=I=>{t.emit("mouseOut",I)},u=I=>{t.emit("mouseEnter",I)},m=I=>{t.emit("mouseLeave",I)},f=I=>{t.emit("mouseClick",I)},p=I=>{t.emit("mouseDoubleClick",I)},g=I=>{t.emit("mouseWheel",I)},C=I=>{t.emit("mouseContextMenu",I)},y=I=>{t.emit("touchStart",I)},v=I=>{t.emit("touchEnd",I)},b=I=>{t.emit("touchCancel",I)},x=I=>{const at=I.changedTouches[0];r.isDown||i.setCurrentMousePoint(ft(at,s)),t.emit("touchMove",I)},E=I=>{t.emit("pointerDown",I)},_=I=>{t.emit("pointerUp",I)},L=I=>{t.emit("pointerCancel",I)},N=I=>{t.emit("pointerMove",I)},Y=I=>{t.emit("pan",I)},G=I=>{t.emit("panStart",I)},V=I=>{t.emit("panMove",I)},J=I=>{t.emit("panEnd",I)},rt=I=>{t.emit("panCancel",I)},tt=I=>{t.emit("panLeft",I)},te=I=>{t.emit("panRight",I)},Xt=I=>{t.emit("panUp",I)},jt=I=>{t.emit("panDown",I)},ee=I=>{t.emit("pinch",I)},R=I=>{t.emit("pinchin",I)},k=I=>{t.emit("pinchout",I)},$=I=>{t.emit("press",I)},Z=I=>{t.emit("rotate",I)},At=I=>{t.emit("swipe",I)},ne=I=>{t.emit("swipeLeft",I)},yi=I=>{t.emit("swipeRight",I)},wi=I=>{t.emit("swipeUp",I)},yt=I=>{t.emit("swipeDown",I)},he=I=>{t.emit("tap",I)},ot=I=>{!I.target||s==I.target||s.contains(I.target)||t.emit("tapOutSide",I)},Ct=I=>{t.emit("transitionstart",I)},Pn=I=>{t.emit("transitionend",I)},rn=I=>{t.emit("animationstart",I)},on=I=>{t.emit("animationend",I)};let Fe={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return Fe},mousePoint:r,eb:t,start:async function(){n.push(W(s,"mousedown",o)),n.push(W(s,"mouseup",a)),n.push(W(s,"mousemove",h)),n.push(W(s,"mouseover",c)),n.push(W(s,"mouseout",l)),n.push(W(s,"mouseenter",u)),n.push(W(s,"mouseleave",m)),n.push(W(s,"click",f)),n.push(W(s,"dblclick",p)),n.push(W(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",g)),n.push(W(s,"contextmenu",C)),n.push(W(s,"touchstart",y)),n.push(W(s,"touchend",v)),n.push(W(s,"touchcancel",b)),n.push(W(s,"touchmove",x)),n.push(W(s,"pointerdown",E)),n.push(W(s,"pointerup",_)),n.push(W(s,"pointercancel",L)),n.push(W(s,"pointermove",N)),e.on("pan",Y),e.on("panstart",G),e.on("panmove",V),e.on("panend",J),e.on("pancancel",rt),e.on("panleft",tt),e.on("panright",te),e.on("panup",Xt),e.on("pandown",jt),e.on("pinch",ee),e.on("pinchin",R),e.on("pinchout",k),e.on("press",$),e.on("rotate",Z),e.on("swipe",At),e.on("swipeleft",ne),e.on("swiperight",yi),e.on("swipeup",wi),e.on("swipedown",yt),e.on("tap",he),n.push(W(document,"pointerdown",ot)),n.push(W(s,"transitionstart",Ct)),n.push(W(s,"transitionend",Pn)),n.push(W(s,"animationstart",rn)),n.push(W(s,"animationend",on));const I=await ql(s,at=>{Fe=at,t.emit("resize",at)});n.push(I),n.push(Hl(this,{start:at=>{i.setStartMousePoint(ft(at,s),!0)},move:at=>{i.setCurrentMousePoint(ft(at,s))},end:at=>{i.setCurrentMousePoint(ft(at,s),!1)}}))},end:()=>{t.removeAllListeners(),n.forEach(I=>I()),n=[],e.off("pan",Y),e.off("panstart",G),e.off("panmove",V),e.off("panend",J),e.off("pancancel",rt),e.off("panleft",tt),e.off("panright",te),e.off("panup",Xt),e.off("pandown",jt),e.off("pinch",ee),e.off("pinchin",R),e.off("pinchout",k),e.off("press",$),e.off("rotate",Z),e.off("swipe",At),e.off("swipeleft",ne),e.off("swiperight",yi),e.off("swipeup",wi),e.off("swipedown",yt),e.off("tap",he)}}}function Hl(s,t){return Wl(s,t)}function Wl(s,t){const e=s.eb,n=o=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(o)},i=o=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("pointerDown",n),()=>e.off("pointerDown",n)}function pw(s,t){const e=s.eb,n=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(o)},i=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("mouseDown",n),()=>e.off("mouseDown",n)}function gw(s,t){const e=s.eb,n=o=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const a=o.changedTouches[0];t?.start?.(a)},i=o=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const a=o.changedTouches[0];t?.end?.(a)},r=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",n),()=>e.off("touchStart",n)}let Io=class{x;y;toX;toY;constructor(t){this.x=F(t?.x||0,2),this.y=F(t?.y||0,2),this.toX=F(t?.toX||0,2),this.toY=F(t?.toY||0,2)}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(t=2){const e=Nt(this.x,this.y,this.toX,this.toY);if(e===0){const n=Math.min(this.x,this.toX),i=Math.min(this.y,this.toY),r=Math.max(this.x,this.toX),o=Math.max(this.y,this.toY);return{x:n,y:i,width:r-n,height:o-i}}else{const n=Math.sin(e),i=Math.cos(e),r=i*this.x-n*this.y,o=i*this.toX-n*this.toY,a=i*this.y+n*this.x,h=i*this.toY+n*this.toX;return{x:F(Math.min(r,o),t),y:F(Math.min(a,h),t),width:F(Math.max(r,o)-Math.min(r,o),t),height:F(Math.max(a,h)-Math.min(a,h),t)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-n)/(h-c),u=h*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class Do extends Io{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=F(t.rx,2),this.ry=F(t.ry,2),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}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-n)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*m,g=f*f/(r*r)+p*p/(o*o);if(g>1){const V=Math.sqrt(g);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const C=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),y=h!=c?1:-1,v=y*C*r*p/o,b=y*C*-o*f/r,x=(t+n)/2,E=(e+i)/2,_=Math.cos(l)*v-Math.sin(l)*b+x,L=Math.sin(l)*v+Math.cos(l)*b+E,N=(V,J,rt,tt)=>(V*tt>=J*rt?1:-1)*Math.acos((V*rt+J*tt)/(Math.sqrt(V*V+J*J)*Math.sqrt(rt*rt+tt*tt))),Y=N(1,0,t-_,e-L)-l,G=N(t-_,e-L,n-_,i-L);return[_,L,r,o,l,Y,Y+G]}}class yw extends Io{cx;cy;isLineThrough;constructor(t){super(t),this.cx=F(t.cx,2),this.cy=F(t.cy,2),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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(t=2){const e=[this.x,this.toX],n=[this.y,this.toY];let i,r,o,a;for(let l=0;l<2;++l)i=l==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,r=l==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,o=l==0?this.x:this.y,Math.abs(i)>1e-12&&(a=-r/(2*i),0<a&&a<1&&[e,n][l].push(i*a*a+r*a+o));const h={x:Math.min(0,...e),y:Math.min(0,...n)},c={x:Math.max(0,...e),y:Math.max(0,...n)};return{x:F(h.x,t),y:F(h.y,t),width:F(c.x-h.x,t),height:F(c.y-h.y,t)}}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 ww=yw;class xt extends Io{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=F(t.c1x,2),this.c1y=F(t.c1y,2),this.c2x=F(t.c2x,2),this.c2y=F(t.c2y,2)}clone(){return new xt({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(t=2){let e=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),n=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),i=this.x-this.c1x,r=(-n+Math.sqrt(n*n-4*e*i))/2/e,o=(-n-Math.sqrt(n*n-4*e*i))/2/e;const a=[this.y,this.toY],h=[this.x,this.toX];let c;const l=[];Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),e=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),n=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),i=this.y-this.c1y,r=(-n+Math.sqrt(n*n-4*e*i))/2/e,o=(-n-Math.sqrt(n*n-4*e*i))/2/e,Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y}));const u=[],m=l.length;for(let g=0;g<m;g++){for(let C=g+1;C<m;C++)l[g].X===l[C].X&&l[g].Y===l[C].Y&&(C=++g);u.push({X:l[g].X,Y:l[g].Y})}const f={x:Math.min(...h),y:Math.min(...a)},p={x:Math.max(...h),y:Math.max(...a)};return{x:F(f.x,t),y:F(f.y,t),width:F(p.x-f.x,t),height:F(p.y-f.y,t),dots:u}}static base3(t,e,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,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],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const g=l*u[p]+l,C=xt.base3(g,t,n,r,a),y=xt.base3(g,e,i,o,h);f+=m[p]*Math.sqrt(C*C+y*y)}return l*f}length(t=1){return xt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,g=n*this.y+e*this.c1y,C=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y:g},end:{x:C,y},alpha:v}}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||xt.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=xt.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=xt.bezlen(e,n,i,r,o,a,h,c,m);return m}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}}}const os=Math.PI*2;function Jl(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function bw(s,t,e,n,i,r,o,a,h,c){const l=c*(s-e)/2+h*(t-n)/2,u=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=l*l,g=u*u;let C=m*f-m*g-f*p;C<0&&(C=0),C/=m*g+f*p,C=Math.sqrt(C)*(i===r?-1:1);const y=C*o/a*u,v=C*-a/o*l,b=c*y-h*v+(s+e)/2,x=h*y+c*v+(t+n)/2,E=(l-y)/o,_=(u-v)/a,L=(-l-y)/o,N=(-u-v)/a,Y=Jl(1,0,E,_);let G=Jl(E,_,L,N);return r===0&&G>0&&(G-=os),r===1&&G<0&&(G+=os),[b,x,Y,G]}function xw(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function Zl(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*os/360),l=Math.cos(h*os/360),u=l*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+l*(t-n)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=bw(s,t,e,n,i,r,o,a,c,l),g=[];let C=p[2],y=p[3];const v=Math.max(Math.ceil(Math.abs(y)/(os/4)),1);y/=v;for(let b=0;b<v;b++)g.push(xw(C,y)),C+=y;return g.map(b=>{for(let x=0;x<b.length;x+=2){let E=b[x+0],_=b[x+1];E*=o,_*=a;const L=l*E-c*_,N=c*E+l*_;b[x+0]=L+p[0],b[x+1]=N+p[1]}return b})}function ko(s,t,e,n,i,r){return[s/3+2/3*e,t/3+2/3*n,i/3+2/3*e,r/3+2/3*n,i,r]}function as(s,t,e,n){return[s,t,e,n,e,n]}const oi={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Ke(s="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",s)}function Kl(){return Ke("path")}const vw=s=>s instanceof SVGElement&&s.tagName==="path";function Sw(s,t="shape"){return si(pr(s),`${t}.svg`)}function Ql(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function _w(s){return s.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 tu(s){const t=[];return Ql(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,i)=>{let r=n.toLowerCase();const o=Ni(i);for(r=="m"&&o.length>oi[r]&&(t.push([n,...o.splice(0,oi[r])]),r="l",n=n=="m"?"l":"L");o.length;){if(o.length<oi[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,oi[r])])}return r=="z"&&t.push([n]),""}),t}function eu(s){let t=0,e=0,n=0,i=0;return s.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=n,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=n;break;default:for(let h=1;h<r.length;)r[h++]+=n,r[h++]+=i}switch(a){case"Z":n=t,i=e;break;case"H":n=r[1];break;case"V":i=r[1];break;case"M":n=t=r[1],i=e=r[2];break;default:n=r[r.length-2],i=r[r.length-1]}return r})}function Cw(s){const t=[];let e=0,n=0,i=0,r=0,o=0,a=0,h=0,c=0,l;for(let u=0,m=s.length;u<m;u++){let f=s[u];const p=f[0];switch(p){case"M":e=f[1],n=f[2];break;case"A":const g=Zl(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!g.length)continue;g.forEach((v,b)=>{const[x,E,_,L,N,Y,G,V]=v;f=["C",_,L,N,Y,G,V],b<g.length-1&&t.push(f)});break;case"S":let C=i,y=r;(l=="C"||l=="S")&&(C+=C-h,y+=y-c),f=["C",C,y,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...ko(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...ko(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,n)];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 hs{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"),n=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)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),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(()=>{hs.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 Lo extends Ts{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=sf(this.source);if(t===0){this.emit("finish");return}let e,n,i=Ia(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=Ia(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
38
- `&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){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":ue("whitespace",t)?(this.textchunk+=nu(this.entity),this.mode="text"):t==";"?(this.textchunk+=nu(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&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(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),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=="-"&&n=="-"&&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(!ue("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,n)}break;case"close tag name start":ue("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(ue("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(ue("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":ue("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(ue("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(!ue("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(ue("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&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function nu(s){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 s.charAt(0)=="#"?s.charAt(1).toLowerCase()=="x"?e=parseInt(s.substring(2),16):e=parseInt(s.substring(1),10):e=t[s],e?String.fromCharCode(e):"&"+s}var su=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ro(s,t={}){var e=1,n=1;function i(R){var k=R.match(/\n/g);k&&(e+=k.length);var $=R.lastIndexOf(`
39
- `);n=~$?R.length-$:n+R.length}function r(){var R={line:e,column:n};return function(k){return k.position=new o(R),p(),k}}function o(R){this.start=R,this.end={line:e,column:n},this.source=t.source}o.prototype.content=s;var a=[];function h(R){var k=new Error(t.source+":"+e+":"+n+": "+R);if(k.reason=R,k.filename=t.source,k.line=e,k.column=n,k.source=s,t.silent)a.push(k);else throw k}function c(){var R=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function m(){var R,k=[];for(p(),g(k);s.length&&s.charAt(0)!="}"&&(R=jt()||ee());)R!==!1&&(k.push(R),g(k));return k}function f(R){var k=R.exec(s);if(k){var $=k[0];return i($),s=s.slice($.length),k}}function p(){f(/^\s*/)}function g(R){var k;for(R=R||[];k=C();)k!==!1&&R.push(k);return R}function C(){var R=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var k=2;s.charAt(k)!=""&&(s.charAt(k)!="*"||s.charAt(k+1)!="/");)++k;if(k+=2,s.charAt(k-1)==="")return h("End of comment missing");var $=s.slice(2,k-2);return n+=2,i($),s=s.slice(k),n+=2,R({type:"comment",comment:$})}}function y(){var R=f(/^([^{]+)/);if(R)return be(R[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function v(){var R=r(),k=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=be(k[0]),!f(/^:\s*/))return h("property missing ':'");var $=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),Z=R({type:"declaration",property:k.replace(su,""),value:$?be($[0]).replace(su,""):""});return f(/^[;\s]*/),Z}}function b(){var R=[];if(!l())return h("missing '{'");g(R);for(var k;k=v();)k!==!1&&(R.push(k),g(R));return u()?R:h("missing '}'")}function x(){for(var R,k=[],$=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(R[1]),f(/^,\s*/);if(k.length)return $({type:"keyframe",values:k,declarations:b()})}function E(){var R=r(),k=f(/^@([-\w]+)?keyframes\s*/);if(k){var $=k[1];if(k=f(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var Z=k[1];if(!l())return h("@keyframes missing '{'");for(var At,ne=g();At=x();)ne.push(At),ne=ne.concat(g());return u()?R({type:"keyframes",name:Z,vendor:$,keyframes:ne}):h("@keyframes missing '}'")}}function _(){var R=r(),k=f(/^@supports *([^{]+)/);if(k){var $=be(k[1]);if(!l())return h("@supports missing '{'");var Z=g().concat(m());return u()?R({type:"supports",supports:$,rules:Z}):h("@supports missing '}'")}}function L(){var R=r(),k=f(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var $=g().concat(m());return u()?R({type:"host",rules:$}):h("@host missing '}'")}}function N(){var R=r(),k=f(/^@media *([^{]+)/);if(k){var $=be(k[1]);if(!l())return h("@media missing '{'");var Z=g().concat(m());return u()?R({type:"media",media:$,rules:Z}):h("@media missing '}'")}}function Y(){var R=r(),k=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return R({type:"custom-media",name:be(k[1]),media:be(k[2])})}function G(){var R=r(),k=f(/^@page */);if(k){var $=y()||[];if(!l())return h("@page missing '{'");for(var Z=g(),At;At=v();)Z.push(At),Z=Z.concat(g());return u()?R({type:"page",selectors:$,declarations:Z}):h("@page missing '}'")}}function V(){var R=r(),k=f(/^@([-\w]+)?document *([^{]+)/);if(k){var $=be(k[1]),Z=be(k[2]);if(!l())return h("@document missing '{'");var At=g().concat(m());return u()?R({type:"document",document:Z,vendor:$,rules:At}):h("@document missing '}'")}}function J(){var R=r(),k=f(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var $=g(),Z;Z=v();)$.push(Z),$=$.concat(g());return u()?R({type:"font-face",declarations:$}):h("@font-face missing '}'")}}var rt=Xt("import"),tt=Xt("charset"),te=Xt("namespace");function Xt(R){var k=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var $=r(),Z=f(k);if(Z){var At={type:R};return At[R]=Z[1].trim(),$(At)}}}function jt(){if(s[0]=="@")return E()||N()||Y()||_()||rt()||tt()||te()||V()||G()||L()||J()}function ee(){var R=r(),k=y();return k?(g(),R({type:"rule",selectors:k,declarations:b()})):h("selector missing")}return Oo(c())}function be(s){return s?s.replace(/^\s+|\s+$/g,""):""}function Oo(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(o){Oo(o,n)}):r&&typeof r=="object"&&Oo(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let Ew=class extends Lo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=Ro(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),No(this.currentItem.style,this.currentItem,Bo)}switch(this.processAttrs(e,n),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 n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});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&&No(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+zo(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(Bo.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&No(o,this.currentItem,Bo),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function zo(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return zo(s,t,i,r)-zo(e,n,i,r)}function No(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const Bo=["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 Tt{prevPathX=0;prevPathY=0;isUpdatedSVGPathData=!0;isUpdatedSVGPathD=!0;isUpdatedBoundingClientRect=!0;isUpdatedPolymorphPoints=!0;isUpdatedTotalLength=!0;normalizedLines=[];constructor(t){const e=typeof t=="string"?tu(t):t||[],n=Cw(eu(e));for(let i=0,r=n.length;i<r;i++){const o=n[i];o[0]=="M"?(this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new xt({x:this.prevPathX,y:this.prevPathY,c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(this.isUpdatedSVGPathData=!0,this.isUpdatedSVGPathD=!0,this.isUpdatedBoundingClientRect=!0,this.isUpdatedPolymorphPoints=!0,this.isUpdatedTotalLength=!0,t instanceof Do){Zl(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,g,C,y]=c;this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:g,toX:C,toY:y})),this.prevPathX=C,this.prevPathY=y});return}if(t instanceof xt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,i,r,o,a;t instanceof ww?[e,n,i,r,o,a]=ko(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=as(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new Tt,n=t.length;if(n){e.prevPathX=t[0],e.prevPathY=t[1];for(let i=2;i+5<n;i+=6)e._appendLine(new xt({x:e.prevPathX,y:e.prevPathY,c1x:t[i],c1y:t[i+1],c2x:t[i+2],c2y:t[i+3],toX:t[i+4],toY:t[i+5]}))}return e}static fromLines(t){const e=new Tt,n=t.length;if(n){e.prevPathX=t[0].x,e.prevPathY=t[0].y;for(let i=0;i<n;i++)e._appendLine(t[i])}return e}clone(){return Tt.fromLines(this.normalizedLines)}cachedSVGPathData=[];toSVGPathData(){if(this.isUpdatedSVGPathData){const t=[];for(let e=0,n=this.normalizedLines.length;e<n;e++){const i=this.normalizedLines[e];e==0&&t.push(["M",i.x,i.y]),t.push(...i.toSVGPathData())}this.cachedSVGPathData=t,this.isUpdatedSVGPathData=!1}return this.cachedSVGPathData}cachedSVGPathD="";toSVGPathD(){return this.isUpdatedSVGPathD&&(this.cachedSVGPathD=_w(this.toSVGPathData()),this.isUpdatedSVGPathD=!1),this.cachedSVGPathD}toCanvasContext(t){t.beginPath();for(let e=0,n=this.normalizedLines.length;e<n;e++){const i=this.normalizedLines[e];e==0&&t.moveTo(i.x,i.y),i.toCanvasContext(t)}}cachedBoundingClientRect={x:0,y:0,width:0,height:0};getBoundingClientRect(t=2){if(this.isUpdatedBoundingClientRect){const e=[],n=[];if(this.normalizedLines.forEach(i=>{const r=i.getBoundingClientRect(t);e.push(r.x,r.x+r.width),n.push(r.y,r.y+r.height)}),e.length==0||n.length==0)this.cachedBoundingClientRect={x:0,y:0,width:0,height:0};else{const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);this.cachedBoundingClientRect={x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}this.isUpdatedBoundingClientRect=!1}return this.cachedBoundingClientRect}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}transform(t){let e;return t.m?e=t.m:(e=new bt,e.translate(t.x||0,t.y||0),e.rotate(t.degree||0,t.centerX,t.centerY),e.scale(t.scaleX||1,t.scaleY||1,t.centerX,t.centerY)),e.isIdentity?this.clone():Tt.fromLines(this.normalizedLines.map(n=>{let i=n.x,r=n.y,o=n.c1x,a=n.c1y,h=n.c2x,c=n.c2y,l=n.toX,u=n.toY;return{x:i,y:r}=e.transformPoint({x:i,y:r}),{x:o,y:a}=e.transformPoint({x:o,y:a}),{x:h,y:c}=e.transformPoint({x:h,y:c}),{x:l,y:u}=e.transformPoint({x:l,y:u}),new xt({x:i,y:r,c1x:o,c1y:a,c2x:h,c2y:c,toX:l,toY:u})}))}cachedTotalLength;getTotalLength(){return(typeof this.cachedTotalLength!="number"||this.isUpdatedTotalLength)&&(this.cachedTotalLength=Math.round(this.normalizedLines.reduce((t,e)=>t+=e.length(),0)),this.isUpdatedTotalLength=!1),this.cachedTotalLength}getPointAtLength(t){let e=0,n=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(n=o.length(),e+n>=t)return o.getPointAtSegmentLength(t-e);e+=n}return this.normalizedLines[i-1].getPointAtSegmentLength(n)}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 n=t*e,i=this.normalizedLines[0];if(n--,n>1)for(let r=1;r<e&&(i=this.normalizedLines[r],n>1);r++)n-=1;return i.interpolate(n)}}getSubPathD(t,e,n=1e-6){const i=this.getSubPathDAtLength(e,!0);return Oi(n)(t,0)?i:i.getSubPathDAtLength(t,!1)}getSubPathDAtLength(t,e=!1){const n=new Tt;let i=0,r=!1;for(let o=0,a=this.normalizedLines.length;o<a;o++){const h=this.normalizedLines[o];o==0&&(n.prevPathX=h.x,n.prevPathY=h.y);const c=h.length();if(i+c>t&&!r){r=!0;const l=h.getPointAtSegmentLength(t-i);if(n._appendLine(new xt({x:n.prevPathX,y:n.prevPathY,c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),e)return n;n.normalizedLines=[],n._appendLine(new xt({x:n.prevPathX,y:n.prevPathY,c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:h.toX,toY:h.toY})),i+=c;continue}n._appendLine(h),i+=c}return n}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),m=r+a,f=this.getPointAtLength(m),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<o?(i=l,r=c,o=u):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Nt(h.x,h.y,i.x,i.y):Nt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}cachedPolymorphPoints=[];getPolymorphPoints(){if(this.isUpdatedPolymorphPoints){if(this.normalizedLines.length){const t=this.normalizedLines[0];this.cachedPolymorphPoints=[t.x,t.y].concat(this.normalizedLines.reduce((e,n)=>e.concat([n.c1x,n.c1y,n.c2x,n.c2y,n.toX,n.toY]),[]))}this.isUpdatedPolymorphPoints=!1}return[...this.cachedPolymorphPoints]}getPolymorphPointsPerimeter(){let t=0;const e=this.getPolymorphPoints(),n=e.length;if(n){let i=e[n-2],r=e[n-1];for(let o=0;o<n;o+=6)t+=Le(e[o],e[o+1],i,r),i=e[o],r=e[o+1]}return Math.floor(t)}expendToPolymorphPoints(t){const e=t.length,n=this.getPolymorphPoints(),i=n.length;if(i){const r=[];let o=e-i;const a=Math.ceil(e/i);r.push(["M",n[0],n[1]]);let h=2;for(;h+5<=i-1;){const c=n[h++],l=n[h++],u=n[h++],m=n[h++],f=n[h++],p=n[h++];r.push(["C",c,l,u,m,f,p]);let g=0;for(;g<a&&o>0;)r.push(["C",f,p,f,p,f,p]),o-=6,g++}return new Tt(r)}else return Tt.fromPolymorphPoints(t)}static getInterpolator(t,e){return n=>{const i=Oi(Number.EPSILON);return i(n,0)?t.clone():i(n,1)?e.clone():Tt.fromPolymorphPoints(Pf(t.getPolymorphPoints(),e.getPolymorphPoints(),n).map(r=>F(r,2)))}}}const iu=Pw("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 Pw(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Mt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function ai(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function Tw(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function Mw(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const cs={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 Fo{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.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&&(n.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class ru{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class hi{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=n||t?.height||0,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(cs);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=cs[i].canvas}}__getStyleState(){const t={},e=Object.keys(cs);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(cs);for(let r=0;r<i.length;r++){const o=cs[i[r]],a=this[i[r]];if(o.apply){if(a instanceof ru){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Fo)e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Mt("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(o.svgAttr+"-opacity",""+l)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__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(iu);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=iu[a],c=new RegExp(a,"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 n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Mt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Mt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Mt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(Mt("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(Mt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,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,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-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)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],g=e+f*m[1],C=[-h[1],h[0]],y=[c[1],-c[0]],v=function(E){const _=E[0];return E[1]>=0?Math.acos(_):-Math.acos(_)},b=v(C),x=v(y);this.lineTo(p+C[0]*r,g+C[1]*r),this.arc(p,g,r,b,x)}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,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:ai(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Fo(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:ai(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Fo(a,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),n={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"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=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:n,"text-anchor":Tw(this.textAlign),"dominant-baseline":Mw(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),l=e+n*Math.sin(i),u=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=ai(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,l,u,m,f,p,g,C;if(t.length===3)n=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+n+", "+i+")";if(e instanceof hi){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)C=m.childNodes[0].getAttribute("id"),this.__ids[C]=C,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const b=f.getAttribute("transform");let x;b?x=b+" "+v:x=v,f.setAttribute("transform",x),y.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||l!==e.height)&&(g=this.__document.createElement("canvas"),g.width=r,g.height=o,g.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=g),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ai(this.__ids);let r;return n.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")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof hi&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new ru(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Yo{canvas;context;customContext;enablePath2D=!1;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1,r=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new hi({canvas:this.canvas,width:e||this.canvas.width,height:n||this.canvas.height})),this.enablePath2D=typeof r=="boolean"?r:!1}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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.enablePath2D&&(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.enablePath2D&&(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.enablePath2D&&this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){if(this.enablePath2D){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}}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=this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix=this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix=this.currentMatrix.scale(t,e),this.translate(-n,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.enablePath2D&&this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.enablePath2D&&this.currentPath2D.lineTo(t,e),this}arc(t,e,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.enablePath2D&&this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.enablePath2D&&this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.enablePath2D&&this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.enablePath2D&&this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.enablePath2D&&this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.enablePath2D&&this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).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 n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,n,i,r,o,a,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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class Q{shouldUpdatePathD=!1;shouldUpdateTransformPathD=!1;shouldUpdateSVGElInDraw=!1;shouldUpdateMInDraw=!0;shouldUpdateAttrsInDraw=!0;shouldUpdateStyleInDraw=!0;id;initD;d;parent;attrs={};style={};initCenterX;initCenterY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;interactive;drag;transform$=new Te;transformSubscription;isMouseIn=!1;isDragging=!1;m;el;constructor(t){this.id=Dn(4),this.initD=t?.initD,this.setAttr({stroke:"none",fill:"none"}),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.initCenterX=t?.centerX,this.initCenterY=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.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.transformSubscription=this.transform$.subscribe(()=>{this.shouldUpdateTransformPathD=!0,this.shouldUpdateMInDraw=!0})}destroy(){this.transformSubscription.unsubscribe()}moveTo(t,e){const n=this._x,i=this._y;(n!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dX:t-n,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&&(this.transform$.next({dX:t-this._x}),this._x=t)}get y(){return this._y}set y(t){this._y!==t&&(this.transform$.next({dY:t-this._y}),this._y=t)}rotateTo(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}scaleTo(t,e){const n=this._scaleX,i=this._scaleY;(this._scaleX!==t||this._scaleY!==(e||t))&&(this._scaleX=t,this._scaleY=e||t,this.transform$.next({dScaleX:this._scaleX/n,dScaleY:this._scaleY/i}))}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX!==t&&(this.transform$.next({dScaleX:t/this._scaleX}),this._scaleX=t)}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY!==t&&(this.transform$.next({dScaleY:t/this._scaleY}),this._scaleY=t)}pathD(t){return t?(this.d=t,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0):this.initD?this.d||(this.d=this.initD instanceof Tt?this.initD:new Tt(this.initD)):(!this.d||this.shouldUpdatePathD)&&(this.d=new Tt(this.toSVGPathData()),this.shouldUpdatePathD=!1,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0),this.d}cachedTransformedPathD;transformPathD(){if(!this.m){const{x:t,y:e}=this.transformOrigin();let n=0,i=0;if(this.parent?.dDegree||this.parent?.dScaleX!==1||this.parent?.dScaleY!==1){const o=this.transformOrigin(!0);n=o.x,i=o.y}const r=new bt;r.translate(this.x+(this.parent?.dX||0),this.y+(this.parent?.dY||0)),r.rotate(this.degree,t,e),r.scale(this.scaleX,this.scaleY,t,e),this.parent?.dDegree&&r.rotate(this.parent.dDegree,n,i),(this.parent?.dScaleX!==1||this.parent?.dScaleY!==1)&&r.scale(this.parent?.dScaleX||1,this.parent?.dScaleY||1,n,i),this.m=r}return(this.shouldUpdateTransformPathD||!this.cachedTransformedPathD)&&(this.cachedTransformedPathD=this.pathD().transform({m:this.m}),this.shouldUpdateTransformPathD=!1),this.cachedTransformedPathD}getBaseOptions(){return{initD:this.initD,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,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,interactive:this.interactive,drag:{...this.drag}}}clone(){return this.cloneShape()}cloneShape(){return new Q(this.getBaseOptions())}update(t){this.shouldUpdatePathD=!0}toSVGEl(){return null}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getRealBoundingClientRect(t=2){return this.transformPathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}getRealBoundingClientRectCenter(t=2){return this.transformPathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=0,i=0;if(this.parent&&!t){const r=this.parent.combo.getBoundingClientRectCenter(e);n=r.x-this.parent.dX,i=r.y-this.parent.dY}else if(typeof this.initCenterX>"u"&&typeof this.initCenterY>"u"){const r=this.getBoundingClientRectCenter(e);n=r.x,i=r.y}else n=this.initCenterX||0,i=this.initCenterY||0;return{x:n,y:i}}isPointInPath(t,e,n){if(t instanceof Yo)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,n);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*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}isPointInStroke(t,e,n){if(t instanceof Yo)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,n);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*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}setStyle(t){Object.assign(this.style,t),this.shouldUpdateStyleInDraw=!0}setAttr(t,e){if(typeof t!="string")for(const n in t){const i=t[n];i&&i!=this.getAttr(n)&&(this.attrs[dt(n)]=i,this.shouldUpdateAttrsInDraw=!0)}else e&&e!=this.getAttr(t)&&(this.attrs[dt(t)]=e,this.shouldUpdateAttrsInDraw=!0)}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}hasAttr(t){return!!this.getAttr(t)}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const n=t?.friction||1;this.vx*=n,this.vy*=n,this.move(this.vx,this.vy)}animateEaseTo(t,e){const n=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*n,this.vy=r*n,this.animate(e)}animateSpringTo(t,e){const n=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.animate({friction:.9,...e})}getSpringMassAlphaTo(t,e){const n=e?.springLength||100,i=e?.spring||5e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}return 0}followTo(t,e=3){this.rotateTo(gt(Nt(this.x,this.y,t.x,t.y)));const{dx:n,dy:i}=Re(j(this.degree),e);this.vx=n,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateTo(gt(Nt(this.x,this.y,t.x,t.y)));const{dx:n,dy:i}=Re(j(this.degree),e);this.ax=n,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}checkCollision(t){const e=t.x-this.x,n=t.y-this.y,i=Math.sqrt(e*e+n*n),{x:r,y:o,width:a,height:h}=t.getBoundingClientRect(),{x:c,y:l}=t.getBoundingClientRectCenter(),{x:u,y:m,width:f,height:p}=this.getBoundingClientRect(),{x:g,y:C}=this.getBoundingClientRectCenter();if(i<Math.abs(c-r)+Math.abs(g-u)||i<Math.abs(l-o)+Math.abs(C-m)){const y=Math.atan2(n,e),v={x:0,y:0},b=Qt(-y,e,n),x=Qt(-y,this.vx,this.vy),E=Qt(-y,t.vx,t.vy),_=x.x-E.x;x.x=((this.mass-t.mass)*x.x+2*t.mass*E.x)/(this.mass+t.mass),E.x=_+x.x;const L=Math.abs(x.x)+Math.abs(E.x),N=this.ballRadius+t.ballRadius-Math.abs(v.x-b.x);v.x+=x.x/L*N,b.x+=E.x/L*N;const Y=Qt(y,v.x,v.y),G=Qt(y,b.x,b.y);t.moveTo(this.x+G.x,this.y+G.y),this.moveTo(this.x+Y.x,this.y+Y.y);const V=Qt(y,x.x,x.y),J=Qt(y,E.x,E.y);this.vx=V.x,this.vy=V.y,t.vx=J.x,t.vy=J.y}}checkWall(t){if(!t?.wall)return;const e=typeof t.wall.bounce=="number"?t.wall.bounce:-1,n=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height,{x:a,y:h,width:c,height:l}=this.getBoundingClientRect();t.wall.cycle||!1?(this.x+a>r?this.moveXTo(n-(a+c)):this.x+a+c<n&&this.moveXTo(r-a),this.y+h>o?this.moveYTo(i-(h+l)):this.y+h+l<i&&this.moveYTo(o-h)):(this.x+a+c>r?(this.moveXTo(r-(a+c)),this.vx*=e):this.x+a<n&&(this.moveXTo(n+(a+c)),this.vx*=e),this.y+h+l>o?(this.moveYTo(o-(h+l)),this.vy*=e):this.y+h<i&&(this.moveYTo(i+(h+l)),this.vy*=e))}getTotalLength(){return this.transformPathD().getTotalLength()}getPointAtLength(t){return this.transformPathD().getPointAtLength(t)}interpolate(t){return this.transformPathD().interpolate(t)}trailPath(t=0,e=1){const n=this.getTotalLength(),i=t*n,r=e*n;return{subPathD:this.transformPathD().getSubPathD(i,r),point:this.getPointAtLength(r)}}strokeDashTween(t=1e3,e){const n=this.pathD().getTotalLength();this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const i=e?.onUpdate,r=new jn({frameDuration:t});r.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+F(o.offset,2)),i?.(o,a)}})),r.play()}static generateRosetta(t,e,n,i,r){if(r==0)throw new Error("no dividing by zero, please");const o=[],a=360/r;for(let h=0;h<r;h+=1){const c=a*h*Math.PI/180,l=t+2*n*Math.cos(c),u=e+2*n*Math.sin(c);o.push(new Do({x:t,y:e,rx:n,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),o.push(new Do({x:l,y:u,rx:n,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new Q({initD:Tt.fromLines(o)})}}class Rt{shapes=[];svg;forceWidth;attrs={};style={};initCenterX;initCenterY;x;y;degree;scaleX;scaleY;interactive;drag;constructor(t){if(this.initCenterX=t?.centerX,this.initCenterY=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),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.svg=t?.svg,this.forceWidth=t?.forceWidth,t?.svg){this.initCenterX=0,this.initCenterY=0;let e=0,n=0,i=0,r=0;const o=new Ew(t.svg).parse();for(let a=0,h=o.length;a<h;a++){const c=o[a];if(c.type=="viewbox"&&c.width&&c.height){if(e=parseFloat(c.width),n=parseFloat(c.height),t.forceWidth){const p=e/n;i=t.forceWidth,r=i/p}else i=e,r=n;continue}if(c.type!="path"||!Ql(c.path))continue;const l={};for(const p in c)p==="type"||p==="path"||p==="transform"||(l[p]=c[p]);const u=eu(tu(c.path)),m=[];let f=[];for(let p=0,g=u.length;p<g;p++){const C=u[p];f.push(C),C[0].toLowerCase()=="z"&&(m.push(f),f=[])}f.length&&m.push(f),m.forEach(p=>{const g=new Q({attrs:l,initD:p});if(c.transform){const y=nl(c.transform).split();g.moveTo(y.x,y.y),g.rotateTo(y.degree),g.scaleTo(y.scaleX,y.scaleY)}this.addShape(g)})}i&&e&&r&&n&&this.comboScale(i/e,r/n,!0)}}destroy(){this.shapes.forEach(t=>t.destroy())}getBaseOptions(){return{svg:this.svg,forceWidth:this.forceWidth,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this.x,y:this.y,degree:this.degree,scaleX:this.scaleX,scaleY:this.scaleY,interactive:this.interactive,drag:{...this.drag}}}clone(){const t=this.cloneShapeCombo();return t.shapes=this.shapes.map(e=>{const n=e.clone();return e.parent&&(n.parent={...e.parent,combo:t}),n}),t}cloneShapeCombo(){return new Rt(this.getBaseOptions())}update(t){this.shapes.forEach(e=>e.update(t))}addShape(t,e){e?.notCopyFromCombo!==!0&&(t.setAttr(this.attrs),t.setStyle(this.style),t.interactive=t.interactive||this.interactive,t.drag={...this.drag,...t.drag}),t.parent={combo:this,dX:e?.dX||0,dY:e?.dY||0,dDegree:e?.dDegree||0,dScaleX:e?.dScaleX||1,dScaleY:e?.dScaleY||1},this.shapes.push(t)}comboMove(t,e,n=!1){n||(this.x+=t,this.y+=e),this.shapes.forEach(i=>{i.move(t,e)})}comboRotate(t,e=!1){e||(this.degree+=t),this.shapes.forEach(n=>{n.rotate(t)})}comboScale(t,e,n=!1){n||(this.scaleX*=t,this.scaleY*=e||t),this.shapes.forEach(i=>{i.scale(t,e)})}comboTransform(t,e=!1){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0,e),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0,e),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1,e)}getBoundingClientRect(t=2){const e=[],n=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}getBoundingClientRectCenter(t=2){if(typeof this.initCenterX=="number"&&typeof this.initCenterY=="number")return{x:this.initCenterX,y:this.initCenterY};const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}setStyle(t){Object.assign(this.style,t),this.shapes.forEach(e=>{e.setStyle(t)})}setAttr(t,e){if(typeof t!="string"){for(const n in t){const i=t[n];i&&i!=this.getAttr(n)&&(this.attrs[dt(n)]=i)}this.shapes.forEach(n=>{n.setAttr(t)})}else e&&e!=this.getAttr(t)&&(this.attrs[dt(t)]=e,this.shapes.forEach(n=>{n.setAttr(t,e)}))}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}hasAttr(t){return!!this.getAttr(t)}sort(){this.shapes.map(t=>({shape:t,perimeter:t.transformPathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.expendTo(this);for(let i=n;i<e;i++){const r=t.shapes[i];this.addShape(new Q({initD:r.pathD().clone()}),{dX:r.x-this.x,dY:r.y-this.y,dDegree:r.degree-this.degree,dScaleX:r.scaleX/this.scaleX,dScaleY:r.scaleY/this.scaleY,notCopyFromCombo:!0})}}strokeDashTween(t,e){switch(e?.type){case"sequence":this.shapes.forEach((o,a)=>{o.strokeDashTween(t,{...e,delay:a,onStart:()=>{a==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{a==this.shapes.length-1&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new jn({frameDuration:t}),i={},r={};this.shapes.forEach((o,a)=>{const h=o.pathD().getTotalLength();i[`offset_${a}`]=h,r[`offset_${a}`]=0,o.setAttr({strokeDasharray:`${h} ${h}`,strokeDashoffset:`${h}`})}),n.addTween(i,r,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,a)=>{for(const h in o){const c=zi(h).number;this.shapes[c].setAttr("strokeDashoffset",""+F(o[h],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}function Aw(s,t,e=5){const n=Oi(e);(!n(s.x,t.current.x)||!n(s.y,t.current.y))&&s.followTo(t.current)}function Iw(s,t,e){s.drag&&s.drag.enable&&!s.isDragging&&s.animateEaseTo(t,e)}function Dw(s,t){const e=[],n=s.length;for(let i=0;i<n;i++){const r=s[i];if(t?.springLength){const o=t?.springLength||100;r.isDragging||s.filter(a=>a.id!==r.id).forEach(a=>{const h=Nt(r.x,r.y,a.x,a.y);r.animateSpringTo({x:a.x-Math.cos(h)*o,y:a.y-Math.sin(h)*o},t)})}else t?.spring?i>0&&r.animateSpringTo(s[i-1],t):r.animate(t);if(t?.wall&&r.checkWall(t),t?.enableCollision||t?.enableGravityBetweenObjects||t?.enableSpringMassAlpha)for(let o=i+1;o<n;o++)t?.enableCollision&&r.checkCollision(s[o]),t?.enableGravityBetweenObjects&&r.gravitateTo(s[o]),t?.enableSpringMassAlpha&&e.push([r.x,r.y,s[o].x,s[o].y,r.getSpringMassAlphaTo(s[o],t)])}return e}function ou(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=s[i].transformPathD(),o=s[i+1].transformPathD(),a=r.getPolymorphPoints(),h=o.getPolymorphPoints(),c=a.length>=h.length?a:h;e[i]=Tt.getInterpolator(r.expendToPolymorphPoints(c),o.expendToPolymorphPoints(c))}const n=new Q({initD:""});return i=>{const r=F(t*i,6),o=Math.min(Math.floor(r),t-1),a=F(r-o,6);return n.pathD(e[o](a)),n.setAttr(s[o+1].attrs),n}}function kw(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t;const e=[];s.forEach(o=>{let a;o instanceof Rt?(a=o,a.sort()):(a=new Rt,a.addShape(o)),e.push(a),(!t||t.shapes.length<a.shapes.length)&&(t=a)});const n=[];e.forEach((o,a)=>{o!==t&&o.expendTo(t),o.shapes.forEach((h,c)=>{n[c]=n[c]||[],n[c][a]=h})});const i=[];n.forEach(o=>{i.push(ou(o))});const r=new Rt;return i.forEach(o=>{r.addShape(o(0))}),o=>(i.forEach(a=>{a(o)}),r)}function Lw(s,t=6e3,e){const n=s.findIndex(a=>a instanceof Rt)>=0?kw(s):ou(s),i=n(0),r=e?.onUpdate,o=new jn({frameDuration:t});return o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{r?.(a,h),n(a.t),e?.shapeOrCombo?.(i,a.t)}})),o.play(),i}const ls={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 Yt{_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 n;if(n=/^(\w+)\(([^)]*)\)/.exec(t)){const i=n[2];let r;switch(n[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=B(parseFloat(r[1]),0,100)*255/100,this.g=B(parseFloat(r[2]),0,100)*255/100,this.b=B(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(n=/#([A-Fa-f0-9]+)/.exec(t)){const i=n[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 Yt?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){this._color.r=B(Math.round(Wt(t,this.r)),0,255)}get g(){return this._color.g}set g(t){this._color.g=B(Math.round(Wt(t,this.g)),0,255)}get b(){return this._color.b}set b(t){this._color.b=B(Math.round(Wt(t,this.b)),0,255)}get a(){return this._color.a}set a(t){this._color.a=B(Wt(t,this.a),0,1)}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,n=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+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},${F(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=Qe){$o.fromWorkingColorSpace(xe.copy(this),t);const e=xe.r,n=xe.g,i=xe.b;return t!==Qe?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Yt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=tn(t.r),this.g=tn(t.g),this.b=tn(t.b),this}copyLinearToSRGB(t){return this.r=en(t.r),this.g=en(t.g),this.b=en(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",n="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:n);{const{r:i,g:r,b:o}=this.color;return this.r=255-i,this.g=255-r,this.b=255-o,this}}closet(t="#000000",e="#ffffff"){return this.opposite(!0,t,e).opposite(!0,t,e)}lighten(t){t=B(t,0,1);const{r:e,g:n,b:i,a:r}=this.color;return r==0?this.a=t:(this.r=e+(255-e)*t,this.g=n+(255-n)*t,this.b=i+(255-i)*t),this}darken(t){t=B(t,0,1);const{r:e,g:n,b:i,a:r}=this.color;return r==0?this.a=t:(this.r=e*(1-t),this.g=n*(1-t),this.b=i*(1-t)),this}lerp(t,e){e=B(e,0,1);const{r:n,g:i,b:r}=this.color;return this.r=n+(t.r-n)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,n){return n=B(n,0,1),this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}static gradient(t,e,n){try{return xe.lerpColors(new Yt(t),new Yt(e),n).toString()}catch{return e}}static random(){return xe.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Yt.nextIndex){Yt.nextIndex=t;const e=Object.keys(ls),n=e.length;return xe.setHEX(ls[e[Yt.nextIndex++%n]]).toString()}setColorName(t){const e=ls[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(ls).map(t=>xe.setHEX(t).toString())}setRGB(t,e,n,i=1){return this.r=t,this.g=e,this.b=n,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,n,i=1){const r=Ef(t,1),o=B(e,0,1),a=B(n,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const h=a<=.5?a*(1+o):a+o-a*o,c=2*a-h;this.r=Go(c,h,r+1/3)*255,this.g=Go(c,h,r)*255,this.b=Go(c,h,r-1/3)*255}return this.a=i,this}getHSL(t){const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i)/255,o=Math.min(e,n,i)/255;let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case e:a=(n-i)/l+(n<i?6:0);break;case n:a=(i-e)/l+2;break;case i:default:a=(e-n)/l+4;break}a/=6}return t&&t.setHSL(a,h,c,this.a),{h:a,s:h,l:c,a:this.a}}offsetHSL(t,e,n){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+n)}lerpHSL(t,e){const n=this.getHSL(),i=t.getHSL(),r=_s(n.h,i.h,e),o=_s(n.s,i.s,e),a=_s(n.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,n,i=1){const r=B(t,0,1)*360,o=B(e,0,1),a=B(n,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=a*(1-o),u=a*(1-c*o),m=a*(1-(1-c)*o),f=[[a,m,l],[u,a,l],[l,a,m],[l,u,a],[m,l,a],[a,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,n,i=1){this.setHSV(t,e,n,i)}getHSV(t){const{r:e,g:n,b:i,a:r}=this.color,o=Math.max(e,n,i),a=Math.min(e,n,i),h=o-a;let c;e===o?c=(n-i)/h:n===o?c=2+(i-e)/h:c=4+(e-n)/h,c/=6,c<0&&(c+=1);const l=h==0?0:c,u=o===0?0:h/o,m=o/255;return t&&t.setHSV(l,u,m,r),{h:l,s:u,v:m,a:r}}getHSB(t){const{h:e,s:n,v:i,a:r}=this.getHSV(t);return{h:e,s:n,b:i,a:r}}}const xe=new Yt,au="",Qe="srgb",Xo="srgb-linear",Uo="linear",ci="srgb";function tn(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function en(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}const hu=new wn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),cu=new wn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),lu=[.64,.33,.3,.6,.15,.06],uu=[.2126,.7152,.0722],fu=[.3127,.329],$o={enabled:!0,workingColorSpace:Xo,spaces:{},convert:function(s,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===ci&&(s.r=tn(s.r),s.g=tn(s.g),s.b=tn(s.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(s.applyMatrix3(this.spaces[t].toXYZ),s.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===ci&&(s.r=en(s.r),s.g=en(s.g),s.b=en(s.b))),s},fromWorkingColorSpace:function(s,t){return this.convert(s,this.workingColorSpace,t)},toWorkingColorSpace:function(s,t){return this.convert(s,t,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===au?Uo:this.spaces[s].transfer},getLuminanceCoefficients:function(s,t=this.workingColorSpace){return s.fromArray(this.spaces[t].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,t,e){return s.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}};$o.define({[Xo]:{primaries:lu,whitePoint:fu,transfer:Uo,toXYZ:hu,fromXYZ:cu,luminanceCoefficients:uu,workingColorSpaceConfig:{unpackColorSpace:Qe},outputColorSpaceConfig:{drawingBufferColorSpace:Qe}},[Qe]:{primaries:lu,whitePoint:fu,transfer:ci,toXYZ:hu,fromXYZ:cu,luminanceCoefficients:uu,outputColorSpaceConfig:{drawingBufferColorSpace:Qe}}});function Go(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+(t-s)*6*e:e<1/2?t:e<2/3?s+(t-s)*6*(2/3-e):s}class Rw{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new sc(null);resizeSubscription;mpg=Ze();mouseSubscription;shapes=[];shapeTap$=new sc(null);tapSubscription;lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",n=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&ll(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Ke("svg"),xn(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=ml("canvas"),xn(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=Ao(this.PARENT_EL).subscribe(i=>{this.rect.x=i.x,this.rect.y=i.y,this.rect.width=i.width,this.rect.height=i.height,this.SVG_EL&&we(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(we(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new Yo(this.CANVAS_EL,this.rect.width,this.rect.height,n)),this.size$.next(i)}),this.mouseSubscription=Ul(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{}),this.tapSubscription=Il(this.PARENT_EL).subscribe(i=>{for(const r of this.shapes)if(r.isMouseIn){this.shapeTap$.next(r);break}})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe(),this.tapSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}draw(...t){if(t.length){const e=[];t.forEach(n=>{n instanceof Rt?e.push(...n.shapes):e.push(n)}),this.SVG_EL&&this.shapes.filter(n=>e.findIndex(i=>i.id==n.id)==-1).forEach(n=>{n.el&&(n.el.remove(),delete n.el)}),Af(this.shapes,e)}this.ctx&&this.ctx.clearRect(),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const e of this.shapes){const{x:n,y:i}=e.transformOrigin();let r=0,o=0;if(e.parent?.dDegree||e.parent?.dScaleX!==1||e.parent?.dScaleY!==1){const a=e.transformOrigin(!0);r=a.x,o=a.y}if(e.shouldUpdatePathD&&e.pathD(),this.SVG_EL){if(!e.el||e.shouldUpdateSVGElInDraw){const a=e.toSVGEl();e.el?a&&(e.el.remove(),e.el=a,xn(this.SVG_EL,e.el),we(e.el,{id:e.id})):(e.el=a||Kl(),xn(this.SVG_EL,e.el),we(e.el,{id:e.id})),vw(e.el)&&we(e.el,{d:e.toSVGPathD()}),e.shouldUpdateSVGElInDraw=!1,e.shouldUpdateAttrsInDraw=!0,e.shouldUpdateStyleInDraw=!0,e.shouldUpdateMInDraw=!0}if(e.shouldUpdateAttrsInDraw&&(Oa(e.attrs)||we(e.el,e.attrs),e.shouldUpdateAttrsInDraw=!1),e.shouldUpdateStyleInDraw&&(Oa(e.style)||vn(e.el,e.style),e.shouldUpdateStyleInDraw=!1),e.shouldUpdateMInDraw||!e.m){const a=new bt;a.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),a.rotate(e.degree,n,i),a.scale(e.scaleX,e.scaleY,n,i),e.parent?.dDegree&&a.rotate(e.parent.dDegree,r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&a.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),we(e.el,{transform:a.toString()}),e.m=a,e.shouldUpdateMInDraw=!1}}if(this.ctx&&(this.ctx.save(),this.ctx.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),this.ctx.rotate(j(e.degree),n,i),this.ctx.scale(e.scaleX,e.scaleY,n,i),e.parent?.dDegree&&this.ctx.rotate(j(e.parent.dDegree),r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&this.ctx.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),e.m=this.ctx.currentMatrix,_l(this.ctx,e.attrs),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),e.interactive?this.SVG_EL?e.isMouseIn=e.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?e.isMouseIn=e.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):e.isMouseIn=!1:e.isMouseIn=!1,e.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=e.id),e.isDragging=e.id==this.draggingShapeId,this.mpg.current.isDown&&(e.isDragging||!this.draggingShapeId&&e.isMouseIn&&e.drag&&e.drag.enable)){this.setCursor("grabbing"),e.isDragging=!0,this.draggingShapeId=e.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(e.drag&&e.drag.enable&&e.drag.alongPath){const c=e.drag.alongPath.transform({m:e.m}).closestPoint(this.mpg.current.x,this.mpg.current.y);a=c.point.x-e.x,h=c.point.y-e.y}(a||h)&&(e.move(a,h),e.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==e&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else e.isMouseIn&&e.drag&&e.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}clear(){this.shapes.forEach(t=>{t.el&&(t.el.remove(),delete t.el)}),this.ctx&&this.ctx.clearRect(),this.shapes=[]}drawMouseMoveLine(t){const e=t?.brushSize||4,n=t?.brushColor||"#000000";let i=!1;const r=ri(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{i=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=n,this.ctx.beginPath())},end:()=>{this.ctx&&this.ctx.restore()}}).subscribe(o=>{this.ctx&&(i?this.ctx.lineTo(o.current.x,o.current.y):(i=!0,this.ctx.moveTo(o.current.x,o.current.y)),this.ctx.stroke())});return()=>{r.unsubscribe()}}drawMouseMoveBrush(t){const e=t?.brushSize||10,n=t?.brushDensity||50,i=t?.brushColor||"#000000",r=new Yt(i),o=r.r,a=r.g,h=r.b,c=ri(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(l=>{if(this.ctx){const u=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),m=u.data;for(let f=0;f<n;f++){const p=Math.random()*Math.PI*2,g=Math.random()*e,C=l.current.x+Math.cos(p)*g|0,y=l.current.y+Math.sin(p)*g|0,v=(C+y*u.width)*4;m[v]=o,m[v+1]=a,m[v+2]=h,m[v+3]=255}this.ctx.putImageData(u)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&Sw(this.SVG_EL)}}class nn extends Q{lineLength;startColor;endColor;constructor(t){super({...t,centerX:0,centerY:0}),this.lineLength=t?.lineLength||0,this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.startColor||this.getAttr("stroke")||"#000000"})}cloneShape(){return new nn({...super.getBaseOptions(),lineLength:this.lineLength,startColor:this.startColor,endColor:this.endColor})}lineToAbsolutePoint(t){const e=gt(Nt(this.x,this.y,t.x,t.y)),n=Le(this.x,this.y,t.x,t.y);(e!=this.degree||n!=this.lineLength)&&(e!=this.degree&&this.rotateTo(e),n!=this.lineLength&&(this.lineLength=n),this.shouldUpdatePathD=!0)}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}getBoundingClientRect(){return{x:0,y:0,width:this.lineLength,height:parseFloat(this.getAttr("strokeWidth"))}}toSVGPathData(){return[["m",0,0],["l",this.lineLength,0]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.lineLength,0,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.lineLength,0)}intersection(t){const e=this.transformPathD().normalizedLines[0],n=t.transformPathD().normalizedLines[0];return e.intersection(n)}}class Vo extends Q{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Vo({...super.getBaseOptions(),cx:this.cx,cy:this.cy,toX:this.toX,toY:this.toY,isLineThrough:this.isLineThrough})}update(t){typeof t.cx=="number"&&(this.cx=t.cx,this.shouldUpdatePathD=!0),typeof t.cy=="number"&&(this.cy=t.cy,this.shouldUpdatePathD=!0),typeof t.toX=="number"&&(this.toX=t.toX,this.shouldUpdatePathD=!0),typeof t.toY=="number"&&(this.toY=t.toY,this.shouldUpdatePathD=!0),typeof t.isLineThrough=="boolean"&&(this.isLineThrough=t.isLineThrough,this.shouldUpdatePathD=!0)}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(0+this.toX)/2,e=this.cy*2-(0+this.toY)/2;return[["m",0,0],["q",t,e,this.toX,this.toY]]}else return[["m",0,0],["q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(0+this.toX)/2,n=this.cy*2-(0+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}}class li extends Q{points;isStraight;constructor(t){super(t),this.points=t?.points||[],this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new li({...super.getBaseOptions(),points:[...this.points],isStraight:this.isStraight})}update(t){"points"in t&&(this.points=[...t.points||this.points],this.shouldUpdatePathD=!0),typeof t.isStraight=="boolean"&&(this.isStraight=t.isStraight,this.shouldUpdatePathD=!0)}toSVGPathData(){const t=[];if(this.points.length<3)return t;const e=this.points.length;if(this.isStraight){t.push(["m",this.points[0].x,this.points[0].y]);for(let n=1;n<=e-1;n++)t.push(["l",this.points[n].x-this.points[n-1].x,this.points[n].y-this.points[n-1].y]);t.push(["z"])}else{const n=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;let r=n,o=i;t.push(["m",r,o]);for(let a=0;a<e-1;a++){const h=(this.points[a].x+this.points[a+1].x)/2,c=(this.points[a].y+this.points[a+1].y)/2;t.push(["q",this.points[a].x-r,this.points[a].y-o,h-r,c-o]),r=h,o=c}t.push(["q",this.points[e-1].x-r,this.points[e-1].y-o,n-r,i-o])}return t}toCanvasContext(t){if(this.points.length<3)return;t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let n=1;n<=e-1;n++)t.lineTo(this.points[n].x,this.points[n].y);t.closePath()}else{const n=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(n,i);for(let r=0;r<e-1;r++){const o=(this.points[r].x+this.points[r+1].x)/2,a=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,o,a)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,n,i)}}isPointInShape(t){const e=this.points.length;let n=!1;const i=2e-10;for(let r=0,o=e-1;r<e;o=r,r++){const a=this.points[r].x,h=this.points[r].y,c=this.points[o].x,l=this.points[o].y;if(a===t.x&&h===t.y||c===t.x&&l===t.y||t.y===h&&t.y===l)return!0;if(t.y>=h&&t.y<l||t.y<h&&t.y>=l){const u=(c-a)/(l-h),m=a+u*(t.y-h);if(m===t.x||Math.abs(m-t.x)<i)return!0;m>t.x&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}static generate(t,e,n,i){const r=[];for(let o=0;o<i;o++){const a=o/i*2*Math.PI,{dx:h,dy:c}=Re(a,n);r.push({x:t+h,y:e+c})}return new li({points:r})}}class jo extends Rt{length=100;constructor(t){super(t);const e=new nn({drag:{followSibling:!0},lineLength:this.length});this.addShape(e);const n=new nn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(n,{dX:90-Math.random()*40,dDegree:Math.random()*70});const i=new nn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(i,{dX:90-Math.random()*40,dDegree:-Math.random()*70}),this.comboRotate(-90,!0)}cloneShapeCombo(){return new jo(super.getBaseOptions())}}class _n extends Q{ballRadius;constructor(t){super(t),this.ballRadius=t?.ballRadius||0}cloneShape(){return new _n({...super.getBaseOptions(),ballRadius:this.ballRadius})}update(t){typeof t.ballRadius=="number"&&(this.ballRadius=t.ballRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:-this.ballRadius,y:-this.ballRadius,width:this.ballRadius*2,height:this.ballRadius*2}}toSVGEl(){const t=Ke("circle");return this.setAttr({cx:"0",cy:"0",r:String(this.ballRadius)}),t}toSVGPathData(){return this.ballRadius?[["m",0,-this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,2*this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,-2*this.ballRadius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.ballRadius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.ballRadius===t.ballRadius&&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 yn(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 n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y;return{x:n*t.x-e*t.y,y:e*t.y-n*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}}}class qo extends Q{constructor(t){super(t)}cloneShape(){return new qo({...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 Q{rectWidth;rectHeight;rectBorderRadius;constructor(t){super(t),this.rectWidth=t.rectWidth||0,this.rectHeight=t.rectHeight||0,this.rectBorderRadius=t.rectBorderRadius||0}cloneShape(){return new Ne({...super.getBaseOptions(),rectWidth:this.rectWidth,rectHeight:this.rectHeight,rectBorderRadius:this.rectBorderRadius})}update(t){typeof t.rectWidth=="number"&&(this.rectWidth=t.rectWidth,this.shouldUpdatePathD=!0),typeof t.rectHeight=="number"&&(this.rectHeight=t.rectHeight,this.shouldUpdatePathD=!0),typeof t.rectBorderRadius=="number"&&(this.rectBorderRadius=t.rectBorderRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:0,y:0,width:this.rectWidth,height:this.rectHeight}}toSVGEl(){const t=Ke("rect");return this.setAttr({x:"0",y:"0",width:String(this.rectWidth),height:String(this.rectHeight),rx:String(this.rectBorderRadius),ry:String(this.rectBorderRadius)}),t}toSVGPathData(){return this.rectBorderRadius?[["m",this.rectBorderRadius,0],["l",this.rectWidth-this.rectBorderRadius*2,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,this.rectBorderRadius],["l",0,this.rectHeight-this.rectBorderRadius*2],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,this.rectBorderRadius],["l",this.rectBorderRadius*2-this.rectWidth,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,-this.rectBorderRadius],["l",0,this.rectBorderRadius*2-this.rectHeight],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,-this.rectBorderRadius],["z"]]:[["m",0,0],["l",this.rectWidth,0],["l",0,this.rectHeight],["l",-this.rectWidth,0],["z"]]}toCanvasContext(t){t.beginPath(),this.rectBorderRadius<=0?t.rect(0,0,this.rectWidth,this.rectHeight):(t.moveTo(0,this.rectBorderRadius),t.lineTo(0,this.rectHeight-this.rectBorderRadius),t.quadraticCurveTo(0,this.rectHeight,this.rectBorderRadius,this.rectHeight),t.lineTo(this.rectWidth-this.rectBorderRadius,this.rectHeight),t.quadraticCurveTo(this.rectWidth,this.rectHeight,this.rectWidth,this.rectHeight-this.rectBorderRadius),t.lineTo(this.rectWidth,this.rectBorderRadius),t.quadraticCurveTo(this.rectWidth,0,this.rectWidth-this.rectBorderRadius,0),t.lineTo(this.rectBorderRadius,0),t.quadraticCurveTo(0,0,0,this.rectBorderRadius)),t.closePath()}static fromCubicBezier(t,e,n,i,r,o,a,h){const l=new xt({x:t,y:e,c1x:n,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Ne({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.height})}eq(t){return this.x===t.x&&this.y===t.y&&this.rectWidth===t.rectWidth&&this.rectHeight===t.rectHeight&&this.rectBorderRadius===t.rectBorderRadius}intersection(t){return!(this.x+this.rectWidth<t.x||t.x+t.rectWidth<this.x||this.y+this.rectHeight<t.y||t.y+t.rectHeight<this.y)}isPointInShape(t){return t.x>=this.x&&t.x<=this.x+this.rectWidth&&t.y>=this.y&&t.y<=this.y+this.rectHeight}}class Ho extends Q{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Ho({...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 Wo extends Q{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||50,this.ry=t?.heartRy||50}cloneShape(){return new Wo({...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 Jo extends Q{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Jo({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const n=288+e*144,i=this.r*Math.cos(j(n)),r=this.r*Math.sin(j(n));t.push(["l",i,r])}return t}}class Zo extends Q{constructor(t){super(t)}cloneShape(){return new Zo({...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 Ko extends Q{constructor(t){super(t)}cloneShape(){return new Ko({...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,2*15],["a",15,15,0,1,1,0,-2*15]]}}class Qo extends Q{constructor(t){super({...t,initD:"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 Qo({...super.getBaseOptions()})}}class ta extends Q{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new ta({...super.getBaseOptions(),rx:this.rx,ry:this.ry})}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGEl(){const t=Ke("ellipse");return this.setAttr({cx:"0",cy:"0",rx:String(this.rx),ry:String(this.ry)}),t}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class ea extends Rt{showFlame;flame;ship;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t?.showFlame:!0,this.flame=new Q({initD:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]],drag:{followSibling:!0}}),this.showFlame&&this.addShape(this.flame),this.ship=new Q({initD:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]],drag:{followSibling:!0}}),this.addShape(this.ship)}cloneShapeCombo(){return new ea({...super.getBaseOptions(),showFlame:this.showFlame})}update(t){typeof t?.showFlame=="boolean"&&(this.shapes=[],this.showFlame=t?.showFlame,this.showFlame&&this.addShape(this.flame),this.addShape(this.ship))}}class na extends Rt{width;height;cornerRadius;constructor(t){super(t),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const e=new Ne({drag:{followSibling:!0},rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(e,{dX:0-this.cornerRadius,dY:0-this.height*.5});const n=new _n({drag:{followSibling:!0},ballRadius:2});this.addShape(n);const i=new _n({drag:{followSibling:!0},ballRadius:2});this.addShape(i,{dX:0+this.width})}cloneShapeCombo(){return new na({...super.getBaseOptions(),segmentWidth:this.width,segmentHeight:this.height,segmentCornerRadius:this.cornerRadius})}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 sa extends Rt{options;value$=new Te;subscription;constructor(t){super(t),this.options=t;const e=t?.sliderMin||0,n=t?.sliderMax||100,i=t?.sliderStep||1,r=Tf(e,n,i),o=r(typeof t?.sliderDefaultValue=="number"?B(t.sliderDefaultValue,e,n):e);this.value$.next(o);const a=o/(n-e),h=t?.sliderWidth||100,c=t?.sliderHeight||4,l=c*.5,u=c*2.5,m=t?.sliderBackgroundColor||"#f5f5f5",f=t?.sliderForegroundColor||"#5a82f0",p=new Ne({rectWidth:h,rectHeight:c,rectBorderRadius:l,attrs:{fill:m},drag:{enable:!1}});this.addShape(p);const g=new Ne({rectWidth:h*a,rectHeight:c,rectBorderRadius:l,attrs:{fill:f},drag:{enable:!1}});this.addShape(g);const C=new _n({x:h*a,y:l,ballRadius:u,attrs:{fill:f},drag:{enable:!0,alongPath:new Tt([["m",0,0],["l",h,0]])}});this.addShape(C),this.subscription=C.transform$.subscribe(({dX:y})=>{console.log(y);const v=(C.x-p.x)/h;g.update({rectWidth:h*v}),this.value$.next(r(v*(n-e)+e))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new sa({...super.getBaseOptions(),...this.options})}}class us extends Q{half;lineWidth;radius;startDegree;endDegree;percent=0;percentDegree=0;startColor;endColor;constructor(t){super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t.lineWidth;const e=t.width||0,n=t.height||0,i=(t.endDegree-t.startDegree-180)/2;if(t.radius)this.radius=t.radius;else if(this.half){const r=Math.min(e/2,n)-this.lineWidth;this.radius=Math.max(0,r-r*Math.sin(j(i)))}else this.radius=Math.max(0,Math.min(e/2,n/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=n-this.lineWidth-this.radius*Math.sin(j(i)):this.y=n/2),t.forceCoordinate?(this.startDegree=t.startDegree,this.endDegree=t.endDegree):(this.startDegree=-90+t.startDegree,this.endDegree=-90+t.endDegree),this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({"stroke-linecap":"round","stroke-width":String(this.lineWidth),stroke:this.startColor||"#000000"}),this.setPercent(t.percent||1)}cloneShape(){return new us({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,radius:this.radius,forceCoordinate:!0,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:this.percent})}setPercent(t){this.percent=Math.max(0,t),this.percentDegree=this.startDegree+(this.endDegree-this.startDegree)*t}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){const{dx:t,dy:e}=Re(j(this.startDegree),this.radius),{dx:n,dy:i}=Re(j(this.percentDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.percentDegree-this.startDegree)>=180?1:0,1,n-t,i-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const n=this.radius-this.radius*Math.cos(Math.PI*this.percent),i=this.radius*Math.sin(Math.PI*this.percent);e=t.createLinearGradient(-this.radius,0,-this.radius+n,-i,{0:this.startColor,1:this.endColor})}else{const n=this.radius*Math.sin(2*Math.PI*this.percent),i=this.radius*Math.cos(2*Math.PI*this.percent);e=t.createLinearGradient(0,-this.radius,n,-i,{0:this.startColor,1:this.endColor})}this.setAttr({stroke:e})}t.beginPath(),t.arc(0,0,this.radius,j(this.startDegree),j(this.percentDegree),!1)}}class ia extends Rt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t){if(super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t?.lineWidth||12,this.width=t.width,this.height=t.height,this.bgColor=t?.bgColor,this.startColor=t?.startColor,this.endColor=t?.endColor,this.half?(this.startDegree=t?.startDegree||-90-15,this.endDegree=t?.endDegree||90+15):(this.startDegree=t?.startDegree||0,this.endDegree=t?.endDegree||360),this.percent=t?.percent||0,this.ringBg=new us({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.bgColor,percent:1}),this.addShape(this.ringBg),this.ring=new us({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:0}),this.addShape(this.ring),this.indicatorLineCount=22+1,this.half){const r=this.ringBg.radius-20-17;for(let o=0;o<this.indicatorLineCount;o++){const a=new nn({lineLength:17,startColor:this.startColor,endColor:this.endColor,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(a);const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*o;this.addShape(a,{dX:this.ringBg.x+Math.cos(j(h))*r,dY:this.ringBg.y+Math.sin(j(h))*r,dDegree:h})}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new ia({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,width:this.width,height:this.height,bgColor:this.bgColor,startColor:this.startColor,endColor:this.endColor,startDegree:this.startDegree,endDegree:this.endDegree,percent:this.percent})}setPercent(t){if(this.percent=Math.max(0,t),this.ring.setPercent(t),this.half)for(let e=0;e<this.indicatorLineCount;e++)e/(this.indicatorLineCount-1)<=this.percent?this.lines[e].enableGradient(this.startColor,this.endColor):this.lines[e].disableGradient(this.bgColor)}}class Cn extends Q{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=zi(this.getAttr("fontSize"),10).number,n=zi(this.getAttr("fontWeight"),400).number,i=Cn.measureText(this.text,e,n);this.width=i.width,this.height=i.height}cloneShape(){return new Cn({...super.getBaseOptions(),text:this.text})}toSVGEl(){const t=Ke("text");t.setAttribute("x","0"),t.setAttribute("y","0"),t.style.alignmentBaseline="middle";const e=this.text.split(`
40
- `);if(e.length<=1)t.innerHTML=this.text;else{const n=this.getAttr("line-height","1.2em");e.forEach((i,r)=>{if(i.trim()){const o=Ke("tspan");o.setAttribute("x","0"),o.setAttribute("dy",r>0?n:"0"),o.innerHTML=i.trim(),o.style.alignmentBaseline="middle",t.append(o)}})}return t}toSVGPathData(){return[]}toCanvasContext(t){const e=this.text.split(`
41
- `);if(e.length<=1)t.fillText(this.text,0,0);else{const n=t.measureText(this.text),r=(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)*parseFloat(this.getAttr("line-height","1.2em"));let o=0;e.forEach((a,h)=>{a.trim()&&(o+=h>0?r:0,t.fillText(a.trim(),0,o))})}}static measureText(t,e=12,n=400){const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=n.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,o=i.offsetHeight;return document.body.removeChild(i),{width:r,height:o}}static getFixedWidthText(t,e,n=12,i=400,r="..."){let o="";if(!t||e<n)return o;const a=t.split("");let h=r?Cn.measureText(r,n,i).width:0;for(let c=0,l=a.length;c<l;c++)if(h+=Cn.measureText(a[c],n,i).width,h>e){r&&(o+=r);break}else o+=a[c];return o}}class ra extends Rt{options;constructor(t){super(t),this.options=t;const{shapeCreator:e,width:n,height:i,x:r,y:o,particleCount:a,angle:h,spread:c,startVelocity:l,decay:u,gravity:m,drift:f,ticks:p,colors:g,scalar:C,flat:y}=Object.assign({shapeCreator:()=>new Ne({rectWidth:10,rectHeight:10}),width:100,height:100,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Yt.getColors(),scalar:1,flat:!1},t||{}),v=(_,L)=>{_.x=n*r,_.y=i*o,_.scaleX=C,_.scaleY=C;const N=g[L%g.length];_.setAttr({fill:N}),_.interactive=!1,_.wobble=Math.random()*10,_.wobbleSpeed=Math.min(.11,Math.random()*.1+.05),_.velocity=l*.5+Math.random()*l,_.angle2D=-b+(.5*x-Math.random()*x),_.tiltAngle=(Math.random()*(.75-.25)+.25)*Math.PI,_.tick=0,_.totalTicks=p,_.decay=u,_.drift=f,_.random=Math.random()+2,_.tiltSin=0,_.tiltCos=0,_.wobbleX=0,_.wobbleY=0,_.gravity=m*3,_.scalar=C,_.flat=y,_.color=new Yt(N)},b=j(h),x=j(c);let E=a;for(;E;){const _=e();v(_,E),_.clone=(L=>()=>{const N=e();return v(N,L),N})(E),this.addShape(_),E--}}cloneShapeCombo(){return new ra(this.options)}update(){return this.shapes=this.shapes.filter(t=>{t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);const e=t.tick++/t.totalTicks,n=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,r=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;return t.setAttr("fill",t.color.setAlpha(1-e).toString()),t.degree=gt(Math.PI/10*t.wobble),t.scaleX=Math.abs(r-n)*.1,t.scaleY=Math.abs(o-i)*.1,t.tick<t.totalTicks}),this.shapes.length>0}}function du(s,t={attributes:!0,childList:!0,subtree:!0}){return new st(e=>{const n=new MutationObserver((i,r)=>{e.next(i)});return n.observe(s,t),()=>{n.disconnect()}})}function Ow(s,t){return new Promise(e=>{new MutationObserver((i,r)=>{for(const o of i)o.type==="childList"&&o.addedNodes.forEach(a=>{a.isEqualNode(t)&&(r.disconnect(),e(!0))})}).observe(s,{childList:!0})})}function mu(s,t={root:null}){return new st(e=>{const n=new IntersectionObserver((i,r)=>{if(i.length){const o=i[i.length-1];o&&e.next(o)}},t);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}})}function zw(s,t){return $l().pipe(je(null),it(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||Eo(),{top:i,left:r,right:o,bottom:a}=s.getBoundingClientRect();return(i>=0&&i<=n||a>=0&&a<=n)&&(r>=0&&r<=e||o>=0&&o<=e)}),Me())}function Nw(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return mu(s,{threshold:e,root:t?.root}).pipe(it(n=>n.isIntersecting&&n.intersectionRatio>=e),Me())}let pu=!1;function Bw(){pu||(pu=!0,xl(`
83
+ `,t}function Eu(s){const t=[];for(let e=0,n=Go.length;e<n;e++){const r=Nt(Go[e]+s);t.push(r)}return t}function ws(s,t,e){const n=$a(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[Xc(t)]||n.props.style[Nt(t)]||"":n.props.style}function $n(s,t,e){jr(s,n=>{n.props.style=n.props.style||{},typeof t=="string"&&e?n.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(r=>{n.props.style[r]=t[r]})}),Ya()}function ta(s,t=!1){const e={};if(!t)if(getComputedStyle){const n=getComputedStyle(s);for(let r=0,i=n.length;r<i;r++){const o=n[r];e[o]=n.getPropertyValue(o)}}else{const n=s.style||s.currentStyle;for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return s.style.cssText&&s.style.cssText.split(";").filter(n=>!!n).forEach(n=>{const[r,i]=n.split(":").map(o=>o.trim());r&&i&&(e[r]=i)}),e}function Fb(s,t){const e=Eu(t),n=e.length;let r="";for(let i=0;i<n;i++){const o=e[i];if(r=s[o]||"",r)return r}return r}function Bb(s,t,e){const n=Eu(t),r=n.length;let i="";for(let o=0;o<r;o++){const a=n[o];if(i="style"in s&&s.style[a]||"currentStyle"in s&&s.currentStyle[a]||"",i)return i}if(getComputedStyle){const o=getComputedStyle(s,e);for(let a=0;a<r;a++){const c=n[a];if(i=o.getPropertyValue(c).trim(),i)return i}}return i}function vs(s,t,e){if(t)if(typeof t=="string"&&e)try{s.style.setProperty(t,e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":"")}catch{s.style[t]=e}else t instanceof Object&&Object.keys(t).forEach(n=>{vs(s,n,t[n])})}function ea(s,t){typeof t=="string"?s.style.removeProperty(Nt(t)):Object.keys(t).forEach(e=>{ea(s,e)})}function Tu(s,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const n=document.createElement("style");return n.innerHTML=s,e.appendChild(n),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(n)}}else{const n=document.styleSheets[0].insertRule(s);return()=>{document.styleSheets[0].deleteRule(n)}}}class Ub{selector;name;value;constructor(t,e,n){this.selector=t,this.name=e,this.value=n}toString(){return`${this.selector} { ${this.name}: ${this.value} }`}}class $b{propertyName;values=[];constructor(t){this.propertyName=t}add(t,e){this.values.push(new Ub(t,this.propertyName,e))}}async function Pu(){const s=[],t=document.querySelectorAll("style, link");for(let e=0,n=t.length;e<n;e++){const r=t[e];let i=r.innerHTML;switch(r.nodeName.toLowerCase()){case"style":break;case"link":i=await Cu(r.href,{method:"GET",responseType:"text"});break}i=i.replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g,"").replace(/@[^{};]*;|@[^{};]*\{[^}]*\}/g,"").replace(/[\\n\n]+(?<=[\\n\n]+)\s+/g,""),s.push(i)}return s}async function Yb(){const s={},t=await Pu();for(let e=0,n=t.length;e<n;e++){const i=t[e].match(/[^{]*{[^}]*}/g);if(i)for(let o=0,a=i.length;o<a;o++){const c=i[o].split(/[{}]/g),h=c[0].trim(),u=c[1].split(";");for(let d=0;d<u.length;d++)if(u[d].trim()!=""){const f=u[d].split(":"),m=f[0].trim().toLowerCase(),p=f[1];s[m]||(s[m]=new $b(m)),p&&s[m].add(h,p.trim())}}}return s}function Ne(s,t,e){if(t===void 0&&e===void 0)return na(s);if(typeof t=="string"&&e===void 0)return Au(s,t);typeof t=="object"?jr(s,n=>{for(const r in t)r=="style"?$n(s,r,t[r]):Object.prototype.hasOwnProperty.call(t,r)&&(n.props[r]=""+t[r])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?$n(s,t,e):jr(s,n=>{n.props[t]=""+e})),Ya()}function na(s){const t={};for(let e=0,n=s.attributes,r=n.length;e<r;e++){const i=n[e];i.nodeName&&i.nodeValue&&(i.nodeName==="style"?t[i.nodeName]=ta(s,!0):t[i.nodeName]=i.nodeValue)}return t}function Au(s,t){return t==="style"?ta(s,!0):s.getAttribute(Nt(t))}function yn(s,t,e){return s.setAttribute(Nt(t),""+e)}function jb(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=Nt(e.trim());n!=""&&s.removeAttribute(n)})}function Mu(s,t){for(const e in t){const n=t[e];switch(e){case"fill":n!=="none"&&(s.fillStyle=n);break;case"stroke":n!=="none"&&(s.strokeStyle=n);break;case"stroke-width":case"strokeWidth":s.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":s.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":s.lineJoin=n;break;default:s.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":s.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":s.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&s.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(s.font=n);break;case"font-size":case"fontSize":s.font+=` ${n}`;break;case"font-family":case"fontFamily":s.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":s.textAlign="center";break;case"end":s.textAlign="end";break;case"start":s.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":s.textBaseline=n;break;default:s.textBaseline="alphabetic";break}break}}}function Xb(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}function Gb(){return!!window.PointerEvent}function Vb(s,t){let e=document.createElement(s);t="on"+t;let n=t in e;return n||(e.setAttribute(t,"return;"),n=typeof e[t]=="function"),e=null,n}function sa(){return{x:0,y:0,isDown:!1}}function bn(){const s=sa(),t=sa();return{start:s,current:t,setStart:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,n)},setCurrent:(e,n)=>{t.x=e.x,t.y=e.y,t.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1}}}function Or(s=document.documentElement,t=!1){return st(s,"mousemove",t)}function ku(s=document.documentElement,t=!1){return st(s,"mousedown",t)}function Iu(s=document.documentElement,t=!1){return st(s,"mouseup",t)}function qb(s=document.documentElement,t=!1){return st(s,"mouseover",t)}function Hb(s=document.documentElement,t=!1){return st(s,"mouseout",t)}function Wb(s=document.documentElement,t=!1){return st(s,"mouseenter",t)}function Jb(s=document.documentElement,t=!1){return st(s,"mouseleave",t)}function Kb(s=document.documentElement,t=!1){return st(s,"click",t)}function Zb(s=document.documentElement,t=!1){return st(s,"dblclick",t)}function Qb(s=document.documentElement,t=!1){return st(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function tw(s=document.documentElement,t=!1){return st(s,"contextmenu",t)}function Du(s=document.documentElement,t=!1){return st(s,"touchmove",t)}function Ou(s=document.documentElement,t=!1){return st(s,"touchstart",t)}function Ru(s=document.documentElement,t=!1){return st(s,"touchend",t)}function Lu(s=document.documentElement,t=!1){return st(s,"touchcancel",t)}function ra(s=document.documentElement,t=!1){return st(s,"pointermove",t)}function ia(s=document.documentElement,t=!1){return st(s,"pointerdown",t)}function oa(s=document.documentElement,t=!1){return st(s,"pointerup",t)}function aa(s=document.documentElement,t=!1){return st(s,"pointercancel",t)}function ew(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function nw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function sw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function rw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function iw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function ow(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function aw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function cw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function hw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function lw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function uw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function fw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function dw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("press",e)},e=>{t.off("press",e)})}function mw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function pw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function gw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function yw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function bw(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function ww(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function zu(s=document.documentElement){const t=new At(s);return Tt(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function vw(s=document.documentElement){const t=new At(document.documentElement);return Tt(e=>{const n=r=>{!r.target||s==r.target||s.contains(r.target)||e(r)};return t.on("tap",n),n},(e,n)=>{t.off("tap",n)})}function xw(s=document.documentElement,t=!1){return st(s,"transitionstart",t)}function Sw(s=document.documentElement,t=!1){return Ol(st(s,"transitionend",t),st(s,"webkitTransitionEnd",t),st(s,"oTransitionEnd",t),st(s,"MSTransitionEnd",t))}function _w(s=document.documentElement,t=!1){return st(s,"animationstart",t)}function Cw(s=document.documentElement,t=!1){return st(s,"animationend",t)}function Nu(s=document.documentElement,t=!1){return st(s,"drag",t)}function Fu(s=document.documentElement,t=!1){return st(s,"dragstart",t)}function Bu(s=document.documentElement,t=!1){return st(s,"dragend",t)}function Uu(s=document.documentElement,t=!1){return st(s,"drop",t)}function $u(s=document.documentElement,t=!1){return st(s,"dragenter",t)}function Yu(s=document.documentElement,t=!1){return st(s,"dragleave",t)}function ju(s=document.documentElement,t=!1){return st(s,"dragover",t)}function Xu(s=document.documentElement,t=!1){return st(s,"keydown",t)}function Gu(s=document.documentElement,t=!1){return st(s,"keyup",t)}function Ew(s=document.documentElement,t=!1){return st(s,"keypress",t)}function Tw(s=document.documentElement,t){const e=t?.useMousePoint||bn();return Or(s).pipe(kt(n=>(e.setCurrent(Lt(n,s)),e)))}function Vu(s=document.documentElement,t){const e=t?.useMousePoint||bn();return Or(s).pipe(yy(ku(s).pipe(pn(n=>{e.setStart(Lt(n,s),!0),t?.start?.(n,e)})),()=>Iu(s).pipe(pn(n=>{e.setCurrent(Lt(n,s),!1),t?.end?.(n,e)}))),my(),kt(n=>(e.setCurrent(Lt(n,s),!0),e)))}function qu(s=document.documentElement,t){const e=t?.useMousePoint||bn();return Ou(s).pipe(pn(n=>{const r=n.changedTouches[0];e.setStart(Lt(r,s),!0),t?.start?.(r,e)}),Sr(()=>Du(s).pipe(To(xr(Ru(s),Lu(s)).pipe(pn(n=>{const r=n.changedTouches[0];e.setCurrent(Lt(r,s),!1),t?.end?.(r,e)}))))),kt(n=>{const r=n.changedTouches[0];return e.setCurrent(Lt(r,s),!0),e}))}function Rr(s=document.documentElement,t){const e=t?.useMousePoint||bn();return ia(s).pipe(pn(n=>{e.setStart(Lt(n,s),!0),t?.start?.(n,e)}),Sr(()=>ra(s).pipe(To(xr(oa(s),aa(s)).pipe(pn(n=>{e.setCurrent(Lt(n,s),!1),t?.end?.(n,e)}))))),kt(n=>(e.setCurrent(Lt(n,s),!0),e)))}function Pw(s=document.documentElement,t){return xr(Vu(s,t),qu(s,t))}function Hu(s=document.documentElement,t){const e=t?.useMousePoint||bn();return Ol(Or(s),ia(s)).pipe(Ll(n=>n instanceof PointerEvent?(e.setStart(Lt(n,s),!0),t?.start?.(n,e),ra(s).pipe(To(xr(oa(s),aa(s)).pipe(pn(r=>{e.setCurrent(Lt(r,s),!1),t?.end?.(r,e)}))))):n instanceof MouseEvent?F0(n):gl),kt(n=>(e.setCurrent(Lt(n,s),n instanceof PointerEvent),e)))}function Aw(s){return new Mt(t=>Rr(s,{start:()=>{t.next(0)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(He())}function Mw(s,t){yn(s,"draggable","true");const e=Fu(s,!0).subscribe(i=>{We(i),zl(i);const o=i.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(i)}),n=Nu(s).subscribe(i=>{We(i),t?.onDrag?.(i)}),r=Bu(s).subscribe(i=>{We(i),t?.onEnd?.(i)});return()=>{e.unsubscribe(),n.unsubscribe(),r.unsubscribe()}}function kw(s,t){const e=$u(s).subscribe(o=>{We(o),t?.onEnter?.(o)}),n=ju(s).subscribe(o=>{We(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),r=Yu(s).subscribe(o=>{We(o),t?.onLeave?.(o)}),i=Uu(s).subscribe(o=>{We(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),n.unsubscribe(),r.unsubscribe(),i.unsubscribe()}}function Wu(s=10){return st(window,"scroll",!0).pipe(gy(s))}function Iw(){return st(document,"visibilitychange",!0).pipe(kt(()=>document.visibilityState==="visible"),He())}function Dw(){return st(window,"storage",!1)}function Ow(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,innerWidth:window.innerWidth,innerHeight:window.innerHeight,screenX:window.screenX,screenY:window.screenY,pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset}}function Yn(){const s=document.documentElement||document.body;return{el:s,clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function ca(){const{clientWidth:s,clientHeight:t,scrollLeft:e,scrollTop:n}=Yn();return{width:window.innerWidth||s,height:window.innerHeight||t,x:window.pageXOffset||e,y:window.pageYOffset||n}}function Rw(){const{scrollWidth:s,scrollHeight:t,scrollLeft:e,scrollTop:n}=Yn();return{width:s,height:t,scrollX:window.pageXOffset||e,scrollY:window.pageYOffset||n}}function ha(s){return s.getBoundingClientRect()}function Lw(s){return{x:s.offsetLeft,y:s.offsetTop,width:s.offsetWidth,height:s.offsetHeight}}function la(s){const{top:t,left:e,width:n,height:r}=s.getBoundingClientRect(),{scrollLeft:i,scrollTop:o}=Yn();return{x:e+i,y:t+o,width:n,height:r}}function zw(s){let t=s,e=0,n=0;for(;t!==null;)e+=t.offsetLeft,n+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:n,width:s.offsetWidth,height:s.offsetHeight}}function Nw(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Yn(),n=e-s;return n<=0?0:t/n*100}function Fw(s){const t=ca(),e=ha(s);return e.bottom>=0&&e.top<=t.height&&e.right>=0&&e.left<=t.width}function Bw(s){if("center"in s){const t=s.center,e=ha(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function ua(s){if("center"in s)return s.center;if(typeof s.pageX=="number"&&typeof s.pageY=="number")return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Yn();return{x:s.clientX+t,y:s.clientY+e}}function Lt(s,t){const e={x:0,y:0};if(t){const n=ua(s),r=la(t);e.x=K(n.x-r.x,0,r.width),e.y=K(n.y-r.y,0,r.height)}else{let n=0,r=0;if("currentTarget"in s&&s.currentTarget&&s.target&&s.currentTarget!=s.target){const i=s.currentTarget.getBoundingClientRect(),o=s.target.getBoundingClientRect();n=o.left-i.left,r=o.top-i.top}if("offsetX"in s)e.x=s.offsetX+n,e.y=s.offsetY+r;else{const i=ua(s),o=la(s.target);e.x=K(i.x-o.x+n,0,o.width),e.y=K(i.y-o.y+r,0,o.height)}}return e}function Uw(s){let t=0;return s||(s=window.event),s.wheelDelta?(t=s.wheelDelta/120,window.opera&&(t=-t)):s.detail&&(t=-s.detail/3),t}function $w(s){if(document.implementation.hasFeature("MouseEvents","2.0"))return s.button;switch(s.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const Yw={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},jw={NULL:"",CANCEL:"",HELP:"",BACK_SPACE:"",TAB:"",CLEAR:"",RETURN:"",ENTER:"",SHIFT:"",CONTROL:"",ALT:"",PAUSE:"",ESCAPE:"",SPACE:"",PAGE_UP:"",PAGE_DOWN:"",END:"",HOME:"",ARROW_LEFT:"",LEFT:"",ARROW_UP:"",UP:"",ARROW_RIGHT:"",RIGHT:"",ARROW_DOWN:"",DOWN:"",INSERT:"",DELETE:"",SEMICOLON:"",EQUALS:"",NUMPAD0:"",NUMPAD1:"",NUMPAD2:"",NUMPAD3:"",NUMPAD4:"",NUMPAD5:"",NUMPAD6:"",NUMPAD7:"",NUMPAD8:"",NUMPAD9:"",MULTIPLY:"",ADD:"",SEPARATOR:"",SUBTRACT:"",DECIMAL:"",DIVIDE:"",F1:"",F2:"",F3:"",F4:"",F5:"",F6:"",F7:"",F8:"",F9:"",F10:"",F11:"",F12:"",COMMAND:"",META:"",ZENKAKU_HANKAKU:""};function Xw(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function Ju(s,t){const e=t.ctrl||!1,n=t.shift||!1,r=t.alt||!1;return(e===s.metaKey||e===s.ctrlKey)&&n===s.shiftKey&&r===s.altKey&&t.keys.map(i=>i.toLowerCase()).includes(s.key.toLowerCase())}function Ku(s){return Xu(s.target||document||window).pipe(Rl(t=>Ju(t,s)),kt(t=>{t.stopPropagation(),t.preventDefault()}))}function Gw(s){return Gu(s.target||document||window).pipe(Rl(t=>Ju(t,s)),kt(t=>{t.stopPropagation(),t.preventDefault()}))}function Zu(s={keys:["o"]},t=ie.text){return Ku(s).pipe(Sr(async()=>await mu(t)))}async function Vw(s={keys:["o"]},t=ie.text){return U0(Zu(s,t))}async function Qu(s,t){return new Promise(e=>{const n=new ResizeObserver(r=>{const i=s.getBoundingClientRect();t(i),e(()=>{n.unobserve(s)})});n.observe(s)})}function fa(s=document.documentElement,t){return new Mt(e=>{const n=s.getBoundingClientRect();let r=n.x,i=n.y,o=n.width,a=n.height;e.next(n);const c=new ResizeObserver(h=>{const l=s.getBoundingClientRect();(r!=l.x||i!=l.y||o!=l.width||a!=l.height)&&(r=l.x,i=l.y,o=l.width,a=l.height,e.next(l))});return c.observe(s,t),()=>{c.unobserve(s),c.disconnect()}})}function qw(){return st(window,"orientationchange"in window?"orientationchange":"resize").pipe(kt(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),mn({width:window.innerWidth,height:window.innerHeight}))}function Hw(){const s={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,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:!1,this.setCurrentMousePoint(e,n)},setCurrentMousePoint:(e,n)=>{const r=t.x,i=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-r,t.dy=t.y-i,t.dStartX=t.x-s.x,t.dStartY=t.y-s.y,t.isDown=typeof n=="boolean"?n:!1}}}function Ww(s=document.documentElement){const t=new sr,e=new At(s);let n=[];const r=Hw(),i=r.mousePoint,o=z=>{t.emit("mouseDown",z)},a=z=>{t.emit("mouseUp",z)},c=z=>{i.isDown||r.setCurrentMousePoint(Lt(z,s)),t.emit("mouseMove",z)},h=z=>{t.emit("mouseOver",z)},l=z=>{t.emit("mouseOut",z)},u=z=>{t.emit("mouseEnter",z)},d=z=>{t.emit("mouseLeave",z)},f=z=>{t.emit("mouseClick",z)},m=z=>{t.emit("mouseDoubleClick",z)},p=z=>{t.emit("mouseWheel",z)},_=z=>{t.emit("mouseContextMenu",z)},y=z=>{t.emit("touchStart",z)},b=z=>{t.emit("touchEnd",z)},v=z=>{t.emit("touchCancel",z)},w=z=>{const vt=z.changedTouches[0];i.isDown||r.setCurrentMousePoint(Lt(vt,s)),t.emit("touchMove",z)},E=z=>{t.emit("pointerDown",z)},C=z=>{t.emit("pointerUp",z)},D=z=>{t.emit("pointerCancel",z)},$=z=>{t.emit("pointerMove",z)},O=z=>{t.emit("pan",z)},U=z=>{t.emit("panStart",z)},V=z=>{t.emit("panMove",z)},q=z=>{t.emit("panEnd",z)},ft=z=>{t.emit("panCancel",z)},pt=z=>{t.emit("panLeft",z)},zt=z=>{t.emit("panRight",z)},wt=z=>{t.emit("panUp",z)},It=z=>{t.emit("panDown",z)},Xt=z=>{t.emit("pinch",z)},Y=z=>{t.emit("pinchin",z)},N=z=>{t.emit("pinchout",z)},A=z=>{t.emit("press",z)},L=z=>{t.emit("rotate",z)},H=z=>{t.emit("swipe",z)},W=z=>{t.emit("swipeLeft",z)},ht=z=>{t.emit("swipeRight",z)},mt=z=>{t.emit("swipeUp",z)},Q=z=>{t.emit("swipeDown",z)},Pt=z=>{t.emit("tap",z)},at=z=>{!z.target||s==z.target||s.contains(z.target)||t.emit("tapOutSide",z)},Ct=z=>{t.emit("transitionstart",z)},Ue=z=>{t.emit("transitionend",z)},Se=z=>{t.emit("animationstart",z)},_e=z=>{t.emit("animationend",z)};let pe={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return pe},mousePoint:i,eb:t,start:async function(){n.push(yt(s,"mousedown",o)),n.push(yt(s,"mouseup",a)),n.push(yt(s,"mousemove",c)),n.push(yt(s,"mouseover",h)),n.push(yt(s,"mouseout",l)),n.push(yt(s,"mouseenter",u)),n.push(yt(s,"mouseleave",d)),n.push(yt(s,"click",f)),n.push(yt(s,"dblclick",m)),n.push(yt(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",p)),n.push(yt(s,"contextmenu",_)),n.push(yt(s,"touchstart",y)),n.push(yt(s,"touchend",b)),n.push(yt(s,"touchcancel",v)),n.push(yt(s,"touchmove",w)),n.push(yt(s,"pointerdown",E)),n.push(yt(s,"pointerup",C)),n.push(yt(s,"pointercancel",D)),n.push(yt(s,"pointermove",$)),e.on("pan",O),e.on("panstart",U),e.on("panmove",V),e.on("panend",q),e.on("pancancel",ft),e.on("panleft",pt),e.on("panright",zt),e.on("panup",wt),e.on("pandown",It),e.on("pinch",Xt),e.on("pinchin",Y),e.on("pinchout",N),e.on("press",A),e.on("rotate",L),e.on("swipe",H),e.on("swipeleft",W),e.on("swiperight",ht),e.on("swipeup",mt),e.on("swipedown",Q),e.on("tap",Pt),n.push(yt(document,"pointerdown",at)),n.push(yt(s,"transitionstart",Ct)),n.push(yt(s,"transitionend",Ue)),n.push(yt(s,"animationstart",Se)),n.push(yt(s,"animationend",_e));const z=await Qu(s,vt=>{pe=vt,t.emit("resize",vt)});n.push(z),n.push(tf(this,{start:vt=>{r.setStartMousePoint(Lt(vt,s),!0)},move:vt=>{r.setCurrentMousePoint(Lt(vt,s))},end:vt=>{r.setCurrentMousePoint(Lt(vt,s),!1)}}))},end:()=>{t.removeAllListeners(),n.forEach(z=>z()),n=[],e.off("pan",O),e.off("panstart",U),e.off("panmove",V),e.off("panend",q),e.off("pancancel",ft),e.off("panleft",pt),e.off("panright",zt),e.off("panup",wt),e.off("pandown",It),e.off("pinch",Xt),e.off("pinchin",Y),e.off("pinchout",N),e.off("press",A),e.off("rotate",L),e.off("swipe",H),e.off("swipeleft",W),e.off("swiperight",ht),e.off("swipeup",mt),e.off("swipedown",Q),e.off("tap",Pt)}}}function tf(s,t){return ef(s,t)}function ef(s,t){const e=s.eb,n=o=>{e.on("pointerMove",i),e.on("pointerUp",r),e.on("pointerCancel",r),t?.start?.(o)},r=o=>{e.off("pointerMove",i),e.off("pointerUp",r),e.off("pointerCancel",r),t?.end?.(o)},i=o=>{t?.move?.(o)};return e.on("pointerDown",n),()=>e.off("pointerDown",n)}function Jw(s,t){const e=s.eb,n=o=>{document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",r,!1),t?.start?.(o)},r=o=>{document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",r,!1),t?.end?.(o)},i=o=>{t?.move?.(o)};return e.on("mouseDown",n),()=>e.off("mouseDown",n)}function Kw(s,t){const e=s.eb,n=o=>{e.on("touchMove",i),e.on("touchEnd",r),e.on("touchCancel",r);const a=o.changedTouches[0];t?.start?.(a)},r=o=>{e.off("touchMove",i),e.off("touchEnd",r),e.off("touchCancel",r);const a=o.changedTouches[0];t?.end?.(a)},i=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",n),()=>e.off("touchStart",n)}let da=class{x;y;toX;toY;constructor(t){this.x=Z(t?.x||0,2),this.y=Z(t?.y||0,2),this.toX=Z(t?.toX||0,2),this.toY=Z(t?.toY||0,2)}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(t=2){const e=se(this.x,this.y,this.toX,this.toY);if(e===0){const n=Math.min(this.x,this.toX),r=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),o=Math.max(this.y,this.toY);return{x:n,y:r,width:i-n,height:o-r}}else{const n=Math.sin(e),r=Math.cos(e),i=r*this.x-n*this.y,o=r*this.toX-n*this.toY,a=r*this.y+n*this.x,c=r*this.toY+n*this.toX;return{x:Z(Math.min(i,o),t),y:Z(Math.min(a,c),t),width:Z(Math.max(i,o)-Math.min(i,o),t),height:Z(Math.max(a,c)-Math.min(a,c),t)}}}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,n=this.y,r=t.toX,i=t.toY,o=this.toX-e,a=t.x-r;if(!o&&!a)return null;const c=(this.toY-n)/o,h=(t.y-i)/a;if(o){if(!a)return{x:r,y:c*(r-e)+n}}else return{x:e,y:h*(e-r)+i};const l=(-h*r+i+c*e-n)/(c-h),u=c*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class ma extends da{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=Z(t.rx,2),this.ry=Z(t.ry,2),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}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,n,r,i,o,a,c]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,r,i,o,a,c,!this.sweepFlag)}convert(t,e,n,r,i,o,a,c,h){const l=a/180*Math.PI,u=(t-n)/2,d=(e-r)/2,f=Math.cos(l)*u+Math.sin(l)*d,m=-Math.sin(l)*u+Math.cos(l)*d,p=f*f/(i*i)+m*m/(o*o);if(p>1){const V=Math.sqrt(p);throw i=V*i,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${i}/${o}.`)}const _=Math.sqrt((i*i*o*o-i*i*m*m-o*o*f*f)/(i*i*m*m+o*o*f*f)),y=c!=h?1:-1,b=y*_*i*m/o,v=y*_*-o*f/i,w=(t+n)/2,E=(e+r)/2,C=Math.cos(l)*b-Math.sin(l)*v+w,D=Math.sin(l)*b+Math.cos(l)*v+E,$=(V,q,ft,pt)=>(V*pt>=q*ft?1:-1)*Math.acos((V*ft+q*pt)/(Math.sqrt(V*V+q*q)*Math.sqrt(ft*ft+pt*pt))),O=$(1,0,t-C,e-D)-l,U=$(t-C,e-D,n-C,r-D);return[C,D,i,o,l,O,O+U]}}class Zw extends da{cx;cy;isLineThrough;constructor(t){super(t),this.cx=Z(t.cx,2),this.cy=Z(t.cy,2),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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(t=2){const e=[this.x,this.toX],n=[this.y,this.toY];let r,i,o,a;for(let l=0;l<2;++l)r=l==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=l==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,o=l==0?this.x:this.y,Math.abs(r)>1e-12&&(a=-i/(2*r),0<a&&a<1&&[e,n][l].push(r*a*a+i*a+o));const c={x:Math.min(0,...e),y:Math.min(0,...n)},h={x:Math.max(0,...e),y:Math.max(0,...n)};return{x:Z(c.x,t),y:Z(c.y,t),width:Z(h.x-c.x,t),height:Z(h.y-c.y,t)}}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 Qw=Zw;class jt extends da{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=Z(t.c1x,2),this.c1y=Z(t.c1y,2),this.c2x=Z(t.c2x,2),this.c2y=Z(t.c2y,2)}clone(){return new jt({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(t=2){let e=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),n=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),r=this.x-this.c1x,i=(-n+Math.sqrt(n*n-4*e*r))/2/e,o=(-n-Math.sqrt(n*n-4*e*r))/2/e;const a=[this.y,this.toY],c=[this.x,this.toX];let h;const l=[];Math.abs(i)>1e12&&(i=.5),Math.abs(o)>1e12&&(o=.5),i>=0&&i<=1&&(h=this.interpolate(i),c.push(h.x),a.push(h.y),l.push({X:h.x,Y:h.y})),o>=0&&o<=1&&(h=this.interpolate(o),c.push(h.x),a.push(h.y),l.push({X:h.x,Y:h.y})),e=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),n=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),r=this.y-this.c1y,i=(-n+Math.sqrt(n*n-4*e*r))/2/e,o=(-n-Math.sqrt(n*n-4*e*r))/2/e,Math.abs(i)>1e12&&(i=.5),Math.abs(o)>1e12&&(o=.5),i>=0&&i<=1&&(h=this.interpolate(i),c.push(h.x),a.push(h.y),l.push({X:h.x,Y:h.y})),o>=0&&o<=1&&(h=this.interpolate(o),c.push(h.x),a.push(h.y),l.push({X:h.x,Y:h.y}));const u=[],d=l.length;for(let p=0;p<d;p++){for(let _=p+1;_<d;_++)l[p].X===l[_].X&&l[p].Y===l[_].Y&&(_=++p);u.push({X:l[p].X,Y:l[p].Y})}const f={x:Math.min(...c),y:Math.min(...a)},m={x:Math.max(...c),y:Math.max(...a)};return{x:Z(f.x,t),y:Z(f.y,t),width:Z(m.x-f.x,t),height:Z(m.y-f.y,t),dots:u}}static base3(t,e,n,r,i){const o=-3*e+9*n-9*r+3*i,a=t*o+6*e-12*n+6*r;return t*a-3*e+3*n}static bezlen(t,e,n,r,i,o,a,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/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 m=0;m<12;m++){const p=l*u[m]+l,_=jt.base3(p,t,n,i,a),y=jt.base3(p,e,r,o,c);f+=d[m]*Math.sqrt(_*_+y*y)}return l*f}length(t=1){return jt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,r=Math.pow(n,3),i=Math.pow(n,2),o=e*e,a=o*e,c=r*this.x+i*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,h=r*this.y+i*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),m=n*this.x+e*this.c1x,p=n*this.y+e*this.c1y,_=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,b=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:c,y:h,m:{x:l,y:u},n:{x:d,y:f},start:{x:m,y:p},end:{x:_,y},alpha:b}}getTatLen(t){const e=this.x,n=this.y,r=this.c1x,i=this.c1y,o=this.c2x,a=this.c2y,c=this.toX,h=this.toY;if(t<0||jt.bezlen(e,n,r,i,o,a,c,h)<t)return 0;const l=1;let u=l/2,d=l-u,f=jt.bezlen(e,n,r,i,o,a,c,h,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=jt.bezlen(e,n,r,i,o,a,c,h,d);return d}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}}}const xs=Math.PI*2;function nf(s,t,e,n){const r=s*n-t*e<0?-1:1;let i=s*e+t*n;return i>1&&(i=1),i<-1&&(i=-1),r*Math.acos(i)}function tv(s,t,e,n,r,i,o,a,c,h){const l=h*(s-e)/2+c*(t-n)/2,u=-c*(s-e)/2+h*(t-n)/2,d=o*o,f=a*a,m=l*l,p=u*u;let _=d*f-d*p-f*m;_<0&&(_=0),_/=d*p+f*m,_=Math.sqrt(_)*(r===i?-1:1);const y=_*o/a*u,b=_*-a/o*l,v=h*y-c*b+(s+e)/2,w=c*y+h*b+(t+n)/2,E=(l-y)/o,C=(u-b)/a,D=(-l-y)/o,$=(-u-b)/a,O=nf(1,0,E,C);let U=nf(E,C,D,$);return i===0&&U>0&&(U-=xs),i===1&&U<0&&(U+=xs),[v,w,O,U]}function ev(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),r=Math.sin(s),i=Math.cos(s+t),o=Math.sin(s+t);return[n,r,n-r*e,r+n*e,i+o*e,o-i*e,i,o]}function sf(s,t,e,n,r,i,o,a,c){const h=Math.sin(c*xs/360),l=Math.cos(c*xs/360),u=l*(s-e)/2+h*(t-n)/2,d=-h*(s-e)/2+l*(t-n)/2;if(u===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const m=tv(s,t,e,n,r,i,o,a,h,l),p=[];let _=m[2],y=m[3];const b=Math.max(Math.ceil(Math.abs(y)/(xs/4)),1);y/=b;for(let v=0;v<b;v++)p.push(ev(_,y)),_+=y;return p.map(v=>{for(let w=0;w<v.length;w+=2){let E=v[w+0],C=v[w+1];E*=o,C*=a;const D=l*E-h*C,$=h*E+l*C;v[w+0]=D+m[0],v[w+1]=$+m[1]}return v})}function pa(s,t,e,n,r,i){return[s/3+2/3*e,t/3+2/3*n,r/3+2/3*e,i/3+2/3*n,r,i]}function Ss(s,t,e,n){return[s,t,e,n,e,n]}const Lr={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function wn(s="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",s)}function rf(){return wn("path")}const nv=s=>s instanceof SVGElement&&s.tagName==="path";function sv(s,t="shape"){return Dr(ao(s),`${t}.svg`)}function of(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function rv(s){return s.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 af(s){const t=[];return of(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,r)=>{let i=n.toLowerCase();const o=Ii(r);for(i=="m"&&o.length>Lr[i]&&(t.push([n,...o.splice(0,Lr[i])]),i="l",n=n=="m"?"l":"L");o.length;){if(o.length<Lr[i])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,Lr[i])])}return i=="z"&&t.push([n]),""}),t}function cf(s){let t=0,e=0,n=0,r=0;return s.map(function(i){const o=i[0],a=o.toUpperCase();if(o!=a)switch(i[0]=a,o){case"a":i[6]+=n,i[7]+=r;break;case"v":i[1]+=r;break;case"h":i[1]+=n;break;default:for(let c=1;c<i.length;)i[c++]+=n,i[c++]+=r}switch(a){case"Z":n=t,r=e;break;case"H":n=i[1];break;case"V":r=i[1];break;case"M":n=t=i[1],r=e=i[2];break;default:n=i[i.length-2],r=i[i.length-1]}return i})}function iv(s){const t=[];let e=0,n=0,r=0,i=0,o=0,a=0,c=0,h=0,l;for(let u=0,d=s.length;u<d;u++){let f=s[u];const m=f[0];switch(m){case"M":e=f[1],n=f[2];break;case"A":const p=sf(r,i,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!p.length)continue;p.forEach((b,v)=>{const[w,E,C,D,$,O,U,V]=b;f=["C",C,D,$,O,U,V],v<p.length-1&&t.push(f)});break;case"S":let _=r,y=i;(l=="C"||l=="S")&&(_+=_-c,y+=y-h),f=["C",_,y,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=r*2-o,a=i*2-a):(o=r,a=i),f=["C",...pa(r,i,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...pa(r,i,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...Ss(r,i,f[1],f[2])];break;case"H":f=["C",...Ss(r,i,f[1],i)];break;case"V":f=["C",...Ss(r,i,r,f[1])];break;case"Z":f=["C",...Ss(r,i,e,n)];break}l=m,r=f[f.length-2],i=f[f.length-1],f.length>4?(c=f[f.length-4],h=f[f.length-3]):(c=r,h=i),t.push(f)}return t}class _s{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"),n=document.createElement("video"),r=document.createElement("source"),i=new MediaSource;i.addEventListener("sourceopen",()=>t(!0)),r.src=URL.createObjectURL(i),r.media="(min-width:10px)",n.append(r),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),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(()=>{_s.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 ga extends sr{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ud(this.source);if(t===0){this.emit("finish");return}let e,n,r=Yc(this.source,0);for(let i=1;i<t;i++)e=n,n=r,r=Yc(this.source,i),this.raw+=n,n&&this.step(n,r,e);r&&this.step(r,void 0,n),this.emit("finish")}step(t,e,n){t==`
84
+ `&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){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":Me("whitespace",t)?(this.textchunk+=hf(this.entity),this.mode="text"):t==";"?(this.textchunk+=hf(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&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(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),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=="-"&&n=="-"&&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(!Me("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,n)}break;case"close tag name start":Me("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(Me("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(Me("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":Me("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(Me("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(!Me("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(Me("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&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function hf(s){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 s.charAt(0)=="#"?s.charAt(1).toLowerCase()=="x"?e=parseInt(s.substring(2),16):e=parseInt(s.substring(1),10):e=t[s],e?String.fromCharCode(e):"&"+s}var lf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ya(s,t={}){var e=1,n=1;function r(Y){var N=Y.match(/\n/g);N&&(e+=N.length);var A=Y.lastIndexOf(`
85
+ `);n=~A?Y.length-A:n+Y.length}function i(){var Y={line:e,column:n};return function(N){return N.position=new o(Y),m(),N}}function o(Y){this.start=Y,this.end={line:e,column:n},this.source=t.source}o.prototype.content=s;var a=[];function c(Y){var N=new Error(t.source+":"+e+":"+n+": "+Y);if(N.reason=Y,N.filename=t.source,N.line=e,N.column=n,N.source=s,t.silent)a.push(N);else throw N}function h(){var Y=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:Y,parsingErrors:a}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var Y,N=[];for(m(),p(N);s.length&&s.charAt(0)!="}"&&(Y=It()||Xt());)Y!==!1&&(N.push(Y),p(N));return N}function f(Y){var N=Y.exec(s);if(N){var A=N[0];return r(A),s=s.slice(A.length),N}}function m(){f(/^\s*/)}function p(Y){var N;for(Y=Y||[];N=_();)N!==!1&&Y.push(N);return Y}function _(){var Y=i();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var N=2;s.charAt(N)!=""&&(s.charAt(N)!="*"||s.charAt(N+1)!="/");)++N;if(N+=2,s.charAt(N-1)==="")return c("End of comment missing");var A=s.slice(2,N-2);return n+=2,r(A),s=s.slice(N),n+=2,Y({type:"comment",comment:A})}}function y(){var Y=f(/^([^{]+)/);if(Y)return Fe(Y[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(N){return N.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(N){return N.replace(/\u200C/g,",")})}function b(){var Y=i(),N=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(N){if(N=Fe(N[0]),!f(/^:\s*/))return c("property missing ':'");var A=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),L=Y({type:"declaration",property:N.replace(lf,""),value:A?Fe(A[0]).replace(lf,""):""});return f(/^[;\s]*/),L}}function v(){var Y=[];if(!l())return c("missing '{'");p(Y);for(var N;N=b();)N!==!1&&(Y.push(N),p(Y));return u()?Y:c("missing '}'")}function w(){for(var Y,N=[],A=i();Y=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)N.push(Y[1]),f(/^,\s*/);if(N.length)return A({type:"keyframe",values:N,declarations:v()})}function E(){var Y=i(),N=f(/^@([-\w]+)?keyframes\s*/);if(N){var A=N[1];if(N=f(/^([-\w]+)\s*/),!N)return c("@keyframes missing name");var L=N[1];if(!l())return c("@keyframes missing '{'");for(var H,W=p();H=w();)W.push(H),W=W.concat(p());return u()?Y({type:"keyframes",name:L,vendor:A,keyframes:W}):c("@keyframes missing '}'")}}function C(){var Y=i(),N=f(/^@supports *([^{]+)/);if(N){var A=Fe(N[1]);if(!l())return c("@supports missing '{'");var L=p().concat(d());return u()?Y({type:"supports",supports:A,rules:L}):c("@supports missing '}'")}}function D(){var Y=i(),N=f(/^@host\s*/);if(N){if(!l())return c("@host missing '{'");var A=p().concat(d());return u()?Y({type:"host",rules:A}):c("@host missing '}'")}}function $(){var Y=i(),N=f(/^@media *([^{]+)/);if(N){var A=Fe(N[1]);if(!l())return c("@media missing '{'");var L=p().concat(d());return u()?Y({type:"media",media:A,rules:L}):c("@media missing '}'")}}function O(){var Y=i(),N=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(N)return Y({type:"custom-media",name:Fe(N[1]),media:Fe(N[2])})}function U(){var Y=i(),N=f(/^@page */);if(N){var A=y()||[];if(!l())return c("@page missing '{'");for(var L=p(),H;H=b();)L.push(H),L=L.concat(p());return u()?Y({type:"page",selectors:A,declarations:L}):c("@page missing '}'")}}function V(){var Y=i(),N=f(/^@([-\w]+)?document *([^{]+)/);if(N){var A=Fe(N[1]),L=Fe(N[2]);if(!l())return c("@document missing '{'");var H=p().concat(d());return u()?Y({type:"document",document:L,vendor:A,rules:H}):c("@document missing '}'")}}function q(){var Y=i(),N=f(/^@font-face\s*/);if(N){if(!l())return c("@font-face missing '{'");for(var A=p(),L;L=b();)A.push(L),A=A.concat(p());return u()?Y({type:"font-face",declarations:A}):c("@font-face missing '}'")}}var ft=wt("import"),pt=wt("charset"),zt=wt("namespace");function wt(Y){var N=new RegExp("^@"+Y+"\\s*([^;]+);");return function(){var A=i(),L=f(N);if(L){var H={type:Y};return H[Y]=L[1].trim(),A(H)}}}function It(){if(s[0]=="@")return E()||$()||O()||C()||ft()||pt()||zt()||V()||U()||D()||q()}function Xt(){var Y=i(),N=y();return N?(p(),Y({type:"rule",selectors:N,declarations:v()})):c("selector missing")}return ba(h())}function Fe(s){return s?s.replace(/^\s+|\s+$/g,""):""}function ba(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var r in s){var i=s[r];Array.isArray(i)?i.forEach(function(o){ba(o,n)}):i&&typeof i=="object"&&ba(i,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let ov=class extends ga{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=ya(e);for(const r of n.stylesheet.rules)for(const i of r.declarations)for(const o of r.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${i.property}:${i.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let r=this.groups.length;for(;r--;)if(this.groups[r]!=this.currentItem){let i="",o="";for(const a in this.groups[r])a=="transform"?i=this.groups[r].transform:a=="class"&&this.globalStyles["."+this.groups[r][a]]?o=this.globalStyles["."+this.groups[r][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[r][a]]?o=this.globalStyles["#"+this.groups[r][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[r][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=i:this.currentItem.transform+=" "+i,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),va(this.currentItem.style,this.currentItem,xa)}switch(this.processAttrs(e,n),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 n=[],r;switch(t){case"svg":let i="",o="";if(e.width&&e.height)i=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(i=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}i&&o&&this.items.push({type:"viewbox",width:i,height:o});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":r={},e.style&&va(e.style,r),r.offset=r.offset||e.offset,r.color=r["stop-color"]||e["stop-color"],r.opacity=r["stop-opacity"]||e["stop-opacity"],~(r.offset+"").indexOf("%")?r.offset=parseFloat(r.offset):r.offset=parseFloat(r.offset)*100,r.offset=+r.offset.toFixed(2),this.grad.stops.push(r);break;case"linearGradient":this.grad.angle=(360+wa(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,c=this.grad.stops.length;a<c;a++)r=this.grad.stops[a],a&&a!=c-1?n.push(r.color+":"+r.offset):n.push(r.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,c=this.grad.stops.length;a<c;a++)r=this.grad.stops[a],a&&a!=c-1?n.push(r.color+":"+r.offset):n.push(r.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const i in e){const o=e[i];if(xa.includes(i)&&(this.currentItem[i]=o),i==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:i,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:i,stops:[]})),i==="style"&&va(o,this.currentItem,xa),i==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),i==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const c=a[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}i==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),i==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),i==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function wa(s,t,e,n,r,i){if(typeof r>"u"||typeof i>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return wa(s,t,r,i)-wa(e,n,r,i)}function va(s,t,e){const n=(s+"").split(";"),r=/^\s+|\s+$/g;for(let i=0,o=n.length;i<o;i++){const a=n[i].split(":"),c=a[0].replace(r,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=a[1].replace(r,""))}}const xa=["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 Wt{prevPathX=0;prevPathY=0;isUpdatedSVGPathData=!0;isUpdatedSVGPathD=!0;isUpdatedBoundingClientRect=!0;isUpdatedPolymorphPoints=!0;isUpdatedTotalLength=!0;normalizedLines=[];constructor(t){const e=typeof t=="string"?af(t):t||[],n=iv(cf(e));for(let r=0,i=n.length;r<i;r++){const o=n[r];o[0]=="M"?(this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new jt({x:this.prevPathX,y:this.prevPathY,c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(this.isUpdatedSVGPathData=!0,this.isUpdatedSVGPathD=!0,this.isUpdatedBoundingClientRect=!0,this.isUpdatedPolymorphPoints=!0,this.isUpdatedTotalLength=!0,t instanceof ma){sf(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[l,u,d,f,m,p,_,y]=h;this.normalizedLines.push(new jt({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:m,c2y:p,toX:_,toY:y})),this.prevPathX=_,this.prevPathY=y});return}if(t instanceof jt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,r,i,o,a;t instanceof Qw?[e,n,r,i,o,a]=pa(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,r,i,o,a]=Ss(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new jt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:r,c2y:i,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new Wt,n=t.length;if(n){e.prevPathX=t[0],e.prevPathY=t[1];for(let r=2;r+5<n;r+=6)e._appendLine(new jt({x:e.prevPathX,y:e.prevPathY,c1x:t[r],c1y:t[r+1],c2x:t[r+2],c2y:t[r+3],toX:t[r+4],toY:t[r+5]}))}return e}static fromLines(t){const e=new Wt,n=t.length;if(n){e.prevPathX=t[0].x,e.prevPathY=t[0].y;for(let r=0;r<n;r++)e._appendLine(t[r])}return e}clone(){return Wt.fromLines(this.normalizedLines)}cachedSVGPathData=[];toSVGPathData(){if(this.isUpdatedSVGPathData){const t=[];for(let e=0,n=this.normalizedLines.length;e<n;e++){const r=this.normalizedLines[e];e==0&&t.push(["M",r.x,r.y]),t.push(...r.toSVGPathData())}this.cachedSVGPathData=t,this.isUpdatedSVGPathData=!1}return this.cachedSVGPathData}cachedSVGPathD="";toSVGPathD(){return this.isUpdatedSVGPathD&&(this.cachedSVGPathD=rv(this.toSVGPathData()),this.isUpdatedSVGPathD=!1),this.cachedSVGPathD}toCanvasContext(t){t.beginPath();for(let e=0,n=this.normalizedLines.length;e<n;e++){const r=this.normalizedLines[e];e==0&&t.moveTo(r.x,r.y),r.toCanvasContext(t)}}cachedBoundingClientRect={x:0,y:0,width:0,height:0};getBoundingClientRect(t=2){if(this.isUpdatedBoundingClientRect){const e=[],n=[];if(this.normalizedLines.forEach(r=>{const i=r.getBoundingClientRect(t);e.push(i.x,i.x+i.width),n.push(i.y,i.y+i.height)}),e.length==0||n.length==0)this.cachedBoundingClientRect={x:0,y:0,width:0,height:0};else{const r=Math.min(...e),i=Math.min(...n),o=Math.max(...e),a=Math.max(...n);this.cachedBoundingClientRect={x:Z(r,t),y:Z(i,t),width:Z(o-r,t),height:Z(a-i,t)}}this.isUpdatedBoundingClientRect=!1}return this.cachedBoundingClientRect}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}transform(t){let e;return t.m?e=t.m:(e=new Yt,e.translate(t.x||0,t.y||0),e.rotate(t.degree||0,t.centerX,t.centerY),e.scale(t.scaleX||1,t.scaleY||1,t.centerX,t.centerY)),e.isIdentity?this.clone():Wt.fromLines(this.normalizedLines.map(n=>{let r=n.x,i=n.y,o=n.c1x,a=n.c1y,c=n.c2x,h=n.c2y,l=n.toX,u=n.toY;return{x:r,y:i}=e.transformPoint({x:r,y:i}),{x:o,y:a}=e.transformPoint({x:o,y:a}),{x:c,y:h}=e.transformPoint({x:c,y:h}),{x:l,y:u}=e.transformPoint({x:l,y:u}),new jt({x:r,y:i,c1x:o,c1y:a,c2x:c,c2y:h,toX:l,toY:u})}))}cachedTotalLength;getTotalLength(){return(typeof this.cachedTotalLength!="number"||this.isUpdatedTotalLength)&&(this.cachedTotalLength=Math.round(this.normalizedLines.reduce((t,e)=>t+=e.length(),0)),this.isUpdatedTotalLength=!1),this.cachedTotalLength}getPointAtLength(t){let e=0,n=0;const r=this.normalizedLines.length;for(let i=0;i<r;i++){const o=this.normalizedLines[i];if(n=o.length(),e+n>=t)return o.getPointAtSegmentLength(t-e);e+=n}return this.normalizedLines[r-1].getPointAtSegmentLength(n)}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 n=t*e,r=this.normalizedLines[0];if(n--,n>1)for(let i=1;i<e&&(r=this.normalizedLines[i],n>1);i++)n-=1;return r.interpolate(n)}}getSubPathD(t,e,n=1e-6){const r=this.getSubPathDAtLength(e,!0);return Mi(n)(t,0)?r:r.getSubPathDAtLength(t,!1)}getSubPathDAtLength(t,e=!1){const n=new Wt;let r=0,i=!1;for(let o=0,a=this.normalizedLines.length;o<a;o++){const c=this.normalizedLines[o];o==0&&(n.prevPathX=c.x,n.prevPathY=c.y);const h=c.length();if(r+h>t&&!i){i=!0;const l=c.getPointAtSegmentLength(t-r);if(n._appendLine(new jt({x:n.prevPathX,y:n.prevPathY,c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),e)return n;n.normalizedLines=[],n._appendLine(new jt({x:n.prevPathX,y:n.prevPathY,c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:c.toX,toY:c.toY})),r+=h;continue}n._appendLine(c),r+=h}return n}closestPoint(t,e){const n=this.getTotalLength();let r={x:t,y:e},i=0,o=1/0,a=8;for(let h=0;h<=n;h+=a){const l=this.getPointAtLength(h),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<o&&(r=l,i=h,o=u)}for(a/=2;a>.5;){const h=i-a,l=this.getPointAtLength(h),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),d=i+a,f=this.getPointAtLength(d),m=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);h>=0&&u<o?(r=l,i=h,o=u):d<=n&&m<o?(r=f,i=d,o=m):a/=2}const c=this.getPointAtLength(i+(i===n?-.1:.1));return{point:r,rotation:i>=n?se(c.x,c.y,r.x,r.y):se(r.x,r.y,c.x,c.y),distance:Math.sqrt(o)}}cachedPolymorphPoints=[];getPolymorphPoints(){if(this.isUpdatedPolymorphPoints){if(this.normalizedLines.length){const t=this.normalizedLines[0];this.cachedPolymorphPoints=[t.x,t.y].concat(this.normalizedLines.reduce((e,n)=>e.concat([n.c1x,n.c1y,n.c2x,n.c2y,n.toX,n.toY]),[]))}this.isUpdatedPolymorphPoints=!1}return[...this.cachedPolymorphPoints]}getPolymorphPointsPerimeter(){let t=0;const e=this.getPolymorphPoints(),n=e.length;if(n){let r=e[n-2],i=e[n-1];for(let o=0;o<n;o+=6)t+=Ze(e[o],e[o+1],r,i),r=e[o],i=e[o+1]}return Math.floor(t)}expendToPolymorphPoints(t){const e=t.length,n=this.getPolymorphPoints(),r=n.length;if(r){const i=[];let o=e-r;const a=Math.ceil(e/r);i.push(["M",n[0],n[1]]);let c=2;for(;c+5<=r-1;){const h=n[c++],l=n[c++],u=n[c++],d=n[c++],f=n[c++],m=n[c++];i.push(["C",h,l,u,d,f,m]);let p=0;for(;p<a&&o>0;)i.push(["C",f,m,f,m,f,m]),o-=6,p++}return new Wt(i)}else return Wt.fromPolymorphPoints(t)}static getInterpolator(t,e){return n=>{const r=Mi(Number.EPSILON);return r(n,0)?t.clone():r(n,1)?e.clone():Wt.fromPolymorphPoints(tm(t.getPolymorphPoints(),e.getPolymorphPoints(),n).map(i=>Z(i,2)))}}}const uf=av("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 av(s,t=10){const e={},n=s.split(",");for(let r=0;r<n.length;r+=2){const i="&"+n[r+1]+";",o=parseInt(n[r],t);e[i]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Jt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function zr(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function cv(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function hv(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Cs={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 Sa{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);i&&(n.setAttribute("stop-color",Jt("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class ff{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Nr{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=n||t?.height||0,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(Cs);for(let e=0,n=t.length;e<n;e++){const r=t[e];this[r]=Cs[r].canvas}}__getStyleState(){const t={},e=Object.keys(Cs);for(let n=0,r=e.length;n<r;n++){const i=e[n];t[i]=this[i]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const i=e[n];this[i]=t[i]}}__createElement(t,e={},n=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),i=Object.keys(e);n&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let o=0;o<i.length;o++){const a=i[o];r.setAttribute(a,e[a])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(i=>{i.setAttribute(t,"")}));const r=Object.keys(Cs);for(let i=0;i<r.length;i++){const o=Cs[r[i]],a=this[r[i]];if(o.apply){if(a instanceof ff){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Jt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Sa)e.setAttribute(o.apply,Jt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(h){e.setAttribute(o.svgAttr,Jt("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}else{let c=o.svgAttr;if(r[i]==="globalAlpha"&&(c=t+"-"+o.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const r=Object.keys(uf);for(let i=0,o=r.length;i<o;i++){const a=r[i],c=uf[a],h=new RegExp(a,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Jt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Jt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Jt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,r,i,o){this.__addTransform(Jt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:r,e:i,f:o}))}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(Jt("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(Jt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Jt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,r,i,o){this.__currentPosition={x:i,y:o},this.__addPathCommand(Jt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:r,x:i,y:o}))}quadraticCurveTo(t,e,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(Jt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,r,i){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(i<0)throw new Error("IndexSizeError: The radius provided ("+i+") is negative.");if(o===t&&a===e||t===n&&e===r||i===0){this.lineTo(t,e);return}const c=this.normalize([o-t,a-e]),h=this.normalize([n-t,r-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],u=Math.acos(Math.abs(l)),d=this.normalize([c[0]+h[0],c[1]+h[1]]),f=i/Math.sin(u/2),m=t+f*d[0],p=e+f*d[1],_=[-c[1],c[0]],y=[h[1],-h[0]],b=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},v=b(_),w=b(y);this.lineTo(m+_[0]*i,p+_[1]*i),this.arc(m,p,i,v,w)}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,n,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,r){const i=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,r){const i=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],r=n.childNodes;for(let i=r.length-1;i>=0;i--)r[i]&&n.removeChild(r[i]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,r){if(t===0&&e===0&&n===this.width&&r===this.height){this.__clearCanvas();return}const i=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:r,fill:"#FFFFFF"},!0);i.appendChild(o)}createLinearGradient(t,e,n,r){const i=this.__createElement("linearGradient",{id:zr(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(i),new Sa(i,this)}createRadialGradient(t,e,n,r,i,o){const a=this.__createElement("radialGradient",{id:zr(this.__ids),cx:r+"px",cy:i+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Sa(a,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),n={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"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,r){const i=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":i.family,"font-size":i.size,"font-style":i.style,"font-weight":i.weight,"text-decoration":i.decoration,x:e,y:n,"text-anchor":cv(this.textAlign),"dominant-baseline":hv(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(r),o.appendChild(this.__wrapTextLink(i,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,r,i,o){if(r===i)return;r=r%(2*Math.PI),i=i%(2*Math.PI),r===i&&(i=(i+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(i),c=e+n*Math.sin(i),h=t+n*Math.cos(r),l=e+n*Math.sin(r),u=o?0:1;let d=0,f=i-r;f<0&&(f+=2*Math.PI),o?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(Jt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=zr(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Jt("url(#{id})",{id:n})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],n,r,i,o,a=0,c=0,h,l,u,d,f,m,p,_;if(t.length===3)n=t[1],r=t[2],h=e.width,l=e.height,i=h,o=l;else if(t.length===5)n=t[1],r=t[2],i=t[3],o=t[4],h=e.width,l=e.height;else if(t.length===9)a=t[1],c=t[2],h=t[3],l=t[4],n=t[5],r=t[6],i=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const b="translate("+n+", "+r+")";if(e instanceof Nr){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)_=d.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const v=f.getAttribute("transform");let w;v?w=v+" "+b:w=b,f.setAttribute("transform",w),y.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",i),m.setAttribute("height",o),m.setAttribute("preserveAspectRatio","none"),(a||c||h!==e.width||l!==e.height)&&(p=this.__document.createElement("canvas"),p.width=i,p.height=o,p.getContext("2d")?.drawImage(e,a,c,h,l,0,0,i,o),e=p),m.setAttribute("transform",b),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(m))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=zr(this.__ids);let i;return n.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(i=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(i),this.__SVGdefs.appendChild(n)):t instanceof Nr&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new ff(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class _a{canvas;context;customContext;enablePath2D=!1;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,r=!1,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),r&&(this.customContext=new Nr({canvas:this.canvas,width:e||this.canvas.width,height:n||this.canvas.height})),this.enablePath2D=typeof i=="boolean"?i:!1}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,n,r){return this.context.fillRect(t,e,n,r),this.customContext&&this.customContext.fillRect(t,e,n,r),this}fillText(t,e,n,r){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,r),this.customContext&&this.customContext.fillText(t,e,n),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,n,r){return this.context.strokeText(t,e,n,r),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,r){return this.context.strokeRect(t,e,n,r),this.customContext&&this.customContext.strokeRect(t,e,n,r),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,n,r),this.customContext&&this.customContext.clearRect(t,e,n,r),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.enablePath2D&&(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.enablePath2D&&(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.enablePath2D&&this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){if(this.enablePath2D){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}}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=this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix=this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,r=0){return this.translate(n,r),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix=this.currentMatrix.scale(t,e),this.translate(-n,-r),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.enablePath2D&&this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.enablePath2D&&this.currentPath2D.lineTo(t,e),this}arc(t,e,n,r,i,o){return this.context.arc(t,e,n,r,i,o),this.customContext&&this.customContext.arc(t,e,n,r,i,o?-1:1),this.enablePath2D&&this.currentPath2D.arc(t,e,n,r,i,o),this}arcTo(t,e,n,r,i){return this.context.arcTo(t,e,n,r,i),this.customContext&&this.customContext.arcTo(t,e,n,r,i),this.enablePath2D&&this.currentPath2D.arcTo(t,e,n,r,i),this}ellipse(t,e,n,r,i,o,a,c){return this.context.ellipse(t,e,n,r,i,o,a,c),this.enablePath2D&&this.currentPath2D.ellipse(t,e,n,r,i,o,a,c),this}quadraticCurveTo(t,e,n,r){return this.context.quadraticCurveTo(t,e,n,r),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,r),this.enablePath2D&&this.currentPath2D.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,o){return this.context.bezierCurveTo(t,e,n,r,i,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,r,i,o),this.enablePath2D&&this.currentPath2D.bezierCurveTo(t,e,n,r,i,o),this}rect(t,e,n,r){return this.context.rect(t,e,n,r),this.customContext&&this.customContext.rect(t,e,n,r),this.enablePath2D&&this.currentPath2D.rect(t,e,n,r),this}createLinearGradient(t,e,n,r,i){const o=this.context.createLinearGradient(t,e,n,r);return i&&Object.entries(i).forEach(([a,c])=>{o.addColorStop(parseFloat(a),c)}),o}createRadialGradient(t,e,n,r,i,o,a){const c=this.context.createRadialGradient(t,e,n,r,i,o);return a&&Object.entries(a).forEach(([h,l])=>{c.addColorStop(parseFloat(h),l)}),c}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],r=e[1];this.context.drawImage(t,n,r)}else if(e.length===4){const n=e[0],r=e[1],i=e[2],o=e[3];this.context.drawImage(t,n,r,i,o)}else if(e.length===8){const n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,n,r,i,o,a,c,h,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,n=this.canvas.width,r=this.canvas.height,i){return this.context.getImageData(t,e,n,r,i)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class _t{shouldUpdatePathD=!1;shouldUpdateTransformPathD=!1;shouldUpdateSVGElInDraw=!1;shouldUpdateMInDraw=!0;shouldUpdateAttrsInDraw=!0;shouldUpdateStyleInDraw=!0;id;initD;d;parent;attrs={};style={};initCenterX;initCenterY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;interactive;drag;transform$=new qe;transformSubscription;isMouseIn=!1;isDragging=!1;m;el;constructor(t){this.id=Bi(),this.initD=t?.initD,this.setAttr({stroke:"none",fill:"none"}),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.initCenterX=t?.centerX,this.initCenterY=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.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.transformSubscription=this.transform$.subscribe(()=>{this.shouldUpdateTransformPathD=!0,this.shouldUpdateMInDraw=!0})}destroy(){this.transformSubscription.unsubscribe()}moveTo(t,e){const n=this._x,r=this._y;(n!==t||r!==e)&&(this._x=t,this._y=e,this.transform$.next({dX:t-n,dY:e-r}))}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&&(this.transform$.next({dX:t-this._x}),this._x=t)}get y(){return this._y}set y(t){this._y!==t&&(this.transform$.next({dY:t-this._y}),this._y=t)}rotateTo(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}scaleTo(t,e){const n=this._scaleX,r=this._scaleY;(this._scaleX!==t||this._scaleY!==(e||t))&&(this._scaleX=t,this._scaleY=e||t,this.transform$.next({dScaleX:this._scaleX/n,dScaleY:this._scaleY/r}))}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX!==t&&(this.transform$.next({dScaleX:t/this._scaleX}),this._scaleX=t)}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY!==t&&(this.transform$.next({dScaleY:t/this._scaleY}),this._scaleY=t)}pathD(t){return t?(this.d=t,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0):this.initD?this.d||(this.d=this.initD instanceof Wt?this.initD:new Wt(this.initD)):(!this.d||this.shouldUpdatePathD)&&(this.d=new Wt(this.toSVGPathData()),this.shouldUpdatePathD=!1,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0),this.d}cachedTransformedPathD;transformPathD(){if(!this.m){const{x:t,y:e}=this.transformOrigin();let n=0,r=0;if(this.parent?.dDegree||this.parent?.dScaleX!==1||this.parent?.dScaleY!==1){const o=this.transformOrigin(!0);n=o.x,r=o.y}const i=new Yt;i.translate(this.x+(this.parent?.dX||0),this.y+(this.parent?.dY||0)),i.rotate(this.degree,t,e),i.scale(this.scaleX,this.scaleY,t,e),this.parent?.dDegree&&i.rotate(this.parent.dDegree,n,r),(this.parent?.dScaleX!==1||this.parent?.dScaleY!==1)&&i.scale(this.parent?.dScaleX||1,this.parent?.dScaleY||1,n,r),this.m=i}return(this.shouldUpdateTransformPathD||!this.cachedTransformedPathD)&&(this.cachedTransformedPathD=this.pathD().transform({m:this.m}),this.shouldUpdateTransformPathD=!1),this.cachedTransformedPathD}getBaseOptions(){return{initD:this.initD,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,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,interactive:this.interactive,drag:{...this.drag}}}clone(){return this.cloneShape()}cloneShape(){return new _t(this.getBaseOptions())}update(t){this.shouldUpdatePathD=!0}toSVGEl(){return null}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getRealBoundingClientRect(t=2){return this.transformPathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}getRealBoundingClientRectCenter(t=2){return this.transformPathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=0,r=0;if(this.parent&&!t){const i=this.parent.combo.getBoundingClientRectCenter(e);n=i.x-this.parent.dX,r=i.y-this.parent.dY}else if(typeof this.initCenterX>"u"&&typeof this.initCenterY>"u"){const i=this.getBoundingClientRectCenter(e);n=i.x,r=i.y}else n=this.initCenterX||0,r=this.initCenterY||0;return{x:n,y:r}}isPointInPath(t,e,n){if(t instanceof _a)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const r=this.el.getCTM();if(r){const i=r.inverse();return this.el.isPointInFill({x:i.a*e+i.c*n+i.e,y:i.b*e+i.d*n+i.f})}}return!1}isPointInStroke(t,e,n){if(t instanceof _a)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const r=this.el.getCTM();if(r){const i=r.inverse();return this.el.isPointInStroke({x:i.a*e+i.c*n+i.e,y:i.b*e+i.d*n+i.f})}}return!1}setStyle(t){Object.assign(this.style,t),this.shouldUpdateStyleInDraw=!0}setAttr(t,e){if(typeof t!="string")for(const n in t){const r=t[n];r&&r!=this.getAttr(n)&&(this.attrs[Nt(n)]=r,this.shouldUpdateAttrsInDraw=!0)}else e&&e!=this.getAttr(t)&&(this.attrs[Nt(t)]=e,this.shouldUpdateAttrsInDraw=!0)}getAttr(t,e){return this.attrs[t]||this.attrs[Nt(t)]||e}hasAttr(t){return!!this.getAttr(t)}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const n=t?.friction||1;this.vx*=n,this.vy*=n,this.move(this.vx,this.vy)}animateEaseTo(t,e){const n=e?.easing||.05,r=t.x-this.x,i=t.y-this.y;this.vx=r*n,this.vy=i*n,this.animate(e)}animateSpringTo(t,e){const n=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(r=>{const i=r.x-this.x,o=r.y-this.y,a=i*n,c=o*n;this.vx+=a,this.vy+=c}),this.animate({friction:.9,...e})}getSpringMassAlphaTo(t,e){const n=e?.springLength||100,r=e?.spring||5e-4,i=t.x-this.x,o=t.y-this.y,a=Math.sqrt(i*i+o*o);if(a<n){const c=i*r,h=o*r;return this.vx+=c/this.mass,this.vy+=h/this.mass,t.vx-=c/t.mass,t.vy-=h/t.mass,1-a/n}return 0}followTo(t,e=3){this.rotateTo(Ut(se(this.x,this.y,t.x,t.y)));const{dx:n,dy:r}=Qe(ut(this.degree),e);this.vx=n,this.vy=r,this.animate()}followAccelerationTo(t,e=.05){this.rotateTo(Ut(se(this.x,this.y,t.x,t.y)));const{dx:n,dy:r}=Qe(ut(this.degree),e);this.ax=n,this.ay=r,this.animate()}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,r=e*e+n*n,i=Math.sqrt(r),o=this.mass*t.mass/r,a=o*e/i,c=o*n/i;this.vx+=a/this.mass,this.vy+=c/this.mass,t.vx-=a/t.mass,t.vy-=c/t.mass}checkCollision(t){const e=t.x-this.x,n=t.y-this.y,r=Math.sqrt(e*e+n*n),{x:i,y:o,width:a,height:c}=t.getBoundingClientRect(),{x:h,y:l}=t.getBoundingClientRectCenter(),{x:u,y:d,width:f,height:m}=this.getBoundingClientRect(),{x:p,y:_}=this.getBoundingClientRectCenter();if(r<Math.abs(h-i)+Math.abs(p-u)||r<Math.abs(l-o)+Math.abs(_-d)){const y=Math.atan2(n,e),b={x:0,y:0},v=me(-y,e,n),w=me(-y,this.vx,this.vy),E=me(-y,t.vx,t.vy),C=w.x-E.x;w.x=((this.mass-t.mass)*w.x+2*t.mass*E.x)/(this.mass+t.mass),E.x=C+w.x;const D=Math.abs(w.x)+Math.abs(E.x),$=this.ballRadius+t.ballRadius-Math.abs(b.x-v.x);b.x+=w.x/D*$,v.x+=E.x/D*$;const O=me(y,b.x,b.y),U=me(y,v.x,v.y);t.moveTo(this.x+U.x,this.y+U.y),this.moveTo(this.x+O.x,this.y+O.y);const V=me(y,w.x,w.y),q=me(y,E.x,E.y);this.vx=V.x,this.vy=V.y,t.vx=q.x,t.vy=q.y}}checkWall(t){if(!t?.wall)return;const e=typeof t.wall.bounce=="number"?t.wall.bounce:-1,n=t.wall.x,r=t.wall.y,i=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height,{x:a,y:c,width:h,height:l}=this.getBoundingClientRect();t.wall.cycle||!1?(this.x+a>i?this.moveXTo(n-(a+h)):this.x+a+h<n&&this.moveXTo(i-a),this.y+c>o?this.moveYTo(r-(c+l)):this.y+c+l<r&&this.moveYTo(o-c)):(this.x+a+h>i?(this.moveXTo(i-(a+h)),this.vx*=e):this.x+a<n&&(this.moveXTo(n+(a+h)),this.vx*=e),this.y+c+l>o?(this.moveYTo(o-(c+l)),this.vy*=e):this.y+c<r&&(this.moveYTo(r+(c+l)),this.vy*=e))}getTotalLength(){return this.transformPathD().getTotalLength()}getPointAtLength(t){return this.transformPathD().getPointAtLength(t)}interpolate(t){return this.transformPathD().interpolate(t)}trailPath(t=0,e=1){const n=this.getTotalLength(),r=t*n,i=e*n;return{subPathD:this.transformPathD().getSubPathD(r,i),point:this.getPointAtLength(i)}}strokeDashTween(t=1e3,e){const n=this.pathD().getTotalLength();this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,i=new gs({frameDuration:t});i.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+Z(o.offset,2)),r?.(o,a)}})),i.play()}static generateRosetta(t,e,n,r,i){if(i==0)throw new Error("no dividing by zero, please");const o=[],a=360/i;for(let c=0;c<i;c+=1){const h=a*c*Math.PI/180,l=t+2*n*Math.cos(h),u=e+2*n*Math.sin(h);o.push(new ma({x:t,y:e,rx:n,ry:r,xAxisRotate:a*c,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),o.push(new ma({x:l,y:u,rx:n,ry:r,xAxisRotate:a*c,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new _t({initD:Wt.fromLines(o)})}}class te{shapes=[];svg;forceWidth;attrs={};style={};initCenterX;initCenterY;x;y;degree;scaleX;scaleY;interactive;drag;constructor(t){if(this.initCenterX=t?.centerX,this.initCenterY=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),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.svg=t?.svg,this.forceWidth=t?.forceWidth,t?.svg){this.initCenterX=0,this.initCenterY=0;let e=0,n=0,r=0,i=0;const o=new ov(t.svg).parse();for(let a=0,c=o.length;a<c;a++){const h=o[a];if(h.type=="viewbox"&&h.width&&h.height){if(e=parseFloat(h.width),n=parseFloat(h.height),t.forceWidth){const m=e/n;r=t.forceWidth,i=r/m}else r=e,i=n;continue}if(h.type!="path"||!of(h.path))continue;const l={};for(const m in h)m==="type"||m==="path"||m==="transform"||(l[m]=h[m]);const u=cf(af(h.path)),d=[];let f=[];for(let m=0,p=u.length;m<p;m++){const _=u[m];f.push(_),_[0].toLowerCase()=="z"&&(d.push(f),f=[])}f.length&&d.push(f),d.forEach(m=>{const p=new _t({attrs:l,initD:m});if(h.transform){const y=cu(h.transform).split();p.moveTo(y.x,y.y),p.rotateTo(y.degree),p.scaleTo(y.scaleX,y.scaleY)}this.addShape(p)})}r&&e&&i&&n&&this.comboScale(r/e,i/n,!0)}}destroy(){this.shapes.forEach(t=>t.destroy())}getBaseOptions(){return{svg:this.svg,forceWidth:this.forceWidth,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this.x,y:this.y,degree:this.degree,scaleX:this.scaleX,scaleY:this.scaleY,interactive:this.interactive,drag:{...this.drag}}}clone(){const t=this.cloneShapeCombo();return t.shapes=this.shapes.map(e=>{const n=e.clone();return e.parent&&(n.parent={...e.parent,combo:t}),n}),t}cloneShapeCombo(){return new te(this.getBaseOptions())}update(t){this.shapes.forEach(e=>e.update(t))}addShape(t,e){e?.notCopyFromCombo!==!0&&(t.setAttr(this.attrs),t.setStyle(this.style),t.interactive=t.interactive||this.interactive,t.drag={...this.drag,...t.drag}),t.parent={combo:this,dX:e?.dX||0,dY:e?.dY||0,dDegree:e?.dDegree||0,dScaleX:e?.dScaleX||1,dScaleY:e?.dScaleY||1},this.shapes.push(t)}comboMove(t,e,n=!1){n||(this.x+=t,this.y+=e),this.shapes.forEach(r=>{r.move(t,e)})}comboRotate(t,e=!1){e||(this.degree+=t),this.shapes.forEach(n=>{n.rotate(t)})}comboScale(t,e,n=!1){n||(this.scaleX*=t,this.scaleY*=e||t),this.shapes.forEach(r=>{r.scale(t,e)})}comboTransform(t,e=!1){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0,e),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0,e),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1,e)}getBoundingClientRect(t=2){const e=[],n=[];if(this.shapes.forEach(c=>{const h=c.getBoundingClientRect(t);e.push(h.x,h.x+h.width),n.push(h.y,h.y+h.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const r=Math.min(...e),i=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Z(r,t),y:Z(i,t),width:Z(o-r,t),height:Z(a-i,t)}}getBoundingClientRectCenter(t=2){if(typeof this.initCenterX=="number"&&typeof this.initCenterY=="number")return{x:this.initCenterX,y:this.initCenterY};const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}setStyle(t){Object.assign(this.style,t),this.shapes.forEach(e=>{e.setStyle(t)})}setAttr(t,e){if(typeof t!="string"){for(const n in t){const r=t[n];r&&r!=this.getAttr(n)&&(this.attrs[Nt(n)]=r)}this.shapes.forEach(n=>{n.setAttr(t)})}else e&&e!=this.getAttr(t)&&(this.attrs[Nt(t)]=e,this.shapes.forEach(n=>{n.setAttr(t,e)}))}getAttr(t,e){return this.attrs[t]||this.attrs[Nt(t)]||e}hasAttr(t){return!!this.getAttr(t)}sort(){this.shapes.map(t=>({shape:t,perimeter:t.transformPathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.expendTo(this);for(let r=n;r<e;r++){const i=t.shapes[r];this.addShape(new _t({initD:i.pathD().clone()}),{dX:i.x-this.x,dY:i.y-this.y,dDegree:i.degree-this.degree,dScaleX:i.scaleX/this.scaleX,dScaleY:i.scaleY/this.scaleY,notCopyFromCombo:!0})}}strokeDashTween(t,e){switch(e?.type){case"sequence":this.shapes.forEach((o,a)=>{o.strokeDashTween(t,{...e,delay:a,onStart:()=>{a==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{a==this.shapes.length-1&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new gs({frameDuration:t}),r={},i={};this.shapes.forEach((o,a)=>{const c=o.pathD().getTotalLength();r[`offset_${a}`]=c,i[`offset_${a}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,i,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,a)=>{for(const c in o){const h=ki(c).number;this.shapes[h].setAttr("strokeDashoffset",""+Z(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}function lv(s,t,e=5){const n=Mi(e);(!n(s.x,t.current.x)||!n(s.y,t.current.y))&&s.followTo(t.current)}function uv(s,t,e){s.drag&&s.drag.enable&&!s.isDragging&&s.animateEaseTo(t,e)}function fv(s,t){const e=[],n=s.length;for(let r=0;r<n;r++){const i=s[r];if(t?.springLength){const o=t?.springLength||100;i.isDragging||s.filter(a=>a.id!==i.id).forEach(a=>{const c=se(i.x,i.y,a.x,a.y);i.animateSpringTo({x:a.x-Math.cos(c)*o,y:a.y-Math.sin(c)*o},t)})}else t?.spring?r>0&&i.animateSpringTo(s[r-1],t):i.animate(t);if(t?.wall&&i.checkWall(t),t?.enableCollision||t?.enableGravityBetweenObjects||t?.enableSpringMassAlpha)for(let o=r+1;o<n;o++)t?.enableCollision&&i.checkCollision(s[o]),t?.enableGravityBetweenObjects&&i.gravitateTo(s[o]),t?.enableSpringMassAlpha&&e.push([i.x,i.y,s[o].x,s[o].y,i.getSpringMassAlphaTo(s[o],t)])}return e}function df(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let r=0;r<t;r++){const i=s[r].transformPathD(),o=s[r+1].transformPathD(),a=i.getPolymorphPoints(),c=o.getPolymorphPoints(),h=a.length>=c.length?a:c;e[r]=Wt.getInterpolator(i.expendToPolymorphPoints(h),o.expendToPolymorphPoints(h))}const n=new _t({initD:""});return r=>{const i=Z(t*r,6),o=Math.min(Math.floor(i),t-1),a=Z(i-o,6);return n.pathD(e[o](a)),n.setAttr(s[o+1].attrs),n}}function dv(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t;const e=[];s.forEach(o=>{let a;o instanceof te?(a=o,a.sort()):(a=new te,a.addShape(o)),e.push(a),(!t||t.shapes.length<a.shapes.length)&&(t=a)});const n=[];e.forEach((o,a)=>{o!==t&&o.expendTo(t),o.shapes.forEach((c,h)=>{n[h]=n[h]||[],n[h][a]=c})});const r=[];n.forEach(o=>{r.push(df(o))});const i=new te;return r.forEach(o=>{i.addShape(o(0))}),o=>(r.forEach(a=>{a(o)}),i)}function mv(s,t=6e3,e){const n=s.findIndex(a=>a instanceof te)>=0?dv(s):df(s),r=n(0),i=e?.onUpdate,o=new gs({frameDuration:t});return o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,c)=>{i?.(a,c),n(a.t),e?.shapeOrCombo?.(r,a.t)}})),o.play(),r}class pv{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new ml(null);resizeSubscription;mpg=bn();mouseSubscription;shapes=[];shapeTap$=new ml(null);tapSubscription;lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",n=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&gu(this.PARENT_EL),e=="svg"&&(this.SVG_EL=wn("svg"),Un(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=vu("canvas"),Un(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=fa(this.PARENT_EL).subscribe(r=>{this.rect.x=r.x,this.rect.y=r.y,this.rect.width=r.width,this.rect.height=r.height,this.SVG_EL&&Ne(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(Ne(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new _a(this.CANVAS_EL,this.rect.width,this.rect.height,n)),this.size$.next(r)}),this.mouseSubscription=Hu(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{}),this.tapSubscription=zu(this.PARENT_EL).subscribe(r=>{for(const i of this.shapes)if(i.isMouseIn){this.shapeTap$.next(i);break}})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe(),this.tapSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}draw(...t){if(t.length){const e=[];t.forEach(n=>{n instanceof te?e.push(...n.shapes):e.push(n)}),this.SVG_EL&&this.shapes.filter(n=>e.findIndex(r=>r.id==n.id)==-1).forEach(n=>{n.el&&(n.el.remove(),delete n.el)}),sm(this.shapes,e)}this.ctx&&this.ctx.clearRect(),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const e of this.shapes){const{x:n,y:r}=e.transformOrigin();let i=0,o=0;if(e.parent?.dDegree||e.parent?.dScaleX!==1||e.parent?.dScaleY!==1){const a=e.transformOrigin(!0);i=a.x,o=a.y}if(e.shouldUpdatePathD&&e.pathD(),this.SVG_EL){if(!e.el||e.shouldUpdateSVGElInDraw){const a=e.toSVGEl();e.el?a&&(e.el.remove(),e.el=a,Un(this.SVG_EL,e.el),Ne(e.el,{id:e.id})):(e.el=a||rf(),Un(this.SVG_EL,e.el),Ne(e.el,{id:e.id})),nv(e.el)&&Ne(e.el,{d:e.toSVGPathD()}),e.shouldUpdateSVGElInDraw=!1,e.shouldUpdateAttrsInDraw=!0,e.shouldUpdateStyleInDraw=!0,e.shouldUpdateMInDraw=!0}if(e.shouldUpdateAttrsInDraw&&(eh(e.attrs)||Ne(e.el,e.attrs),e.shouldUpdateAttrsInDraw=!1),e.shouldUpdateStyleInDraw&&(eh(e.style)||$n(e.el,e.style),e.shouldUpdateStyleInDraw=!1),e.shouldUpdateMInDraw||!e.m){const a=new Yt;a.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),a.rotate(e.degree,n,r),a.scale(e.scaleX,e.scaleY,n,r),e.parent?.dDegree&&a.rotate(e.parent.dDegree,i,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&a.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,i,o),Ne(e.el,{transform:a.toString()}),e.m=a,e.shouldUpdateMInDraw=!1}}if(this.ctx&&(this.ctx.save(),this.ctx.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),this.ctx.rotate(ut(e.degree),n,r),this.ctx.scale(e.scaleX,e.scaleY,n,r),e.parent?.dDegree&&this.ctx.rotate(ut(e.parent.dDegree),i,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&this.ctx.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,i,o),e.m=this.ctx.currentMatrix,Mu(this.ctx,e.attrs),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),e.interactive?this.SVG_EL?e.isMouseIn=e.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?e.isMouseIn=e.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):e.isMouseIn=!1:e.isMouseIn=!1,e.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=e.id),e.isDragging=e.id==this.draggingShapeId,this.mpg.current.isDown&&(e.isDragging||!this.draggingShapeId&&e.isMouseIn&&e.drag&&e.drag.enable)){this.setCursor("grabbing"),e.isDragging=!0,this.draggingShapeId=e.id;let a=this.mpg.current.x-this.mpg.start.x,c=this.mpg.current.y-this.mpg.start.y;if(a||c){if(e.drag&&e.drag.enable&&e.drag.alongPath){const h=e.drag.alongPath.transform({m:e.m}).closestPoint(this.mpg.current.x,this.mpg.current.y);a=h.point.x-e.x,c=h.point.y-e.y}(a||c)&&(e.move(a,c),e.parent?.combo.shapes.forEach(h=>{h.drag?.followSibling&&h!==e&&h.move(a,c)}))}this.mpg.setStart(this.mpg.current)}else e.isMouseIn&&e.drag&&e.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}clear(){this.shapes.forEach(t=>{t.el&&(t.el.remove(),delete t.el)}),this.ctx&&this.ctx.clearRect(),this.shapes=[]}drawMouseMoveLine(t){const e=t?.brushSize||4,n=t?.brushColor||"#000000";let r=!1;const i=Rr(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{r=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=n,this.ctx.beginPath())},end:()=>{this.ctx&&this.ctx.restore()}}).subscribe(o=>{this.ctx&&(r?this.ctx.lineTo(o.current.x,o.current.y):(r=!0,this.ctx.moveTo(o.current.x,o.current.y)),this.ctx.stroke())});return()=>{i.unsubscribe()}}drawMouseMoveBrush(t){const e=t?.brushSize||10,n=t?.brushDensity||50,r=t?.brushColor||"#000000",i=new ue(r),o=i.r,a=i.g,c=i.b,h=Rr(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(l=>{if(this.ctx){const u=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),d=u.data;for(let f=0;f<n;f++){const m=Math.random()*Math.PI*2,p=Math.random()*e,_=l.current.x+Math.cos(m)*p|0,y=l.current.y+Math.sin(m)*p|0,b=(_+y*u.width)*4;d[b]=o,d[b+1]=a,d[b+2]=c,d[b+3]=255}this.ctx.putImageData(u)}});return()=>{h.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&sv(this.SVG_EL)}}class vn extends _t{lineLength;startColor;endColor;constructor(t){super({...t,centerX:0,centerY:0}),this.lineLength=t?.lineLength||0,this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.startColor||this.getAttr("stroke")||"#000000"})}cloneShape(){return new vn({...super.getBaseOptions(),lineLength:this.lineLength,startColor:this.startColor,endColor:this.endColor})}lineToAbsolutePoint(t){const e=Ut(se(this.x,this.y,t.x,t.y)),n=Ze(this.x,this.y,t.x,t.y);(e!=this.degree||n!=this.lineLength)&&(e!=this.degree&&this.rotateTo(e),n!=this.lineLength&&(this.lineLength=n),this.shouldUpdatePathD=!0)}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}getBoundingClientRect(){return{x:0,y:0,width:this.lineLength,height:parseFloat(this.getAttr("strokeWidth"))}}toSVGPathData(){return[["m",0,0],["l",this.lineLength,0]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.lineLength,0,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.lineLength,0)}intersection(t){const e=this.transformPathD().normalizedLines[0],n=t.transformPathD().normalizedLines[0];return e.intersection(n)}}class Ca extends _t{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Ca({...super.getBaseOptions(),cx:this.cx,cy:this.cy,toX:this.toX,toY:this.toY,isLineThrough:this.isLineThrough})}update(t){typeof t.cx=="number"&&(this.cx=t.cx,this.shouldUpdatePathD=!0),typeof t.cy=="number"&&(this.cy=t.cy,this.shouldUpdatePathD=!0),typeof t.toX=="number"&&(this.toX=t.toX,this.shouldUpdatePathD=!0),typeof t.toY=="number"&&(this.toY=t.toY,this.shouldUpdatePathD=!0),typeof t.isLineThrough=="boolean"&&(this.isLineThrough=t.isLineThrough,this.shouldUpdatePathD=!0)}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(0+this.toX)/2,e=this.cy*2-(0+this.toY)/2;return[["m",0,0],["q",t,e,this.toX,this.toY]]}else return[["m",0,0],["q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(0+this.toX)/2,n=this.cy*2-(0+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}}class Fr extends _t{points;isStraight;constructor(t){super(t),this.points=t?.points||[],this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Fr({...super.getBaseOptions(),points:[...this.points],isStraight:this.isStraight})}update(t){"points"in t&&(this.points=[...t.points||this.points],this.shouldUpdatePathD=!0),typeof t.isStraight=="boolean"&&(this.isStraight=t.isStraight,this.shouldUpdatePathD=!0)}toSVGPathData(){const t=[];if(this.points.length<3)return t;const e=this.points.length;if(this.isStraight){t.push(["m",this.points[0].x,this.points[0].y]);for(let n=1;n<=e-1;n++)t.push(["l",this.points[n].x-this.points[n-1].x,this.points[n].y-this.points[n-1].y]);t.push(["z"])}else{const n=(this.points[0].x+this.points[e-1].x)/2,r=(this.points[0].y+this.points[e-1].y)/2;let i=n,o=r;t.push(["m",i,o]);for(let a=0;a<e-1;a++){const c=(this.points[a].x+this.points[a+1].x)/2,h=(this.points[a].y+this.points[a+1].y)/2;t.push(["q",this.points[a].x-i,this.points[a].y-o,c-i,h-o]),i=c,o=h}t.push(["q",this.points[e-1].x-i,this.points[e-1].y-o,n-i,r-o])}return t}toCanvasContext(t){if(this.points.length<3)return;t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let n=1;n<=e-1;n++)t.lineTo(this.points[n].x,this.points[n].y);t.closePath()}else{const n=(this.points[0].x+this.points[e-1].x)/2,r=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(n,r);for(let i=0;i<e-1;i++){const o=(this.points[i].x+this.points[i+1].x)/2,a=(this.points[i].y+this.points[i+1].y)/2;t.quadraticCurveTo(this.points[i].x,this.points[i].y,o,a)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,n,r)}}isPointInShape(t){const e=this.points.length;let n=!1;const r=2e-10;for(let i=0,o=e-1;i<e;o=i,i++){const a=this.points[i].x,c=this.points[i].y,h=this.points[o].x,l=this.points[o].y;if(a===t.x&&c===t.y||h===t.x&&l===t.y||t.y===c&&t.y===l)return!0;if(t.y>=c&&t.y<l||t.y<c&&t.y>=l){const u=(h-a)/(l-c),d=a+u*(t.y-c);if(d===t.x||Math.abs(d-t.x)<r)return!0;d>t.x&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}static generate(t,e,n,r){const i=[];for(let o=0;o<r;o++){const a=o/r*2*Math.PI,{dx:c,dy:h}=Qe(a,n);i.push({x:t+c,y:e+h})}return new Fr({points:i})}}class Ea extends te{length=100;constructor(t){super(t);const e=new vn({drag:{followSibling:!0},lineLength:this.length});this.addShape(e);const n=new vn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(n,{dX:90-Math.random()*40,dDegree:Math.random()*70});const r=new vn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(r,{dX:90-Math.random()*40,dDegree:-Math.random()*70}),this.comboRotate(-90,!0)}cloneShapeCombo(){return new Ea(super.getBaseOptions())}}class jn extends _t{ballRadius;constructor(t){super(t),this.ballRadius=t?.ballRadius||0}cloneShape(){return new jn({...super.getBaseOptions(),ballRadius:this.ballRadius})}update(t){typeof t.ballRadius=="number"&&(this.ballRadius=t.ballRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:-this.ballRadius,y:-this.ballRadius,width:this.ballRadius*2,height:this.ballRadius*2}}toSVGEl(){const t=wn("circle");return this.setAttr({cx:"0",cy:"0",r:String(this.ballRadius)}),t}toSVGPathData(){return this.ballRadius?[["m",0,-this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,2*this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,-2*this.ballRadius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.ballRadius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.ballRadius===t.ballRadius&&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 Bn(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 n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y;return{x:n*t.x-e*t.y,y:e*t.y-n*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}}}class Ta extends _t{constructor(t){super(t)}cloneShape(){return new Ta({...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 nn extends _t{rectWidth;rectHeight;rectBorderRadius;constructor(t){super(t),this.rectWidth=t.rectWidth||0,this.rectHeight=t.rectHeight||0,this.rectBorderRadius=t.rectBorderRadius||0}cloneShape(){return new nn({...super.getBaseOptions(),rectWidth:this.rectWidth,rectHeight:this.rectHeight,rectBorderRadius:this.rectBorderRadius})}update(t){typeof t.rectWidth=="number"&&(this.rectWidth=t.rectWidth,this.shouldUpdatePathD=!0),typeof t.rectHeight=="number"&&(this.rectHeight=t.rectHeight,this.shouldUpdatePathD=!0),typeof t.rectBorderRadius=="number"&&(this.rectBorderRadius=t.rectBorderRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:0,y:0,width:this.rectWidth,height:this.rectHeight}}toSVGEl(){const t=wn("rect");return this.setAttr({x:"0",y:"0",width:String(this.rectWidth),height:String(this.rectHeight),rx:String(this.rectBorderRadius),ry:String(this.rectBorderRadius)}),t}toSVGPathData(){return this.rectBorderRadius?[["m",this.rectBorderRadius,0],["l",this.rectWidth-this.rectBorderRadius*2,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,this.rectBorderRadius],["l",0,this.rectHeight-this.rectBorderRadius*2],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,this.rectBorderRadius],["l",this.rectBorderRadius*2-this.rectWidth,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,-this.rectBorderRadius],["l",0,this.rectBorderRadius*2-this.rectHeight],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,-this.rectBorderRadius],["z"]]:[["m",0,0],["l",this.rectWidth,0],["l",0,this.rectHeight],["l",-this.rectWidth,0],["z"]]}toCanvasContext(t){t.beginPath(),this.rectBorderRadius<=0?t.rect(0,0,this.rectWidth,this.rectHeight):(t.moveTo(0,this.rectBorderRadius),t.lineTo(0,this.rectHeight-this.rectBorderRadius),t.quadraticCurveTo(0,this.rectHeight,this.rectBorderRadius,this.rectHeight),t.lineTo(this.rectWidth-this.rectBorderRadius,this.rectHeight),t.quadraticCurveTo(this.rectWidth,this.rectHeight,this.rectWidth,this.rectHeight-this.rectBorderRadius),t.lineTo(this.rectWidth,this.rectBorderRadius),t.quadraticCurveTo(this.rectWidth,0,this.rectWidth-this.rectBorderRadius,0),t.lineTo(this.rectBorderRadius,0),t.quadraticCurveTo(0,0,0,this.rectBorderRadius)),t.closePath()}static fromCubicBezier(t,e,n,r,i,o,a,c){const l=new jt({x:t,y:e,c1x:n,c1y:r,c2x:i,c2y:o,toX:a,toY:c}).getBoundingClientRect();return new nn({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.height})}eq(t){return this.x===t.x&&this.y===t.y&&this.rectWidth===t.rectWidth&&this.rectHeight===t.rectHeight&&this.rectBorderRadius===t.rectBorderRadius}intersection(t){return!(this.x+this.rectWidth<t.x||t.x+t.rectWidth<this.x||this.y+this.rectHeight<t.y||t.y+t.rectHeight<this.y)}isPointInShape(t){return t.x>=this.x&&t.x<=this.x+this.rectWidth&&t.y>=this.y&&t.y<=this.y+this.rectHeight}}class Pa extends _t{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Pa({...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 Aa extends _t{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||50,this.ry=t?.heartRy||50}cloneShape(){return new Aa({...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 Ma extends _t{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Ma({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const n=288+e*144,r=this.r*Math.cos(ut(n)),i=this.r*Math.sin(ut(n));t.push(["l",r,i])}return t}}class ka extends _t{constructor(t){super(t)}cloneShape(){return new ka({...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 Ia extends _t{constructor(t){super(t)}cloneShape(){return new Ia({...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,2*15],["a",15,15,0,1,1,0,-2*15]]}}class Da extends _t{constructor(t){super({...t,initD:"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 Da({...super.getBaseOptions()})}}class Oa extends _t{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Oa({...super.getBaseOptions(),rx:this.rx,ry:this.ry})}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGEl(){const t=wn("ellipse");return this.setAttr({cx:"0",cy:"0",rx:String(this.rx),ry:String(this.ry)}),t}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Ra extends te{showFlame;flame;ship;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t?.showFlame:!0,this.flame=new _t({initD:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]],drag:{followSibling:!0}}),this.showFlame&&this.addShape(this.flame),this.ship=new _t({initD:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]],drag:{followSibling:!0}}),this.addShape(this.ship)}cloneShapeCombo(){return new Ra({...super.getBaseOptions(),showFlame:this.showFlame})}update(t){typeof t?.showFlame=="boolean"&&(this.shapes=[],this.showFlame=t?.showFlame,this.showFlame&&this.addShape(this.flame),this.addShape(this.ship))}}class La extends te{width;height;cornerRadius;constructor(t){super(t),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const e=new nn({drag:{followSibling:!0},rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(e,{dX:0-this.cornerRadius,dY:0-this.height*.5});const n=new jn({drag:{followSibling:!0},ballRadius:2});this.addShape(n);const r=new jn({drag:{followSibling:!0},ballRadius:2});this.addShape(r,{dX:0+this.width})}cloneShapeCombo(){return new La({...super.getBaseOptions(),segmentWidth:this.width,segmentHeight:this.height,segmentCornerRadius:this.cornerRadius})}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(ut(t.degree))*this.width,y:t.y+Math.sin(ut(t.degree))*this.width}}}class za extends te{options;value$=new qe;subscription;constructor(t){super(t),this.options=t;const e=t?.sliderMin||0,n=t?.sliderMax||100,r=t?.sliderStep||1,i=em(e,n,r),o=i(typeof t?.sliderDefaultValue=="number"?K(t.sliderDefaultValue,e,n):e);this.value$.next(o);const a=o/(n-e),c=t?.sliderWidth||100,h=t?.sliderHeight||4,l=h*.5,u=h*2.5,d=t?.sliderBackgroundColor||"#f5f5f5",f=t?.sliderForegroundColor||"#5a82f0",m=new nn({rectWidth:c,rectHeight:h,rectBorderRadius:l,attrs:{fill:d},drag:{enable:!1}});this.addShape(m);const p=new nn({rectWidth:c*a,rectHeight:h,rectBorderRadius:l,attrs:{fill:f},drag:{enable:!1}});this.addShape(p);const _=new jn({x:c*a,y:l,ballRadius:u,attrs:{fill:f},drag:{enable:!0,alongPath:new Wt([["m",0,0],["l",c,0]])}});this.addShape(_),this.subscription=_.transform$.subscribe(({dX:y})=>{console.log(y);const b=(_.x-m.x)/c;p.update({rectWidth:c*b}),this.value$.next(i(b*(n-e)+e))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new za({...super.getBaseOptions(),...this.options})}}class Es extends _t{half;lineWidth;radius;startDegree;endDegree;percent=0;percentDegree=0;startColor;endColor;constructor(t){super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t.lineWidth;const e=t.width||0,n=t.height||0,r=(t.endDegree-t.startDegree-180)/2;if(t.radius)this.radius=t.radius;else if(this.half){const i=Math.min(e/2,n)-this.lineWidth;this.radius=Math.max(0,i-i*Math.sin(ut(r)))}else this.radius=Math.max(0,Math.min(e/2,n/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=n-this.lineWidth-this.radius*Math.sin(ut(r)):this.y=n/2),t.forceCoordinate?(this.startDegree=t.startDegree,this.endDegree=t.endDegree):(this.startDegree=-90+t.startDegree,this.endDegree=-90+t.endDegree),this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({"stroke-linecap":"round","stroke-width":String(this.lineWidth),stroke:this.startColor||"#000000"}),this.setPercent(t.percent||1)}cloneShape(){return new Es({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,radius:this.radius,forceCoordinate:!0,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:this.percent})}setPercent(t){this.percent=Math.max(0,t),this.percentDegree=this.startDegree+(this.endDegree-this.startDegree)*t}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){const{dx:t,dy:e}=Qe(ut(this.startDegree),this.radius),{dx:n,dy:r}=Qe(ut(this.percentDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.percentDegree-this.startDegree)>=180?1:0,1,n-t,r-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const n=this.radius-this.radius*Math.cos(Math.PI*this.percent),r=this.radius*Math.sin(Math.PI*this.percent);e=t.createLinearGradient(-this.radius,0,-this.radius+n,-r,{0:this.startColor,1:this.endColor})}else{const n=this.radius*Math.sin(2*Math.PI*this.percent),r=this.radius*Math.cos(2*Math.PI*this.percent);e=t.createLinearGradient(0,-this.radius,n,-r,{0:this.startColor,1:this.endColor})}this.setAttr({stroke:e})}t.beginPath(),t.arc(0,0,this.radius,ut(this.startDegree),ut(this.percentDegree),!1)}}class Na extends te{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t){if(super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t?.lineWidth||12,this.width=t.width,this.height=t.height,this.bgColor=t?.bgColor,this.startColor=t?.startColor,this.endColor=t?.endColor,this.half?(this.startDegree=t?.startDegree||-90-15,this.endDegree=t?.endDegree||90+15):(this.startDegree=t?.startDegree||0,this.endDegree=t?.endDegree||360),this.percent=t?.percent||0,this.ringBg=new Es({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.bgColor,percent:1}),this.addShape(this.ringBg),this.ring=new Es({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:0}),this.addShape(this.ring),this.indicatorLineCount=22+1,this.half){const i=this.ringBg.radius-20-17;for(let o=0;o<this.indicatorLineCount;o++){const a=new vn({lineLength:17,startColor:this.startColor,endColor:this.endColor,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(a);const c=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*o;this.addShape(a,{dX:this.ringBg.x+Math.cos(ut(c))*i,dY:this.ringBg.y+Math.sin(ut(c))*i,dDegree:c})}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new Na({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,width:this.width,height:this.height,bgColor:this.bgColor,startColor:this.startColor,endColor:this.endColor,startDegree:this.startDegree,endDegree:this.endDegree,percent:this.percent})}setPercent(t){if(this.percent=Math.max(0,t),this.ring.setPercent(t),this.half)for(let e=0;e<this.indicatorLineCount;e++)e/(this.indicatorLineCount-1)<=this.percent?this.lines[e].enableGradient(this.startColor,this.endColor):this.lines[e].disableGradient(this.bgColor)}}class Xn extends _t{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=ki(this.getAttr("fontSize"),10).number,n=ki(this.getAttr("fontWeight"),400).number,r=Xn.measureText(this.text,e,n);this.width=r.width,this.height=r.height}cloneShape(){return new Xn({...super.getBaseOptions(),text:this.text})}toSVGEl(){const t=wn("text");t.setAttribute("x","0"),t.setAttribute("y","0"),t.style.alignmentBaseline="middle";const e=this.text.split(`
86
+ `);if(e.length<=1)t.innerHTML=this.text;else{const n=this.getAttr("line-height","1.2em");e.forEach((r,i)=>{if(r.trim()){const o=wn("tspan");o.setAttribute("x","0"),o.setAttribute("dy",i>0?n:"0"),o.innerHTML=r.trim(),o.style.alignmentBaseline="middle",t.append(o)}})}return t}toSVGPathData(){return[]}toCanvasContext(t){const e=this.text.split(`
87
+ `);if(e.length<=1)t.fillText(this.text,0,0);else{const n=t.measureText(this.text),i=(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)*parseFloat(this.getAttr("line-height","1.2em"));let o=0;e.forEach((a,c)=>{a.trim()&&(o+=c>0?i:0,t.fillText(a.trim(),0,o))})}}static measureText(t,e=12,n=400){const r=document.createElement("span");r.style.visibility="hidden",r.style.margin="0",r.style.padding="0",r.style.inset="0",r.style.whiteSpace="nowrap",r.style.overflow="visible",r.style.fontSize=e+"px",r.style.fontWeight=n.toString(),r.innerText=t,document.body.appendChild(r);const i=r.offsetWidth,o=r.offsetHeight;return document.body.removeChild(r),{width:i,height:o}}static getFixedWidthText(t,e,n=12,r=400,i="..."){let o="";if(!t||e<n)return o;const a=t.split("");let c=i?Xn.measureText(i,n,r).width:0;for(let h=0,l=a.length;h<l;h++)if(c+=Xn.measureText(a[h],n,r).width,c>e){i&&(o+=i);break}else o+=a[h];return o}}class Fa extends te{options;constructor(t){super(t),this.options=t;const{shapeCreator:e,width:n,height:r,x:i,y:o,particleCount:a,angle:c,spread:h,startVelocity:l,decay:u,gravity:d,drift:f,ticks:m,colors:p,scalar:_,flat:y}=Object.assign({shapeCreator:()=>new nn({rectWidth:10,rectHeight:10}),width:100,height:100,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:lp,scalar:1,flat:!1},t||{}),b=(C,D)=>{C.x=n*i,C.y=r*o,C.scaleX=_,C.scaleY=_;const $=p[D%p.length];C.setAttr({fill:$}),C.interactive=!1,C.wobble=Math.random()*10,C.wobbleSpeed=Math.min(.11,Math.random()*.1+.05),C.velocity=l*.5+Math.random()*l,C.angle2D=-v+(.5*w-Math.random()*w),C.tiltAngle=(Math.random()*(.75-.25)+.25)*Math.PI,C.tick=0,C.totalTicks=m,C.decay=u,C.drift=f,C.random=Math.random()+2,C.tiltSin=0,C.tiltCos=0,C.wobbleX=0,C.wobbleY=0,C.gravity=d*3,C.scalar=_,C.flat=y,C.color=new ue($)},v=ut(c),w=ut(h);let E=a;for(;E;){const C=e();b(C,E),C.clone=(D=>()=>{const $=e();return b($,D),$})(E),this.addShape(C),E--}}cloneShapeCombo(){return new Fa(this.options)}update(){return this.shapes=this.shapes.filter(t=>{t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);const e=t.tick++/t.totalTicks,n=t.x+t.random*t.tiltCos,r=t.y+t.random*t.tiltSin,i=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;return t.setAttr("fill",t.color.setAlpha(1-e).toString()),t.degree=Ut(Math.PI/10*t.wobble),t.scaleX=Math.abs(i-n)*.1,t.scaleY=Math.abs(o-r)*.1,t.tick<t.totalTicks}),this.shapes.length>0}}function mf(s,t={attributes:!0,childList:!0,subtree:!0}){return new Mt(e=>{const n=new MutationObserver((r,i)=>{e.next(r)});return n.observe(s,t),()=>{n.disconnect()}})}function gv(s,t){return new Promise(e=>{new MutationObserver((r,i)=>{for(const o of r)o.type==="childList"&&o.addedNodes.forEach(a=>{a.isEqualNode(t)&&(i.disconnect(),e(!0))})}).observe(s,{childList:!0})})}function pf(s,t={root:null}){return new Mt(e=>{const n=new IntersectionObserver((r,i)=>{if(r.length){const o=r[r.length-1];o&&e.next(o)}},t);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}})}function yv(s,t){return Wu().pipe(mn(null),kt(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||ca(),{top:r,left:i,right:o,bottom:a}=s.getBoundingClientRect();return(r>=0&&r<=n||a>=0&&a<=n)&&(i>=0&&i<=e||o>=0&&o<=e)}),He())}function bv(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return pf(s,{threshold:e,root:t?.root}).pipe(kt(n=>n.isIntersecting&&n.intersectionRatio>=e),He())}let gf=!1;function wv(){gf||(gf=!0,Tu(`
42
88
  :root {
43
89
  --sat:env(safe-area-inset-top, 0px);
44
90
  --sar:env(safe-area-inset-right, 0px);
@@ -51,16 +97,9 @@ Content-Type: `+f.type+`\r
51
97
  --sab:env(safe-area-inset-bottom, 0px);
52
98
  --sal:env(safe-area-inset-left, 0px);
53
99
  }
54
- `))}Bw();function Fw(){return Ao(document.documentElement).pipe(Mr(Er),it(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function Yw(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new st(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((n,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),n()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(n=>{t.next({longitude:n.coords.longitude,latitude:n.coords.latitude})},n=>{t.error(n)},s)}).catch(n=>{t.error(n)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function gu(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return X(t,"change").pipe(it(e=>e.matches),je(t.matches),Me())}function oa(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.sessionStorage.getItem(e);if(a)return Ta(a)}catch{}},i=a=>{try{typeof a.v<"u"?window.sessionStorage.setItem(e,Li(a)):window.sessionStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=Cs(n(),t);return a().v},set:a=>{const{set:h}=Cs(n(),t),c=h(a);i(c)}}}function Xw(){window.sessionStorage.clear()}function yu(){return du(document).pipe(it(()=>location),je(location))}function Uw(){return yu().pipe(it(s=>s.href),je(location.href),Me())}function $w(){return X(window,"hashchange").pipe(it(s=>s.target.location.hash.replace("#","")),je(window.location.hash.replace("#","")),Me())}function wu(s="current"){return X(window,"popstate").pipe(it(t=>t.state||{}),it(t=>({...t,[s]:t[s]||window.location.pathname+window.location.search+window.location.hash})),Me((t,e)=>t[s]===e[s]))}function Gw(s={nameInState:"current",alreadyPushState:!0}){const t=s.nameInState,e=typeof s.alreadyPushState=="boolean"?s.alreadyPushState:!0,{get:n,set:i}=oa("fe-route-history"),r=n()||[],{get:o,set:a}=oa("fe-route-history-index"),h=o();let c=typeof h=="number"?h:r.length-1;function l(y){return r.findIndex(b=>b[t]===y[t])}const u={currentIndex:c};function m(y){y=B(y,-1,r.length-1),c<0?(u.direction="keep",u.delta=0):(y<c?u.direction="backward":y>c?u.direction="forward":u.direction="keep",u.delta=y-c),u.from=u.to,u.to=r[y]?.[t],c=y,u.currentIndex=c,a(c)}m(c);function f(y){r.push(y),i(r),m(r.length-1)}function p(y,v){const b={...v,[t]:y};window.history.pushState(b,"",y),f(b)}function g(y,v=e){const b=l(y);if(b<0){c>=0&&(r.splice(c+1),i(r)),v?f(y):p(y[t],y);return}b!=c&&m(b)}const C=wu().subscribe(y=>{g(y,!0)});return{history:r,route:u,navigate:(y,v)=>{g({...v,[t]:y},e)},go(y){window.history.go(y)},back(){window.history.back()},forward(){window.history.forward()},destroy:()=>{C.unsubscribe()}}}function Vw(s,t,e){if(typeof t=="string"&&(t=Da(t)),(typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},s.dataset);return Object.keys(n).forEach(i=>{if(n[i]?.startsWith("[")||n[i]?.startsWith("{"))try{n[i]=JSON.parse(n[i]||"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),Object.entries(n).forEach(([i,r])=>{r?s.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete s.dataset[i]})}}function jw(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function bu(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.localStorage.getItem(e);if(a)return Ta(a)}catch{}},i=a=>{try{typeof a.v<"u"?window.localStorage.setItem(e,Li(a)):window.localStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=Cs(n(),t);return a().v},set:a=>{const{set:h}=Cs(n(),t),c=h(a);i(c)}}}function qw(){window.localStorage.clear()}const{get:xu,set:vu}=bu(ys("theme")),Su=new Te,Hw=Su.pipe(je(void 0));function _u(s){switch(s){case"dark":document.documentElement.classList.add("dark"),Je(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),Je(document.documentElement,"data-theme","light");break}}function Cu(s){return vu(s),_u(s),Su.next(s),s}function Ww(){return Cu(xu()=="dark"?"light":"dark")}function Jw(){return ng([Hw,gu("(prefers-color-scheme: dark)")]).pipe(it(([s,t])=>s||(s=xu(),s||(s=t?"dark":"light"),vu(s),_u(s),s)))}function Zw(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function Kw(s,t){document.documentElement.style.setProperty(s,t)}function Qw(s,t){let e=t?.value||"";if(!e){const r=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();r&&(e=decodeURIComponent(r))}const n=()=>e,i=r=>{if(e=r,e){const o=t?.domain?"; domain="+t.domain:"",a=t?.path?"; path="+t.path:"",h=t?.secure==!0?"; secure":"";let c=s+"="+encodeURIComponent(e)+o+a+h;if(t?.days){const l="; expires="+new Date(Date.now()+t.days*864e5).toUTCString();c+=l}document.cookie=c}};return i(e),{get:n,set:i}}function tb(){const s=document.cookie.split("; ");for(let t=0;t<s.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const n=encodeURIComponent(s[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=n+"/";i.length>0;)document.cookie=n+i.join("/"),i.pop();e.shift()}}}function eb(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function nb(s,t=1,e){return new Promise((n,i)=>{let r;const o=window.indexedDB.open(s,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,eb(r,e),n(r)}})}function sb(s,t,e={id:1,name:"xxx"}){return new Promise((n,i)=>{const r=s.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{n(a)},r.onerror=a=>{i(a)}})}const aa=new Rn;function ha(s,t){return Ri({url:s,...t})}async function ui(s,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");try{const e=ha(s,t),n=new AbortController;aa.set(e,n);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{n.abort()},o);let h=await fetch(new Request(s,{...t,signal:n.signal}));if(aa.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&Es("useFetch: HTTP Status 0 received."),r&&typeof ReadableStream<"u"&&h.body&&h.body.getReader){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,m=u!==0;let f=0;const p=new ReadableStream({start(g){function C(){c.read().then(({done:y,value:v})=>{y?g.close():(f+=v.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:m,loaded:f,total:u})),g.enqueue(v),C())}).catch(y=>{g.error(y)})}C()}});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 throw new ad(`useFetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}catch(e){throw e.name==="AbortError"?new Error("Request timed out"):e.name==="TimeoutError"?new Error("Request timed out"):e}}function ib(s,t){const e=aa.get(ha(s,t));e&&e.abort()}function rb(s=3,t){return Yi(ui,s,t)}function ob(s=6e4){return Xi(ui,s)}function ab(s=6e4,t=3,e){return Xi(Yi(ui,t,e),s)}const hb={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:(s,t)=>{switch(t){case"W":return`${s}周`;default:return`${s}日`}},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:(s,t)=>{const e=s*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},cb={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:s=>{const t=["th","st","nd","rd"],e=s%100;return`[${s}${t[(e-20)%10]||t[e]||t[0]}]`}},Be=new Rn;let fi="zh-cn";ca(cb),ca(hb);function ca(s,t){if(!s)return Be.get(fi);let e;if(typeof s=="string"){const n=s.toLowerCase();if(Be.get(n))e=n;else if(t)Be.set(n,t),e=n;else return Be.get(fi)}else{const{name:n}=s;Be.set(n,s),e=n}return e&&(fi=e),Be.get(e)||Be.get(fi)}let lb=0;function sn(s,t={},e=[],n){return{name:String(++lb),tag:s,props:t,children:e,el:n}}function di(s){return sn(s.tagName,bo(s),Array.from(s.children).map(t=>di(t)),s)}function En(s,t=document.documentElement){if(s.el)return s.el;if(s.el=s.tag=="path"?Kl():document.createElement(s.tag),s.props)for(const e in s.props){const n=s.props[e];e.startsWith("on")?s.el.addEventListener(e.slice(2).toLowerCase(),n):e==="style"?rs(s.el,s.props[e]):Je(s.el,e,n)}return s.children&&(typeof s.children=="string"?s.el.appendChild(document.createTextNode(s.children)):s.children.forEach(e=>{En(e,s.el)})),t.appendChild(s.el),s.el}function mi(s,t){if(!s.el)return;if(s.tag!==t.tag){(s.el.parentElement||document.body).replaceChild(En(t),s.el);return}const e=t.el=s.el,n=s.props,i=t.props;for(const a in n)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),n[a]):e.removeAttribute(a));for(const a in i){const h=n[a],c=i[a];if(c!=h)if(a.startsWith("on")){const l=a.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(a==="style"){for(const l in h)l in c||wo(e,l);rs(e,c)}else Je(e,a,c)}const r=s.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{En(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)mi(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{En(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class ub{state;el;constructor(t,e){this.state=Ki(t,{deep:!0}),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const n=e;[...n.attributes].forEach(a=>{const h=a.name,c=a.value;if(h==="v-model")if(po(n)){const l=n;Ee(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(mo(n)){const l=n;Ee(()=>{l.checked=Ya(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const m=u.target,f=m.value;m.checked?If(this.getStateValue(c),f):Fa(this.getStateValue(c),f)})}else if(fo(n)){const l=n;Ee(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=n;Ee(()=>{l.value=this.getStateValue(c)});const u=m=>{this.setStateValue(c,m.target.value)};l.addEventListener("input",u)}else h==="v-text"?Ee(()=>{n.innerText=this.getStateValue(c)}):h==="v-html"&&Ee(()=>{n.innerHTML=this.getStateValue(c)})}),n.childNodes.length>0&&this.compile(n);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&Ee(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(n=>{e=e[n]}),e}setStateValue(t,e){let n=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)n=n[i[o]];n[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){
55
- let output = "";
56
- function echo(html){
57
- output += html;
58
- }
59
- ${t}
60
- return output;
61
- })`}}function Eu(s,t,e){return new WebSocket(s)}function fb(s){return`${s}eventbus/${Dn(3,"number")}/${Dn(8)}/websocket`}class ae{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=ae.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||Eu,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=ae.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===ae.CONNECTING||this.socket?.readyState===ae.OPEN||(this.state=ae.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{ie(`(${this.url}) onopen`),this.state=ae.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;ie(`(${this.url}) onclose: code(${e}) reason(${n}) wasClean(${i})`),this.state=ae.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),Ha(this.reconnectAttempts++)))},this.socket.onerror=t=>{ie(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(ie(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const n=t.data.substring(1);try{e=JSON.parse(n)}catch(i){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:i.toString(),message:n})]}e.forEach(i=>{const r=JSON.parse(i);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):Es(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?Es(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&Es(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===ae.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,n={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1)})),this.listeners[t].push(e)}unregister(t,e,n={}){const i=this.listeners[t];if(i){const r=i.indexOf(e);r!=-1&&(i.splice(r,1),i.length===0&&(this._send({type:"unregister",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1)}),delete this.listeners[t]))}}publish(t,e,n={}){this._send({type:"publish",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1),body:e})}async send(t,e,n={},i=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,h)=>{r.resolve=a,this._send({type:"send",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1),body:{requestid:r.requestid,...e}}),setTimeout(()=>{h(`(${this.url}) send(${r.requestid}: ${Xe(e)}) Timeout!`)},i)});return delete this.waitings[r.requestid],o}}function pi(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(s)?t="iOS":/android/i.test(s)?t="Android":/BlackBerry/i.test(s)?t="BlackBerry":/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()}function db(s=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(s)){const e=s.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(s)){const e=s.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function gi(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()}function mb(){const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t}function pb(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function gb(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function yb(){return gi()=="safari"}function la(){return pi()==="ios"}function Pu(){return pi()==="macos"}function wb(){return la()|Pu()}function Tu(){return pi()==="android"}function bb(){const s=window.navigator.appVersion;if(/Android/.test(s)&&!/Chrome\/\d/.test(s)){const t=s.match(/Safari\/(\d+.\d)/);return t&&typeof t=="object"&&t.length>=2?parseFloat(t[1])<535.19:!0}else return!1}function xb(){return la()||Tu()}function Mu(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const vb=Mu()!==-1,Sb=document.documentMode?document.documentMode===9:!1,_b=document.documentMode?document.documentMode===10:!1,Cb=document.documentMode?document.documentMode===11:!1;function Au(){return gi()==="wechat"}function Iu(){return gi()==="ali"}function Eb(){return Au()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Pb(){return Iu()&&navigator.userAgent.match(/miniprogram/i)}function Tb(s=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>s?"pc":"mobile",t.dataset.rem=n=Math.min(100,Math.round(100*(r/s))),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return parseFloat(r)*n},window.px2rem=function(r){return parseFloat(r)/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}class Mb extends Lo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=Ro(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),fa(this.currentItem.style,this.currentItem,da)}switch(this.processAttrs(e,n),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 n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});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&&fa(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+ua(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(da.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&fa(o,this.currentItem,da),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}}function ua(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return ua(s,t,i,r)-ua(e,n,i,r)}function fa(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const da=["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 Ab{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new hs(t),this.remoteVideoUtil=new hs(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(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}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(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[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 o=new RTCPeerConnection(i);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
100
+ `))}wv();function vv(){return fa(document.documentElement).pipe(xo(bo),kt(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function xv(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new Mt(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((n,r)=>{navigator.geolocation.getCurrentPosition(i=>{t.next({longitude:i.coords.longitude,latitude:i.coords.latitude}),n()},i=>{r(i)})}).then(()=>{e=navigator.geolocation.watchPosition(n=>{t.next({longitude:n.coords.longitude,latitude:n.coords.latitude})},n=>{t.error(n)},s)}).catch(n=>{t.error(n)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function yf(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return st(t,"change").pipe(kt(e=>e.matches),mn(t.matches),He())}function Ba(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.sessionStorage.getItem(e);if(a)return fc(a)}catch{}},r=a=>{try{typeof a.value<"u"?window.sessionStorage.setItem(e,uc(a)):window.sessionStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=nr(n(),t);return a().value},set:a=>{const{set:c}=nr(n(),t),h=c(a);r(h)}}}function Sv(){window.sessionStorage.clear()}function bf(){return mf(document).pipe(kt(()=>location),mn(location))}function _v(){return bf().pipe(kt(s=>s.href),mn(location.href),He())}function Cv(){return st(window,"hashchange").pipe(kt(s=>s.target.location.hash.replace("#","")),mn(window.location.hash.replace("#","")),He())}function wf(s="current"){return st(window,"popstate").pipe(kt(t=>t.state||{}),kt(t=>({...t,[s]:t[s]||window.location.pathname+window.location.search+window.location.hash})),He((t,e)=>t[s]===e[s]))}function Ev(s={nameInState:"current",alreadyPushState:!0}){const t=s.nameInState,e=typeof s.alreadyPushState=="boolean"?s.alreadyPushState:!0,{get:n,set:r}=Ba("fe-route-history"),i=n()||[],{get:o,set:a}=Ba("fe-route-history-index"),c=o();let h=typeof c=="number"?c:i.length-1;function l(y){return i.findIndex(v=>v[t]===y[t])}const u={currentIndex:h};function d(y){y=K(y,-1,i.length-1),h<0?(u.direction="keep",u.delta=0):(y<h?u.direction="backward":y>h?u.direction="forward":u.direction="keep",u.delta=y-h),u.from=u.to,u.to=i[y]?.[t],h=y,u.currentIndex=h,a(h)}d(h);function f(y){i.push(y),r(i),d(i.length-1)}function m(y,b){const v={...b,[t]:y};window.history.pushState(v,"",y),f(v)}function p(y,b=e){const v=l(y);if(v<0){h>=0&&(i.splice(h+1),r(i)),b?f(y):m(y[t],y);return}v!=h&&d(v)}const _=wf().subscribe(y=>{p(y,!0)});return{history:i,route:u,navigate:(y,b)=>{p({...b,[t]:y},e)},go(y){window.history.go(y)},back(){window.history.back()},forward(){window.history.forward()},destroy:()=>{_.unsubscribe()}}}function Tv(s,t,e){if(typeof t=="string"&&(t=Xc(t)),(typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},s.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]||"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),Object.entries(n).forEach(([r,i])=>{i?s.dataset[r]=i instanceof Object?JSON.stringify(i):i:delete s.dataset[r]})}}function Pv(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function vf(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.localStorage.getItem(e);if(a)return fc(a)}catch{}},r=a=>{try{typeof a.value<"u"?window.localStorage.setItem(e,uc(a)):window.localStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=nr(n(),t);return a().value},set:a=>{const{set:c}=nr(n(),t),h=c(a);r(h)}}}function Av(){window.localStorage.clear()}const Mv=["dark","light"],{get:xf,set:Sf}=vf(oi("theme")),_f=new qe,kv=_f.pipe(mn(void 0));function Cf(s){switch(s){case"dark":document.documentElement.classList.add("dark"),yn(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),yn(document.documentElement,"data-theme","light");break}}function Ef(s){return Sf(s),Cf(s),_f.next(s),s}function Iv(){return Ef(xf()=="dark"?"light":"dark")}function Dv(){return K0([kv,yf("(prefers-color-scheme: dark)")]).pipe(kt(([s,t])=>s||(s=xf(),s||(s=t?"dark":"light",Sf(s)),Cf(s),s)))}function et(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function Ov(s,t){document.documentElement.style.setProperty(s,t)}function Rv(s){return{foregroundCommon:et("--yz-foreground-common","#ffffff"),foregroundBorderCommon:et("--yz-foreground-border-common","#e6e6e6"),panelCommon:et("--yz-panel-common","#f5f5f5"),panelBorderCommon:et("--yz-panel-border-common","#b3b3b3"),gapCommon:et("--yz-gap-common","#cccccc"),placeholderCommon:et("--yz-placeholder-common","#8f8f8f"),fontCommon:et("--yz-font-common","#333333"),fontSecondaryCommon:et("--yz-font-secondary-common","#666666"),fontTertiaryCommon:et("--yz-font-tertiary-common","#999999"),foregroundReverse:et("--yz-foreground-reverse","#ffffff"),foregroundBorderReverse:et("--yz-foreground-border-reverse","#e6e6e6"),panelReverse:et("--yz-panel-reverse","#f5f5f5"),panelBorderReverse:et("--yz-panel-border-reverse","#b3b3b3"),gapReverse:et("--yz-gap-reverse","#cccccc"),placeholderReverse:et("--yz-placeholder-reverse","#8f8f8f"),fontReverse:et("--yz-font-reverse","#333333"),fontSecondaryReverse:et("--yz-font-secondary-reverse","#666666"),fontTertiaryReverse:et("--yz-font-tertiary-reverse","#999999"),blueCommon:et("--yz-xg-blue","#5a82f0"),bluePanelCommon:et("--yz-xg-blue-panel","#e6f0ff"),bluePanelBorderCommon:et("--yz-xg-blue-panel-border","#a0b4f0"),blueGradientCommon:et("--yz-xg-blue-gradient","#66b3ff"),redCommon:et("--yz-xg-red","#fa503c"),redPanelCommon:et("--yz-xg-red-panel","#fff5f5"),redPanelBorderCommon:et("--yz-xg-red-panel-border","#fac8c8"),redGradientCommon:et("--yz-xg-red-gradient","#fa8c78"),greenCommon:et("--yz-xg-green","#00be5a"),greenGradientCommon:et("--yz-xg-green-gradient","#00e678"),yellowCommon:et("--yz-xg-yellow","#fa8c00"),yellowGradientCommon:et("--yz-xg-yellow-gradient","#ffb400"),newenergyCommon:et("--yz-xg-newenergy","#64c896"),newenergyPanelCommon:et("--yz-xg-newenergy-panel","#ebfaf2"),primaryPattern:et(`--yz-pattern-${s}-primary`,"#5a82f0"),secondaryPattern:et(`--yz-pattern-${s}-secondary`,"#e6f0ff"),gradientPattern:et(`--yz-pattern-${s}-gradient`,"#66b3ff"),foregroundPattern:et(`--yz-pattern-${s}-foreground`,"#ffffff"),foregroundBorderPattern:et(`--yz-pattern-${s}-foreground-border`,"#e6e6e6"),panelPattern:et(`--yz-pattern-${s}-panel`,"#f5f5f5"),panelBorderPattern:et(`--yz-pattern-${s}-panel-border`,"#b3b3b3"),gapPattern:et(`--yz-pattern-${s}-gap`,"#cccccc"),placeholderPattern:et(`--yz-pattern-${s}-placeholder`,"#8f8f8f"),fontPattern:et(`--yz-pattern-${s}-font`,"#333333"),fontSecondaryPattern:et(`--yz-pattern-${s}-font-secondary`,"#666666"),fontTertiaryPattern:et(`--yz-pattern-${s}-font-tertiary`,"#999999")}}function Lv(s,t){let e=t?.value||"";if(!e){const i=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();i&&(e=decodeURIComponent(i))}const n=()=>e,r=i=>{if(e=i,e){const o=t?.domain?"; domain="+t.domain:"",a=t?.path?"; path="+t.path:"",c=t?.secure==!0?"; secure":"";let h=s+"="+encodeURIComponent(e)+o+a+c;if(t?.days){const l="; expires="+new Date(Date.now()+t.days*864e5).toUTCString();h+=l}document.cookie=h}};return r(e),{get:n,set:r}}function zv(){const s=document.cookie.split("; ");for(let t=0;t<s.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const n=encodeURIComponent(s[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",r=location.pathname.split("/");for(document.cookie=n+"/";r.length>0;)document.cookie=n+r.join("/"),r.pop();e.shift()}}}function Nv(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function Fv(s,t=1,e){return new Promise((n,r)=>{let i;const o=window.indexedDB.open(s,t);o.onerror=()=>{r("无法使用IndexDB!")},o.onsuccess=a=>{i=a.target.result,Nv(i,e),n(i)}})}function Bv(s,t,e={id:1,name:"xxx"}){return new Promise((n,r)=>{const i=s.transaction([t],"readwrite");i.objectStore(t).add(e),i.oncomplete=a=>{n(a)},i.onerror=a=>{r(a)}})}const Uv={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:(s,t)=>{switch(t){case"W":return`${s}周`;default:return`${s}日`}},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:(s,t)=>{const e=s*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},$v={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:s=>{const t=["th","st","nd","rd"],e=s%100;return`[${s}${t[(e-20)%10]||t[e]||t[0]}]`}},sn=new qm;let Br="zh-cn";Ua($v),Ua(Uv);function Ua(s,t){if(!s)return sn.get(Br);let e;if(typeof s=="string"){const n=s.toLowerCase();if(sn.get(n))e=n;else if(t)sn.set(n,t),e=n;else return sn.get(Br)}else{const{name:n}=s;sn.set(n,s),e=n}return e&&(Br=e),sn.get(e)||sn.get(Br)}function Tf(s,t={},e=[]){return typeof s=="string"?{tag:s,props:t,children:typeof e=="string"?e:e.filter(n=>typeof n!="boolean")}:s(t)}function Ur(s){const t=Tf(s.tagName,na(s),Array.from(s.children).map(e=>Ur(e)));return t.el=s,t}function Be(s,t=document.documentElement){if(typeof s=="string"){const n=document.createTextNode(s);return t.appendChild(n),n}if(s.el)return s.el;const e=s.tag=="path"?rf():document.createElement(s.tag);if(s.props)for(const[n,r]of Object.entries(s.props))n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),r):n==="style"?vs(e,r):yn(e,n,r);return t.appendChild(e),s.el=e,s.children&&(typeof s.children=="string"?Be(s.children,e):s.children.forEach(n=>{Be(n,e)})),e}function Ts(s,t){typeof s=="string"||!s.el||(Array.isArray(s.children)&&s.children.forEach(e=>{s.el&&Ts(e,s.el)}),t.removeChild(s.el))}function $r(s,t,e){if(!s.el||!t.el)return;e=e||s.el.parentElement||document.body||document.documentElement;const n=s.props.key,r=t.props.key;if(s.tag!==t.tag||s.el!==t.el||(r||n)&&r!==n){e.replaceChild(Be(t,e),s.el);return}const i=t.el=s.el,o=s.props,a=t.props;for(const l in o)l in a||(l.startsWith("on")?i.removeEventListener(l.slice(2).toLowerCase(),o[l]):i.removeAttribute(l));for(const l in a){const u=o[l],d=a[l];if(d!=u)if(l.startsWith("on")){const f=l.slice(2).toLowerCase();i.removeEventListener(f,u),i.addEventListener(f,d)}else if(l==="style"){for(const f in u)f in d||ea(i,f);vs(i,d)}else yn(i,l,d)}const c=s.children||[],h=t.children||[];if(typeof h=="string")i.innerHTML="",Be(h,i);else if(typeof c=="string")i.innerHTML="",h.forEach(l=>{Be(l,i)});else{const l=Math.min(c.length,h.length);for(let u=0;u<l;u++)$r(c[u],h[u],i);h.length>c.length?h.slice(c.length).forEach(u=>{Be(u,i)}):h.length<c.length&&c.slice(h.length).forEach(u=>{Ts(u,i)})}}function Pf(s=document.documentElement,t,e){t.el?!e||!e.el?(Ts(t,s),Be(t,s)):$r(e,t,s):(e&&Ts(e,s),Be(t,s))}const Yr=new Map;function $a(s,t=Yr){let e=t.get(s);return e||(e=Ur(s),t.set(s,e),e)}function jr(s,t,e=Yr){const n=$a(s,e);n.alternate||(n.alternate=Ur(s),In(n.alternate.props,n.props,!0)),t(n.alternate)}function Af(s=Yr){const t=Array.from(s.entries());for(const[e,n]of t){const r=n.alternate;r&&($r(n,r),n.props=r.props,n.alternate=void 0)}}function Ya(s=Yr){jm(()=>Af(s),50)}function Yv(){const s=new Map;let t=null;const e=new Set;let n=!1;function r(l){const u=t,d=u.stateIndex;u.states[d]===void 0&&(u.states[d]=l);function f(m){let p;typeof m=="function"?p=m(u.states[d]):p=m,u.states[d]!==p&&(u.states[d]=p,o(u))}return u.stateIndex++,[u.states[d],f]}function i(l,u){const d=t,f=d.effectIndex,m=d.effects[f]||{};if(!u||!m.deps||u.some((_,y)=>_!==m.deps[y])){m.cleanup&&m.cleanup();const _=l();d.effects[f]={deps:u?[...u]:[],cleanup:_}}d.effectIndex++}function o(l){e.add({component:l.component,props:l.props,container:l.container}),n||(n=!0,setTimeout(a,0))}function a(){const l=Array.from(e);e.clear(),l.forEach(({component:u,props:d,container:f})=>{c(u,f,d)}),n=!1}function c(l,u,d={}){let f=s.get(u);f?f.props=d:(f={component:l,props:d,states:[],stateIndex:0,effects:[],effectIndex:0,children:[],mounted:!1,container:u,vnode:void 0},s.set(u,f)),t=f,f.stateIndex=0,f.effectIndex=0;const m=l(d);return Pf(u,m,f.vnode),f.vnode=m,f.mounted=!0,t=null,f}function h(l){l.effects.forEach(u=>{u.cleanup&&u.cleanup()}),l.children&&l.children.forEach(u=>h(u)),l.container&&"innerHTML"in l.container&&(l.container.innerHTML=""),s.delete(l.container)}return{useState:r,useEffect:i,render:c,unmount:h,scheduleRender:o}}function Mf(){let s;function t(d){s=d,d(),s=null}class e{subscribers=new Set;add(){s&&!this.subscribers.has(s)&&this.subscribers.add(s)}notify(){this.subscribers.forEach(f=>f())}}const n=new WeakMap;function r(d,f){let m=n.get(d);m||(m=new Map,n.set(d,m));let p=m.get(f);return p||(p=new e,m.set(f,p)),p}function i(d,f,m=o){if(!Array.isArray(d))return;const p=Array.prototype,_=Object.create(p);["push","pop","shift","unshift","splice","sort","reverse"].forEach(y=>{_[y]=function(...b){return["push","unshift","splice"].includes(y)&&(y==="splice"?b.slice(2):b).forEach((w,E)=>{cn(w)&&(b[E]=m(w)),f.add()}),p[y].apply(this,b),this.slice()}}),Object.setPrototypeOf(d,_),d.forEach((y,b)=>{cn(y)&&(d[b]=m(y)),f.add()})}function o(d){return Object.keys(d).forEach(f=>{const m=r(d,f);let p=d[f];Object.defineProperty(d,f,{configurable:!0,enumerable:!0,get(){return cn(p)&&(Array.isArray(p)?i(p,m,o):o(p)),m.add(),p},set(_){p!==_&&(p=_,m.notify())}})}),d}function a(d){return o({value:d})}const c=h;function h(d){if(!cn(d))return d;const f={get(p,_,y){let b=Reflect.get(p,_,y);const v=r(p,_);if(cn(b)&&!("isYZProxy"in b)){const w=h(b);Array.isArray(b)&&(w.YZProxyArrayDep=v),b=w}return v.add(),b},set(p,_,y,b){const v=Reflect.get(p,_,b),w=Reflect.set(p,_,y,b);if(_=="YZProxyArrayDep")return w;if(v!==y){let E;Array.isArray(p)?E=p.YZProxyArrayDep:E=r(p,_),E.notify()}return w},deleteProperty(p,_){if(!(_ in p))return!1;let b=typeof _=="symbol"?void 0:p[_];cn(b)&&(b=Array.isArray(b)?[...b]:{...b});const v=Reflect.deleteProperty(p,_);if(v){let w;Array.isArray(p)?w=p.YZProxyArrayDep:w=r(p,_),w.notify()}return v},has(p,_){return _==="isYZProxy"||_ in p}};return new Proxy(d,f)}function l(d,f){const m=h(d);return u(m,f),m}function u(d,f){f.childNodes.forEach(m=>{switch(m.nodeType){case 1:const p=m;[...p.attributes].forEach(v=>{const w=v.name,E=v.value;if(w==="v-model")if(Zo(p)){const C=p;t(()=>{C.checked=Ie(d,E)==C.value}),C.addEventListener("change",D=>{Li(d,E,D.target.value)})}else if(Ko(p)){const C=p;t(()=>{C.checked=Vc(Ie(d,E),C.value)}),C.addEventListener("change",D=>{const $=D.target,O=$.value;$.checked?im(Ie(d,E),O):Di(Ie(d,E),O)})}else if(Jo(p)){const C=p;t(()=>{C.value=Ie(d,E)}),C.addEventListener("change",D=>{Li(d,E,D.target.value)})}else{const C=p;t(()=>{C.value=Ie(d,E)});const D=$=>{Li(d,E,$.target.value)};C.addEventListener("input",D)}else w==="v-text"?t(()=>{p.innerText=Ie(d,E)}):w==="v-html"&&t(()=>{p.innerHTML=Ie(d,E)})}),p.childNodes.length>0&&u(d,p);break;case 3:const _=m.textContent||"",y=/\{\{\s*([^{}\s]+)\s*\}\}/g,b=y.exec(_);b&&b[1]&&t(()=>{m.textContent=_.replace(y,Ie(d,b[1]))});break}})}return{watchEffect:t,reactiveVue2:o,ref:a,reactiveVue3:h,reactive:c,mvvm:l}}const jv=Mf();function kf(s,t,e){return new WebSocket(s)}function Xv(s){return`${s}eventbus/${jd(3)}/${jc(8)}/websocket`}class xe{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=xe.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||kf,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=xe.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===xe.CONNECTING||this.socket?.readyState===xe.OPEN||(this.state=xe.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{er(`(${this.url}) onopen`),this.state=xe.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:r}=t;er(`(${this.url}) onclose: code(${e}) reason(${n}) wasClean(${r})`),this.state=xe.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),dm(this.reconnectAttempts++)))},this.socket.onerror=t=>{er(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(er(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const n=t.data.substring(1);try{e=JSON.parse(n)}catch(r){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:r.toString(),message:n})]}e.forEach(r=>{const i=JSON.parse(r);if(i.body&&Object.prototype.hasOwnProperty.call(i.body,"requestid")){const o=this.waitings[i.body.requestid];o?o.resolve?.(i.body):ce(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[i.address]){const o=this.listeners[i.address];for(let a=0;a<o.length;a++)i.type==="err"?o[a]({failureCode:i.failureCode,failureType:i.failureType,message:i.message}):o[a](null,i.body)}else this.onunhandled(i)})}else t.data instanceof ArrayBuffer?ce(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&ce(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===xe.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,n={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:In(n,this.socketCreatorOptions.headers,!1)})),this.listeners[t].push(e)}unregister(t,e,n={}){const r=this.listeners[t];if(r){const i=r.indexOf(e);i!=-1&&(r.splice(i,1),r.length===0&&(this._send({type:"unregister",address:t,headers:In(n,this.socketCreatorOptions.headers,!1)}),delete this.listeners[t]))}}publish(t,e,n={}){this._send({type:"publish",address:t,headers:In(n,this.socketCreatorOptions.headers,!1),body:e})}async send(t,e,n={},r=3e4){this.requestid++;const i=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,c)=>{i.resolve=a,this._send({type:"send",address:t,headers:In(n,this.socketCreatorOptions.headers,!1),body:{requestid:i.requestid,...e}}),setTimeout(()=>{c(`(${this.url}) send(${i.requestid}: ${Km(e)}) Timeout!`)},r)});return delete this.waitings[i.requestid],o}}function Xr(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(s)?t="iOS":/android/i.test(s)?t="Android":/BlackBerry/i.test(s)?t="BlackBerry":/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()}function Gv(s=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(s)){const e=s.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(s)){const e=s.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Gr(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()}function Vv(){const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t}function qv(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Hv(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Wv(){return Gr()=="safari"}function ja(){return Xr()==="ios"}function If(){return Xr()==="macos"}function Jv(){return ja()|If()}function Df(){return Xr()==="android"}function Kv(){const s=window.navigator.appVersion;if(/Android/.test(s)&&!/Chrome\/\d/.test(s)){const t=s.match(/Safari\/(\d+.\d)/);return t&&typeof t=="object"&&t.length>=2?parseFloat(t[1])<535.19:!0}else return!1}function Zv(){return ja()||Df()}function Of(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const r=s.indexOf("rv:");return parseInt(s.substring(r+3,s.indexOf(".",r)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const Qv=Of()!==-1,t2=document.documentMode?document.documentMode===9:!1,e2=document.documentMode?document.documentMode===10:!1,n2=document.documentMode?document.documentMode===11:!1;function Rf(){return Gr()==="wechat"}function Lf(){return Gr()==="ali"}function s2(){return Rf()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function r2(){return Lf()&&navigator.userAgent.match(/miniprogram/i)}function i2(s=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const r=function(){t.style.height=window.innerHeight+"px";const i=t.clientWidth;t.dataset.width=i,t.dataset.layout=i>s?"pc":"mobile",t.dataset.rem=n=Math.min(100,Math.round(100*(i/s))),t.style.fontSize=n+"px"};r(),window.rem2px=function(i){return parseFloat(i)*n},window.px2rem=function(i){return parseFloat(i)/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}class o2 extends ga{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=ya(e);for(const r of n.stylesheet.rules)for(const i of r.declarations)for(const o of r.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${i.property}:${i.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let r=this.groups.length;for(;r--;)if(this.groups[r]!=this.currentItem){let i="",o="";for(const a in this.groups[r])a=="transform"?i=this.groups[r].transform:a=="class"&&this.globalStyles["."+this.groups[r][a]]?o=this.globalStyles["."+this.groups[r][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[r][a]]?o=this.globalStyles["#"+this.groups[r][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[r][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=i:this.currentItem.transform+=" "+i,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),Ga(this.currentItem.style,this.currentItem,Va)}switch(this.processAttrs(e,n),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 n=[],r;switch(t){case"svg":let i="",o="";if(e.width&&e.height)i=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(i=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}i&&o&&this.items.push({type:"viewbox",width:i,height:o});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":r={},e.style&&Ga(e.style,r),r.offset=r.offset||e.offset,r.color=r["stop-color"]||e["stop-color"],r.opacity=r["stop-opacity"]||e["stop-opacity"],~(r.offset+"").indexOf("%")?r.offset=parseFloat(r.offset):r.offset=parseFloat(r.offset)*100,r.offset=+r.offset.toFixed(2),this.grad.stops.push(r);break;case"linearGradient":this.grad.angle=(360+Xa(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,c=this.grad.stops.length;a<c;a++)r=this.grad.stops[a],a&&a!=c-1?n.push(r.color+":"+r.offset):n.push(r.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,c=this.grad.stops.length;a<c;a++)r=this.grad.stops[a],a&&a!=c-1?n.push(r.color+":"+r.offset):n.push(r.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const i in e){const o=e[i];if(Va.includes(i)&&(this.currentItem[i]=o),i==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:i,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:i,stops:[]})),i==="style"&&Ga(o,this.currentItem,Va),i==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),i==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const c=a[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}i==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),i==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),i==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}}function Xa(s,t,e,n,r,i){if(typeof r>"u"||typeof i>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Xa(s,t,r,i)-Xa(e,n,r,i)}function Ga(s,t,e){const n=(s+"").split(";"),r=/^\s+|\s+$/g;for(let i=0,o=n.length;i<o;i++){const a=n[i].split(":"),c=a[0].replace(r,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=a[1].replace(r,""))}}const Va=["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 a2{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new _s(t),this.remoteVideoUtil=new _s(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(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}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(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const r=void 0,i=new RTCPeerConnection(r);this.localPeerConnection=i,this.trace("Created local peer connection object localPeerConnection."),i.addEventListener("icecandidate",this.handleConnection),i.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(r);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),i.addTrack(e[0],t),i.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),i.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const r=new RTCIceCandidate(n),i=this.getOtherPeer(e);i&&(i.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
62
101
  ${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:
63
102
  ${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:
64
103
  ${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:
65
- ${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 n=this.getPeerName(t);this.trace(`${n} ${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 n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ib{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 Du=[],ku={};function ma(s){Du.push(s)}function Db(s,t=!1){const e=pd();if(ku[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{Du.forEach(r=>r())});const n=["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(s,{debug:t,jsApiList:n,openTagList:i})),ku[e]=!0}function kb(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Lb(s){ma(function(){wx.updateAppMessageShareData(s)})}function Rb(s){ma(function(){wx.updateTimelineShareData(s)})}function Ob(s){wx.chooseImage(s)}function zb(s){wx.previewImage(s)}function Nb(s){wx.uploadImage(s)}function Bb(s){wx.downloadImage(s)}function Fb(s){wx.getLocalImgData(s)}function Yb(){wx.startRecord()}function Xb(s){wx.stopRecord(s)}function Ub(s){wx.onVoiceRecordEnd(s)}function $b(s){wx.playVoice(s)}function Gb(s){wx.pauseVoice(s)}function Vb(s){wx.stopVoice(s)}function jb(s){wx.onVoicePlayEnd(s)}function qb(s){wx.uploadVoice(s)}function Hb(s){wx.downloadVoice(s)}function Wb(s){wx.translateVoice(s)}function Jb(s){wx.getNetworkType(s)}function Zb(s){wx.openLocation(s)}function Kb(s){wx.getLocation(s)}function Qb(s){wx.scanQRCode(s)}function tx(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function ex(s,t,e="snsapi_userinfo",n=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${s}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${n}#wechat_redirect`}function nx(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function fs(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function sx(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.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 ix(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(fs(n))}}),function(n){t?.(n.code)})}function rx(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(fs(n))}}),function(n){t?.(n)})}function ox(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(fs(n))}}),function(){t?.()})}function ax(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(fs(n,"chooseImage"))}}),function(n){t?.(n)})}function hx(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(fs(n))}}),function(){t?.()})}class cx{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}const Vt=window.crypto.subtle;async function Lu(s,t=In.SHA256){if(!Vt)throw new Error("Crypto API not supported");const e=await Vt.digest(t,Bi(s));return $a(e)}async function lx(s,t=In.SHA256){return Lu(JSON.stringify(vf(s)),t)}async function ux(s,t=In.AESGCM){if(!Vt)throw new Error("Crypto API not supported");const e=crypto.getRandomValues(new Uint8Array(12)),n=await Vt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),i=await Vt.encrypt({name:t,iv:e},n,Bi(s));return{algorithm:t,iv:e,key:n,encryptedData:i}}async function fx(s){if(!Vt)throw new Error("Crypto API not supported");const t=await Vt.decrypt({name:s.algorithm,iv:s.iv},s.key,s.encryptedData);return $a(t)}async function dx(s,t=In.ECDSA,e="SHA-384"){if(!Vt)throw new Error("Crypto API not supported");const{privateKey:n,publicKey:i}=await Vt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Bi(JSON.stringify(s)),o=await Vt.sign({name:t,hash:{name:e}},n,r);return{algorithm:t,hash:e,publicKey:i,signature:o,encodedData:r}}async function mx(s){if(!Vt)throw new Error("Crypto API not supported");return await Vt.verify({name:s.algorithm,hash:{name:s.hash}},s.publicKey,s.signature,s.encodedData)}class px{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,n){this.currentPage=n?.currentPage||0,this.itemsPerPage=n?.itemsPerPage||10,this.entriesInterval=n?.entriesInterval||5,this.entriesEdge=n?.entriesEdge||1,this.linkTo=n?.linkTo||"javascript:;",this.prevText=n?.prevText||"上一页",this.nextText=n?.nextText||"下一页",this.ellipseText=n?.ellipseText||"...",this.prevShowAlways=typeof n?.prevShowAlways=="boolean"?n?.prevShowAlways:!0,this.nextShowAlways=typeof n?.nextShowAlways=="boolean"?n?.nextShowAlways:!0,this.callback=n?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),En(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return sn("div",{class:"pagination"},[])}appendVNode(t,e,n){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=n?.text||String(e+1),r=n?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?sn("span",{class:`current ${r}`},i):sn("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:o=>this.selectPage(e,o)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),n=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"}),n>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,n);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<n&&this.ellipseText&&t.children.push(sn("span",{},this.ellipseText))}for(let r=n;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(sn("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let o=r;o<this.totalPages;o++)this.appendVNode(t,o)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),mi(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 n=this.callback(t);return e&&(n||Rr(e)),n}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class gx{static;store;eb;axios;ds;constructor(t={}){this.static=t.static||{};const e=t.store?.state||{};this.store=oh({reducer:t.store?.reducer||(()=>e),initState:e,enhancer:t.store?.enhancer,immutable:typeof t.store?.immutable=="boolean"?t.store?.immutable:!0}),this.eb=new Ts,this.axios=new $h({baseURL:t.axios?.baseURL,timeout:t.axios?.timeout,headers:t.axios?.headers,responseType:t.axios?.responseType,responseEncoding:t.axios?.responseEncoding,interceptor:t.axios?.interceptor,retry:t.axios?.retry,cache:t.axios?.cache}),this.ds=new dd({concurrency:1})}}class yx{appId;reportUrl;constructor(t){this.appId=t.appId,this.reportUrl=t.reportUrl,this.listenJSError(),this.listenAssetsError(),this.listenPromiseError(),t.checkWhiteScreen&&this.listenWhiteScreenError()}listenJSError(){window.onerror=(t,e,n,i,r)=>{const o={type:"js_error",msg:t,file:e,row:n,col:i,stack:r?.stack};this.report(o)}}listenAssetsError(){window.addEventListener("error",t=>{const e=t.target;if(e instanceof HTMLScriptElement||e instanceof HTMLStyleElement||e instanceof HTMLImageElement){const n={type:"resource_error",filename:e.src||e.href,tagName:e.tagName};this.report(n)}},!0)}listenPromiseError(){window.addEventListener("unhandledrejection",t=>{const e={type:"promise_error",reason:t.reason};this.report(e)})}listenWhiteScreenError(){co(()=>{setTimeout(()=>{const t=[[window.innerWidth/2,window.innerHeight/2],[window.innerWidth/2,window.innerHeight*.2],[window.innerWidth/2,window.innerHeight*.8],[window.innerWidth*.2,window.innerHeight/2],[window.innerWidth*.8,window.innerHeight/2]];let e=0;if(t.forEach(n=>{const[i,r]=n,a=document.elementsFromPoint(i,r)[0];(a?.tagName==="BODY"||a?.tagName==="HTML")&&e++}),e>=t.length*.8){const n={type:"whitescreen_error",reason:"检测到白屏!"};this.report(n)}},3e3)})}report(t){const e=JSON.stringify({...t,appId:this.appId,time:Df()});console.error(e),this.reportUrl&&navigator.sendBeacon(this.reportUrl,e)}}d.ArrowShape=qo,d.BallShape=_n,d.BezierEasing=Ur,d.BufferAttribute=ye,d.COLOR_NAMES=ls,d.CSSToJSEasing=Hg,d.Clock=Vr,d.Color=Yt,d.ColorManagement=$o,d.CommonKeyCode=aw,d.ConfettiShapeCombo=ra,d.Context=gx,d.CrossShape=Qo,d.CurveShape=Vo,d.CustomCanvasContext=Wc,d.CustomCanvasGradient=Qs,d.CustomCanvasPattern=Qr,d.DOMParse=Lo,d.DOMSVGUtil=We,d.DOMToBlob=pr,d.DOMToString=mr,d.DOMVideo=hs,d.DrawContext=Rw,d.Easing=O,d.EllipseShape=ta,d.FileUpload=hp,d.Float32BufferAttribute=ly,d.FoxShape=Zo,d.HeartShape=Ho,d.HeartVariantShape=Wo,d.Int16BufferAttribute=oy,d.Int32BufferAttribute=hy,d.Int8BufferAttribute=sy,d.Interpolation=pe,d.Key=hw,d.LineShape=nn,d.LinearSRGBColorSpace=Xo,d.LinearToSRGB=en,d.LinearTransfer=Uo,d.Ls=Be,d.MVVM=ub,d.Matrix=bt,d.Matrix2=io,d.Matrix3=wn,d.Matrix4=kt,d.NoColorSpace=au,d.Pagination=px,d.PointsShape=li,d.QRCode=ke,d.RabbitShape=Ko,d.RectShape=Ne,d.RingIndicatorShapeCombo=ia,d.RingShape=us,d.SRGBColorSpace=Qe,d.SRGBToLinear=tn,d.SRGBTransfer=ci,d.SVGParse=Mb,d.SVGParsedPathArgsLength=ts,d.SegmentShapeCombo=na,d.Shape=Q,d.ShapeCombo=Rt,d.ShipShapeCombo=ea,d.SliderShapeCombo=sa,d.StarShape=Jo,d.TWEEN=n0,d.TextShape=Cn,d.Timeline=jn,d.TreeShapeCombo=jo,d.Tween=Gr,d.Uint16BufferAttribute=ay,d.Uint32BufferAttribute=cy,d.Uint8BufferAttribute=iy,d.Uint8ClampedBufferAttribute=ry,d.Vector2=Jn,d.Vector3=Bt,d.Vector4=Zr,d.WebGLCoordinateSystem=es,d.WebGLRenderer=Ib,d.WebGPUCoordinateSystem=so,d.WebMonitor=yx,d.WebRTCClient=Ab,d.WebSocketClient=ae,d.YZCanvasContext=to,d.__color=xe,d.addClass=Wy,d.addWatermark=z0,d.addWxJsReadyFnBeforeConfig=ma,d.ajax=wl,d.aliJsChooseImage=ax,d.aliJsGetLocation=rx,d.aliJsOpenLocation=ox,d.aliJsPreviewImage=hx,d.aliJsReady=nx,d.aliJsScan=ix,d.aliJsTradePay=sx,d.angle=Nt,d.animate=dy,d.animateShapes=Dw,d.animationEnd$=$1,d.animationStart$=U1,d.atomReadAttribute=Sl,d.atomReadAttributes=bo,d.atomReadStyle=i1,d.atomReadStyles=yo,d.atomRemoveAttribute=h1,d.atomRemoveDataset=jw,d.atomRemoveStyle=wo,d.atomWriteAttribute=Je,d.atomWriteStyle=rs,d.base64EncodeOutputStream=Yc,d.bitmapMapper=sl,d.blobToImageData=h0,d.byteArrayOutputStream=Wr,d.cancelFetch=ib,d.changeBrightness=R0,d.changeCheckboxChecked=Gy,d.changeDiaphaneity=O0,d.changeRadioChecked=$y,d.changeSelected=Uy,d.changeSize=L0,d.checkWxJsApi=kb,d.clearCookies=tb,d.clearLocalStorage=qw,d.clearSessionStorage=Xw,d.closeLog=jf,d.closest=Ny,d.computeImageDisplayRect=i0,d.containsChild=Ly,d.createDefaultMousePoint=xo,d.createElement=ml,d.createElementNS=Ky,d.createEvent=qs,d.createFragment=dl,d.createFromEventPattern=Pg,d.createIndexDB=nb,d.createObjectURL=il,d.createRunCycleInMaxRate=Ng,d.createTextNode=Qy,d.createWebSocket=Eu,d.createXMLHttpRequest=yl,d.cssAttrsToCanvasAttrs=_l,d.decrypt=fx,d.dispatchClickFromEvent=Rg,d.dispatchEvent=Or,d.dispatchEventFromEvent=Lg,d.distance=Le,d.domPrefixes=ao,d.drag$=Dl,d.dragEnd$=Ll,d.dragEnter$=Ol,d.dragLeave$=zl,d.dragOver$=Nl,d.dragStart$=kl,d.drawBitmapInCanvas=fy,d.drawQRCodeToCanvas=X0,d.drop$=Rl,d.easeNameToCubicBezier=$r,d.empty=ll,d.encrypt=ux,d.flipSideToSide=l0,d.flipUpsideDown=u0,d.followMouseShape=Aw,d.getBitmapFromCanvas=uy,d.getBrowserClient=gi,d.getBrowserClientVersion=mb,d.getBrowserLanguage=pb,d.getCSSVar=Zw,d.getDOMMatrix=oo,d.getDirection=$0,d.getDocumentElement=Sn,d.getElementPositionInPage=To,d.getElementPositionInPage2=ew,d.getElementPositionInViewport=Po,d.getEmSize=Ay,d.getEventCurrentTarget=_g,d.getFetchId=ha,d.getFileExtension=rp,d.getFileMD5Hash=qh,d.getFileTypeFromFile=ip,d.getFormSubmitData=n1,d.getImageData=Nc,d.getImageDataByAIData=B0,d.getImageMainColor=c0,d.getInnerText=jy,d.getInternetExplorerVersion=Mu,d.getKeyCode=cw,d.getMIME=op,d.getMouseButton=ow,d.getMousePositionInElement=ft,d.getMousePositionInPage=Mo,d.getMousePositionInViewport=iw,d.getOperatingSystem=pi,d.getOperatingSystemVersion=db,d.getPage=Q1,d.getRelativeBoundingClientRect=tw,d.getRemSize=lo,d.getRules=a1,d.getScrollWheelDelta=rw,d.getSelectedText=xy,d.getStyle=is,d.getStyleSheets=vl,d.getTheme$=Jw,d.getTimeZone=gb,d.getVerticalScrollTopPercentInPage=nw,d.getVertxRegisterBaseUrl=fb,d.getViewport=Eo,d.getVnode=jr,d.getWindow=K1,d.gifImage=Xc,d.h=sn,d.hFromEl=di,d.hasClass=Zy,d.hideEl=fl,d.html=cl,d.iframePostMessage=t1,d.imageDataToBitmap=r0,d.imageDataToBlob=a0,d.imageDataToDataURL=o0,d.injectStyle=xl,d.injectWxJsConfig=Db,d.insert=xn,d.isActiveEl=Ty,d.isAliBrowser=Iu,d.isAliMiniProgram=Pb,d.isAndroid=Tu,d.isAppleDevice=wb,d.isBadAndroid=bb,d.isBrowserSupportFileAPI=ep,d.isElement=my,d.isIE=vb,d.isIE10=_b,d.isIE11=Cb,d.isIE9=Sb,d.isIOS=la,d.isInViewport=sw,d.isInput=ss,d.isInputCheckbox=mo,d.isInputNumber=Xy,d.isInputRadio=po,d.isInputText=Yy,d.isMacOS=Pu,d.isMobile=xb,d.isRootEl=Py,d.isSafari=yb,d.isSelect=fo,d.isSupportEvent=u1,d.isSupportPointer=l1,d.isSupportTouch=c1,d.isTextArea=Fy,d.isWxBrowser=Au,d.isWxMiniProgram=Eb,d.jpgToPng=A0,d.keyDown$=Bl,d.keyPress$=G1,d.keyUp$=Fl,d.leftRotate=f0,d.length=yn,d.mapTDTJSSDK=cx,d.marginSharpen=M0,d.mosaic=N0,d.mount=En,d.mouseClick$=g1,d.mouseContextMenu$=b1,d.mouseDoubleClick$=y1,d.mouseDown$=Cl,d.mouseEnter$=m1,d.mouseLeave$=p1,d.mouseMove$=ii,d.mouseOut$=d1,d.mouseOver$=f1,d.mouseUp$=El,d.mouseWheel$=w1,d.nearestElement=Iy,d.nextElementSibling=Oy,d.normalizePoint=U0,d.objectSignature=lx,d.onBeforeUnload=rl,d.onDocumentReady=co,d.openLog=Vf,d.outputGifBase64=Uc,d.outputQRCodeBase64=Y0,d.pan$=x1,d.panCancel$=C1,d.panDown$=M1,d.panEnd$=_1,d.panLeft$=E1,d.panMove$=v1,d.panRight$=P1,d.panStart$=S1,d.panUp$=T1,d.parent=Dy,d.parents=uo,d.parseCSS=Ro,d.parseTransformToMatrix=nl,d.patch=mi,d.pinch$=A1,d.pinchIn$=I1,d.pinchOut$=D1,d.pngToJpg=I0,d.pointerCancel$=Co,d.pointerDown$=So,d.pointerMove$=vo,d.pointerUp$=_o,d.polar=Re,d.polymorphTween=Lw,d.press$=k1,d.preventDefault=Ae,d.previousElementSibling=zy,d.querySelectorAllToStringArray=np,d.radiusClip=k0,d.readFileInBrowser=Fn,d.readStyleFromStyles=s1,d.rectClip=D0,d.rem2px=My,d.remove=qy,d.removeAllEventListeners=Eg,d.removeClass=Jy,d.requestAnimationFrameCycle=zr,d.reverseCSSToJSEasing=Wg,d.reverseEaseNameToCubicBezier=Rc,d.reverseEasing=Ac,d.revokeObjectURL=py,d.rightRotate=d0,d.rotate$=L1,d.rotatePoint=Qt,d.runInSandbox=e1,d.scheduleIdle=Ec,d.scheduleIdleAsap=Mc,d.scheduleVnodeAsap=qr,d.scheduleVnodeImmediately=s0,d.scrollParent=ky,d.scrollTo=Cy,d.selectFileInBrowser=gr,d.setCSSVar=Kw,d.setIntervalAccurate=zg,d.setLogUploadFn=qf,d.setManualScroll=Ey,d.setRem=Tb,d.setStyle=vn,d.setTheme=Cu,d.setTimeoutAccurate=Nr,d.setWindowTitle=vy,d.shadowRoot=By,d.sharpen=T0,d.showEl=ul,d.siblings=Ry,d.signEncrypt=dx,d.signature=Lu,d.simulateEventFromTouch=Og,d.stopPropagation=Rr,d.storage$=Z1,d.stringToDOM=sp,d.swipe$=R1,d.swipeDown$=B1,d.swipeLeft$=O1,d.swipeRight$=z1,d.swipeUp$=N1,d.tap$=Il,d.tapOutSide$=F1,d.targetToAfterDropShape=Iw,d.text=Vy,d.toBlackAndWhite=g0,d.toBlue=x0,d.toBlueAndGreen=_0,d.toBlueAndGrey=P0,d.toDegree=gt,d.toGreen=b0,d.toGreenAndGrey=E0,d.toGrey=m0,d.toGrey2=p0,d.toOpposite=y0,d.toRadian=j,d.toRed=w0,d.toRedAndBlue=S0,d.toRedAndGreen=v0,d.toRedAndGrey=C0,d.toggleClass=go,d.toggleElDisplay=Hy,d.toggleTheme=Ww,d.touchCancel$=Al,d.touchEnd$=Ml,d.touchMove$=Pl,d.touchStart$=Tl,d.transform=ho,d.transformPath2D=ny,d.transitionEnd$=X1,d.transitionStart$=Y1,d.updateVnode=Zs,d.useAttribute=we,d.useClickA=si,d.useClipboard=_y,d.useCompatableDownMovePoint$=j1,d.useCookie=Qw,d.useCoords$=Yw,d.useDataset=Vw,d.useDocumentVisible$=J1,d.useDraggable=H1,d.useDrop=W1,d.useElementEventBus=mw,d.useEvent$=X,d.useEventListener=W,d.useFeRoute=Gw,d.useFetch=ui,d.useFetchCache=ob,d.useFetchRetry=rb,d.useFetchRetryCache=ab,d.useHashChange$=$w,d.useHotKeyDown$=Vl,d.useHotKeyFile=uw,d.useHotKeyFile$=jl,d.useHotKeyUp$=lw,d.useIntersection$=mu,d.useLoadImage=al,d.useLoadLink=yy,d.useLoadScript=gy,d.useLocalStorage=bu,d.useLocale=ca,d.useLocation$=yu,d.useMatchMedia$=gu,d.useMouseAndPointerDownMovePoint$=Ul,d.useMouseDownMovePoint$=Yl,d.useMouseMovePoint$=V1,d.useMousePoint=Ze,d.useMutation$=du,d.useParentEventListener=Cg,d.usePointerDownMovePoint$=ri,d.usePopStateChange$=wu,d.usePressDownMove=Hl,d.usePressDownMoveWithMouse=pw,d.usePressDownMoveWithPointer=Wl,d.usePressDownMoveWithTouch=gw,d.usePull$=q1,d.useResize=ql,d.useResize$=Ao,d.useSafeArea$=Fw,d.useScroll$=$l,d.useSelectFile=hl,d.useSelectFileImage=by,d.useSessionStorage=oa,d.useTouchDownMovePoint$=Xl,d.useUrlChange$=Uw,d.useVisible$=Nw,d.useVisibleSimple$=zw,d.useWindowResize$=fw,d.verifyDecrypt=mx,d.vibrate=Sy,d.waitElementAddedInDOM=Ow,d.waitForStyleSheetsLoaded=wy,d.writeToIndexDB=sb,d.wxJsChooseImage=Ob,d.wxJsDownloadImage=Bb,d.wxJsDownloadVoice=Hb,d.wxJsGetLocalImgData=Fb,d.wxJsGetLocation=Kb,d.wxJsGetNetworkType=Jb,d.wxJsLogin=ex,d.wxJsOnVoicePlayEnd=jb,d.wxJsOnVoiceRecordEnd=Ub,d.wxJsOpenLocation=Zb,d.wxJsPauseVoice=Gb,d.wxJsPay=tx,d.wxJsPlayVoice=$b,d.wxJsPreviewImage=zb,d.wxJsScanQRCode=Qb,d.wxJsStartRecord=Yb,d.wxJsStopRecord=Xb,d.wxJsStopVoice=Vb,d.wxJsTranslateVoice=Wb,d.wxJsUpdateAppMessageShareData=Lb,d.wxJsUpdateTimelineShareData=Rb,d.wxJsUploadImage=Nb,d.wxJsUploadVoice=qb,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
104
+ ${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 n=this.getPeerName(t);this.trace(`${n} ${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 n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class c2{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 zf=[],Nf={};function qa(s){zf.push(s)}function h2(s,t=!1){const e=dp();if(Nf[e])return;wx.error(i=>{console.log(i.errMsg||JSON.stringify(i))}),wx.ready(()=>{zf.forEach(i=>i())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],r=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:r})),Nf[e]=!0}function l2(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function u2(s){qa(function(){wx.updateAppMessageShareData(s)})}function f2(s){qa(function(){wx.updateTimelineShareData(s)})}function d2(s){wx.chooseImage(s)}function m2(s){wx.previewImage(s)}function p2(s){wx.uploadImage(s)}function g2(s){wx.downloadImage(s)}function y2(s){wx.getLocalImgData(s)}function b2(){wx.startRecord()}function w2(s){wx.stopRecord(s)}function v2(s){wx.onVoiceRecordEnd(s)}function x2(s){wx.playVoice(s)}function S2(s){wx.pauseVoice(s)}function _2(s){wx.stopVoice(s)}function C2(s){wx.onVoicePlayEnd(s)}function E2(s){wx.uploadVoice(s)}function T2(s){wx.downloadVoice(s)}function P2(s){wx.translateVoice(s)}function A2(s){wx.getNetworkType(s)}function M2(s){wx.openLocation(s)}function k2(s){wx.getLocation(s)}function I2(s){wx.scanQRCode(s)}function D2(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(r){r.err_msg=="get_brand_wcpay_request:ok"?t():e(r.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function O2(s,t,e="snsapi_userinfo",n=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${s}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${n}#wechat_redirect`}function R2(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function Ps(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function L2(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let r="未知错误";switch(n.resultCode){case 9e3:return r="订单支付成功",t?.(r);case 8e3:r="正在处理中";break;case 4e3:r="订单支付失败";break;case 6001:r="用户中途取消";break;case 6002:r="网络连接出错";break;case 99:r="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(r)})}function z2(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(Ps(n))}}),function(n){t?.(n.code)})}function N2(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(Ps(n))}}),function(n){t?.(n)})}function F2(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(Ps(n))}}),function(){t?.()})}function B2(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(Ps(n,"chooseImage"))}}),function(n){t?.(n)})}function U2(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(Ps(n))}}),function(){t?.()})}class $2{map;constructor(t,e=120.619585,n=31.299379,r=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),r)}}class Y2{static;store;eb;axios;ns;constructor(t={}){this.static=t.static||{};const e=t.store?.state||{};this.store=fh({reducer:t.store?.reducer||(()=>e),initState:e,enhancer:t.store?.enhancer}),this.eb=new sr,this.axios=new tl({baseURL:t.axios?.baseURL,timeout:t.axios?.timeout,headers:t.axios?.headers,responseType:t.axios?.responseType,responseEncoding:t.axios?.responseEncoding,interceptor:t.axios?.interceptor}),this.ns=new $m({concurrency:1})}}class j2{appId;reportUrl;constructor(t){this.appId=t.appId,this.reportUrl=t.reportUrl,this.listenJSError(),this.listenAssetsError(),this.listenPromiseError(),t.checkWhiteScreen&&this.listenWhiteScreenError()}listenJSError(){window.onerror=(t,e,n,r,i)=>{const o={type:"js_error",msg:t,file:e,row:n,col:r,stack:i?.stack};this.report(o)}}listenAssetsError(){window.addEventListener("error",t=>{const e=t.target;if(e instanceof HTMLScriptElement||e instanceof HTMLStyleElement||e instanceof HTMLImageElement){const n={type:"resource_error",filename:e.src||e.href,tagName:e.tagName};this.report(n)}},!0)}listenPromiseError(){window.addEventListener("unhandledrejection",t=>{const e={type:"promise_error",reason:t.reason};this.report(e)})}listenWhiteScreenError(){qo(()=>{setTimeout(()=>{const t=[[window.innerWidth/2,window.innerHeight/2],[window.innerWidth/2,window.innerHeight*.2],[window.innerWidth/2,window.innerHeight*.8],[window.innerWidth*.2,window.innerHeight/2],[window.innerWidth*.8,window.innerHeight/2]];let e=0;if(t.forEach(n=>{const[r,i]=n,a=document.elementsFromPoint(r,i)[0];(a?.tagName==="BODY"||a?.tagName==="HTML")&&e++}),e>=t.length*.8){const n={type:"whitescreen_error",reason:"检测到白屏!"};this.report(n)}},3e3)})}report(t){const e=JSON.stringify({...t,appId:this.appId,time:om()});console.error(e),this.reportUrl&&navigator.sendBeacon(this.reportUrl,e)}}function Ff(){return document.querySelector('meta[name="app-version"]')?.getAttribute("content")}async function Bf(){const e=(await(await fetch(`/index.html?t=${Date.now()}`,{cache:"no-store"})).text()).match(/<meta\s+name=["']app-version["']\s+content=["']([^"']+)["']/);return e?e[1]:null}function Uf(){window.confirm("系统已更新,是否立即刷新页面?")&&window.location.reload()}async function X2(){try{const s=Ff(),t=await Bf();s&&t&&s!==t&&Uf()}catch(s){console.error("版本检测失败:",s)}}function G2(s){const t=s?.message||s?.reason?.message||"";return t.includes("Loading chunk")||t.includes("ChunkLoadError")||t.includes("Failed to fetch dynamically imported module")}function V2(){const s="app_chunk_reload_once";sessionStorage.getItem(s)?console.error("刷新后仍然失败,请提示用户手动刷新或联系管理员"):(sessionStorage.setItem(s,"1"),alert("系统资源已更新,正在为您刷新页面"),window.location.reload())}g.ArrowShape=Ta,g.BallShape=jn,g.BezierEasing=zo,g.CSSToJSEasing=O1,g.Clock=Bo,g.CommonKeyCode=Yw,g.ConfettiShapeCombo=Fa,g.Context=Y2,g.CrossShape=Da,g.CurveShape=Ca,g.CustomCanvasContext=Hl,g.CustomCanvasGradient=Tr,g.CustomCanvasPattern=Do,g.DOMParse=ga,g.DOMSVGUtil=gn,g.DOMVideo=_s,g.DrawContext=pv,g.Easing=X,g.EllipseShape=Oa,g.FileUpload=s0,g.FoxShape=ka,g.HeartShape=Pa,g.HeartVariantShape=Aa,g.Interpolation=ze,g.Key=jw,g.LineShape=vn,g.Ls=sn,g.Matrix=Yt,g.Matrix2=$o,g.Matrix3=kr,g.Matrix4=Qt,g.PointsShape=Fr,g.QRCode=Ke,g.RabbitShape=Ia,g.RectShape=nn,g.RingIndicatorShapeCombo=Na,g.RingShape=Es,g.SVGParse=o2,g.SVGParsedPathArgsLength=ds,g.SegmentShapeCombo=La,g.Shape=_t,g.ShapeCombo=te,g.ShipShapeCombo=Ra,g.SliderShapeCombo=za,g.StarShape=Ma,g.THEME_NAMES=Mv,g.TWEEN=$1,g.TextShape=Xn,g.Timeline=gs,g.TreeShapeCombo=Ea,g.Tween=Fo,g.Vector2=Cr,g.Vector3=ve,g.Vector4=ko,g.WebGLCoordinateSystem=ys,g.WebGLRenderer=c2,g.WebGPUCoordinateSystem=Uo,g.WebMonitor=j2,g.WebRTCClient=a2,g.WebSocketClient=xe,g.YZCanvasContext=Oo,g.addClass=Mb,g.addWatermark=h1,g.addWxJsReadyFnBeforeConfig=qa,g.ajax=Cu,g.aliJsChooseImage=B2,g.aliJsGetLocation=N2,g.aliJsOpenLocation=F2,g.aliJsPreviewImage=U2,g.aliJsReady=R2,g.aliJsScan=z2,g.aliJsTradePay=L2,g.angle=se,g.animate=q1,g.animateShapes=fv,g.animationEnd$=Cw,g.animationStart$=_w,g.atomReadAttribute=Au,g.atomReadAttributes=na,g.atomReadStyle=Bb,g.atomReadStyles=ta,g.atomRemoveAttribute=jb,g.atomRemoveDataset=Pv,g.atomRemoveStyle=ea,g.atomWriteAttribute=yn,g.atomWriteStyle=vs,g.base64EncodeOutputStream=Ul,g.bitmapMapper=hu,g.blobToImageData=Ly,g.byteArrayOutputStream=Mo,g.changeBrightness=a1,g.changeCheckboxChecked=Cb,g.changeDiaphaneity=c1,g.changeRadioChecked=_b,g.changeSelected=Sb,g.changeSize=o1,g.checkVersion=X2,g.checkWxJsApi=l2,g.clearCookies=zv,g.clearLocalStorage=Av,g.clearSessionStorage=Sv,g.closeLog=ah,g.closest=yb,g.compileTemplate=zb,g.computeImageDisplayRect=Iy,g.containsChild=db,g.createDefaultMousePoint=sa,g.createElement=vu,g.createElementNS=Db,g.createEvent=_r,g.createFragment=wu,g.createFromEventPattern=xy,g.createIndexDB=Fv,g.createMiniReact=Yv,g.createMiniVue=Mf,g.createObjectURL=lu,g.createTextNode=Ob,g.createWebSocket=kf,g.createXMLHttpRequest=_u,g.cssAttrsToCanvasAttrs=Mu,g.dispatchClickFromEvent=My,g.dispatchEvent=Po,g.dispatchEventFromEvent=Ay,g.distance=Ze,g.domPrefixes=Go,g.domToBlob=ao,g.domToString=oo,g.drag$=Nu,g.dragEnd$=Bu,g.dragEnter$=$u,g.dragLeave$=Yu,g.dragOver$=ju,g.dragStart$=Fu,g.drawBitmapInCanvas=V1,g.drawQRCodeToCanvas=m1,g.drop$=Uu,g.easeNameToCubicBezier=No,g.empty=gu,g.fetchLatestVersionFromHtml=Bf,g.flipSideToSide=Ny,g.flipUpsideDown=Fy,g.followMouseShape=lv,g.getBitmapFromCanvas=G1,g.getBrowserClient=Gr,g.getBrowserClientVersion=Vv,g.getBrowserLanguage=qv,g.getCSSVar=et,g.getCurrentVersion=Ff,g.getDOMMatrix=Xo,g.getDirection=g1,g.getDocumentElement=Yn,g.getElementPositionInPage=la,g.getElementPositionInPage2=zw,g.getElementPositionInViewport=ha,g.getEmSize=hb,g.getEventCurrentTarget=by,g.getFileMD5Hash=rl,g.getFileMimeFromFileInBrowser=n0,g.getFormSubmitData=Nb,g.getImageData=Nl,g.getImageDataByAIData=u1,g.getImageMainColor=zy,g.getInnerText=Tb,g.getInternetExplorerVersion=Of,g.getKeyCode=Xw,g.getMouseButton=$w,g.getMousePositionInElement=Lt,g.getMousePositionInPage=ua,g.getMousePositionInViewport=Bw,g.getOperatingSystem=Xr,g.getOperatingSystemVersion=Gv,g.getPage=Rw,g.getRelativeBoundingClientRect=Lw,g.getRemSize=Ho,g.getRules=Yb,g.getScrollWheelDelta=Uw,g.getSelectedText=tb,g.getStyle=ws,g.getStyleSheets=Pu,g.getTheme$=Dv,g.getThemeColors=Rv,g.getTimeZone=Hv,g.getVNode=$a,g.getVerticalScrollTopPercentInPage=Nw,g.getVertxRegisterBaseUrl=Xv,g.getViewport=ca,g.getWindow=Ow,g.gifImage=$l,g.h=Tf,g.hFromEl=Ur,g.handleChunkLoadError=V2,g.hasClass=Ib,g.hideEl=bu,g.html=pu,g.iframePostMessage=Rb,g.imageDataToBitmap=Dy,g.imageDataToBlob=Ry,g.imageDataToDataURL=Oy,g.injectStyle=Tu,g.injectWxJsConfig=h2,g.insert=Un,g.isActiveEl=ab,g.isAliBrowser=Lf,g.isAliMiniProgram=r2,g.isAndroid=Df,g.isAppleDevice=Jv,g.isBadAndroid=Kv,g.isBrowserSupportFileAPI=Qg,g.isChunkLoadError=G2,g.isElement=H1,g.isIE=Qv,g.isIE10=e2,g.isIE11=n2,g.isIE9=t2,g.isIOS=ja,g.isInViewport=Fw,g.isInput=bs,g.isInputCheckbox=Ko,g.isInputNumber=xb,g.isInputRadio=Zo,g.isInputText=vb,g.isMacOS=If,g.isMobile=Zv,g.isRootEl=ob,g.isSafari=Wv,g.isSelect=Jo,g.isSupportEvent=Vb,g.isSupportPointer=Gb,g.isSupportTouch=Xb,g.isTextArea=wb,g.isWxBrowser=Rf,g.isWxMiniProgram=s2,g.jpgToPng=n1,g.keyDown$=Xu,g.keyPress$=Ew,g.keyUp$=Gu,g.leftRotate=By,g.length=Bn,g.mapTDTJSSDK=$2,g.marginSharpen=e1,g.miniVue=jv,g.mosaic=l1,g.mountVNode=Be,g.mouseClick$=Kb,g.mouseContextMenu$=tw,g.mouseDoubleClick$=Zb,g.mouseDown$=ku,g.mouseEnter$=Wb,g.mouseLeave$=Jb,g.mouseMove$=Or,g.mouseOut$=Hb,g.mouseOver$=qb,g.mouseUp$=Iu,g.mouseWheel$=Qb,g.nearestElement=lb,g.nextElementSibling=pb,g.normalizePoint=p1,g.onBeforeUnload=uu,g.onDocumentReady=qo,g.openLog=Gm,g.outputGifBase64=Yl,g.outputQRCodeBase64=d1,g.pan$=ew,g.panCancel$=iw,g.panDown$=hw,g.panEnd$=rw,g.panLeft$=ow,g.panMove$=nw,g.panRight$=aw,g.panStart$=sw,g.panUp$=cw,g.parent=ub,g.parents=Wo,g.parseCSS=ya,g.parseTransformToMatrix=cu,g.patchVNode=$r,g.pinch$=lw,g.pinchIn$=uw,g.pinchOut$=fw,g.pngToJpg=s1,g.pointerCancel$=aa,g.pointerDown$=ia,g.pointerMove$=ra,g.pointerUp$=oa,g.polar=Qe,g.polymorphTween=mv,g.press$=dw,g.preventDefault=We,g.previousElementSibling=gb,g.querySelectorAllToStringArray=t0,g.radiusClip=i1,g.readFileInBrowser=ss,g.readStyleFromStyles=Fb,g.rectClip=r1,g.rem2px=cb,g.remove=Pb,g.removeAllEventListeners=vy,g.removeClass=kb,g.renderVNode=Pf,g.reverseCSSToJSEasing=R1,g.reverseEaseNameToCubicBezier=nu,g.reverseEasing=Kl,g.revokeObjectURL=W1,g.rightRotate=Uy,g.rotate$=mw,g.rotatePoint=me,g.runInSandbox=Lb,g.scheduleVNodeAsap=Ya,g.scheduleVNodeImmediately=Af,g.scrollParent=fb,g.scrollTo=rb,g.selectFileInBrowser=co,g.setCSSVar=Ov,g.setLogUploadFn=Vm,g.setManualScroll=ib,g.setRem=i2,g.setStyle=$n,g.setTheme=Ef,g.setWindowTitle=eb,g.shadowRoot=bb,g.sharpen=t1,g.showEl=yu,g.showUpdateDialog=Uf,g.siblings=mb,g.simulateEventFromTouch=ky,g.stopPropagation=zl,g.storage$=Dw,g.stringToDom=e0,g.swipe$=pw,g.swipeDown$=ww,g.swipeLeft$=gw,g.swipeRight$=yw,g.swipeUp$=bw,g.tap$=zu,g.tapOutSide$=vw,g.targetToAfterDropShape=uv,g.text=Eb,g.toBlackAndWhite=jy,g.toBlue=qy,g.toBlueAndGreen=Jy,g.toBlueAndGrey=Qy,g.toDegree=Ut,g.toGreen=Vy,g.toGreenAndGrey=Zy,g.toGrey=$y,g.toGrey2=Yy,g.toOpposite=Xy,g.toRadian=ut,g.toRed=Gy,g.toRedAndBlue=Wy,g.toRedAndGreen=Hy,g.toRedAndGrey=Ky,g.toggleClass=Qo,g.toggleElDisplay=Ab,g.toggleTheme=Iv,g.touchCancel$=Lu,g.touchEnd$=Ru,g.touchMove$=Du,g.touchStart$=Ou,g.transform=Vo,g.transformPath2D=X1,g.transitionEnd$=Sw,g.transitionStart$=xw,g.unmountVNode=Ts,g.updateVNode=jr,g.useAttribute=Ne,g.useClickA=Dr,g.useClipboard=sb,g.useCompatableDownMovePoint$=Pw,g.useCookie=Lv,g.useCoords$=xv,g.useDataset=Tv,g.useDocumentVisible$=Iw,g.useDraggable=Mw,g.useDrop=kw,g.useElementEventBus=Ww,g.useEvent$=st,g.useEventListener=yt,g.useFeRoute=Ev,g.useHashChange$=Cv,g.useHotKeyDown$=Ku,g.useHotKeyFile=Vw,g.useHotKeyFile$=Zu,g.useHotKeyUp$=Gw,g.useIntersection$=pf,g.useLoadImage=du,g.useLoadLink=K1,g.useLoadScript=J1,g.useLocalStorage=vf,g.useLocale=Ua,g.useLocation$=bf,g.useMatchMedia$=yf,g.useMouseAndPointerDownMovePoint$=Hu,g.useMouseDownMovePoint$=Vu,g.useMouseMovePoint$=Tw,g.useMousePoint=bn,g.useMutation$=mf,g.useParentEventListener=wy,g.usePointerDownMovePoint$=Rr,g.usePopStateChange$=wf,g.usePressDownMove=tf,g.usePressDownMoveWithMouse=Jw,g.usePressDownMoveWithPointer=ef,g.usePressDownMoveWithTouch=Kw,g.usePull$=Aw,g.useResize=Qu,g.useResize$=fa,g.useSafeArea$=vv,g.useScroll$=Wu,g.useSelectFile=mu,g.useSelectFileImage=Q1,g.useSessionStorage=Ba,g.useTouchDownMovePoint$=qu,g.useUrlChange$=_v,g.useVisible$=bv,g.useVisibleSimple$=yv,g.useWindowResize$=qw,g.vibrate=nb,g.waitElementAddedInDOM=gv,g.waitForStyleSheetsLoaded=Z1,g.writeToIndexDB=Bv,g.wxJsChooseImage=d2,g.wxJsDownloadImage=g2,g.wxJsDownloadVoice=T2,g.wxJsGetLocalImgData=y2,g.wxJsGetLocation=k2,g.wxJsGetNetworkType=A2,g.wxJsLogin=O2,g.wxJsOnVoicePlayEnd=C2,g.wxJsOnVoiceRecordEnd=v2,g.wxJsOpenLocation=M2,g.wxJsPauseVoice=S2,g.wxJsPay=D2,g.wxJsPlayVoice=x2,g.wxJsPreviewImage=m2,g.wxJsScanQRCode=I2,g.wxJsStartRecord=b2,g.wxJsStopRecord=w2,g.wxJsStopVoice=_2,g.wxJsTranslateVoice=P2,g.wxJsUpdateAppMessageShareData=u2,g.wxJsUpdateTimelineShareData=f2,g.wxJsUploadImage=p2,g.wxJsUploadVoice=E2,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
66
105
  //# sourceMappingURL=zyzgroup_core_web.umd.cjs.map