@gientech/modual 2.3.0 → 2.3.2

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.
@@ -0,0 +1,308 @@
1
+ import ts,{useRef as Va,useMemo as ii,useState as lj,useEffect as Us,createElement as hj,useContext as dj}from"react";import fj from"react-dom";import{jsx as zc}from"react/jsx-runtime";import{Icon as tp}from"@mxmweb/zui";import{Spin as pj}from"antd";import"dayjs";var sr={},gj=Object.defineProperty,vj=(n,t,e)=>t in n?gj(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Te=(n,t,e)=>vj(n,typeof t!="symbol"?t+"":t,e),oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lb(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $w={exports:{}},Ws={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Hw;function mj(){if(Hw)return Ws;Hw=1;var n=ts,t=Symbol.for("react.element"),e=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(s,u,c){var l,d={},p=null,g=null;c!==void 0&&(p=""+c),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(g=u.ref);for(l in u)r.call(u,l)&&!a.hasOwnProperty(l)&&(d[l]=u[l]);if(s&&s.defaultProps)for(l in u=s.defaultProps,u)d[l]===void 0&&(d[l]=u[l]);return{$$typeof:t,type:s,key:p,ref:g,props:d,_owner:i.current}}return Ws.Fragment=e,Ws.jsx=o,Ws.jsxs=o,Ws}var Xw;function yj(){return Xw||(Xw=1,$w.exports=mj()),$w.exports}var nn=yj();function ro(n){"@babel/helpers - typeof";return ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(n)}function bj(n,t){if(ro(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t);if(ro(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function rM(n){var t=bj(n,"string");return ro(t)=="symbol"?t:t+""}function ft(n,t,e){return(t=rM(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function qw(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),e.push.apply(e,r)}return e}function Lt(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(e),!0).forEach(function(r){ft(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):qw(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}function et(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Kw(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,rM(r.key),r)}}function nt(n,t,e){return t&&Kw(n.prototype,t),e&&Kw(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function s1(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function xj(n){if(Array.isArray(n))return s1(n)}function Ej(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function hb(n,t){if(n){if(typeof n=="string")return s1(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s1(n,t):void 0}}function wj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ht(n){return xj(n)||Ej(n)||hb(n)||wj()}function es(n){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},es(n)}function iM(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iM=function(){return!!n})()}function kj(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Aj(n,t){if(t&&(ro(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kj(n)}function Bt(n,t,e){return t=es(t),Aj(n,iM()?Reflect.construct(t,e||[],es(n).constructor):t.apply(n,e))}function u1(n,t){return u1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},u1(n,t)}function zt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&u1(n,t)}function Sj(n){if(Array.isArray(n))return n}function Cj(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(e=e.call(n)).next,t===0){if(Object(e)!==e)return;u=!1}else for(;!(u=(r=a.call(e)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function Nj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pt(n,t){return Sj(n)||Cj(n,t)||hb(n,t)||Nj()}var Zw={exports:{}},Jw;function Tj(){return Jw||(Jw=1,(function(n){var t=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function i(u,c,l){this.fn=u,this.context=c,this.once=l||!1}function a(u,c,l,d,p){if(typeof l!="function")throw new TypeError("The listener must be a function");var g=new i(l,d||u,p),m=e?e+c:c;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],g]:u._events[m].push(g):(u._events[m]=g,u._eventsCount++),u}function o(u,c){--u._eventsCount===0?u._events=new r:delete u._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,l;if(this._eventsCount===0)return u;for(l in c=this._events)t.call(c,l)&&u.push(e?l.slice(1):l);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=e?e+u:u,l=this._events[c];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,p=l.length,g=new Array(p);d<p;d++)g[d]=l[d].fn;return g},s.prototype.listenerCount=function(u){var c=e?e+u:u,l=this._events[c];return l?l.fn?1:l.length:0},s.prototype.emit=function(u,c,l,d,p,g){var m=e?e+u:u;if(!this._events[m])return!1;var y=this._events[m],v=arguments.length,x,E;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,c),!0;case 3:return y.fn.call(y.context,c,l),!0;case 4:return y.fn.call(y.context,c,l,d),!0;case 5:return y.fn.call(y.context,c,l,d,p),!0;case 6:return y.fn.call(y.context,c,l,d,p,g),!0}for(E=1,x=new Array(v-1);E<v;E++)x[E-1]=arguments[E];y.fn.apply(y.context,x)}else{var w=y.length,S;for(E=0;E<w;E++)switch(y[E].once&&this.removeListener(u,y[E].fn,void 0,!0),v){case 1:y[E].fn.call(y[E].context);break;case 2:y[E].fn.call(y[E].context,c);break;case 3:y[E].fn.call(y[E].context,c,l);break;case 4:y[E].fn.call(y[E].context,c,l,d);break;default:if(!x)for(S=1,x=new Array(v-1);S<v;S++)x[S-1]=arguments[S];y[E].fn.apply(y[E].context,x)}}return!0},s.prototype.on=function(u,c,l){return a(this,u,c,l,!1)},s.prototype.once=function(u,c,l){return a(this,u,c,l,!0)},s.prototype.removeListener=function(u,c,l,d){var p=e?e+u:u;if(!this._events[p])return this;if(!c)return o(this,p),this;var g=this._events[p];if(g.fn)g.fn===c&&(!d||g.once)&&(!l||g.context===l)&&o(this,p);else{for(var m=0,y=[],v=g.length;m<v;m++)(g[m].fn!==c||d&&!g[m].once||l&&g[m].context!==l)&&y.push(g[m]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=e?e+u:u,this._events[c]&&o(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=e,s.EventEmitter=s,n.exports=s})(Zw)),Zw.exports}var Mj=Tj();const aM=lb(Mj);var Ne=1e-6,Ke=typeof Float32Array<"u"?Float32Array:Array,_j="zyx";function oM(){var n=new Ke(9);return Ke!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Oj(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}function Pj(n,t,e,r,i,a,o,s,u){var c=new Ke(9);return c[0]=n,c[1]=t,c[2]=e,c[3]=r,c[4]=i,c[5]=a,c[6]=o,c[7]=s,c[8]=u,c}function pe(){var n=new Ke(16);return Ke!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n}function sM(n){var t=new Ke(16);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function ns(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function uM(n,t,e,r,i,a,o,s,u,c,l,d,p,g,m,y){var v=new Ke(16);return v[0]=n,v[1]=t,v[2]=e,v[3]=r,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=u,v[9]=c,v[10]=l,v[11]=d,v[12]=p,v[13]=g,v[14]=m,v[15]=y,v}function c1(n,t,e,r,i,a,o,s,u,c,l,d,p,g,m,y,v){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n[6]=s,n[7]=u,n[8]=c,n[9]=l,n[10]=d,n[11]=p,n[12]=g,n[13]=m,n[14]=y,n[15]=v,n}function va(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function cM(n,t){if(n===t){var e=t[1],r=t[2],i=t[3],a=t[6],o=t[7],s=t[11];n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=a,n[11]=t[14],n[12]=i,n[13]=o,n[14]=s}else n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15];return n}function si(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],d=t[9],p=t[10],g=t[11],m=t[12],y=t[13],v=t[14],x=t[15],E=e*s-r*o,w=e*u-i*o,S=e*c-a*o,k=r*u-i*s,A=r*c-a*s,N=i*c-a*u,T=l*y-d*m,O=l*v-p*m,M=l*x-g*m,P=d*v-p*y,L=d*x-g*y,j=p*x-g*v,z=E*j-w*L+S*P+k*M-A*O+N*T;return z?(z=1/z,n[0]=(s*j-u*L+c*P)*z,n[1]=(i*L-r*j-a*P)*z,n[2]=(y*N-v*A+x*k)*z,n[3]=(p*A-d*N-g*k)*z,n[4]=(u*M-o*j-c*O)*z,n[5]=(e*j-i*M+a*O)*z,n[6]=(v*S-m*N-x*w)*z,n[7]=(l*N-p*S+g*w)*z,n[8]=(o*L-s*M+c*T)*z,n[9]=(r*M-e*L-a*T)*z,n[10]=(m*A-y*S+x*E)*z,n[11]=(d*S-l*A-g*E)*z,n[12]=(s*O-o*P-u*T)*z,n[13]=(e*P-r*O+i*T)*z,n[14]=(y*w-m*k-v*E)*z,n[15]=(l*k-d*w+p*E)*z,n):null}function Rj(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],d=t[9],p=t[10],g=t[11],m=t[12],y=t[13],v=t[14],x=t[15],E=e*s-r*o,w=e*u-i*o,S=e*c-a*o,k=r*u-i*s,A=r*c-a*s,N=i*c-a*u,T=l*y-d*m,O=l*v-p*m,M=l*x-g*m,P=d*v-p*y,L=d*x-g*y,j=p*x-g*v;return n[0]=s*j-u*L+c*P,n[1]=i*L-r*j-a*P,n[2]=y*N-v*A+x*k,n[3]=p*A-d*N-g*k,n[4]=u*M-o*j-c*O,n[5]=e*j-i*M+a*O,n[6]=v*S-m*N-x*w,n[7]=l*N-p*S+g*w,n[8]=o*L-s*M+c*T,n[9]=r*M-e*L-a*T,n[10]=m*A-y*S+x*E,n[11]=d*S-l*A-g*E,n[12]=s*O-o*P-u*T,n[13]=e*P-r*O+i*T,n[14]=y*w-m*k-v*E,n[15]=l*k-d*w+p*E,n}function lM(n){var t=n[0],e=n[1],r=n[2],i=n[3],a=n[4],o=n[5],s=n[6],u=n[7],c=n[8],l=n[9],d=n[10],p=n[11],g=n[12],m=n[13],y=n[14],v=n[15],x=t*o-e*a,E=t*s-r*a,w=e*s-r*o,S=c*m-l*g,k=c*y-d*g,A=l*y-d*m,N=t*A-e*k+r*S,T=a*A-o*k+s*S,O=c*w-l*E+d*x,M=g*w-m*E+y*x;return u*N-i*T+v*O-p*M}function Nn(n,t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],d=t[8],p=t[9],g=t[10],m=t[11],y=t[12],v=t[13],x=t[14],E=t[15],w=e[0],S=e[1],k=e[2],A=e[3];return n[0]=w*r+S*s+k*d+A*y,n[1]=w*i+S*u+k*p+A*v,n[2]=w*a+S*c+k*g+A*x,n[3]=w*o+S*l+k*m+A*E,w=e[4],S=e[5],k=e[6],A=e[7],n[4]=w*r+S*s+k*d+A*y,n[5]=w*i+S*u+k*p+A*v,n[6]=w*a+S*c+k*g+A*x,n[7]=w*o+S*l+k*m+A*E,w=e[8],S=e[9],k=e[10],A=e[11],n[8]=w*r+S*s+k*d+A*y,n[9]=w*i+S*u+k*p+A*v,n[10]=w*a+S*c+k*g+A*x,n[11]=w*o+S*l+k*m+A*E,w=e[12],S=e[13],k=e[14],A=e[15],n[12]=w*r+S*s+k*d+A*y,n[13]=w*i+S*u+k*p+A*v,n[14]=w*a+S*c+k*g+A*x,n[15]=w*o+S*l+k*m+A*E,n}function Xo(n,t,e){var r=e[0],i=e[1],a=e[2],o,s,u,c,l,d,p,g,m,y,v,x;return t===n?(n[12]=t[0]*r+t[4]*i+t[8]*a+t[12],n[13]=t[1]*r+t[5]*i+t[9]*a+t[13],n[14]=t[2]*r+t[6]*i+t[10]*a+t[14],n[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],d=t[5],p=t[6],g=t[7],m=t[8],y=t[9],v=t[10],x=t[11],n[0]=o,n[1]=s,n[2]=u,n[3]=c,n[4]=l,n[5]=d,n[6]=p,n[7]=g,n[8]=m,n[9]=y,n[10]=v,n[11]=x,n[12]=o*r+l*i+m*a+t[12],n[13]=s*r+d*i+y*a+t[13],n[14]=u*r+p*i+v*a+t[14],n[15]=c*r+g*i+x*a+t[15]),n}function hM(n,t,e){var r=e[0],i=e[1],a=e[2];return n[0]=t[0]*r,n[1]=t[1]*r,n[2]=t[2]*r,n[3]=t[3]*r,n[4]=t[4]*i,n[5]=t[5]*i,n[6]=t[6]*i,n[7]=t[7]*i,n[8]=t[8]*a,n[9]=t[9]*a,n[10]=t[10]*a,n[11]=t[11]*a,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Dj(n,t,e,r){var i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,d,p,g,m,y,v,x,E,w,S,k,A,N,T,O,M,P,L,j,z,U;return s<Ne?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),c=Math.cos(e),l=1-c,d=t[0],p=t[1],g=t[2],m=t[3],y=t[4],v=t[5],x=t[6],E=t[7],w=t[8],S=t[9],k=t[10],A=t[11],N=i*i*l+c,T=a*i*l+o*u,O=o*i*l-a*u,M=i*a*l-o*u,P=a*a*l+c,L=o*a*l+i*u,j=i*o*l+a*u,z=a*o*l-i*u,U=o*o*l+c,n[0]=d*N+y*T+w*O,n[1]=p*N+v*T+S*O,n[2]=g*N+x*T+k*O,n[3]=m*N+E*T+A*O,n[4]=d*M+y*P+w*L,n[5]=p*M+v*P+S*L,n[6]=g*M+x*P+k*L,n[7]=m*M+E*P+A*L,n[8]=d*j+y*z+w*U,n[9]=p*j+v*z+S*U,n[10]=g*j+x*z+k*U,n[11]=m*j+E*z+A*U,t!==n&&(n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n)}function dM(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],d=t[10],p=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=a*i+c*r,n[5]=o*i+l*r,n[6]=s*i+d*r,n[7]=u*i+p*r,n[8]=c*i-a*r,n[9]=l*i-o*r,n[10]=d*i-s*r,n[11]=p*i-u*r,n}function fM(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],d=t[10],p=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=a*i-c*r,n[1]=o*i-l*r,n[2]=s*i-d*r,n[3]=u*i-p*r,n[8]=a*r+c*i,n[9]=o*r+l*i,n[10]=s*r+d*i,n[11]=u*r+p*i,n}function Lj(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],d=t[6],p=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=a*i+c*r,n[1]=o*i+l*r,n[2]=s*i+d*r,n[3]=u*i+p*r,n[4]=c*i-a*r,n[5]=l*i-o*r,n[6]=d*i-s*r,n[7]=p*i-u*r,n}function ia(n,t){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}function Ua(n,t){return n[0]=t[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function pM(n,t,e){var r=e[0],i=e[1],a=e[2],o=Math.sqrt(r*r+i*i+a*a),s,u,c;return o<Ne?null:(o=1/o,r*=o,i*=o,a*=o,s=Math.sin(t),u=Math.cos(t),c=1-u,n[0]=r*r*c+u,n[1]=i*r*c+a*s,n[2]=a*r*c-i*s,n[3]=0,n[4]=r*i*c-a*s,n[5]=i*i*c+u,n[6]=a*i*c+r*s,n[7]=0,n[8]=r*a*c+i*s,n[9]=i*a*c-r*s,n[10]=a*a*c+u,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n)}function gM(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=r,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function vM(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function l1(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=r,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function mM(n,t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,u=i+i,c=a+a,l=r*s,d=r*u,p=r*c,g=i*u,m=i*c,y=a*c,v=o*s,x=o*u,E=o*c;return n[0]=1-(g+y),n[1]=d+E,n[2]=p-x,n[3]=0,n[4]=d-E,n[5]=1-(l+y),n[6]=m+v,n[7]=0,n[8]=p+x,n[9]=m-v,n[10]=1-(l+g),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function Ij(n,t){var e=new Ke(3),r=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],d=r*r+i*i+a*a+o*o;return d>0?(e[0]=(s*o+l*r+u*a-c*i)*2/d,e[1]=(u*o+l*i+c*r-s*a)*2/d,e[2]=(c*o+l*a+s*i-u*r)*2/d):(e[0]=(s*o+l*r+u*a-c*i)*2,e[1]=(u*o+l*i+c*r-s*a)*2,e[2]=(c*o+l*a+s*i-u*r)*2),mM(n,t,e),n}function Ul(n,t){return n[0]=t[12],n[1]=t[13],n[2]=t[14],n}function rs(n,t){var e=t[0],r=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return n[0]=Math.sqrt(e*e+r*r+i*i),n[1]=Math.sqrt(a*a+o*o+s*s),n[2]=Math.sqrt(u*u+c*c+l*l),n}function Wl(n,t){var e=new Ke(3);rs(e,t);var r=1/e[0],i=1/e[1],a=1/e[2],o=t[0]*r,s=t[1]*i,u=t[2]*a,c=t[4]*r,l=t[5]*i,d=t[6]*a,p=t[8]*r,g=t[9]*i,m=t[10]*a,y=o+l+m,v=0;return y>0?(v=Math.sqrt(y+1)*2,n[3]=.25*v,n[0]=(d-g)/v,n[1]=(p-u)/v,n[2]=(s-c)/v):o>l&&o>m?(v=Math.sqrt(1+o-l-m)*2,n[3]=(d-g)/v,n[0]=.25*v,n[1]=(s+c)/v,n[2]=(p+u)/v):l>m?(v=Math.sqrt(1+l-o-m)*2,n[3]=(p-u)/v,n[0]=(s+c)/v,n[1]=.25*v,n[2]=(d+g)/v):(v=Math.sqrt(1+m-o-l)*2,n[3]=(s-c)/v,n[0]=(p+u)/v,n[1]=(d+g)/v,n[2]=.25*v),n}function jj(n,t,e,r){t[0]=r[12],t[1]=r[13],t[2]=r[14];var i=r[0],a=r[1],o=r[2],s=r[4],u=r[5],c=r[6],l=r[8],d=r[9],p=r[10];e[0]=Math.sqrt(i*i+a*a+o*o),e[1]=Math.sqrt(s*s+u*u+c*c),e[2]=Math.sqrt(l*l+d*d+p*p);var g=1/e[0],m=1/e[1],y=1/e[2],v=i*g,x=a*m,E=o*y,w=s*g,S=u*m,k=c*y,A=l*g,N=d*m,T=p*y,O=v+S+T,M=0;return O>0?(M=Math.sqrt(O+1)*2,n[3]=.25*M,n[0]=(k-N)/M,n[1]=(A-E)/M,n[2]=(x-w)/M):v>S&&v>T?(M=Math.sqrt(1+v-S-T)*2,n[3]=(k-N)/M,n[0]=.25*M,n[1]=(x+w)/M,n[2]=(A+E)/M):S>T?(M=Math.sqrt(1+S-v-T)*2,n[3]=(A-E)/M,n[0]=(x+w)/M,n[1]=.25*M,n[2]=(k+N)/M):(M=Math.sqrt(1+T-v-S)*2,n[3]=(x-w)/M,n[0]=(A+E)/M,n[1]=(k+N)/M,n[2]=.25*M),n}function Bj(n,t,e,r){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,d=i*u,p=i*c,g=i*l,m=a*c,y=a*l,v=o*l,x=s*u,E=s*c,w=s*l,S=r[0],k=r[1],A=r[2];return n[0]=(1-(m+v))*S,n[1]=(p+w)*S,n[2]=(g-E)*S,n[3]=0,n[4]=(p-w)*k,n[5]=(1-(d+v))*k,n[6]=(y+x)*k,n[7]=0,n[8]=(g+E)*A,n[9]=(y-x)*A,n[10]=(1-(d+m))*A,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function du(n,t,e,r,i){var a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,d=s+s,p=a*c,g=a*l,m=a*d,y=o*l,v=o*d,x=s*d,E=u*c,w=u*l,S=u*d,k=r[0],A=r[1],N=r[2],T=i[0],O=i[1],M=i[2],P=(1-(y+x))*k,L=(g+S)*k,j=(m-w)*k,z=(g-S)*A,U=(1-(p+x))*A,J=(v+E)*A,W=(m+w)*N,at=(v-E)*N,ut=(1-(p+y))*N;return n[0]=P,n[1]=L,n[2]=j,n[3]=0,n[4]=z,n[5]=U,n[6]=J,n[7]=0,n[8]=W,n[9]=at,n[10]=ut,n[11]=0,n[12]=e[0]+T-(P*T+z*O+W*M),n[13]=e[1]+O-(L*T+U*O+at*M),n[14]=e[2]+M-(j*T+J*O+ut*M),n[15]=1,n}function db(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=e+e,s=r+r,u=i+i,c=e*o,l=r*o,d=r*s,p=i*o,g=i*s,m=i*u,y=a*o,v=a*s,x=a*u;return n[0]=1-d-m,n[1]=l+x,n[2]=p-v,n[3]=0,n[4]=l-x,n[5]=1-c-m,n[6]=g+y,n[7]=0,n[8]=p+v,n[9]=g-y,n[10]=1-c-d,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function zj(n,t,e,r,i,a,o){var s=1/(e-t),u=1/(i-r),c=1/(a-o);return n[0]=a*2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a*2*u,n[6]=0,n[7]=0,n[8]=(e+t)*s,n[9]=(i+r)*u,n[10]=(o+a)*c,n[11]=-1,n[12]=0,n[13]=0,n[14]=o*a*2*c,n[15]=0,n}function yM(n,t,e,r,i){var a=1/Math.tan(t/2);if(n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0){var o=1/(r-i);n[10]=(i+r)*o,n[14]=2*i*r*o}else n[10]=-1,n[14]=-2*r;return n}var Fj=yM;function Gj(n,t,e,r,i){var a=1/Math.tan(t/2);if(n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0){var o=1/(r-i);n[10]=i*o,n[14]=i*r*o}else n[10]=-1,n[14]=-r;return n}function Vj(n,t,e,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return n[0]=u,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=c,n[6]=0,n[7]=0,n[8]=-((o-s)*u*.5),n[9]=(i-a)*c*.5,n[10]=r/(e-r),n[11]=-1,n[12]=0,n[13]=0,n[14]=r*e/(e-r),n[15]=0,n}function bM(n,t,e,r,i,a,o){var s=1/(t-e),u=1/(r-i),c=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*u,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*c,n[11]=0,n[12]=(t+e)*s,n[13]=(i+r)*u,n[14]=(o+a)*c,n[15]=1,n}var xM=bM;function EM(n,t,e,r,i,a,o){var s=1/(t-e),u=1/(r-i),c=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*u,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=c,n[11]=0,n[12]=(t+e)*s,n[13]=(i+r)*u,n[14]=a*c,n[15]=1,n}function wM(n,t,e,r){var i,a,o,s,u,c,l,d,p,g,m=t[0],y=t[1],v=t[2],x=r[0],E=r[1],w=r[2],S=e[0],k=e[1],A=e[2];return Math.abs(m-S)<Ne&&Math.abs(y-k)<Ne&&Math.abs(v-A)<Ne?va(n):(l=m-S,d=y-k,p=v-A,g=1/Math.sqrt(l*l+d*d+p*p),l*=g,d*=g,p*=g,i=E*p-w*d,a=w*l-x*p,o=x*d-E*l,g=Math.sqrt(i*i+a*a+o*o),g?(g=1/g,i*=g,a*=g,o*=g):(i=0,a=0,o=0),s=d*o-p*a,u=p*i-l*o,c=l*a-d*i,g=Math.sqrt(s*s+u*u+c*c),g?(g=1/g,s*=g,u*=g,c*=g):(s=0,u=0,c=0),n[0]=i,n[1]=s,n[2]=l,n[3]=0,n[4]=a,n[5]=u,n[6]=d,n[7]=0,n[8]=o,n[9]=c,n[10]=p,n[11]=0,n[12]=-(i*m+a*y+o*v),n[13]=-(s*m+u*y+c*v),n[14]=-(l*m+d*y+p*v),n[15]=1,n)}function Uj(n,t,e,r){var i=t[0],a=t[1],o=t[2],s=r[0],u=r[1],c=r[2],l=i-e[0],d=a-e[1],p=o-e[2],g=l*l+d*d+p*p;g>0&&(g=1/Math.sqrt(g),l*=g,d*=g,p*=g);var m=u*p-c*d,y=c*l-s*p,v=s*d-u*l;return g=m*m+y*y+v*v,g>0&&(g=1/Math.sqrt(g),m*=g,y*=g,v*=g),n[0]=m,n[1]=y,n[2]=v,n[3]=0,n[4]=d*v-p*y,n[5]=p*m-l*v,n[6]=l*y-d*m,n[7]=0,n[8]=l,n[9]=d,n[10]=p,n[11]=0,n[12]=i,n[13]=a,n[14]=o,n[15]=1,n}function Wj(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function Yj(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]+n[3]*n[3]+n[4]*n[4]+n[5]*n[5]+n[6]*n[6]+n[7]*n[7]+n[8]*n[8]+n[9]*n[9]+n[10]*n[10]+n[11]*n[11]+n[12]*n[12]+n[13]*n[13]+n[14]*n[14]+n[15]*n[15])}function $j(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n}function kM(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n}function Hj(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n}function Xj(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n[3]=t[3]+e[3]*r,n[4]=t[4]+e[4]*r,n[5]=t[5]+e[5]*r,n[6]=t[6]+e[6]*r,n[7]=t[7]+e[7]*r,n[8]=t[8]+e[8]*r,n[9]=t[9]+e[9]*r,n[10]=t[10]+e[10]*r,n[11]=t[11]+e[11]*r,n[12]=t[12]+e[12]*r,n[13]=t[13]+e[13]*r,n[14]=t[14]+e[14]*r,n[15]=t[15]+e[15]*r,n}function h1(n,t){return n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]&&n[4]===t[4]&&n[5]===t[5]&&n[6]===t[6]&&n[7]===t[7]&&n[8]===t[8]&&n[9]===t[9]&&n[10]===t[10]&&n[11]===t[11]&&n[12]===t[12]&&n[13]===t[13]&&n[14]===t[14]&&n[15]===t[15]}function qj(n,t){var e=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],u=n[6],c=n[7],l=n[8],d=n[9],p=n[10],g=n[11],m=n[12],y=n[13],v=n[14],x=n[15],E=t[0],w=t[1],S=t[2],k=t[3],A=t[4],N=t[5],T=t[6],O=t[7],M=t[8],P=t[9],L=t[10],j=t[11],z=t[12],U=t[13],J=t[14],W=t[15];return Math.abs(e-E)<=Ne*Math.max(1,Math.abs(e),Math.abs(E))&&Math.abs(r-w)<=Ne*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(i-S)<=Ne*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(a-k)<=Ne*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(o-A)<=Ne*Math.max(1,Math.abs(o),Math.abs(A))&&Math.abs(s-N)<=Ne*Math.max(1,Math.abs(s),Math.abs(N))&&Math.abs(u-T)<=Ne*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-O)<=Ne*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-M)<=Ne*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(d-P)<=Ne*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(p-L)<=Ne*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(g-j)<=Ne*Math.max(1,Math.abs(g),Math.abs(j))&&Math.abs(m-z)<=Ne*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(y-U)<=Ne*Math.max(1,Math.abs(y),Math.abs(U))&&Math.abs(v-J)<=Ne*Math.max(1,Math.abs(v),Math.abs(J))&&Math.abs(x-W)<=Ne*Math.max(1,Math.abs(x),Math.abs(W))}var AM=Nn,Kj=kM;const Zj=Object.freeze(Object.defineProperty({__proto__:null,add:$j,adjoint:Rj,clone:sM,copy:ns,create:pe,decompose:jj,determinant:lM,equals:qj,exactEquals:h1,frob:Yj,fromQuat:db,fromQuat2:Ij,fromRotation:pM,fromRotationTranslation:mM,fromRotationTranslationScale:Bj,fromRotationTranslationScaleOrigin:du,fromScaling:Ua,fromTranslation:ia,fromValues:uM,fromXRotation:gM,fromYRotation:vM,fromZRotation:l1,frustum:zj,getRotation:Wl,getScaling:rs,getTranslation:Ul,identity:va,invert:si,lookAt:wM,mul:AM,multiply:Nn,multiplyScalar:Hj,multiplyScalarAndAdd:Xj,ortho:xM,orthoNO:bM,orthoZO:EM,perspective:Fj,perspectiveFromFieldOfView:Vj,perspectiveNO:yM,perspectiveZO:Gj,rotate:Dj,rotateX:dM,rotateY:fM,rotateZ:Lj,scale:hM,set:c1,str:Wj,sub:Kj,subtract:kM,targetTo:Uj,translate:Xo,transpose:cM},Symbol.toStringTag,{value:"Module"}));function Yt(){var n=new Ke(3);return Ke!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function _i(n){var t=new Ke(3);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Ri(n){var t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function Ee(n,t,e){var r=new Ke(3);return r[0]=n,r[1]=t,r[2]=e,r}function ui(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function kn(n,t,e,r){return n[0]=t,n[1]=e,n[2]=r,n}function da(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n}function d1(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n}function Jj(n,t,e){return n[0]=t[0]*e[0],n[1]=t[1]*e[1],n[2]=t[2]*e[2],n}function Qj(n,t,e){return n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.min(t[2],e[2]),n}function tB(n,t,e){return n[0]=Math.max(t[0],e[0]),n[1]=Math.max(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n}function Yl(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n}function eB(n,t){var e=t[0]-n[0],r=t[1]-n[1],i=t[2]-n[2];return Math.sqrt(e*e+r*r+i*i)}function Za(n,t){var e=t[0],r=t[1],i=t[2],a=e*e+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),n[0]=t[0]*a,n[1]=t[1]*a,n[2]=t[2]*a,n}function ci(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Ml(n,t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return n[0]=i*u-a*s,n[1]=a*o-r*u,n[2]=r*s-i*o,n}function f1(n,t,e,r){var i=t[0],a=t[1],o=t[2];return n[0]=i+r*(e[0]-i),n[1]=a+r*(e[1]-a),n[2]=o+r*(e[2]-o),n}function Tn(n,t,e){var r=t[0],i=t[1],a=t[2],o=e[3]*r+e[7]*i+e[11]*a+e[15];return o=o||1,n[0]=(e[0]*r+e[4]*i+e[8]*a+e[12])/o,n[1]=(e[1]*r+e[5]*i+e[9]*a+e[13])/o,n[2]=(e[2]*r+e[6]*i+e[10]*a+e[14])/o,n}function nB(n,t,e){var r=t[0],i=t[1],a=t[2];return n[0]=r*e[0]+i*e[3]+a*e[6],n[1]=r*e[1]+i*e[4]+a*e[7],n[2]=r*e[2]+i*e[5]+a*e[8],n}function rB(n,t,e){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,d=a*s-r*c,p=r*u-i*s;return l=l+l,d=d+d,p=p+p,n[0]=s+o*l+i*p-a*d,n[1]=u+o*d+a*l-r*p,n[2]=c+o*p+r*d-i*l,n}function Ys(n,t){var e=n[0],r=n[1],i=n[2],a=t[0],o=t[1],s=t[2];return Math.abs(e-a)<=Ne*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-o)<=Ne*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=Ne*Math.max(1,Math.abs(i),Math.abs(s))}var iB=d1,Qw=eB,SM=Ri;(function(){var n=Yt();return function(t,e,r,i,a,o){var s,u;for(e||(e=3),r||(r=0),i?u=Math.min(i*e+r,t.length):u=t.length,s=r;s<u;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],a(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2];return t}})();function li(){var n=new Ke(4);return Ke!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0),n}function au(n,t,e,r){var i=new Ke(4);return i[0]=n,i[1]=t,i[2]=e,i[3]=r,i}function aB(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function oB(n,t,e,r,i){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function sB(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=e*e+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),n[0]=e*o,n[1]=r*o,n[2]=i*o,n[3]=a*o,n}function Di(n,t,e){var r=t[0],i=t[1],a=t[2],o=t[3];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*o,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*o,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*o,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*o,n}(function(){var n=li();return function(t,e,r,i,a,o){var s,u;for(e||(e=4),r||(r=0),i?u=Math.min(i*e+r,t.length):u=t.length,s=r;s<u;s+=e)n[0]=t[s],n[1]=t[s+1],n[2]=t[s+2],n[3]=t[s+3],a(n,n,o),t[s]=n[0],t[s+1]=n[1],t[s+2]=n[2],t[s+3]=n[3];return t}})();function He(){var n=new Ke(4);return Ke!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function sa(n,t,e){e=e*.5;var r=Math.sin(e);return n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=Math.cos(e),n}function fa(n,t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],c=e[2],l=e[3];return n[0]=r*l+o*s+i*c-a*u,n[1]=i*l+o*u+a*s-r*c,n[2]=a*l+o*c+r*u-i*s,n[3]=o*l-r*s-i*u-a*c,n}function ep(n,t,e,r){var i=t[0],a=t[1],o=t[2],s=t[3],u=e[0],c=e[1],l=e[2],d=e[3],p,g,m,y,v;return g=i*u+a*c+o*l+s*d,g<0&&(g=-g,u=-u,c=-c,l=-l,d=-d),1-g>Ne?(p=Math.acos(g),m=Math.sin(p),y=Math.sin((1-r)*p)/m,v=Math.sin(r*p)/m):(y=1-r,v=r),n[0]=y*i+v*u,n[1]=y*a+v*c,n[2]=y*o+v*l,n[3]=y*s+v*d,n}function np(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=e*e+r*r+i*i+a*a,s=o?1/o:0;return n[0]=-e*s,n[1]=-r*s,n[2]=-i*s,n[3]=a*s,n}function uB(n,t){var e=t[0]+t[4]+t[8],r;if(e>0)r=Math.sqrt(e+1),n[3]=.5*r,r=.5/r,n[0]=(t[5]-t[7])*r,n[1]=(t[6]-t[2])*r,n[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),n[i]=.5*r,r=.5/r,n[3]=(t[a*3+o]-t[o*3+a])*r,n[a]=(t[a*3+i]+t[i*3+a])*r,n[o]=(t[o*3+i]+t[i*3+o])*r}return n}function Fc(n,t,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:_j,a=Math.PI/360;t*=a,r*=a,e*=a;var o=Math.sin(t),s=Math.cos(t),u=Math.sin(e),c=Math.cos(e),l=Math.sin(r),d=Math.cos(r);switch(i){case"xyz":n[0]=o*c*d+s*u*l,n[1]=s*u*d-o*c*l,n[2]=s*c*l+o*u*d,n[3]=s*c*d-o*u*l;break;case"xzy":n[0]=o*c*d-s*u*l,n[1]=s*u*d-o*c*l,n[2]=s*c*l+o*u*d,n[3]=s*c*d+o*u*l;break;case"yxz":n[0]=o*c*d+s*u*l,n[1]=s*u*d-o*c*l,n[2]=s*c*l-o*u*d,n[3]=s*c*d+o*u*l;break;case"yzx":n[0]=o*c*d+s*u*l,n[1]=s*u*d+o*c*l,n[2]=s*c*l-o*u*d,n[3]=s*c*d-o*u*l;break;case"zxy":n[0]=o*c*d-s*u*l,n[1]=s*u*d+o*c*l,n[2]=s*c*l+o*u*d,n[3]=s*c*d-o*u*l;break;case"zyx":n[0]=o*c*d-s*u*l,n[1]=s*u*d+o*c*l,n[2]=s*c*l-o*u*d,n[3]=s*c*d+o*u*l;break;default:throw new Error("Unknown angle order "+i)}return n}var cB=au,Gc=aB,CM=oB,t2=fa,$l=sB;(function(){var n=Yt(),t=Ee(1,0,0),e=Ee(0,1,0);return function(r,i,a){var o=ci(i,a);return o<-.999999?(Ml(n,t,i),SM(n)<1e-6&&Ml(n,e,i),Za(n,n),sa(r,n,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(Ml(n,i,a),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+o,$l(r,r))}})();(function(){var n=He(),t=He();return function(e,r,i,a,o,s){return ep(n,r,o,s),ep(t,i,a,s),ep(e,n,t,2*s*(1-s)),e}})();(function(){var n=oM();return function(t,e,r,i){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],$l(t,uB(t,n))}})();function fb(){var n=new Ke(2);return Ke!=Float32Array&&(n[0]=0,n[1]=0),n}function lB(n,t){return n[0]=t[0],n[1]=t[1],n}function hB(n,t,e){return n[0]=t,n[1]=e,n}function dB(n,t){var e=t[0],r=t[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i)),n[0]=t[0]*i,n[1]=t[1]*i,n}function fB(n,t){return n[0]*t[0]+n[1]*t[1]}function pB(n,t){return n[0]===t[0]&&n[1]===t[1]}(function(){var n=fb();return function(t,e,r,i,a,o){var s,u;for(e||(e=2),r||(r=0),i?u=Math.min(i*e+r,t.length):u=t.length,s=r;s<u;s+=e)n[0]=t[s],n[1]=t[s+1],a(n,n,o),t[s]=n[0],t[s+1]=n[1];return t}})();var xu=function(n){return n!==null&&typeof n!="function"&&isFinite(n.length)},gB=function(n,t){return xu(n)?n.indexOf(t)>-1:!1},vB=function(n,t){if(!xu(n))return n;for(var e=[],r=0;r<n.length;r++){var i=n[r];t(i,r)&&e.push(i)}return e},mB=function(n,t){return t===void 0&&(t=[]),vB(n,function(e){return!gB(t,e)})};function St(n){return typeof n=="function"}function Tt(n){return n==null}function yi(n){return Array.isArray(n)}const An=(function(n){var t=typeof n;return n!==null&&t==="object"||t==="function"});function NM(n,t){if(n){var e;if(yi(n))for(var r=0,i=n.length;r<i&&(e=t(n[r],r),e!==!1);r++);else if(An(n)){for(var a in n)if(n.hasOwnProperty(a)&&(e=t(n[a],a),e===!1))break}}}var p1=function(n){return typeof n=="object"&&n!==null},yB={}.toString,TM=function(n,t){return yB.call(n)==="[object "+t+"]"},is=function(n){if(!p1(n)||!TM(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var t=n;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t},bB=function(n){if(!yi(n))return[];for(var t=[],e=0;e<n.length;e++)t=t.concat(n[e]);return t};function e2(n){if(!Array.isArray(n))return-1/0;var t=n.length;if(!t)return-1/0;for(var e=n[0],r=1;r<t;r++)e=Math.max(e,n[r]);return e}const n2=(function(n){if(yi(n))return n.reduce(function(t,e){return Math.min(t,e)},n[0])});var xB=function(n,t,e){if(!yi(n)&&!is(n))return n;var r=e;return NM(n,function(i,a){r=t(r,i,a)}),r};function fe(n){return typeof n=="string"}function EB(n,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++){var a=n[r];t.has(a)||(e.push(a),t.set(a,!0))}return e}var wB=Object.prototype.hasOwnProperty;function Mh(n,t){if(!t||!yi(n))return{};for(var e={},r=St(t)?t:function(s){return s[t]},i,a=0;a<n.length;a++){var o=n[a];i=r(o),wB.call(e,i)?e[i].push(o):e[i]=[o]}return e}var dn=function(n,t,e){return n<t?t:n>e?e:n};function Xt(n){return typeof n=="number"}var kB=1e-5;function fu(n,t,e){return e===void 0&&(e=kB),n===t||Math.abs(n-t)<e}var MM=function(n,t){return(n%t+t)%t};const _M=(function(n){return Tt(n)?"":n.toString()});var AB=function(n){var t=_M(n);return t.charAt(0).toLowerCase()+t.substring(1)};function SB(n,t){return!n||!t?n:n.replace(/\\?\{([^{}]+)\}/g,function(e,r){return e.charAt(0)==="\\"?e.slice(1):t[r]===void 0?"":t[r]})}var Hl=function(n){var t=_M(n);return t.charAt(0).toUpperCase()+t.substring(1)},CB={}.toString,NB=function(n){return CB.call(n).replace(/^\[object /,"").replace(/]$/,"")},Eu=function(n){return TM(n,"Boolean")},TB=Object.prototype,MB=function(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||TB;return n===e},Ce=function(n){return n===void 0};function _B(n){return n instanceof Element||n instanceof Document}function r2(n,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(n[e]=t[e])}function OB(n,t,e,r){return t&&r2(n,t),e&&r2(n,e),n}var g1=function(n){if(typeof n!="object"||n===null)return n;var t;if(yi(n)){t=[];for(var e=0,r=n.length;e<r;e++)typeof n[e]=="object"&&n[e]!=null?t[e]=g1(n[e]):t[e]=n[e]}else{t={};for(var i in n)typeof n[i]=="object"&&n[i]!=null?t[i]=g1(n[i]):t[i]=n[i]}return t};function _h(n,t,e){var r;return function(){var i=this,a=arguments,o=function(){r=null,n.apply(i,a)};clearTimeout(r),r=setTimeout(o,t)}}var PB=5;function RB(n,t){if(Object.hasOwn)return Object.hasOwn(n,t);if(n==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(n),t)}function OM(n,t,e,r){e=e||0,r=r||PB;for(var i in t)if(RB(t,i)){var a=t[i];a!==null&&is(a)?(is(n[i])||(n[i]={}),e<r?OM(n[i],a,e+1,r):n[i]=t[i]):yi(a)?(n[i]=[],n[i]=n[i].concat(a)):a!==void 0&&(n[i]=a)}}var ma=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r+=1)OM(n,t[r]);return n},DB=Object.prototype.hasOwnProperty;function PM(n){if(Tt(n))return!0;if(xu(n))return!n.length;var t=NB(n);if(t==="Map"||t==="Set")return!n.size;if(MB(n))return!Object.keys(n).length;for(var e in n)if(DB.call(n,e))return!1;return!0}var Jn=function(n,t){if(n===t)return!0;if(!n||!t||fe(n)||fe(t))return!1;if(xu(n)||xu(t)){if(n.length!==t.length)return!1;for(var e=!0,r=0;r<n.length&&(e=Jn(n[r],t[r]),!!e);r++);return e}if(p1(n)||p1(t)){var i=Object.keys(n),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,r=0;r<i.length&&(e=Jn(n[i[r]],t[i[r]]),!!e);r++);return e}return!1};const lr=(function(n,t,e){for(var r=0,i=fe(t)?t.split("."):t;n&&r<i.length;)n=n[i[r++]];return n===void 0||r<i.length?e:n}),Xl=(function(n,t,e){var r=n,i=fe(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(An(r[a])||(r[a]=Xt(i[o+1])?[]:{}),r=r[a]):r[a]=e}),n});var LB=Object.prototype.hasOwnProperty;const wu=(function(n,t){if(n===null||!is(n))return{};var e={};return NM(t,function(r){LB.call(n,r)&&(e[r]=n[r])}),e}),RM=(function(n,t){return xB(n,function(e,r,i){return t.includes(i)||(e[i]=r),e},{})}),IB=(function(n,t,e){var r,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),r=null,o=n.apply(i,a),r||(i=a=null)},c=function(){var l=Date.now();!s&&e.leading===!1&&(s=l);var d=t-(l-s);return i=this,a=arguments,d<=0||d>t?(r&&(clearTimeout(r),r=null),s=l,o=n.apply(i,a),r||(i=a=null)):!r&&e.trailing!==!1&&(r=setTimeout(u,d)),o};return c.cancel=function(){clearTimeout(r),s=0,r=i=a=null},c}),rp=(function(){});var v1=function(n,t){return v1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},v1(n,t)};function Rr(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");v1(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ae=function(){return ae=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ae.apply(this,arguments)};function dr(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e}function di(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})}function DM(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lt(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var r=e.call(n),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(o)throw o.error}}return a}function Sn(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}function ip(n,t,e,r){if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)}var LM={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function jB(n,t,e){if(n[e].length>7){n[e].shift();for(var r=n[e],i=e;r.length;)t[e]="A",n.splice(i+=1,0,["C"].concat(r.splice(0,6)));n.splice(e,1)}}var pu={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function IM(n){return Array.isArray(n)&&n.every(function(t){var e=t[0].toLowerCase();return pu[e]===t.length-1&&"achlmqstvz".includes(e)})}function jM(n){return IM(n)&&n.every(function(t){var e=t[0];return e===e.toUpperCase()})}function BM(n){return jM(n)&&n.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function i2(n){for(var t=n.pathValue[n.segmentStart],e=t.toLowerCase(),r=n.data;r.length>=pu[e]&&(e==="m"&&r.length>2?(n.segments.push([t].concat(r.splice(0,2))),e="l",t=t==="m"?"l":"L"):n.segments.push([t].concat(r.splice(0,pu[e]))),!!pu[e]););}function BB(n){var t=n.index,e=n.pathValue,r=e.charCodeAt(t);if(r===48){n.param=0,n.index+=1;return}if(r===49){n.param=1,n.index+=1;return}n.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t)}function zB(n){return n>=48&&n<=57||n===43||n===45||n===46}function Lo(n){return n>=48&&n<=57}function FB(n){var t=n.max,e=n.pathValue,r=n.index,i=r,a=!1,o=!1,s=!1,u=!1,c;if(i>=t){n.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(c=e.charCodeAt(i),(c===43||c===45)&&(i+=1,c=e.charCodeAt(i)),!Lo(c)&&c!==46){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" is not a number');return}if(c!==46){if(a=c===48,i+=1,c=e.charCodeAt(i),a&&i<t&&c&&Lo(c)){n.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(e[r],'" illegal number');return}for(;i<t&&Lo(e.charCodeAt(i));)i+=1,o=!0;c=e.charCodeAt(i)}if(c===46){for(u=!0,i+=1;Lo(e.charCodeAt(i));)i+=1,s=!0;c=e.charCodeAt(i)}if(c===101||c===69){if(u&&!o&&!s){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid float exponent');return}if(i+=1,c=e.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&Lo(e.charCodeAt(i)))for(;i<t&&Lo(e.charCodeAt(i));)i+=1;else{n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid integer exponent');return}}n.index=i,n.param=+n.pathValue.slice(r,i)}function GB(n){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return n===10||n===13||n===8232||n===8233||n===32||n===9||n===11||n===12||n===160||n>=5760&&t.includes(n)}function _l(n){for(var t=n.pathValue,e=n.max;n.index<e&&GB(t.charCodeAt(n.index));)n.index+=1}function VB(n){switch(n|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function UB(n){return(n|32)===97}function WB(n){var t=n.max,e=n.pathValue,r=n.index,i=e.charCodeAt(r),a=pu[e[r].toLowerCase()];if(n.segmentStart=r,!VB(i)){n.err='[path-util]: Invalid path value "'.concat(e[r],'" is not a path command');return}if(n.index+=1,_l(n),n.data=[],!a){i2(n);return}for(;;){for(var o=a;o>0;o-=1){if(UB(i)&&(o===3||o===4)?BB(n):FB(n),n.err.length)return;n.data.push(n.param),_l(n),n.index<t&&e.charCodeAt(n.index)===44&&(n.index+=1,_l(n))}if(n.index>=n.max||!zB(e.charCodeAt(n.index)))break}i2(n)}var YB=(function(){function n(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return n})();function $B(n){if(IM(n))return[].concat(n);var t=new YB(n);for(_l(t);t.index<t.max&&!t.err.length;)WB(t);return t.err?t.err:t.segments}function HB(n){if(jM(n))return[].concat(n);var t=$B(n),e=0,r=0,i=0,a=0;return t.map(function(o){var s=o.slice(1).map(Number),u=o[0],c=u.toUpperCase();if(u==="M")return e=s[0],r=s[1],i=e,a=r,["M",e,r];var l;if(u!==c)switch(c){case"A":l=[c,s[0],s[1],s[2],s[3],s[4],s[5]+e,s[6]+r];break;case"V":l=[c,s[0]+r];break;case"H":l=[c,s[0]+e];break;default:{var d=s.map(function(g,m){return g+(m%2?r:e)});l=[c].concat(d)}}else l=[c].concat(s);var p=l.length;switch(c){case"Z":e=i,r=a;break;case"H":e=l[1];break;case"V":r=l[1];break;default:e=l[p-2],r=l[p-1],c==="M"&&(i=e,a=r)}return l})}function XB(n,t){var e=n[0],r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=n.slice(1).map(Number),u=n;if("TQ".includes(e)||(t.qx=null,t.qy=null),e==="H")u=["L",n[1],i];else if(e==="V")u=["L",r,n[1]];else if(e==="S"){var c=r*2-a,l=i*2-o;t.x1=c,t.y1=l,u=["C",c,l].concat(s)}else if(e==="T"){var d=r*2-t.qx,p=i*2-t.qy;t.qx=d,t.qy=p,u=["Q",d,p].concat(s)}else if(e==="Q"){var g=s[0],m=s[1];t.qx=g,t.qy=m}return u}function ql(n){if(BM(n))return[].concat(n);for(var t=HB(n),e=ae({},LM),r=0;r<t.length;r+=1){t[r]=XB(t[r],e);var i=t[r],a=i.length;e.x1=+i[a-2],e.y1=+i[a-1],e.x2=+i[a-4]||e.x1,e.y2=+i[a-3]||e.y1}return t}function qB(n){return BM(n)&&n.every(function(t){var e=t[0];return"MC".includes(e)})}function Vc(n,t,e){var r=n*Math.cos(e)-t*Math.sin(e),i=n*Math.sin(e)+t*Math.cos(e);return{x:r,y:i}}function pb(n,t,e,r,i,a,o,s,u,c){var l=n,d=t,p=e,g=r,m=s,y=u,v=Math.PI*120/180,x=Math.PI/180*(+i||0),E=[],w,S,k,A,N;if(c)S=c[0],k=c[1],A=c[2],N=c[3];else{w=Vc(l,d,-x),l=w.x,d=w.y,w=Vc(m,y,-x),m=w.x,y=w.y;var T=(l-m)/2,O=(d-y)/2,M=T*T/(p*p)+O*O/(g*g);M>1&&(M=Math.sqrt(M),p*=M,g*=M);var P=p*p,L=g*g,j=(a===o?-1:1)*Math.sqrt(Math.abs((P*L-P*O*O-L*T*T)/(P*O*O+L*T*T)));A=j*p*O/g+(l+m)/2,N=j*-g*T/p+(d+y)/2,S=Math.asin(((d-N)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),k=Math.asin(((y-N)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),S=l<A?Math.PI-S:S,k=m<A?Math.PI-k:k,S<0&&(S=Math.PI*2+S),k<0&&(k=Math.PI*2+k),o&&S>k&&(S-=Math.PI*2),!o&&k>S&&(k-=Math.PI*2)}var z=k-S;if(Math.abs(z)>v){var U=k,J=m,W=y;k=S+v*(o&&k>S?1:-1),m=A+p*Math.cos(k),y=N+g*Math.sin(k),E=pb(m,y,p,g,i,0,o,J,W,[k,U,A,N])}z=k-S;var at=Math.cos(S),ut=Math.sin(S),yt=Math.cos(k),kt=Math.sin(k),It=Math.tan(z/4),ee=4/3*p*It,$=4/3*g*It,Y=[l,d],F=[l+ee*ut,d-$*at],K=[m+ee*kt,y-$*yt],ot=[m,y];if(F[0]=2*Y[0]-F[0],F[1]=2*Y[1]-F[1],c)return F.concat(K,ot,E);E=F.concat(K,ot,E);for(var dt=[],mt=0,Ot=E.length;mt<Ot;mt+=1)dt[mt]=mt%2?Vc(E[mt-1],E[mt],x).y:Vc(E[mt],E[mt+1],x).x;return dt}function KB(n,t,e,r,i,a){var o=.3333333333333333,s=2/3;return[o*n+s*e,o*t+s*r,o*i+s*e,o*a+s*r,i,a]}function ra(n,t,e){var r=n[0],i=n[1],a=t[0],o=t[1];return[r+(a-r)*e,i+(o-i)*e]}var a2=function(n,t,e,r){var i=.5,a=ra([n,t],[e,r],i);return Sn(Sn([],a,!0),[e,r,e,r],!1)};function ZB(n,t){var e=n[0],r=n.slice(1).map(Number),i=r[0],a=r[1],o,s=t.x1,u=t.y1,c=t.x,l=t.y;switch("TQ".includes(e)||(t.qx=null,t.qy=null),e){case"M":return t.x=i,t.y=a,n;case"A":return o=[s,u].concat(r),["C"].concat(pb(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9]));case"Q":return t.qx=i,t.qy=a,o=[s,u].concat(r),["C"].concat(KB(o[0],o[1],o[2],o[3],o[4],o[5]));case"L":return["C"].concat(a2(s,u,i,a));case"Z":return s===c&&u===l?["C",s,u,c,l,c,l]:["C"].concat(a2(s,u,c,l))}return n}function m1(n,t){if(t===void 0&&(t=!1),qB(n)){var e=[].concat(n);return t?[e,[]]:e}for(var r=ql(n),i=ae({},LM),a=[],o="",s=r.length,u,c,l=[],d=0;d<s;d+=1){r[d]&&(o=r[d][0]),a[d]=o;var p=ZB(r[d],i);r[d]=p,jB(r,a,d),s=r.length,o==="Z"&&l.push(d),u=r[d],c=u.length,i.x1=+u[c-2],i.y1=+u[c-1],i.x2=+u[c-4]||i.x1,i.y2=+u[c-3]||i.y1}return t?[r,l]:r}function JB(n){return n.map(function(t){return Array.isArray(t)?[].concat(t):t})}function QB(n){var t=n.slice(1).map(function(e,r,i){return r?i[r-1].slice(-2).concat(e.slice(1)):n[0].slice(1).concat(e.slice(1))}).map(function(e){return e.map(function(r,i){return e[e.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(e){return["C"].concat(e.slice(2))}))}function Hn(n,t){return Math.sqrt((n[0]-t[0])*(n[0]-t[0])+(n[1]-t[1])*(n[1]-t[1]))}function y1(n,t,e,r,i){var a=Hn([n,t],[e,r]),o={x:0,y:0};if(typeof i=="number")if(i<=0)o={x:n,y:t};else if(i>=a)o={x:e,y:r};else{var s=ra([n,t],[e,r],i/a),u=s[0],c=s[1];o={x:u,y:c}}return{length:a,point:o,min:{x:Math.min(n,e),y:Math.min(t,r)},max:{x:Math.max(n,e),y:Math.max(t,r)}}}function o2(n,t){var e=n.x,r=n.y,i=t.x,a=t.y,o=e*i+r*a,s=Math.sqrt((Math.pow(e,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),u=e*a-r*i<0?-1:1,c=u*Math.acos(o/s);return c}function tz(n,t,e,r,i,a,o,s,u,c){var l=Math.abs,d=Math.sin,p=Math.cos,g=Math.sqrt,m=Math.PI,y=l(e),v=l(r),x=(i%360+360)%360,E=x*(m/180);if(n===s&&t===u)return{x:n,y:t};if(y===0||v===0)return y1(n,t,s,u,c).point;var w=(n-s)/2,S=(t-u)/2,k={x:p(E)*w+d(E)*S,y:-d(E)*w+p(E)*S},A=Math.pow(k.x,2)/Math.pow(y,2)+Math.pow(k.y,2)/Math.pow(v,2);A>1&&(y*=g(A),v*=g(A));var N=Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(k.y,2)-Math.pow(v,2)*Math.pow(k.x,2),T=Math.pow(y,2)*Math.pow(k.y,2)+Math.pow(v,2)*Math.pow(k.x,2),O=N/T;O=O<0?0:O;var M=(a!==o?1:-1)*g(O),P={x:M*(y*k.y/v),y:M*(-(v*k.x)/y)},L={x:p(E)*P.x-d(E)*P.y+(n+s)/2,y:d(E)*P.x+p(E)*P.y+(t+u)/2},j={x:(k.x-P.x)/y,y:(k.y-P.y)/v},z=o2({x:1,y:0},j),U={x:(-k.x-P.x)/y,y:(-k.y-P.y)/v},J=o2(j,U);!o&&J>0?J-=2*m:o&&J<0&&(J+=2*m),J%=2*m;var W=z+J*c,at=y*p(W),ut=v*d(W),yt={x:p(E)*at-d(E)*ut+L.x,y:d(E)*at+p(E)*ut+L.y};return yt}function ez(n,t,e,r,i,a,o,s,u,c,l){var d,p=l.bbox,g=p===void 0?!0:p,m=l.length,y=m===void 0?!0:m,v=l.sampleSize,x=v===void 0?30:v,E=typeof c=="number",w=n,S=t,k=0,A=[w,S,k],N=[w,S],T=0,O={x:0,y:0},M=[{x:w,y:S}];E&&c<=0&&(O={x:w,y:S});for(var P=0;P<=x;P+=1){if(T=P/x,d=tz(n,t,e,r,i,a,o,s,u,T),w=d.x,S=d.y,g&&M.push({x:w,y:S}),y&&(k+=Hn(N,[w,S])),N=[w,S],E&&k>=c&&c>A[2]){var L=(k-c)/(k-A[2]);O={x:N[0]*(1-L)+A[0]*L,y:N[1]*(1-L)+A[1]*L}}A=[w,S,k]}return E&&c>=k&&(O={x:s,y:u}),{length:k,point:O,min:{x:Math.min.apply(null,M.map(function(j){return j.x})),y:Math.min.apply(null,M.map(function(j){return j.y}))},max:{x:Math.max.apply(null,M.map(function(j){return j.x})),y:Math.max.apply(null,M.map(function(j){return j.y}))}}}function nz(n,t,e,r,i,a,o,s,u){var c=1-u;return{x:Math.pow(c,3)*n+3*Math.pow(c,2)*u*e+3*c*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(c,3)*t+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*a+Math.pow(u,3)*s}}function zM(n,t,e,r,i,a,o,s,u,c){var l,d=c.bbox,p=d===void 0?!0:d,g=c.length,m=g===void 0?!0:g,y=c.sampleSize,v=y===void 0?10:y,x=typeof u=="number",E=n,w=t,S=0,k=[E,w,S],A=[E,w],N=0,T={x:0,y:0},O=[{x:E,y:w}];x&&u<=0&&(T={x:E,y:w});for(var M=0;M<=v;M+=1){if(N=M/v,l=nz(n,t,e,r,i,a,o,s,N),E=l.x,w=l.y,p&&O.push({x:E,y:w}),m&&(S+=Hn(A,[E,w])),A=[E,w],x&&S>=u&&u>k[2]){var P=(S-u)/(S-k[2]);T={x:A[0]*(1-P)+k[0]*P,y:A[1]*(1-P)+k[1]*P}}k=[E,w,S]}return x&&u>=S&&(T={x:o,y:s}),{length:S,point:T,min:{x:Math.min.apply(null,O.map(function(L){return L.x})),y:Math.min.apply(null,O.map(function(L){return L.y}))},max:{x:Math.max.apply(null,O.map(function(L){return L.x})),y:Math.max.apply(null,O.map(function(L){return L.y}))}}}function rz(n,t,e,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*n+2*s*o*e+Math.pow(o,2)*i,y:Math.pow(s,2)*t+2*s*o*r+Math.pow(o,2)*a}}function iz(n,t,e,r,i,a,o,s){var u,c=s.bbox,l=c===void 0?!0:c,d=s.length,p=d===void 0?!0:d,g=s.sampleSize,m=g===void 0?10:g,y=typeof o=="number",v=n,x=t,E=0,w=[v,x,E],S=[v,x],k=0,A={x:0,y:0},N=[{x:v,y:x}];y&&o<=0&&(A={x:v,y:x});for(var T=0;T<=m;T+=1){if(k=T/m,u=rz(n,t,e,r,i,a,k),v=u.x,x=u.y,l&&N.push({x:v,y:x}),p&&(E+=Hn(S,[v,x])),S=[v,x],y&&E>=o&&o>w[2]){var O=(E-o)/(E-w[2]);A={x:S[0]*(1-O)+w[0]*O,y:S[1]*(1-O)+w[1]*O}}w=[v,x,E]}return y&&o>=E&&(A={x:i,y:a}),{length:E,point:A,min:{x:Math.min.apply(null,N.map(function(M){return M.x})),y:Math.min.apply(null,N.map(function(M){return M.y}))},max:{x:Math.max.apply(null,N.map(function(M){return M.x})),y:Math.max.apply(null,N.map(function(M){return M.y}))}}}function FM(n,t,e){for(var r,i,a,o,s,u,c=ql(n),l=typeof t=="number",d,p=[],g,m=0,y=0,v=0,x=0,E,w=[],S=[],k=0,A={x:0,y:0},N=A,T=A,O=A,M=0,P=0,L=c.length;P<L;P+=1)E=c[P],g=E[0],d=g==="M",p=d?p:[m,y].concat(E.slice(1)),d?(v=E[1],x=E[2],A={x:v,y:x},N=A,k=0,l&&t<.001&&(O=A)):g==="L"?(r=y1(p[0],p[1],p[2],p[3],(t||0)-M),k=r.length,A=r.min,N=r.max,T=r.point):g==="A"?(i=ez(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(t||0)-M,e||{}),k=i.length,A=i.min,N=i.max,T=i.point):g==="C"?(a=zM(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(t||0)-M,e||{}),k=a.length,A=a.min,N=a.max,T=a.point):g==="Q"?(o=iz(p[0],p[1],p[2],p[3],p[4],p[5],(t||0)-M,e||{}),k=o.length,A=o.min,N=o.max,T=o.point):g==="Z"&&(p=[m,y,v,x],s=y1(p[0],p[1],p[2],p[3],(t||0)-M),k=s.length,A=s.min,N=s.max,T=s.point),l&&M<t&&M+k>=t&&(O=T),S.push(N),w.push(A),M+=k,u=g!=="Z"?E.slice(-2):[v,x],m=u[0],y=u[1];return l&&t>=M&&(O={x:m,y}),{length:M,point:O,min:{x:Math.min.apply(null,w.map(function(j){return j.x})),y:Math.min.apply(null,w.map(function(j){return j.y}))},max:{x:Math.max.apply(null,S.map(function(j){return j.x})),y:Math.max.apply(null,S.map(function(j){return j.y}))}}}function az(n,t){return FM(n,void 0,ae(ae({},t),{bbox:!1,length:!0})).length}function oz(n){var t=n.length,e=t-1;return n.map(function(r,i){return n.map(function(a,o){var s=i+o,u;return o===0||n[s]&&n[s][0]==="M"?(u=n[s],["M"].concat(u.slice(-2))):(s>=t&&(s-=e),n[s])})})}function sz(n,t){var e=n.length-1,r=[],i=0,a=0,o=oz(n);return o.forEach(function(s,u){n.slice(1).forEach(function(c,l){a+=Hn(n[(u+l)%e].slice(-2),t[l%e].slice(-2))}),r[u]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}function uz(n,t,e,r,i,a,o,s){return 3*((s-t)*(e+i)-(o-n)*(r+a)+r*(n-i)-e*(t-a)+s*(i+n/3)-o*(a+t/3))/20}function cz(n){var t=0,e=0,r=0;return m1(n).map(function(i){var a;switch(i[0]){case"M":return t=i[1],e=i[2],0;default:var o=i.slice(1),s=o[0],u=o[1],c=o[2],l=o[3],d=o[4],p=o[5];return r=uz(t,e,s,u,c,l,d,p),a=i.slice(-2),t=a[0],e=a[1],r}}).reduce(function(i,a){return i+a},0)}function s2(n){return cz(n)>=0}function lz(n,t,e){return FM(n,t,ae(ae({},e),{bbox:!1,length:!0})).point}var hz=50;function dz(n,t){t===void 0&&(t=.5);var e=n.slice(0,2),r=n.slice(2,4),i=n.slice(4,6),a=n.slice(6,8),o=ra(e,r,t),s=ra(r,i,t),u=ra(i,a,t),c=ra(o,s,t),l=ra(s,u,t),d=ra(c,l,t);return[["C"].concat(o,c,d),["C"].concat(l,u,a)]}function u2(n){return n.map(function(t,e,r){var i=e&&r[e-1].slice(-2).concat(t.slice(1)),a=e?zM(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,o;return e?o=a?dz(i):[t,t]:o=[t],{s:t,ss:o,l:a}})}function GM(n,t,e,r){if(r===void 0&&(r=0),r>hz)return console.warn("Maximum recursion depth reached in equalizeSegments"),[n,t];var i=u2(n),a=u2(t),o=i.length,s=a.length,u=i.filter(function(x){return x.l}).length,c=a.filter(function(x){return x.l}).length,l=i.filter(function(x){return x.l}).reduce(function(x,E){var w=E.l;return x+w},0)/u||0,d=a.filter(function(x){return x.l}).reduce(function(x,E){var w=E.l;return x+w},0)/c||0,p=e||Math.max(o,s),g=[l,d],m=[p-o,p-s],y=0,v=[i,a].map(function(x,E){return x.l===p?x.map(function(w){return w.s}):x.map(function(w,S){return y=S&&m[E]&&w.l>=g[E],m[E]-=y?1:0,y?w.ss:[w.s]}).flat()});return v[0].length===v[1].length?v:GM(v[0],v[1],p,r+1)}function b1(n){var t=document.createElement("div");t.innerHTML=n;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function fz(n,t){for(;!{}.hasOwnProperty.call(n,t)&&(n=es(n))!==null;);return n}function x1(){return x1=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(n,t,e){var r=fz(n,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?n:e):i.value}},x1.apply(null,arguments)}function c2(n,t,e,r){var i=x1(es(n.prototype),t,e);return typeof i=="function"?function(a){return i.apply(e,a)}:i}/*!
12
+ * @antv/g-math
13
+ * @description Geometry util
14
+ * @version 3.0.1
15
+ * @date 5/9/2025, 8:18:51 AM
16
+ * @author AntVis
17
+ * @docs https://g.antv.antgroup.com/
18
+ */function Ii(n,t,e,r){var i=n-e,a=t-r;return Math.sqrt(i*i+a*a)}function VM(n,t){var e=Math.min.apply(Math,Ht(n)),r=Math.min.apply(Math,Ht(t)),i=Math.max.apply(Math,Ht(n)),a=Math.max.apply(Math,Ht(t));return{x:e,y:r,width:i-e,height:a-r}}function pz(n,t,e){return Math.atan(-t/n*Math.tan(e))}function gz(n,t,e){return Math.atan(t/(n*Math.tan(e)))}function vz(n,t,e,r,i,a){return e*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+n}function mz(n,t,e,r,i,a){return e*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+t}function yz(n,t,e,r,i,a,o){for(var s=pz(e,r,i),u=1/0,c=-1/0,l=[a,o],d=-Math.PI*2;d<=Math.PI*2;d+=Math.PI){var p=s+d;a<o?a<p&&p<o&&l.push(p):o<p&&p<a&&l.push(p)}for(var g=0;g<l.length;g++){var m=vz(n,t,e,r,i,l[g]);m<u&&(u=m),m>c&&(c=m)}for(var y=gz(e,r,i),v=1/0,x=-1/0,E=[a,o],w=-Math.PI*2;w<=Math.PI*2;w+=Math.PI){var S=y+w;a<o?a<S&&S<o&&E.push(S):o<S&&S<a&&E.push(S)}for(var k=0;k<E.length;k++){var A=mz(n,t,e,r,i,E[k]);A<v&&(v=A),A>x&&(x=A)}return{x:u,y:v,width:c-u,height:x-v}}var bz=1e-4;function UM(n,t,e,r,i,a){var o=-1,s=1/0,u=[e,r],c=20;a&&a>200&&(c=a/10);for(var l=1/c,d=l/10,p=0;p<=c;p++){var g=p*l,m=[i.apply(void 0,Ht(n.concat([g]))),i.apply(void 0,Ht(t.concat([g])))],y=Ii(u[0],u[1],m[0],m[1]);y<s&&(o=g,s=y)}if(o===0)return{x:n[0],y:t[0]};if(o===1){var v=n.length;return{x:n[v-1],y:t[v-1]}}s=1/0;for(var x=0;x<32&&!(d<bz);x++){var E=o-d,w=o+d,S=[i.apply(void 0,Ht(n.concat([E]))),i.apply(void 0,Ht(t.concat([E])))],k=Ii(u[0],u[1],S[0],S[1]);if(E>=0&&k<s)o=E,s=k;else{var A=[i.apply(void 0,Ht(n.concat([w]))),i.apply(void 0,Ht(t.concat([w])))],N=Ii(u[0],u[1],A[0],A[1]);w<=1&&N<s?(o=w,s=N):d*=.5}}return{x:i.apply(void 0,Ht(n.concat([o]))),y:i.apply(void 0,Ht(t.concat([o])))}}function WM(n,t,e,r){return Ii(n,t,e,r)}function YM(n,t,e,r,i){return{x:(1-i)*n+i*e,y:(1-i)*t+i*r}}function xz(n,t,e,r,i,a){var o=[e-n,r-t];if(pB(o,[0,0]))return Math.sqrt((i-n)*(i-n)+(a-t)*(a-t));var s=[-o[1],o[0]];dB(s,s);var u=[i-n,a-t];return Math.abs(fB(u,s))}function E1(n,t,e,r,i){var a=1-i;return a*a*a*n+3*t*i*a*a+3*e*i*i*a+r*i*i*i}function l2(n,t,e,r){var i=-3*n+9*t-9*e+3*r,a=6*n-12*t+6*e,o=3*t-3*n,s=[],u,c,l;if(fu(i,0))fu(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var d=a*a-4*i*o;fu(d,0)?s.push(-a/(2*i)):d>0&&(l=Math.sqrt(d),u=(-a+l)/(2*i),c=(-a-l)/(2*i),u>=0&&u<=1&&s.push(u),c>=0&&c<=1&&s.push(c))}return s}function Ez(n,t,e,r,i,a,o,s){for(var u=[n,o],c=[t,s],l=l2(n,e,i,o),d=l2(t,r,a,s),p=0;p<l.length;p++)u.push(E1(n,e,i,o,l[p]));for(var g=0;g<d.length;g++)c.push(E1(t,r,a,s,d[g]));return VM(u,c)}function wz(n,t,e,r,i,a,o,s,u,c,l){return UM([n,e,i,o],[t,r,a,s],u,c,E1,l)}function h2(n,t,e,r,i,a,o,s,u,c,l){var d=wz(n,t,e,r,i,a,o,s,u,c,l);return Ii(d.x,d.y,u,c)}function kz(n){if(n.length<2)return 0;for(var t=0,e=0;e<n.length-1;e++){var r=n[e],i=n[e+1];t+=Ii(r[0],r[1],i[0],i[1])}return t}function Az(n){return kz(n)}function w1(n,t,e,r){var i=1-r;return i*i*n+2*r*i*t+r*r*e}function d2(n,t,e){var r=n+e-2*t;if(fu(r,0))return[.5];var i=(n-t)/r;return i<=1&&i>=0?[i]:[]}function Sz(n,t,e,r,i,a){var o=d2(n,e,i)[0],s=d2(t,r,a)[0],u=[n,i],c=[t,a];return o!==void 0&&u.push(w1(n,e,i,o)),s!==void 0&&c.push(w1(t,r,a,s)),VM(u,c)}function Cz(n,t,e,r,i,a,o,s){return UM([n,e,i],[t,r,a],o,s,w1)}function Nz(n,t,e,r,i,a,o,s){var u=Cz(n,t,e,r,i,a,o,s);return Ii(u.x,u.y,o,s)}function $M(n,t){this.v=n,this.k=t}function wn(n,t,e,r){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}wn=function(a,o,s,u){function c(l,d){wn(a,l,function(p){return this._invoke(l,d,p)})}o?i?i(a,o,{value:s,enumerable:!u,configurable:!u,writable:!u}):a[o]=s:(c("next",0),c("throw",1),c("return",2))},wn(n,t,e,r)}function gb(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var n,t,e=typeof Symbol=="function"?Symbol:{},r=e.iterator||"@@iterator",i=e.toStringTag||"@@toStringTag";function a(g,m,y,v){var x=m&&m.prototype instanceof s?m:s,E=Object.create(x.prototype);return wn(E,"_invoke",(function(w,S,k){var A,N,T,O=0,M=k||[],P=!1,L={p:0,n:0,v:n,a:j,f:j.bind(n,4),d:function(z,U){return A=z,N=0,T=n,L.n=U,o}};function j(z,U){for(N=z,T=U,t=0;!P&&O&&!J&&t<M.length;t++){var J,W=M[t],at=L.p,ut=W[2];z>3?(J=ut===U)&&(T=W[(N=W[4])?5:(N=3,3)],W[4]=W[5]=n):W[0]<=at&&((J=z<2&&at<W[1])?(N=0,L.v=U,L.n=W[1]):at<ut&&(J=z<3||W[0]>U||U>ut)&&(W[4]=z,W[5]=U,L.n=ut,N=0))}if(J||z>1)return o;throw P=!0,U}return function(z,U,J){if(O>1)throw TypeError("Generator is already running");for(P&&U===1&&j(U,J),N=U,T=J;(t=N<2?n:T)||!P;){A||(N?N<3?(N>1&&(L.n=-1),j(N,T)):L.n=T:L.v=T);try{if(O=2,A){if(N||(z="next"),t=A[z]){if(!(t=t.call(A,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,N<2&&(N=0)}else N===1&&(t=A.return)&&t.call(A),N<2&&(T=TypeError("The iterator does not provide a '"+z+"' method"),N=1);A=n}else if((t=(P=L.n<0)?T:w.call(S,L))!==o)break}catch(W){A=n,N=1,T=W}finally{O=1}}return{value:t,done:P}}})(g,y,v),!0),E}var o={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(wn(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(l);function p(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,c):(g.__proto__=c,wn(g,i,"GeneratorFunction")),g.prototype=Object.create(d),g}return u.prototype=c,wn(d,"constructor",c),wn(c,"constructor",u),u.displayName="GeneratorFunction",wn(c,i,"GeneratorFunction"),wn(d),wn(d,i,"Generator"),wn(d,r,function(){return this}),wn(d,"toString",function(){return"[object Generator]"}),(gb=function(){return{w:a,m:p}})()}function Kl(n,t){function e(i,a,o,s){try{var u=n[i](a),c=u.value;return c instanceof $M?t.resolve(c.v).then(function(l){e("next",l,o,s)},function(l){e("throw",l,o,s)}):t.resolve(c).then(function(l){u.value=l,o(u)},function(l){return e("throw",l,o,s)})}catch(l){s(l)}}var r;this.next||(wn(Kl.prototype),wn(Kl.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),wn(this,"_invoke",function(i,a,o){function s(){return new t(function(u,c){e(i,o,u,c)})}return r=r?r.then(s,s):s()},!0)}function HM(n,t,e,r,i){return new Kl(gb().w(n,t,e,r),i||Promise)}function Tz(n,t,e,r,i){var a=HM(n,t,e,r,i);return a.next().then(function(o){return o.done?o.value:a.next()})}function Mz(n){var t=Object(n),e=[];for(var r in t)e.unshift(r);return function i(){for(;e.length;)if((r=e.pop())in t)return i.value=r,i.done=!1,i;return i.done=!0,i}}function f2(n){if(n!=null){var t=n[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],e=0;if(t)return t.call(n);if(typeof n.next=="function")return n;if(!isNaN(n.length))return{next:function(){return n&&e>=n.length&&(n=void 0),{value:n&&n[e++],done:!n}}}}throw new TypeError(ro(n)+" is not iterable")}function fn(){var n=gb(),t=n.m(fn),e=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function r(o){var s=typeof o=="function"&&o.constructor;return!!s&&(s===e||(s.displayName||s.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function a(o){var s,u;return function(c){s||(s={stop:function(){return u(c.a,2)},catch:function(){return c.v},abrupt:function(l,d){return u(c.a,i[l],d)},delegateYield:function(l,d,p){return s.resultName=d,u(c.d,f2(l),p)},finish:function(l){return u(c.f,l)}},u=function(l,d,p){c.p=s.prev,c.n=s.next;try{return l(d,p)}finally{s.next=c.n}}),s.resultName&&(s[s.resultName]=c.v,s.resultName=void 0),s.sent=c.v,s.next=c.n;try{return o.call(this,s)}finally{c.p=s.prev,c.n=s.next}}}return(fn=function(){return{wrap:function(o,s,u,c){return n.w(a(o),s,u,c&&c.reverse())},isGeneratorFunction:r,mark:n.m,awrap:function(o,s){return new $M(o,s)},AsyncIterator:Kl,async:function(o,s,u,c,l){return(r(s)?HM:Tz)(a(o),s,u,c,l)},keys:Mz,values:f2}})()}function p2(n,t,e,r,i,a,o){try{var s=n[a](o),u=s.value}catch(c){return void e(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function ya(n){return function(){var t=this,e=arguments;return new Promise(function(r,i){var a=n.apply(t,e);function o(u){p2(a,r,i,o,s,"next",u)}function s(u){p2(a,r,i,o,s,"throw",u)}o(void 0)})}}function Wa(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=hb(n))||t){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){e=e.call(n)},n:function(){var u=e.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{o||e.return==null||e.return()}finally{if(s)throw a}}}}function _z(n,t){if(n==null)return{};var e={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(t.indexOf(r)!==-1)continue;e[r]=n[r]}return e}function lo(n,t){if(n==null)return{};var e,r,i=_z(n,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)e=a[r],t.indexOf(e)===-1&&{}.propertyIsEnumerable.call(n,e)&&(i[e]=n[e])}return i}/*!
20
+ * @antv/g-lite
21
+ * @description A core module for rendering engine implements DOM API.
22
+ * @version 2.3.2
23
+ * @date 7/30/2025, 1:34:19 PM
24
+ * @author AntVis
25
+ * @docs https://g.antv.antgroup.com/
26
+ */var Oz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},XM={exports:{}};(function(n,t){(function(e,r){n.exports=r()})(Oz,function(){function e(k,A,N,T,O){r(k,A,N||0,T||k.length-1,O||a)}function r(k,A,N,T,O){for(;T>N;){if(T-N>600){var M=T-N+1,P=A-N+1,L=Math.log(M),j=.5*Math.exp(2*L/3),z=.5*Math.sqrt(L*j*(M-j)/M)*(P-M/2<0?-1:1),U=Math.max(N,Math.floor(A-P*j/M+z)),J=Math.min(T,Math.floor(A+(M-P)*j/M+z));r(k,A,U,J,O)}var W=k[A],at=N,ut=T;for(i(k,N,A),O(k[T],W)>0&&i(k,N,T);at<ut;){for(i(k,at,ut),at++,ut--;O(k[at],W)<0;)at++;for(;O(k[ut],W)>0;)ut--}O(k[N],W)===0?i(k,N,ut):(ut++,i(k,ut,T)),ut<=A&&(N=ut+1),A<=ut&&(T=ut-1)}}function i(k,A,N){var T=k[A];k[A]=k[N],k[N]=T}function a(k,A){return k<A?-1:k>A?1:0}var o=function(k){k===void 0&&(k=9),this._maxEntries=Math.max(4,k),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(k){var A=this.data,N=[];if(!E(k,A))return N;for(var T=this.toBBox,O=[];A;){for(var M=0;M<A.children.length;M++){var P=A.children[M],L=A.leaf?T(P):P;E(k,L)&&(A.leaf?N.push(P):x(k,L)?this._all(P,N):O.push(P))}A=O.pop()}return N},o.prototype.collides=function(k){var A=this.data;if(!E(k,A))return!1;for(var N=[];A;){for(var T=0;T<A.children.length;T++){var O=A.children[T],M=A.leaf?this.toBBox(O):O;if(E(k,M)){if(A.leaf||x(k,M))return!0;N.push(O)}}A=N.pop()}return!1},o.prototype.load=function(k){if(!(k&&k.length))return this;if(k.length<this._minEntries){for(var A=0;A<k.length;A++)this.insert(k[A]);return this}var N=this._build(k.slice(),0,k.length-1,0);if(!this.data.children.length)this.data=N;else if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var T=this.data;this.data=N,N=T}this._insert(N,this.data.height-N.height-1,!0)}return this},o.prototype.insert=function(k){return k&&this._insert(k,this.data.height-1),this},o.prototype.clear=function(){return this.data=w([]),this},o.prototype.remove=function(k,A){if(!k)return this;for(var N=this.data,T=this.toBBox(k),O=[],M=[],P,L,j;N||O.length;){if(N||(N=O.pop(),L=O[O.length-1],P=M.pop(),j=!0),N.leaf){var z=s(k,N.children,A);if(z!==-1)return N.children.splice(z,1),O.push(N),this._condense(O),this}!j&&!N.leaf&&x(N,T)?(O.push(N),M.push(P),P=0,L=N,N=N.children[0]):L?(P++,N=L.children[P],j=!1):N=null}return this},o.prototype.toBBox=function(k){return k},o.prototype.compareMinX=function(k,A){return k.minX-A.minX},o.prototype.compareMinY=function(k,A){return k.minY-A.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(k){return this.data=k,this},o.prototype._all=function(k,A){for(var N=[];k;)k.leaf?A.push.apply(A,k.children):N.push.apply(N,k.children),k=N.pop();return A},o.prototype._build=function(k,A,N,T){var O=N-A+1,M=this._maxEntries,P;if(O<=M)return P=w(k.slice(A,N+1)),u(P,this.toBBox),P;T||(T=Math.ceil(Math.log(O)/Math.log(M)),M=Math.ceil(O/Math.pow(M,T-1))),P=w([]),P.leaf=!1,P.height=T;var L=Math.ceil(O/M),j=L*Math.ceil(Math.sqrt(M));S(k,A,N,j,this.compareMinX);for(var z=A;z<=N;z+=j){var U=Math.min(z+j-1,N);S(k,z,U,L,this.compareMinY);for(var J=z;J<=U;J+=L){var W=Math.min(J+L-1,U);P.children.push(this._build(k,J,W,T-1))}}return u(P,this.toBBox),P},o.prototype._chooseSubtree=function(k,A,N,T){for(;T.push(A),!(A.leaf||T.length-1===N);){for(var O=1/0,M=1/0,P=void 0,L=0;L<A.children.length;L++){var j=A.children[L],z=g(j),U=y(k,j)-z;U<M?(M=U,O=z<O?z:O,P=j):U===M&&z<O&&(O=z,P=j)}A=P||A.children[0]}return A},o.prototype._insert=function(k,A,N){var T=N?k:this.toBBox(k),O=[],M=this._chooseSubtree(T,this.data,A,O);for(M.children.push(k),l(M,T);A>=0&&O[A].children.length>this._maxEntries;)this._split(O,A),A--;this._adjustParentBBoxes(T,O,A)},o.prototype._split=function(k,A){var N=k[A],T=N.children.length,O=this._minEntries;this._chooseSplitAxis(N,O,T);var M=this._chooseSplitIndex(N,O,T),P=w(N.children.splice(M,N.children.length-M));P.height=N.height,P.leaf=N.leaf,u(N,this.toBBox),u(P,this.toBBox),A?k[A-1].children.push(P):this._splitRoot(N,P)},o.prototype._splitRoot=function(k,A){this.data=w([k,A]),this.data.height=k.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(k,A,N){for(var T,O=1/0,M=1/0,P=A;P<=N-A;P++){var L=c(k,0,P,this.toBBox),j=c(k,P,N,this.toBBox),z=v(L,j),U=g(L)+g(j);z<O?(O=z,T=P,M=U<M?U:M):z===O&&U<M&&(M=U,T=P)}return T||N-A},o.prototype._chooseSplitAxis=function(k,A,N){var T=k.leaf?this.compareMinX:d,O=k.leaf?this.compareMinY:p,M=this._allDistMargin(k,A,N,T),P=this._allDistMargin(k,A,N,O);M<P&&k.children.sort(T)},o.prototype._allDistMargin=function(k,A,N,T){k.children.sort(T);for(var O=this.toBBox,M=c(k,0,A,O),P=c(k,N-A,N,O),L=m(M)+m(P),j=A;j<N-A;j++){var z=k.children[j];l(M,k.leaf?O(z):z),L+=m(M)}for(var U=N-A-1;U>=A;U--){var J=k.children[U];l(P,k.leaf?O(J):J),L+=m(P)}return L},o.prototype._adjustParentBBoxes=function(k,A,N){for(var T=N;T>=0;T--)l(A[T],k)},o.prototype._condense=function(k){for(var A=k.length-1,N=void 0;A>=0;A--)k[A].children.length===0?A>0?(N=k[A-1].children,N.splice(N.indexOf(k[A]),1)):this.clear():u(k[A],this.toBBox)};function s(k,A,N){if(!N)return A.indexOf(k);for(var T=0;T<A.length;T++)if(N(k,A[T]))return T;return-1}function u(k,A){c(k,0,k.children.length,A,k)}function c(k,A,N,T,O){O||(O=w(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var M=A;M<N;M++){var P=k.children[M];l(O,k.leaf?T(P):P)}return O}function l(k,A){return k.minX=Math.min(k.minX,A.minX),k.minY=Math.min(k.minY,A.minY),k.maxX=Math.max(k.maxX,A.maxX),k.maxY=Math.max(k.maxY,A.maxY),k}function d(k,A){return k.minX-A.minX}function p(k,A){return k.minY-A.minY}function g(k){return(k.maxX-k.minX)*(k.maxY-k.minY)}function m(k){return k.maxX-k.minX+(k.maxY-k.minY)}function y(k,A){return(Math.max(A.maxX,k.maxX)-Math.min(A.minX,k.minX))*(Math.max(A.maxY,k.maxY)-Math.min(A.minY,k.minY))}function v(k,A){var N=Math.max(k.minX,A.minX),T=Math.max(k.minY,A.minY),O=Math.min(k.maxX,A.maxX),M=Math.min(k.maxY,A.maxY);return Math.max(0,O-N)*Math.max(0,M-T)}function x(k,A){return k.minX<=A.minX&&k.minY<=A.minY&&A.maxX<=k.maxX&&A.maxY<=k.maxY}function E(k,A){return A.minX<=k.maxX&&A.minY<=k.maxY&&A.maxX>=k.minX&&A.maxY>=k.minY}function w(k){return{children:k,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(k,A,N,T,O){for(var M=[A,N];M.length;)if(N=M.pop(),A=M.pop(),!(N-A<=T)){var P=A+Math.ceil((N-A)/T/2)*T;e(k,P,A,N,O),M.push(A,P,P,N)}}return o})})(XM);var Pz=XM.exports,X=(function(n){return n.GROUP="g",n.FRAGMENT="fragment",n.CIRCLE="circle",n.ELLIPSE="ellipse",n.IMAGE="image",n.RECT="rect",n.LINE="line",n.POLYLINE="polyline",n.POLYGON="polygon",n.TEXT="text",n.PATH="path",n.HTML="html",n.MESH="mesh",n})({}),Ol=(function(n){return n[n.ZERO=0]="ZERO",n[n.NEGATIVE_ONE=1]="NEGATIVE_ONE",n})({}),wa=(function(){function n(){et(this,n),this.plugins=[]}return nt(n,[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var r=t.context.renderingPlugins.indexOf(e);r>=0&&t.context.renderingPlugins.splice(r,1)})}}])})(),Rz=(function(){function n(t){et(this,n),this.clipSpaceNearZ=Ol.NEGATIVE_ONE,this.plugins=[],this.config=Lt({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)}return nt(n,[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex(function(r){return r===t});e===-1&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(r){return r===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])})(),ap=da,Io=ui,Dz=tB,Lz=Qj,g2=Yl,op=iB,ye=(function(){function n(){et(this,n),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return nt(n,[{key:"update",value:function(t,e){Io(this.center,t),Io(this.halfExtents,e),op(this.min,this.center,this.halfExtents),ap(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){ap(this.center,e,t),g2(this.center,this.center,.5),op(this.halfExtents,e,t),g2(this.halfExtents,this.halfExtents,.5),Io(this.min,t),Io(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!n.isEmpty(t)){if(n.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var e=this.center,r=e[0],i=e[1],a=e[2],o=this.halfExtents,s=o[0],u=o[1],c=o[2],l=r-s,d=r+s,p=i-u,g=i+u,m=a-c,y=a+c,v=t.center,x=v[0],E=v[1],w=v[2],S=t.halfExtents,k=S[0],A=S[1],N=S[2],T=x-k,O=x+k,M=E-A,P=E+A,L=w-N,j=w+N;T<l&&(l=T),O>d&&(d=O),M<p&&(p=M),P>g&&(g=P),L<m&&(m=L),j>y&&(y=j),e[0]=(l+d)*.5,e[1]=(p+g)*.5,e[2]=(m+y)*.5,o[0]=(d-l)*.5,o[1]=(g-p)*.5,o[2]=(y-m)*.5,this.min[0]=l,this.min[1]=p,this.min[2]=m,this.max[0]=d,this.max[1]=g,this.max[2]=y}}},{key:"setFromTransformedAABB",value:function(t,e){var r=this.center,i=this.halfExtents,a=t.center,o=t.halfExtents,s=e[0],u=e[4],c=e[8],l=e[1],d=e[5],p=e[9],g=e[2],m=e[6],y=e[10],v=Math.abs(s),x=Math.abs(u),E=Math.abs(c),w=Math.abs(l),S=Math.abs(d),k=Math.abs(p),A=Math.abs(g),N=Math.abs(m),T=Math.abs(y);r[0]=e[12]+s*a[0]+u*a[1]+c*a[2],r[1]=e[13]+l*a[0]+d*a[1]+p*a[2],r[2]=e[14]+g*a[0]+m*a[1]+y*a[2],i[0]=v*o[0]+x*o[1]+E*o[2],i[1]=w*o[0]+S*o[1]+k*o[2],i[2]=A*o[0]+N*o[1]+T*o[2],op(this.min,r,i),ap(this.max,r,i)}},{key:"intersects",value:function(t){var e=this.getMax(),r=this.getMin(),i=t.getMax(),a=t.getMin();return r[0]<=i[0]&&e[0]>=a[0]&&r[1]<=i[1]&&e[1]>=a[1]&&r[2]<=i[2]&&e[2]>=a[2]}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var e=new n,r=Dz([0,0,0],this.getMin(),t.getMin()),i=Lz([0,0,0],this.getMax(),t.getMax());return e.setMinMax(r,i),e}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?Io([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?Io([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0}}])})(),Iz=(function(){function n(t,e){et(this,n),this.distance=t||0,this.normal=e||Ee(0,1,0),this.updatePNVertexFlag()}return nt(n,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ci(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/SM(this.normal);Yl(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,r){var i=this.distanceToPoint(t),a=this.distanceToPoint(e),o=i/(i-a),s=o>=0&&o<=1;return s&&r&&f1(r,t,e,o),s}}])})(),jo=(function(n){return n[n.OUTSIDE=4294967295]="OUTSIDE",n[n.INSIDE=0]="INSIDE",n[n.INDETERMINATE=2147483647]="INDETERMINATE",n})({}),jz=(function(){function n(t){if(et(this,n),this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Iz)}return nt(n,[{key:"extractFromVPMatrix",value:function(t){var e=Pt(t,16),r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=e[6],l=e[7],d=e[8],p=e[9],g=e[10],m=e[11],y=e[12],v=e[13],x=e[14],E=e[15];kn(this.planes[0].normal,o-r,l-s,m-d),this.planes[0].distance=E-y,kn(this.planes[1].normal,o+r,l+s,m+d),this.planes[1].distance=E+y,kn(this.planes[2].normal,o+i,l+u,m+p),this.planes[2].distance=E+v,kn(this.planes[3].normal,o-i,l-u,m-p),this.planes[3].distance=E-v,kn(this.planes[4].normal,o-a,l-c,m-g),this.planes[4].distance=E-x,kn(this.planes[5].normal,o+a,l+c,m+g),this.planes[5].distance=E+x,this.planes.forEach(function(w){w.normalize(),w.updatePNVertexFlag()})}}])})(),mn=(function(){function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;et(this,n),this.x=0,this.y=0,this.x=t,this.y=e}return nt(n,[{key:"clone",value:function(){return new n(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])})(),as=(function(){function n(t,e,r,i){et(this,n),this.x=t,this.y=e,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=e,this.bottom=e+i}return nt(n,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:(function(t){return new n(t.x,t.y,t.width,t.height)})},{key:"applyTransform",value:function(t,e){var r=au(t.x,t.y,0,1),i=au(t.x+t.width,t.y,0,1),a=au(t.x,t.y+t.height,0,1),o=au(t.x+t.width,t.y+t.height,0,1),s=li(),u=li(),c=li(),l=li();Di(s,r,e),Di(u,i,e),Di(c,a,e),Di(l,o,e);var d=Math.min(s[0],u[0],c[0],l[0]),p=Math.min(s[1],u[1],c[1],l[1]),g=Math.max(s[0],u[0],c[0],l[0]),m=Math.max(s[1],u[1],c[1],l[1]);return n.fromRect({x:d,y:p,width:g-d,height:m-p})}}])})(),he="Method not implemented.",Bo="Use document.documentElement instead.",Bz="Cannot append a destroyed element.";function qo(n){return n===void 0?0:n>360||n<-360?n%360:n}var sp=Yt();function In(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(n)&&n.length===3?r?_i(n):ui(sp,n):Xt(n)?r?Ee(n,t,e):kn(sp,n,t,e):r?Ee(n[0],n[1]||t,n[2]||e):kn(sp,n[0],n[1]||t,n[2]||e)}var zz=Math.PI/180;function de(n){return n*zz}var Fz=180/Math.PI;function Mr(n){return n*Fz}function Gz(n){return 360*n}var Zl=Math.PI/2;function Vz(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],o=e*e,s=r*r,u=i*i,c=a*a,l=o+s+u+c,d=e*a-r*i;return d>.499995*l?(n[0]=Zl,n[1]=2*Math.atan2(r,e),n[2]=0):d<-.499995*l?(n[0]=-Zl,n[1]=2*Math.atan2(r,e),n[2]=0):(n[0]=Math.asin(2*(e*i-a*r)),n[1]=Math.atan2(2*(e*a+r*i),1-2*(u+c)),n[2]=Math.atan2(2*(e*r+i*a),1-2*(s+u))),n}function Uz(n,t){var e,r,i=rs(Yt(),t),a=Pt(i,3),o=a[0],s=a[1],u=a[2],c=Math.asin(-t[2]/o);return c<Zl?c>-Zl?(e=Math.atan2(t[6]/s,t[10]/u),r=Math.atan2(t[1]/o,t[0]/o)):(r=0,e=-Math.atan2(t[4]/s,t[5]/s)):(r=0,e=Math.atan2(t[4]/s,t[5]/s)),n[0]=e,n[1]=c,n[2]=r,n}function up(n,t){return t.length===16?Uz(n,t):Vz(n,t)}function Wz(n,t,e,r,i){var a=Math.cos(n),o=Math.sin(n);return Pj(r*a,i*o,0,-r*o,i*a,0,t,e,1)}function Yz(n,t,e,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,u=2*a,c=e-t,l=r-i,d=u/c,p=u/l,g=(e+t)/c,m=(r+i)/l,y,v,x=o-a,E=o*a;return s?(y=-o/x,v=-E/x):(y=-(o+a)/x,v=-2*E/x),n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=g,n[9]=m,n[10]=y,n[11]=-1,n[12]=0,n[13]=0,n[14]=v,n[15]=0,n}function v2(n){var t=n[0],e=n[1],r=n[3],i=n[4],a=Math.sqrt(t*t+e*e),o=Math.sqrt(r*r+i*i),s=t*i-e*r;if(s<0&&(t<i?a=-a:o=-o),a){var u=1/a;t*=u,e*=u}if(o){var c=1/o;r*=c,i*=c}var l=Math.atan2(e,t),d=Mr(l);return[n[6],n[7],a,o,d]}var ei=pe(),Vr=pe(),$s=li(),Mt=[Yt(),Yt(),Yt()],m2=Yt();function $z(n,t,e,r,i,a){if(!Hz(ei,n)||(ns(Vr,ei),Vr[3]=0,Vr[7]=0,Vr[11]=0,Vr[15]=1,Math.abs(lM(Vr))<1e-8))return!1;var o=ei[3],s=ei[7],u=ei[11],c=ei[12],l=ei[13],d=ei[14],p=ei[15];if(o!==0||s!==0||u!==0){$s[0]=o,$s[1]=s,$s[2]=u,$s[3]=p;var g=si(Vr,Vr);if(!g)return!1;cM(Vr,Vr),Di(i,$s,Vr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=l,t[2]=d,Xz(Mt,ei),e[0]=Ri(Mt[0]),Za(Mt[0],Mt[0]),r[0]=ci(Mt[0],Mt[1]),cp(Mt[1],Mt[1],Mt[0],1,-r[0]),e[1]=Ri(Mt[1]),Za(Mt[1],Mt[1]),r[0]/=e[1],r[1]=ci(Mt[0],Mt[2]),cp(Mt[2],Mt[2],Mt[0],1,-r[1]),r[2]=ci(Mt[1],Mt[2]),cp(Mt[2],Mt[2],Mt[1],1,-r[2]),e[2]=Ri(Mt[2]),Za(Mt[2],Mt[2]),r[1]/=e[2],r[2]/=e[2],Ml(m2,Mt[1],Mt[2]),ci(Mt[0],m2)<0)for(var m=0;m<3;m++)e[m]*=-1,Mt[m][0]*=-1,Mt[m][1]*=-1,Mt[m][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Mt[0][0]-Mt[1][1]-Mt[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Mt[0][0]+Mt[1][1]-Mt[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Mt[0][0]-Mt[1][1]+Mt[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Mt[0][0]+Mt[1][1]+Mt[2][2],0)),Mt[2][1]>Mt[1][2]&&(a[0]=-a[0]),Mt[0][2]>Mt[2][0]&&(a[1]=-a[1]),Mt[1][0]>Mt[0][1]&&(a[2]=-a[2]),!0}function Hz(n,t){var e=t[15];if(e===0)return!1;for(var r=1/e,i=0;i<16;i++)n[i]=t[i]*r;return!0}function Xz(n,t){n[0][0]=t[0],n[0][1]=t[1],n[0][2]=t[2],n[1][0]=t[4],n[1][1]=t[5],n[1][2]=t[6],n[2][0]=t[8],n[2][1]=t[9],n[2][2]=t[10]}function cp(n,t,e,r,i){n[0]=t[0]*r+e[0]*i,n[1]=t[1]*r+e[1]*i,n[2]=t[2]*r+e[2]*i}var le=(function(n){return n[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",n})({}),k1=(function(n){return n[n.DEFAULT=0]="DEFAULT",n[n.ROTATIONAL=1]="ROTATIONAL",n[n.TRANSLATIONAL=2]="TRANSLATIONAL",n[n.CINEMATIC=3]="CINEMATIC",n})({}),Nr=(function(n){return n[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE",n})({}),qM={UPDATED:"updated"},y2=2e-4,KM=(function(){function n(){et(this,n),this.clipSpaceNearZ=Ol.NEGATIVE_ONE,this.eventEmitter=new aM,this.matrix=pe(),this.right=Ee(1,0,0),this.up=Ee(0,1,0),this.forward=Ee(0,0,1),this.position=Ee(0,0,1),this.focalPoint=Ee(0,0,0),this.distanceVector=Ee(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=pe(),this.projectionMatrixInverse=pe(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=le.EXPLORING,this.trackingMode=k1.DEFAULT,this.projectionMode=Nr.PERSPECTIVE,this.frustum=new jz,this.orthoMatrix=pe()}return nt(n,[{key:"isOrtho",value:(function(){return this.projectionMode===Nr.ORTHOGRAPHIC})},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===le.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===le.TRACKING&&e!==void 0&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==le.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return si(pe(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var r=ia(pe(),[t,e,0]);this.jitteredProjectionMatrix=Nn(pe(),r,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Nr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Nr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,r,i,a,o){return this.aspect=t/e,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===Nr.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===Nr.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Nr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Nr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var r=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),i=r.x,a=r.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(i,a),this.setFocalPoint(i,a),this.setZoom(t),this.rotate(0,0,o);var s=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),u=s.x,c=s.y,l=Ee(u-i,c-a,0),d=ci(l,this.right)/Ri(this.right),p=ci(l,this.up)/Ri(this.up),g=this.getPosition(),m=Pt(g,2),y=m[0],v=m[1],x=this.getFocalPoint(),E=Pt(x,2),w=E[0],S=E[1];return this.setPosition(y-d,v-p),this.setFocalPoint(w-d,S-p),this}},{key:"setPerspective",value:function(t,e,r,i){var a;this.projectionMode=Nr.PERSPECTIVE,this.fov=r,this.near=t,this.far=e,this.aspect=i;var o=this.near*Math.tan(de(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,c=-.5*u;if((a=this.view)!==null&&a!==void 0&&a.enabled){var l=this.view.fullWidth,d=this.view.fullHeight;c+=this.view.offsetX*u/l,o-=this.view.offsetY*s/d,u*=this.view.width/l,s*=this.view.height/d}return Yz(this.projectionMatrix,c,c+u,o-s,o,t,this.far,this.clipSpaceNearZ===Ol.ZERO),si(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,r,i,a,o){var s;this.projectionMode=Nr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=r,this.bottom=i,this.near=a,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,p=l-u,g=l+u,m=d+c,y=d-c;if((s=this.view)!==null&&s!==void 0&&s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,x=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p+=v*this.view.offsetX,g=p+v*this.view.width,m-=x*this.view.offsetY,y=m-x*this.view.height}return this.clipSpaceNearZ===Ol.NEGATIVE_ONE?xM(this.projectionMatrix,p,g,m,y,a,o):EM(this.projectionMatrix,p,g,m,y,a,o),si(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],i=In(t,e,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],i=Ee(0,1,0);if(this.focalPoint=In(t,e,r),this.trackingMode===k1.CINEMATIC){var a=d1(Yt(),this.focalPoint,this.position);t=a[0],e=a[1],r=a[2];var o=Ri(a),s=Mr(Math.asin(e/o)),u=90+Mr(Math.atan2(r,t)),c=pe();fM(c,c,de(u)),dM(c,c,de(s)),i=Tn(Yt(),[0,1,0],c)}return si(this.matrix,wM(pe(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<y2&&(this.distance=y2),this.dollyingStep=this.distance/100;var e=Yt();t=this.distance;var r=this.forward,i=this.focalPoint;return e[0]=t*r[0]+i[0],e[1]=t*r[1]+i[1],e[2]=t*r[2]+i[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=qo(t),this.computeMatrix(),this._getAxes(),this.type===le.ORBITING||this.type===le.EXPLORING?this._getPosition():this.type===le.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=qo(t),this.computeMatrix(),this._getAxes(),this.type===le.ORBITING||this.type===le.EXPLORING?this._getPosition():this.type===le.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=qo(t),this.computeMatrix(),this._getAxes(),this.type===le.ORBITING||this.type===le.EXPLORING?this._getPosition():this.type===le.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=sa(He(),[0,0,1],de(this.roll));va(this.matrix);var e=sa(He(),[1,0,0],de((this.rotateWorld&&this.type!==le.TRACKING||this.type===le.TRACKING?1:-1)*this.elevation)),r=sa(He(),[0,1,0],de((this.rotateWorld&&this.type!==le.TRACKING||this.type===le.TRACKING?1:-1)*this.azimuth)),i=fa(He(),r,e);i=fa(He(),i,t);var a=db(pe(),i);this.type===le.ORBITING||this.type===le.EXPLORING?(Xo(this.matrix,this.matrix,this.focalPoint),Nn(this.matrix,this.matrix,a),Xo(this.matrix,this.matrix,[0,0,this.distance])):this.type===le.TRACKING&&(Xo(this.matrix,this.matrix,this.position),Nn(this.matrix,this.matrix,a))}},{key:"_setPosition",value:function(t,e,r){this.position=In(t,e,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ui(this.right,In(Di(li(),[1,0,0,0],this.matrix))),ui(this.up,In(Di(li(),[0,1,0,0],this.matrix))),ui(this.forward,In(Di(li(),[0,0,1,0],this.matrix))),Za(this.right,this.right),Za(this.up,this.up),Za(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],r=this.distanceVector[2],i=Ri(this.distanceVector);if(i===0){this.elevation=0,this.azimuth=0;return}this.type===le.TRACKING?(this.elevation=Mr(Math.asin(e/i)),this.azimuth=Mr(Math.atan2(-t,-r))):this.rotateWorld?(this.elevation=Mr(Math.asin(e/i)),this.azimuth=Mr(Math.atan2(-t,-r))):(this.elevation=-Mr(Math.asin(e/i)),this.azimuth=-Mr(Math.atan2(-t,-r)))}},{key:"_getPosition",value:function(){ui(this.position,In(Di(li(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){nB(this.distanceVector,[0,0,-this.distance],Oj(oM(),this.matrix)),da(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=d1(Yt(),this.focalPoint,this.position),this.distance=Ri(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Nr.ORTHOGRAPHIC){var t=this.position,e=sa(He(),[0,0,1],-this.roll*Math.PI/180);du(this.orthoMatrix,e,Ee((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ee(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Nn(pe(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(qM.UPDATED)}}},{key:"rotate",value:function(t,e,r){throw new Error(he)}},{key:"pan",value:function(t,e){throw new Error(he)}},{key:"dolly",value:function(t){throw new Error(he)}},{key:"createLandmark",value:function(t,e){throw new Error(he)}},{key:"gotoLandmark",value:function(t,e){throw new Error(he)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(he)}}])})(),qz=(function(n){return n[n.Standard=0]="Standard",n})({}),Jl=(function(n){return n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED",n[n.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",n})({}),Kz=Yt(),Hs=pe(),Zz=He();function b2(n){if(n.localDirtyFlag){var t=n.localSkew[0]!==0||n.localSkew[1]!==0;if(t){du(n.localTransform,n.localRotation,n.localPosition,Ee(1,1,1),n.origin),(n.localSkew[0]!==0||n.localSkew[1]!==0)&&(va(Hs),Hs[4]=Math.tan(n.localSkew[0]),Hs[1]=Math.tan(n.localSkew[1]),Nn(n.localTransform,n.localTransform,Hs));var e=du(Hs,CM(Zz,0,0,0,1),kn(Kz,1,1,1),n.localScale,n.origin);Nn(n.localTransform,n.localTransform,e)}else{var r=n.localTransform,i=n.localPosition,a=n.localRotation,o=n.localScale,s=n.origin,u=i[0]!==0||i[1]!==0||i[2]!==0,c=a[3]!==1||a[0]!==0||a[1]!==0||a[2]!==0,l=o[0]!==1||o[1]!==1||o[2]!==1,d=s[0]!==0||s[1]!==0||s[2]!==0;!c&&!l&&!d?u?ia(r,i):va(r):du(r,a,i,o,s)}n.localDirtyFlag=!1}}function Jz(n,t){n.dirtyFlag&&(t?Nn(n.worldTransform,t.worldTransform,n.localTransform):ns(n.worldTransform,n.localTransform),n.dirtyFlag=!1)}var ZM={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new as(0,0,0,0)},ct=(function(n){return n.COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>",n})({});function vb(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function JM(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function Lu(){}var ku=.7,Ql=1/ku,Ko="\\s*([+-]?\\d+)\\s*",Au="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qz=/^#([0-9a-f]{3,8})$/,tF=new RegExp(`^rgb\\(${Ko},${Ko},${Ko}\\)$`),eF=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),nF=new RegExp(`^rgba\\(${Ko},${Ko},${Ko},${Au}\\)$`),rF=new RegExp(`^rgba\\(${fi},${fi},${fi},${Au}\\)$`),iF=new RegExp(`^hsl\\(${Au},${fi},${fi}\\)$`),aF=new RegExp(`^hsla\\(${Au},${fi},${fi},${Au}\\)$`),x2={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};vb(Lu,Oh,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:E2,formatHex:E2,formatHex8:oF,formatHsl:sF,formatRgb:w2,toString:w2});function E2(){return this.rgb().formatHex()}function oF(){return this.rgb().formatHex8()}function sF(){return QM(this).formatHsl()}function w2(){return this.rgb().formatRgb()}function Oh(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=Qz.exec(n))?(e=t[1].length,t=parseInt(t[1],16),e===6?k2(t):e===3?new qn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Uc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Uc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=tF.exec(n))?new qn(t[1],t[2],t[3],1):(t=eF.exec(n))?new qn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nF.exec(n))?Uc(t[1],t[2],t[3],t[4]):(t=rF.exec(n))?Uc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iF.exec(n))?C2(t[1],t[2]/100,t[3]/100,1):(t=aF.exec(n))?C2(t[1],t[2]/100,t[3]/100,t[4]):x2.hasOwnProperty(n)?k2(x2[n]):n==="transparent"?new qn(NaN,NaN,NaN,0):null}function k2(n){return new qn(n>>16&255,n>>8&255,n&255,1)}function Uc(n,t,e,r){return r<=0&&(n=t=e=NaN),new qn(n,t,e,r)}function uF(n){return n instanceof Lu||(n=Oh(n)),n?(n=n.rgb(),new qn(n.r,n.g,n.b,n.opacity)):new qn}function cF(n,t,e,r){return arguments.length===1?uF(n):new qn(n,t,e,r??1)}function qn(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}vb(qn,cF,JM(Lu,{brighter(n){return n=n==null?Ql:Math.pow(Ql,n),new qn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?ku:Math.pow(ku,n),new qn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new qn(Ja(this.r),Ja(this.g),Ja(this.b),th(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:A2,formatHex:A2,formatHex8:lF,formatRgb:S2,toString:S2}));function A2(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}`}function lF(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}${$a((isNaN(this.opacity)?1:this.opacity)*255)}`}function S2(){const n=th(this.opacity);return`${n===1?"rgb(":"rgba("}${Ja(this.r)}, ${Ja(this.g)}, ${Ja(this.b)}${n===1?")":`, ${n})`}`}function th(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Ja(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function $a(n){return n=Ja(n),(n<16?"0":"")+n.toString(16)}function C2(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new $r(n,t,e,r)}function QM(n){if(n instanceof $r)return new $r(n.h,n.s,n.l,n.opacity);if(n instanceof Lu||(n=Oh(n)),!n)return new $r;if(n instanceof $r)return n;n=n.rgb();var t=n.r/255,e=n.g/255,r=n.b/255,i=Math.min(t,e,r),a=Math.max(t,e,r),o=NaN,s=a-i,u=(a+i)/2;return s?(t===a?o=(e-r)/s+(e<r)*6:e===a?o=(r-t)/s+2:o=(t-e)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new $r(o,s,u,n.opacity)}function hF(n,t,e,r){return arguments.length===1?QM(n):new $r(n,t,e,r??1)}function $r(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}vb($r,hF,JM(Lu,{brighter(n){return n=n==null?Ql:Math.pow(Ql,n),new $r(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?ku:Math.pow(ku,n),new $r(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,i=2*e-r;return new qn(lp(n>=240?n-240:n+120,i,r),lp(n,i,r),lp(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new $r(N2(this.h),Wc(this.s),Wc(this.l),th(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=th(this.opacity);return`${n===1?"hsl(":"hsla("}${N2(this.h)}, ${Wc(this.s)*100}%, ${Wc(this.l)*100}%${n===1?")":`, ${n})`}`}}));function N2(n){return n=(n||0)%360,n<0?n+360:n}function Wc(n){return Math.max(0,Math.min(1,n||0))}function lp(n,t,e){return(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)*255}function Ye(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=t?t.apply(this,i):i[0],s=e.cache;if(s.has(o))return s.get(o);var u=n.apply(this,i);return e.cache=s.set(o,u)||s,u};return e.cache=new(Ye.Cache||Map),Ye.cacheList.push(e.cache),e}Ye.Cache=Map;Ye.cacheList=[];Ye.clearCache=function(){Ye.cacheList.forEach(function(n){return n.clear()})};var ht=(function(n){return n[n.kUnknown=0]="kUnknown",n[n.kNumber=1]="kNumber",n[n.kPercentage=2]="kPercentage",n[n.kEms=3]="kEms",n[n.kPixels=4]="kPixels",n[n.kRems=5]="kRems",n[n.kDegrees=6]="kDegrees",n[n.kRadians=7]="kRadians",n[n.kGradians=8]="kGradians",n[n.kTurns=9]="kTurns",n[n.kMilliseconds=10]="kMilliseconds",n[n.kSeconds=11]="kSeconds",n[n.kInteger=12]="kInteger",n})({}),Wr=(function(n){return n[n.kUNumber=0]="kUNumber",n[n.kUPercent=1]="kUPercent",n[n.kULength=2]="kULength",n[n.kUAngle=3]="kUAngle",n[n.kUTime=4]="kUTime",n[n.kUOther=5]="kUOther",n})({}),dF=(function(n){return n[n.kYes=0]="kYes",n[n.kNo=1]="kNo",n})({}),fF=(function(n){return n[n.kYes=0]="kYes",n[n.kNo=1]="kNo",n})({}),pF=[{name:"em",unit_type:ht.kEms},{name:"px",unit_type:ht.kPixels},{name:"deg",unit_type:ht.kDegrees},{name:"rad",unit_type:ht.kRadians},{name:"grad",unit_type:ht.kGradians},{name:"ms",unit_type:ht.kMilliseconds},{name:"s",unit_type:ht.kSeconds},{name:"rem",unit_type:ht.kRems},{name:"turn",unit_type:ht.kTurns}],os=(function(n){return n[n.kUnknownType=0]="kUnknownType",n[n.kUnparsedType=1]="kUnparsedType",n[n.kKeywordType=2]="kKeywordType",n[n.kUnitType=3]="kUnitType",n[n.kSumType=4]="kSumType",n[n.kProductType=5]="kProductType",n[n.kNegateType=6]="kNegateType",n[n.kInvertType=7]="kInvertType",n[n.kMinType=8]="kMinType",n[n.kMaxType=9]="kMaxType",n[n.kClampType=10]="kClampType",n[n.kTransformType=11]="kTransformType",n[n.kPositionType=12]="kPositionType",n[n.kURLImageType=13]="kURLImageType",n[n.kColorType=14]="kColorType",n[n.kUnsupportedColorType=15]="kUnsupportedColorType",n})({}),gF=function(n){return pF.find(function(t){return t.name===n}).unit_type},vF=function(n){return n?n==="number"?ht.kNumber:n==="percent"||n==="%"?ht.kPercentage:gF(n):ht.kUnknown},mF=function(n){switch(n){case ht.kNumber:case ht.kInteger:return Wr.kUNumber;case ht.kPercentage:return Wr.kUPercent;case ht.kPixels:return Wr.kULength;case ht.kMilliseconds:case ht.kSeconds:return Wr.kUTime;case ht.kDegrees:case ht.kRadians:case ht.kGradians:case ht.kTurns:return Wr.kUAngle;default:return Wr.kUOther}},yF=function(n){switch(n){case Wr.kUNumber:return ht.kNumber;case Wr.kULength:return ht.kPixels;case Wr.kUPercent:return ht.kPercentage;case Wr.kUTime:return ht.kSeconds;case Wr.kUAngle:return ht.kDegrees;default:return ht.kUnknown}},T2=function(n){var t=1;switch(n){case ht.kPixels:case ht.kDegrees:case ht.kSeconds:break;case ht.kMilliseconds:t=.001;break;case ht.kRadians:t=180/Math.PI;break;case ht.kGradians:t=.9;break;case ht.kTurns:t=360;break}return t},A1=function(n){switch(n){case ht.kNumber:case ht.kInteger:return"";case ht.kPercentage:return"%";case ht.kEms:return"em";case ht.kRems:return"rem";case ht.kPixels:return"px";case ht.kDegrees:return"deg";case ht.kRadians:return"rad";case ht.kGradians:return"grad";case ht.kMilliseconds:return"ms";case ht.kSeconds:return"s";case ht.kTurns:return"turn"}return""},Ph=(function(){function n(){et(this,n)}return nt(n,[{key:"toString",value:(function(){return this.buildCSSText(dF.kNo,fF.kNo,"")})},{key:"isNumericValue",value:function(){return this.getType()>=os.kUnitType&&this.getType()<=os.kClampType}}],[{key:"isAngle",value:(function(t){return t===ht.kDegrees||t===ht.kRadians||t===ht.kGradians||t===ht.kTurns})},{key:"isLength",value:function(t){return t>=ht.kEms&&t<ht.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===ht.kPercentage||t===ht.kEms||t===ht.kRems}},{key:"isTime",value:function(t){return t===ht.kSeconds||t===ht.kMilliseconds}}])})(),bF=(function(n){function t(e){var r;return et(this,t),r=Bt(this,t),r.colorSpace=e,r}return zt(t,n),nt(t,[{key:"getType",value:function(){return os.kColorType}},{key:"to",value:function(e){return this}}])})(Ph),ua=(function(n){return n[n.Constant=0]="Constant",n[n.LinearGradient=1]="LinearGradient",n[n.RadialGradient=2]="RadialGradient",n})({}),Yc=(function(n){function t(e,r){var i;return et(this,t),i=Bt(this,t),i.type=e,i.value=r,i}return zt(t,n),nt(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(e,r,i){return i}},{key:"getType",value:function(){return os.kColorType}}])})(Ph),Dr=(function(n){function t(e){var r;return et(this,t),r=Bt(this,t),r.value=e,r}return zt(t,n),nt(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return os.kKeywordType}},{key:"buildCSSText",value:function(e,r,i){return i+this.value}}])})(Ph),xF=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e="";return Number.isFinite(n)?e="NaN":n>0?e="infinity":e="-infinity",e+=t},S1=function(n){return yF(mF(n))},ln=(function(n){function t(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ht.kNumber;et(this,t),r=Bt(this,t);var a;return typeof i=="string"?a=vF(i):a=i,r.unit=a,r.value=e,r}return zt(t,n),nt(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(e){var r=e;return this.value===r.value&&this.unit===r.unit}},{key:"getType",value:function(){return os.kUnitType}},{key:"convertTo",value:function(e){if(this.unit===e)return new t(this.value,this.unit);var r=S1(this.unit);if(r!==S1(e)||r===ht.kUnknown)return null;var i=T2(this.unit)/T2(e);return new t(this.value*i,e)}},{key:"buildCSSText",value:function(e,r,i){var a;switch(this.unit){case ht.kUnknown:break;case ht.kInteger:a=Number(this.value).toFixed(0);break;case ht.kNumber:case ht.kPercentage:case ht.kEms:case ht.kRems:case ht.kPixels:case ht.kDegrees:case ht.kRadians:case ht.kGradians:case ht.kMilliseconds:case ht.kSeconds:case ht.kTurns:{var o=-999999,s=999999,u=this.value,c=A1(this.unit);if(u<o||u>s){var l=A1(this.unit);!Number.isFinite(u)||Number.isNaN(u)?a=xF(u,l):a=u+(l||"")}else a="".concat(u).concat(c)}}return i+=a,i}}])})(Ph),Ur=new ln(0,"px");new ln(1,"px");var io=new ln(0,"deg"),mb=(function(n){function t(e,r,i){var a,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return et(this,t),a=Bt(this,t,["rgb"]),a.r=e,a.g=r,a.b=i,a.alpha=o,a.isNone=s,a}return zt(t,n),nt(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(e,r,i){return"".concat(i,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])})(bF),M2=new Dr("unset"),EF=new Dr("initial"),wF=new Dr("inherit"),hp={"":M2,unset:M2,initial:EF,inherit:wF},kF=function(n){return hp[n]||(hp[n]=new Dr(n)),hp[n]},t_=new mb(0,0,0,0,!0),e_=new mb(0,0,0,0),AF=Ye(function(n,t,e,r){return new mb(n,t,e,r)},function(n,t,e,r){return"rgba(".concat(n,",").concat(t,",").concat(e,",").concat(r,")")}),Me=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ht.kNumber;return new ln(n,t)};new ln(50,"%");function SF(n){var t=n.type,e=n.value;return t==="hex"?"#".concat(e):t==="literal"?e:t==="rgb"?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}var CF=(function(){var n={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function e(W){throw new Error("".concat(t,": ").concat(W))}function r(){var W=i();return t.length>0&&e("Invalid input not EOF"),W}function i(){return w(a)}function a(){return o("linear-gradient",n.linearGradient,u)||o("repeating-linear-gradient",n.repeatingLinearGradient,u)||o("radial-gradient",n.radialGradient,d)||o("repeating-radial-gradient",n.repeatingRadialGradient,d)||o("conic-gradient",n.conicGradient,d)}function o(W,at,ut){return s(at,function(yt){var kt=ut();return kt&&(U(n.comma)||e("Missing comma before color stops")),{type:W,orientation:kt,colorStops:w(S)}})}function s(W,at){var ut=U(W);if(ut){U(n.startCall)||e("Missing (");var yt=at(ut);return U(n.endCall)||e("Missing )"),yt}}function u(){return c()||l()}function c(){return z("directional",n.sideOrCorner,1)}function l(){return z("angular",n.angleValue,1)}function d(){var W,at=p(),ut;return at&&(W=[],W.push(at),ut=t,U(n.comma)&&(at=p(),at?W.push(at):t=ut)),W}function p(){var W=g()||m();if(W)W.at=v();else{var at=y();if(at){W=at;var ut=v();ut&&(W.at=ut)}else{var yt=x();yt&&(W={type:"default-radial",at:yt})}}return W}function g(){var W=z("shape",/^(circle)/i,0);return W&&(W.style=j()||y()),W}function m(){var W=z("shape",/^(ellipse)/i,0);return W&&(W.style=P()||y()),W}function y(){return z("extent-keyword",n.extentKeywords,1)}function v(){if(z("position",/^at/,0)){var W=x();return W||e("Missing positioning value"),W}}function x(){var W=E();if(W.x||W.y)return{type:"position",value:W}}function E(){return{x:P(),y:P()}}function w(W){var at=W(),ut=[];if(at)for(ut.push(at);U(n.comma);)at=W(),at?ut.push(at):e("One extra comma");return ut}function S(){var W=k();return W||e("Expected color definition"),W.length=P(),W}function k(){return N()||O()||T()||A()}function A(){return z("literal",n.literalColor,0)}function N(){return z("hex",n.hexColor,1)}function T(){return s(n.rgbColor,function(){return{type:"rgb",value:w(M)}})}function O(){return s(n.rgbaColor,function(){return{type:"rgba",value:w(M)}})}function M(){return U(n.number)[1]}function P(){return z("%",n.percentageValue,1)||L()||j()}function L(){return z("position-keyword",n.positionKeywords,1)}function j(){return z("px",n.pixelValue,1)||z("em",n.emValue,1)}function z(W,at,ut){var yt=U(at);if(yt)return{type:W,value:yt[ut]}}function U(W){var at=/^[\n\r\t\s]+/.exec(t);at&&J(at[0].length);var ut=W.exec(t);return ut&&J(ut[0].length),ut}function J(W){t=t.substring(W)}return function(W){return t=W,r()}})();function NF(n,t,e,r){var i=de(r.value),a=0,o=0,s=a+t/2,u=o+e/2,c=Math.abs(t*Math.cos(i))+Math.abs(e*Math.sin(i)),l=n[0]+s-Math.cos(i)*c/2,d=n[1]+u-Math.sin(i)*c/2,p=n[0]+s+Math.cos(i)*c/2,g=n[1]+u+Math.sin(i)*c/2;return{x1:l,y1:d,x2:p,y2:g}}function TF(n,t,e,r,i,a){var o=r.value,s=i.value;r.unit===ht.kPercentage&&(o=r.value/100*t),i.unit===ht.kPercentage&&(s=i.value/100*e);var u=Math.max(Hn([0,0],[o,s]),Hn([0,e],[o,s]),Hn([t,e],[o,s]),Hn([t,0],[o,s]));return a&&(a instanceof ln?u=a.value:a instanceof Dr&&(a.value==="closest-side"?u=Math.min(o,t-o,s,e-s):a.value==="farthest-side"?u=Math.max(o,t-o,s,e-s):a.value==="closest-corner"&&(u=Math.min(Hn([0,0],[o,s]),Hn([0,e],[o,s]),Hn([t,e],[o,s]),Hn([t,0],[o,s]))))),{x:o+n[0],y:s+n[1],r:u}}var MF=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_F=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,OF=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,n_=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function PF(n){var t,e=n.length;if(n[e-1].length=(t=n[e-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},e>1){var r;n[0].length=(r=n[0].length)!==null&&r!==void 0?r:{type:"%",value:"0"}}for(var i=0,a=Number(n[0].length.value),o=1;o<e;o++){var s,u=(s=n[o].length)===null||s===void 0?void 0:s.value;if(!Tt(u)&&!Tt(a)){for(var c=1;c<o-i;c++)n[i+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(o-i))};i=o,a=Number(u)}}}var RF={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},DF=Ye(function(n){var t;return n.type==="angular"?t=Number(n.value):t=RF[n.value]||0,Me(t,"deg")}),LF=Ye(function(n){var t=50,e=50,r="%",i="%";if((n==null?void 0:n.type)==="position"){var a=n.value,o=a.x,s=a.y;(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?t=0:o.value==="center"?t=50:o.value==="right"?t=100:o.value==="top"?e=0:o.value==="bottom"&&(e=100)),(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?e=50:s.value==="right"?t=100:s.value==="top"?e=0:s.value==="bottom"&&(e=100)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(r=o==null?void 0:o.type,t=Number(o.value)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(i=s==null?void 0:s.type,e=Number(s.value))}return{cx:Me(t,r),cy:Me(e,i)}}),IF=Ye(function(n){if(n.indexOf("linear")>-1||n.indexOf("radial")>-1){var t=CF(n);return t.map(function(s){var u=s.type,c=s.orientation,l=s.colorStops;PF(l);var d=l.map(function(w){return{offset:Me(Number(w.length.value),"%"),color:SF(w)}});if(u==="linear-gradient")return new Yc(ua.LinearGradient,{angle:c?DF(c):io,steps:d});if(u==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var p=LF(c[0].at),g=p.cx,m=p.cy,y;if(c[0].style){var v=c[0].style,x=v.type,E=v.value;x==="extent-keyword"?y=kF(E):y=Me(E,x)}return new Yc(ua.RadialGradient,{cx:g,cy:m,size:y,steps:d})}})}var e=n[0];if(n[1]==="("||n[2]==="("){if(e==="l"){var r=MF.exec(n);if(r){var i,a=((i=r[2].match(n_))===null||i===void 0?void 0:i.map(function(s){return s.split(":")}))||[];return[new Yc(ua.LinearGradient,{angle:Me(parseFloat(r[1]),"deg"),steps:a.map(function(s){var u=Pt(s,2),c=u[0],l=u[1];return{offset:Me(Number(c)*100,"%"),color:l}})})]}}else if(e==="r"){var o=jF(n);if(o)if(fe(o))n=o;else return[new Yc(ua.RadialGradient,o)]}else if(e==="p")return BF(n)}});function jF(n){var t=_F.exec(n);if(t){var e,r=((e=t[4].match(n_))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:Me(50,"%"),cy:Me(50,"%"),steps:r.map(function(i){var a=Pt(i,2),o=a[0],s=a[1];return{offset:Me(Number(o)*100,"%"),color:s}})}}return null}function BF(n){var t=OF.exec(n);if(t){var e=t[1],r=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;case"n":e="no-repeat";break;default:e="no-repeat"}return{image:r,repetition:e}}return null}function Su(n){return n&&!!n.image}function eh(n){return n&&!Tt(n.r)&&!Tt(n.g)&&!Tt(n.b)}var gu=Ye(function(n){if(Su(n))return Lt({repetition:"repeat"},n);if(Tt(n)&&(n=""),n==="transparent")return e_;if(n==="currentColor")n="black";else if(n==="none")return t_;var t=IF(n);if(t)return t;var e=Oh(n),r=[0,0,0,0];return e!==null&&(r[0]=e.r||0,r[1]=e.g||0,r[2]=e.b||0,r[3]=e.opacity),AF.apply(void 0,r)});function zF(n,t){if(!(!eh(n)||!eh(t)))return[[Number(n.r),Number(n.g),Number(n.b),Number(n.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(e){var r=e.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(dn(r[i],0,255));return r[3]=dn(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function Iu(n,t){if(Tt(t))return Me(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(n)>=0)return Me(Number(t),"px");if("deg".search(n)>=0)return Me(Number(t),"deg")}var e=[];t=t.replace(n,function(i){return e.push(i),"U".concat(i)});var r="U(".concat(n.source,")");return e.map(function(i){return Me(Number(t.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var r_=function(n){return Iu(new RegExp("px","g"),n)},FF=Ye(r_),GF=function(n){return Iu(new RegExp("%","g"),n)};Ye(GF);var i_=function(n){return Xt(n)||isFinite(Number(n))?Me(Number(n)||0,"px"):Iu(new RegExp("px|%|em|rem","g"),n)},C1=Ye(i_),a_=function(n){return Iu(new RegExp("deg|rad|grad|turn","g"),n)},VF=Ye(a_);function UF(n,t,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",o=n.value||0,s=t.value||0,u=S1(n.unit),c=n.convertTo(u),l=t.convertTo(u);return c&&l?(o=c.value,s=l.value,a=A1(n.unit)):(ln.isLength(n.unit)||ln.isLength(t.unit))&&(o=ur(n,i,e),s=ur(t,i,e),a="px"),[o,s,function(d){return d+a}]}function Xn(n){var t=0;return n.unit===ht.kDegrees?t=n.value:n.unit===ht.kRadians?t=Mr(Number(n.value)):n.unit===ht.kTurns?t=Gz(Number(n.value)):n.value&&(t=n.value),t}function _2(n,t){var e;return Array.isArray(n)?e=n.map(function(r){return Number(r)}):fe(n)?e=n.split(" ").map(function(r){return Number(r)}):Xt(n)&&(e=[n]),t===2?e.length===1?[e[0],e[0]]:[e[0],e[1]]:t===4?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[0],e[1],e[0],e[1]]:e.length===3?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]:t==="even"&&e.length%2===1?[].concat(Ht(e),Ht(e)):e}function ur(n,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n.unit===ht.kPixels)return Number(n.value);if(n.unit===ht.kPercentage&&e){var i=e.nodeName===X.GROUP?e.getLocalBounds():e.getGeometryBounds();return(r?i.min[t]:0)+n.value/100*i.halfExtents[t]*2}return 0}var WF=function(n){return Iu(/deg|rad|grad|turn|px|%/g,n)},YF=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function $F(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(n=n.toLowerCase().trim(),n==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,e=[],r,i=0;r=t.exec(n);){if(r.index!==i)return[];if(i=r.index+r[0].length,YF.indexOf(r[1])>-1&&e.push({name:r[1],params:r[2].split(" ").map(function(a){return WF(a)||gu(a)})}),t.lastIndex===n.length)return e}return[]}function o_(n){return n.toString()}var s_=function(n){return typeof n=="number"?Me(n):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(n)?Me(Number(n)):Me(0)},N1=Ye(s_);Ye(function(n){return fe(n)?n.split(" ").map(N1):n.map(N1)});function yb(n,t){return[n,t,o_]}function bb(n,t){return function(e,r){return[e,r,function(i){return o_(dn(i,n,t))}]}}function u_(n,t){if(n.length===t.length)return[n,t,function(e){return e}]}function T1(n){return n.parsedStyle.d.totalLength===0&&(n.parsedStyle.d.totalLength=az(n.parsedStyle.d.absolutePath)),n.parsedStyle.d.totalLength}function HF(n){return n.parsedStyle.points.totalLength===0&&(n.parsedStyle.points.totalLength=Az(n.parsedStyle.points.points)),n.parsedStyle.points.totalLength}function XF(n){for(var t=0;t<n.length;t++){var e=n[t-1],r=n[t],i=r[0];if(i==="M"&&e){var a=e[0],o=[r[1],r[2]],s=void 0;a==="L"||a==="M"?s=[e[1],e[2]]:(a==="C"||a==="A"||a==="Q")&&(s=[e[e.length-2],e[e.length-1]]),s&&nh(o,s)&&(n.splice(t,1),t--)}}}function qF(n){for(var t=!1,e=n.length,r=0;r<e;r++){var i=n[r],a=i[0];if(a==="C"||a==="A"||a==="Q"){t=!0;break}}return t}function KF(n){for(var t=[],e=[],r=[],i=0;i<n.length;i++){var a=n[i],o=a[0];o==="M"?(r.length&&(e.push(r),r=[]),r.push([a[1],a[2]])):o==="Z"?r.length&&(t.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&e.push(r),{polygons:t,polylines:e}}function nh(n,t){return n[0]===t[0]&&n[1]===t[1]}function ZF(n,t){for(var e=[],r=[],i=[],a=0;a<n.length;a++){var o=n[a],s=o.currentPoint,u=o.params,c=o.prePoint,l=void 0;switch(o.command){case"Q":l=Sz(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=Ez(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var d=o.arcParams;l=yz(d.cx,d.cy,d.rx,d.ry,d.xRotation,d.startAngle,d.endAngle);break;default:e.push(s[0]),r.push(s[1]);break}l&&(o.box=l,e.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height))}e=e.filter(function(S){return!Number.isNaN(S)&&S!==1/0&&S!==-1/0}),r=r.filter(function(S){return!Number.isNaN(S)&&S!==1/0&&S!==-1/0});var p=n2(e),g=n2(r),m=e2(e),y=e2(r);if(i.length===0)return{x:p,y:g,width:m-p,height:y-g};for(var v=0;v<i.length;v++){var x=i[v],E=x.currentPoint,w=void 0;E[0]===p?(w=$c(x,t),p-=w.xExtra):E[0]===m&&(w=$c(x,t),m+=w.xExtra),E[1]===g?(w=$c(x,t),g-=w.yExtra):E[1]===y&&(w=$c(x,t),y+=w.yExtra)}return{x:p,y:g,width:m-p,height:y-g}}function $c(n,t){var e=n.prePoint,r=n.currentPoint,i=n.nextPoint,a=Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2),u=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!u||Math.sin(u)===0||fu(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,l=l>Math.PI/2?Math.PI-l:l;var d={xExtra:Math.cos(u/2-c)*(t/2*(1/Math.sin(u/2)))-t/2||0,yExtra:Math.cos(l-u/2)*(t/2*(1/Math.sin(u/2)))-t/2||0};return d}function O2(n,t){return[t[0]+(t[0]-n[0]),t[1]+(t[1]-n[1])]}var P2=function(n,t){var e=n.x*t.x+n.y*t.y,r=Math.sqrt((Math.pow(n.x,2)+Math.pow(n.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),i=n.x*t.y-n.y*t.x<0?-1:1,a=i*Math.acos(e/r);return a},R2=function(n,t,e,r,i,a,o,s){t=Math.abs(t),e=Math.abs(e),r=MM(r,360);var u=de(r);if(n.x===o.x&&n.y===o.y)return{x:n.x,y:n.y,ellipticalArcAngle:0};if(t===0||e===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(n.x-o.x)/2,l=(n.y-o.y)/2,d={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},p=Math.pow(d.x,2)/Math.pow(t,2)+Math.pow(d.y,2)/Math.pow(e,2);p>1&&(t*=Math.sqrt(p),e*=Math.sqrt(p));var g=Math.pow(t,2)*Math.pow(e,2)-Math.pow(t,2)*Math.pow(d.y,2)-Math.pow(e,2)*Math.pow(d.x,2),m=Math.pow(t,2)*Math.pow(d.y,2)+Math.pow(e,2)*Math.pow(d.x,2),y=g/m;y=y<0?0:y;var v=(i!==a?1:-1)*Math.sqrt(y),x={x:v*(t*d.y/e),y:v*(-(e*d.x)/t)},E={x:Math.cos(u)*x.x-Math.sin(u)*x.y+(n.x+o.x)/2,y:Math.sin(u)*x.x+Math.cos(u)*x.y+(n.y+o.y)/2},w={x:(d.x-x.x)/t,y:(d.y-x.y)/e},S=P2({x:1,y:0},w),k={x:(-d.x-x.x)/t,y:(-d.y-x.y)/e},A=P2(w,k);!a&&A>0?A-=2*Math.PI:a&&A<0&&(A+=2*Math.PI),A%=2*Math.PI;var N=S+A*s,T=t*Math.cos(N),O=e*Math.sin(N),M={x:Math.cos(u)*T-Math.sin(u)*O+E.x,y:Math.sin(u)*T+Math.cos(u)*O+E.y,ellipticalArcStartAngle:S,ellipticalArcEndAngle:S+A,ellipticalArcAngle:N,ellipticalArcCenter:E,resultantRx:t,resultantRy:e};return M};function JF(n){for(var t=[],e=null,r=null,i=null,a=0,o=n.length,s=0;s<o;s++){var u=n[s];r=n[s+1];var c=u[0],l={command:c,prePoint:e,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],a=s;break;case"A":var d=QF(e,u);l.arcParams=d;break}if(c==="Z")e=i,r=n[a+1];else{var p=u.length;e=[u[p-2],u[p-1]]}r&&r[0]==="Z"&&(r=n[a],t[a]&&(t[a].prePoint=e)),l.currentPoint=e,t[a]&&nh(e,t[a].currentPoint)&&(t[a].prePoint=l.prePoint);var g=r?[r[r.length-2],r[r.length-1]]:null;l.nextPoint=g;var m=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[m[0]-e[0],m[1]-e[1]],l.endTangent=[e[0]-m[0],e[1]-m[1]];else if(c==="Q"){var y=[u[1],u[2]];l.startTangent=[m[0]-y[0],m[1]-y[1]],l.endTangent=[e[0]-y[0],e[1]-y[1]]}else if(c==="T"){var v=t[s-1],x=O2(v.currentPoint,m);v.command==="Q"?(l.command="Q",l.startTangent=[m[0]-x[0],m[1]-x[1]],l.endTangent=[e[0]-x[0],e[1]-x[1]]):(l.command="TL",l.startTangent=[m[0]-e[0],m[1]-e[1]],l.endTangent=[e[0]-m[0],e[1]-m[1]])}else if(c==="C"){var E=[u[1],u[2]],w=[u[3],u[4]];l.startTangent=[m[0]-E[0],m[1]-E[1]],l.endTangent=[e[0]-w[0],e[1]-w[1]],l.startTangent[0]===0&&l.startTangent[1]===0&&(l.startTangent=[E[0]-w[0],E[1]-w[1]]),l.endTangent[0]===0&&l.endTangent[1]===0&&(l.endTangent=[w[0]-E[0],w[1]-E[1]])}else if(c==="S"){var S=t[s-1],k=O2(S.currentPoint,m),A=[u[1],u[2]];S.command==="C"?(l.command="C",l.startTangent=[m[0]-k[0],m[1]-k[1]],l.endTangent=[e[0]-A[0],e[1]-A[1]]):(l.command="SQ",l.startTangent=[m[0]-A[0],m[1]-A[1]],l.endTangent=[e[0]-A[0],e[1]-A[1]])}else if(c==="A"){var N=D2(l,0),T=N.x,O=N.y,M=D2(l,1,!1),P=M.x,L=M.y;l.startTangent=[T,O],l.endTangent=[P,L]}t.push(l)}return t}function D2(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=n.arcParams,i=r.rx,a=i===void 0?0:i,o=r.ry,s=o===void 0?0:o,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,d=R2({x:n.prePoint[0],y:n.prePoint[1]},a,s,u,!!c,!!l,{x:n.currentPoint[0],y:n.currentPoint[1]},t),p=R2({x:n.prePoint[0],y:n.prePoint[1]},a,s,u,!!c,!!l,{x:n.currentPoint[0],y:n.currentPoint[1]},e?t+.005:t-.005),g=p.x-d.x,m=p.y-d.y,y=Math.sqrt(g*g+m*m);return{x:-g/y,y:-m/y}}function Hc(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function M1(n,t){return Hc(n)*Hc(t)?(n[0]*t[0]+n[1]*t[1])/(Hc(n)*Hc(t)):1}function L2(n,t){return(n[0]*t[1]<n[1]*t[0]?-1:1)*Math.acos(M1(n,t))}function QF(n,t){var e=t[1],r=t[2],i=MM(de(t[3]),Math.PI*2),a=t[4],o=t[5],s=n[0],u=n[1],c=t[6],l=t[7],d=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,p=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,g=d*d/(e*e)+p*p/(r*r);g>1&&(e*=Math.sqrt(g),r*=Math.sqrt(g));var m=e*e*(p*p)+r*r*(d*d),y=m?Math.sqrt((e*e*(r*r)-m)/m):1;a===o&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*e*p/r:0,x=e?y*-r*d/e:0,E=(s+c)/2+Math.cos(i)*v-Math.sin(i)*x,w=(u+l)/2+Math.sin(i)*v+Math.cos(i)*x,S=[(d-v)/e,(p-x)/r],k=[(-1*d-v)/e,(-1*p-x)/r],A=L2([1,0],S),N=L2(S,k);return M1(S,k)<=-1&&(N=Math.PI),M1(S,k)>=1&&(N=0),o===0&&N>0&&(N-=2*Math.PI),o===1&&N<0&&(N+=2*Math.PI),{cx:E,cy:w,rx:nh(n,[c,l])?0:e,ry:nh(n,[c,l])?0:r,startAngle:A,endAngle:A+N,xRotation:i,arcFlag:a,sweepFlag:o}}var c_=function(n){if(n===""||Array.isArray(n)&&n.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=ql(n)}catch{t=ql(""),console.error("[g]: Invalid SVG Path definition: ".concat(n))}XF(t);var e=qF(t),r=KF(t),i=r.polygons,a=r.polylines,o=JF(t),s=ZF(o,0),u=s.x,c=s.y,l=s.width,d=s.height;return{absolutePath:t,hasArc:e,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(d)?d:0}}},t7=Ye(c_);function l_(n){return fe(n)?t7(n):c_(n)}function e7(n,t,e){var r=n.curve,i=t.curve;(!r||r.length===0)&&(r=m1(n.absolutePath,!1),n.curve=r),(!i||i.length===0)&&(i=m1(t.absolutePath,!1),t.curve=i);var a=[r,i];r.length!==i.length&&(a=GM(r,i));var o=s2(a[0])!==s2(a[1])?QB(a[0]):JB(a[0]);return[o,sz(a[1],o),function(s){return s}]}function n7(n,t){var e;return fe(n)?e=n.split(" ").map(function(r){var i=r.split(","),a=Pt(i,2),o=a[0],s=a[1];return[Number(o),Number(s)]}):e=n,{points:e,totalLength:0,segments:[]}}function r7(n,t){return[n.points,t.points,function(e){return e}]}var Ie=null,Zo=/\s*(\w+)\(([^)]*)\)/g;function Yn(n){return function(t){var e=0;return n.map(function(r){return r===Ie?t[e++]:r})}}function Ia(n){return n}var Cu={matrix:["NNNNNN",[Ie,Ie,0,0,Ie,Ie,0,0,0,0,1,0,Ie,Ie,0,1],Ia],matrix3d:["NNNNNNNNNNNNNNNN",Ia],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Yn([Ie,Ie,new ln(1)]),Ia],scaleX:["N",Yn([Ie,new ln(1),new ln(1)]),Yn([Ie,new ln(1)])],scaleY:["N",Yn([new ln(1),Ie,new ln(1)]),Yn([new ln(1),Ie])],scaleZ:["N",Yn([new ln(1),new ln(1),Ie])],scale3d:["NNN",Ia],skew:["Aa",null,Ia],skewX:["A",null,Yn([Ie,io])],skewY:["A",null,Yn([io,Ie])],translate:["Tt",Yn([Ie,Ie,Ur]),Ia],translateX:["T",Yn([Ie,Ur,Ur]),Yn([Ie,Ur])],translateY:["T",Yn([Ur,Ie,Ur]),Yn([Ur,Ie])],translateZ:["L",Yn([Ur,Ur,Ie])],translate3d:["TTL",Ia]};function h_(n){for(var t=[],e=n.length,r=0;r<e;r++){var i=n[r],a=i[0],o=i.slice(1);a==="translate"||a==="skew"?o.length===1&&o.push(0):a==="scale"&&o.length===1&&o.push(o[0]);var s=Cu[a];if(!s)return[];var u=o.map(function(c){return Me(c)});t.push({t:a,d:u})}return t}function d_(n){if(Array.isArray(n))return h_(n);if(n=(n||"none").trim(),n==="none")return[];var t=[],e,r=0;for(Zo.lastIndex=0;e=Zo.exec(n);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Cu[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var u=[],c=0;c<s.length;c++){var l=o[c],d=s[c],p=void 0;if(l?p={A:function(g){return g.trim()==="0"?io:VF(g)},N:N1,T:C1,L:FF}[d.toUpperCase()](l):p={a:io,n:u[0],t:Ur}[d],p===void 0)return[];u.push(p)}if(t.push({t:i,d:u}),Zo.lastIndex===n.length)return t}return[]}function i7(n){if(Array.isArray(n))return h_(n);if(n=(n||"none").trim(),n==="none")return[];var t=[],e,r=0;for(Zo.lastIndex=0;e=Zo.exec(n);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Cu[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var u=[],c=0;c<s.length;c++){var l=o[c],d=s[c],p=void 0;if(l?p={A:function(g){return g.trim()==="0"?io:a_(g)},N:s_,T:i_,L:r_}[d.toUpperCase()](l):p={a:io,n:u[0],t:Ur}[d],p===void 0)return[];u.push(p)}if(t.push({t:i,d:u}),Zo.lastIndex===n.length)return t}return[]}function a7(n){var t,e,r,i;switch(n.t){case"rotateX":return i=de(Xn(n.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=de(Xn(n.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=de(Xn(n.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=n.d[0].value,e=n.d[1].value,r=n.d[2].value,i=de(Xn(n.d[3]));var a=t*t+e*e+r*r;if(a===0)t=1,e=0,r=0;else if(a!==1){var o=Math.sqrt(a);t/=o,e/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(e*e+r*r)*c,2*(t*e*c+r*u),2*(t*r*c-e*u),0,2*(t*e*c-r*u),1-2*(t*t+r*r)*c,2*(e*r*c+t*u),0,2*(t*r*c+e*u),2*(e*r*c-t*u),1-2*(t*t+e*e)*c,0,0,0,0,1];case"scale":return[n.d[0].value,0,0,0,0,n.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[n.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,n.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,n.d[0].value,0,0,0,0,1];case"scale3d":return[n.d[0].value,0,0,0,0,n.d[1].value,0,0,0,0,n.d[2].value,0,0,0,0,1];case"skew":var l=de(Xn(n.d[0])),d=de(Xn(n.d[1]));return[1,Math.tan(d),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=de(Xn(n.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=de(Xn(n.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=ur(n.d[0],0,null)||0,e=ur(n.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1];case"translateX":return t=ur(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translateY":return e=ur(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,e,0,1];case"translateZ":return r=ur(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return t=ur(n.d[0],0,null)||0,e=ur(n.d[1],0,null)||0,r=ur(n.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1];case"perspective":var p=ur(n.d[0],0,null)||0,g=p?-1/p:0;return[1,0,0,0,0,1,0,0,0,0,1,g,0,0,0,1];case"matrix":return[n.d[0].value,n.d[1].value,0,0,n.d[2].value,n.d[3].value,0,0,0,0,1,0,n.d[4].value,n.d[5].value,0,1];case"matrix3d":return n.d.map(function(m){return m.value})}}function o7(n,t){return[n[0]*t[0]+n[4]*t[1]+n[8]*t[2]+n[12]*t[3],n[1]*t[0]+n[5]*t[1]+n[9]*t[2]+n[13]*t[3],n[2]*t[0]+n[6]*t[1]+n[10]*t[2]+n[14]*t[3],n[3]*t[0]+n[7]*t[1]+n[11]*t[2]+n[15]*t[3],n[0]*t[4]+n[4]*t[5]+n[8]*t[6]+n[12]*t[7],n[1]*t[4]+n[5]*t[5]+n[9]*t[6]+n[13]*t[7],n[2]*t[4]+n[6]*t[5]+n[10]*t[6]+n[14]*t[7],n[3]*t[4]+n[7]*t[5]+n[11]*t[6]+n[15]*t[7],n[0]*t[8]+n[4]*t[9]+n[8]*t[10]+n[12]*t[11],n[1]*t[8]+n[5]*t[9]+n[9]*t[10]+n[13]*t[11],n[2]*t[8]+n[6]*t[9]+n[10]*t[10]+n[14]*t[11],n[3]*t[8]+n[7]*t[9]+n[11]*t[10]+n[15]*t[11],n[0]*t[12]+n[4]*t[13]+n[8]*t[14]+n[12]*t[15],n[1]*t[12]+n[5]*t[13]+n[9]*t[14]+n[13]*t[15],n[2]*t[12]+n[6]*t[13]+n[10]*t[14]+n[14]*t[15],n[3]*t[12]+n[7]*t[13]+n[11]*t[14]+n[15]*t[15]]}function s7(n){return n.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:n.map(a7).reduce(o7)}function I2(n){var t=[0,0,0],e=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return $z(s7(n),t,e,r,i,a),[[t,e,r,a,i]]}var u7=(function(){function n(r,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],o=0;o<4;o++)for(var s=0;s<4;s++)for(var u=0;u<4;u++)a[o][s]+=i[o][u]*r[u][s];return a}function t(r){return r[0][2]===0&&r[0][3]===0&&r[1][2]===0&&r[1][3]===0&&r[2][0]===0&&r[2][1]===0&&r[2][2]===1&&r[2][3]===0&&r[3][2]===0&&r[3][3]===1}function e(r,i,a,o,s){for(var u=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)u[c][3]=s[c];for(var l=0;l<3;l++)for(var d=0;d<3;d++)u[3][l]+=r[d]*u[d][l];var p=o[0],g=o[1],m=o[2],y=o[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(g*g+m*m),v[0][1]=2*(p*g-m*y),v[0][2]=2*(p*m+g*y),v[1][0]=2*(p*g+m*y),v[1][1]=1-2*(p*p+m*m),v[1][2]=2*(g*m-p*y),v[2][0]=2*(p*m-g*y),v[2][1]=2*(g*m+p*y),v[2][2]=1-2*(p*p+g*g),u=n(u,v);var x=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(x[2][1]=a[2],u=n(u,x)),a[1]&&(x[2][1]=0,x[2][0]=a[0],u=n(u,x)),a[0]&&(x[2][0]=0,x[1][0]=a[0],u=n(u,x));for(var E=0;E<3;E++)for(var w=0;w<3;w++)u[E][w]*=i[E];return t(u)?[u[0][0],u[0][1],u[1][0],u[1][1],u[3][0],u[3][1]]:u[0].concat(u[1],u[2],u[3])}return e})();function c7(n){return n.toFixed(6).replace(".000000","")}function dp(n,t){var e,r;return n.decompositionPair!==t&&(n.decompositionPair=t,e=I2(n)),t.decompositionPair!==n&&(t.decompositionPair=n,r=I2(t)),e[0]===null||r[0]===null?[[!1],[!0],function(i){return i?t[0].d:n[0].d}]:(e[0].push(0),r[0].push(1),[e,r,function(i){var a=h7(e[0][3],r[0][3],i[5]),o=u7(i[0],i[1],i[2],a,i[4]),s=o.map(c7).join(",");return s}])}function l7(n,t){for(var e=0,r=0;r<n.length;r++)e+=n[r]*t[r];return e}function h7(n,t,e){var r=l7(n,t);r=dn(r,-1,1);var i=[];if(r===1)i=n;else for(var a=Math.acos(r),o=Math.sin(e*a)*1/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(n[s]*(Math.cos(e*a)-r*o)+t[s]*o);return i}function fp(n){return n.replace(/[XY]/,"")}function pp(n){return n.replace(/(X|Y|Z|3d)?$/,"3d")}var d7=function(n,t){return n==="perspective"&&t==="perspective"||(n==="matrix"||n==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function f7(n,t,e){var r=!1;if(!n.length||!t.length){n.length||(r=!0,n=t,t=[]);for(var i=function(){var M=n[a],P=M.t,L=M.d,j=P.substring(0,5)==="scale"?1:0;t.push({t:P,d:L.map(function(z){return typeof z=="number"?Me(j):Me(j,z.unit)})})},a=0;a<n.length;a++)i()}var o=[],s=[],u=[];if(n.length!==t.length){var c=dp(n,t);o=[c[0]],s=[c[1]],u=[["matrix",[c[2]]]]}else for(var l=0;l<n.length;l++){var d=n[l].t,p=t[l].t,g=n[l].d,m=t[l].d,y=Cu[d],v=Cu[p],x=void 0;if(d7(d,p)){var E=dp([n[l]],[t[l]]);o.push(E[0]),s.push(E[1]),u.push(["matrix",[E[2]]]);continue}else if(d===p)x=d;else if(y[2]&&v[2]&&fp(d)===fp(p))x=fp(d),g=y[2](g),m=v[2](m);else if(y[1]&&v[1]&&pp(d)===pp(p))x=pp(d),g=y[1](g),m=v[1](m);else{var w=dp(n,t);o=[w[0]],s=[w[1]],u=[["matrix",[w[2]]]];break}for(var S=[],k=[],A=[],N=0;N<g.length;N++){var T=UF(g[N],m[N],e,!1,N);S[N]=T[0],k[N]=T[1],A.push(T[2])}o.push(S),s.push(k),u.push([x,A])}if(r){var O=o;o=s,s=O}return[o,s,function(M){return M.map(function(P,L){var j=P.map(function(z,U){return u[L][1][U](z)}).join(",");return u[L][0]==="matrix"&&j.split(",").length===16&&(u[L][0]="matrix3d"),u[L][0]==="matrix3d"&&j.split(",").length===6&&(u[L][0]="matrix"),"".concat(u[L][0],"(").concat(j,")")}).join(" ")}]}var p7=Ye(function(n){if(fe(n)){if(n==="text-anchor")return[Me(0,"px"),Me(0,"px")];var t=n.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[C1(j2(t[0])),C1(j2(t[1]))]}return[Me(n[0]||0,"px"),Me(n[1]||0,"px")]});function j2(n){return n==="center"?"50%":n==="left"||n==="top"?"0%":n==="right"||n==="bottom"?"100%":n}var xb=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:ct.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:ct.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:ct.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:ct.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:ct.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:ct.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:ct.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:ct.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:ct.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:ct.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:ct.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:ct.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:ct.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:ct.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:ct.FILTER},{n:"clipPath",syntax:ct.DEFINED_PATH},{n:"textPath",syntax:ct.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:ct.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:ct.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:ct.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ct.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:ct.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:ct.COORDINATE},{n:"y1",int:!0,l:!0,syntax:ct.COORDINATE},{n:"z1",int:!0,l:!0,syntax:ct.COORDINATE},{n:"x2",int:!0,l:!0,syntax:ct.COORDINATE},{n:"y2",int:!0,l:!0,syntax:ct.COORDINATE},{n:"z2",int:!0,l:!0,syntax:ct.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:ct.PATH,p:50},{n:"points",int:!0,l:!0,syntax:ct.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:ct.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:ct.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:ct.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:ct.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:ct.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:ct.NUMBER,d:function(n){return n===X.PATH||n===X.POLYGON||n===X.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:ct.MARKER},{n:"markerEnd",syntax:ct.MARKER},{n:"markerMid",syntax:ct.MARKER},{n:"markerStartOffset",syntax:ct.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:ct.LENGTH,l:!0,int:!0,d:"0"}],g7=new Set(xb.filter(function(n){return!!n.l}).map(function(n){return n.n})),f_={},v7=(function(){function n(t){var e=this;et(this,n),this.runtime=t,xb.forEach(function(r){e.registerMetadata(r)})}return nt(n,[{key:"registerMetadata",value:function(t){[t.n].concat(Ht(t.a||[])).forEach(function(e){f_[e]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{forceUpdateGeometry:!1};Object.assign(t.attributes,e);var i=t.parsedStyle.clipPath,a=t.parsedStyle.offsetPath;m7(t,e);var o=!!r.forceUpdateGeometry;if(!o){for(var s in e)if(g7.has(s)){o=!0;break}}var u=p_(t);u.has("fill")&&e.fill&&(t.parsedStyle.fill=gu(e.fill)),u.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=gu(e.stroke)),u.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=gu(e.shadowColor)),u.has("filter")&&e.filter&&(t.parsedStyle.filter=$F(e.filter)),u.has("radius")&&!Tt(e.radius)&&(t.parsedStyle.radius=_2(e.radius,4)),u.has("lineDash")&&!Tt(e.lineDash)&&(t.parsedStyle.lineDash=_2(e.lineDash,"even")),u.has("points")&&e.points&&(t.parsedStyle.points=n7(e.points)),u.has("d")&&e.d===""&&(t.parsedStyle.d=Lt({},ZM)),u.has("d")&&e.d&&(t.parsedStyle.d=l_(e.d)),u.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[ct.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),u.has("clipPath")&&!Ce(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[ct.DEFINED_PATH].calculator("clipPath",i,e.clipPath,t,this.runtime),u.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[ct.DEFINED_PATH].calculator("offsetPath",a,e.offsetPath,t,this.runtime),u.has("transform")&&e.transform&&(t.parsedStyle.transform=d_(e.transform)),u.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=p7(e.transformOrigin)),u.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[ct.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),u.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[ct.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),u.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[ct.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),u.has("zIndex")&&!Tt(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[ct.Z_INDEX].postProcessor(t),u.has("offsetDistance")&&!Tt(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[ct.OFFSET_DISTANCE].postProcessor(t),u.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[ct.TRANSFORM].postProcessor(t),u.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[ct.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.dirty(!0,!0),r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,r=this.runtime.geometryUpdaterFactory[e];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new ye),i.renderBounds||(i.renderBounds=new ye);var a=t.parsedStyle,o=r.update(a,t),s=o.cx,u=s===void 0?0:s,c=o.cy,l=c===void 0?0:c,d=o.cz,p=d===void 0?0:d,g=o.hwidth,m=g===void 0?0:g,y=o.hheight,v=y===void 0?0:y,x=o.hdepth,E=x===void 0?0:x,w=[Math.abs(m),Math.abs(v),E],S=a.stroke,k=a.lineWidth,A=k===void 0?1:k,N=a.increasedLineWidthForHitTesting,T=N===void 0?0:N,O=a.shadowType,M=O===void 0?"outer":O,P=a.shadowColor,L=a.filter,j=L===void 0?[]:L,z=a.transformOrigin,U=[u,l,p];i.contentBounds.update(U,w);var J=e===X.POLYLINE||e===X.POLYGON||e===X.PATH?Math.SQRT2:.5,W=S&&!S.isNone;if(W){var at=((A||0)+(T||0))*J;w[0]+=at,w[1]+=at}if(i.renderBounds.update(U,w),P&&M&&M!=="inner"){var ut=i.renderBounds,yt=ut.min,kt=ut.max,It=a.shadowBlur,ee=a.shadowOffsetX,$=a.shadowOffsetY,Y=It||0,F=ee||0,K=$||0,ot=yt[0]-Y+F,dt=kt[0]+Y+F,mt=yt[1]-Y+K,Ot=kt[1]+Y+K;yt[0]=Math.min(yt[0],ot),kt[0]=Math.max(kt[0],dt),yt[1]=Math.min(yt[1],mt),kt[1]=Math.max(kt[1],Ot),i.renderBounds.setMinMax(yt,kt)}j.forEach(function(we){var Et=we.name,ze=we.params;if(Et==="blur"){var _n=ze[0].value;i.renderBounds.update(i.renderBounds.center,da(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[_n,_n,0]))}else if(Et==="drop-shadow"){var zn=ze[0].value,Je=ze[1].value,Qe=ze[2].value,je=i.renderBounds,Fn=je.min,sn=je.max,Cs=Fn[0]-Qe+zn,Zr=sn[0]+Qe+zn,On=Fn[1]-Qe+Je,Yi=sn[1]+Qe+Je;Fn[0]=Math.min(Fn[0],Cs),sn[0]=Math.max(sn[0],Zr),Fn[1]=Math.min(Fn[1],On),sn[1]=Math.max(sn[1],Yi),i.renderBounds.setMinMax(Fn,sn)}}),t.geometry.dirty=!1;var ne=m<0,Qt=v<0,_t=(ne?-1:1)*(z?ur(z[0],0,t,!0):0),wt=(Qt?-1:1)*(z?ur(z[1],1,t,!0):0);(_t||wt)&&t.setOrigin(_t,wt)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===X.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===X.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])})();function m7(n,t){var e=p_(n);for(var r in t)e.has(r)&&(n.parsedStyle[r]=t[r])}function p_(n){return n.constructor.PARSED_STYLE_LIST}var y7=(function(){function n(){et(this,n),this.mixer=yb}return nt(n,[{key:"calculator",value:function(t,e,r,i){return Xn(r)}}])})(),b7=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r,i,a){return r instanceof Dr&&(r=null),a.sceneGraphService.updateDisplayObjectDependency(t,e,r,i),t==="clipPath"&&i.forEach(function(o){o.childNodes.length===0&&a.sceneGraphService.dirtyToRoot(o)}),r}}])})(),x7=(function(){function n(){et(this,n),this.parser=gu,this.mixer=zF}return nt(n,[{key:"calculator",value:function(t,e,r,i){return r instanceof Dr?r.value==="none"?t_:e_:r}}])})(),E7=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r){return r instanceof Dr?[]:r}}])})();function B2(n){var t=n.parsedStyle,e=t.fontSize;return Tt(e)?null:e}var _1=(function(){function n(){et(this,n),this.mixer=yb}return nt(n,[{key:"calculator",value:(function(t,e,r,i,a){if(Xt(r))return r;if(ln.isRelativeUnit(r.unit)){if(r.unit===ht.kPercentage)return 0;if(r.unit===ht.kEms){if(i.parentNode){var o=B2(i.parentNode);if(o)return o*=r.value,o}return 0}if(r.unit===ht.kRems){var s;if(i!=null&&(s=i.ownerDocument)!==null&&s!==void 0&&s.documentElement){var u=B2(i.ownerDocument.documentElement);if(u)return u*=r.value,u}return 0}}else return r.value})}])})(),w7=(function(){function n(){et(this,n),this.mixer=u_}return nt(n,[{key:"calculator",value:function(t,e,r){return r.map(function(i){return i.value})}}])})(),k7=(function(){function n(){et(this,n),this.mixer=u_}return nt(n,[{key:"calculator",value:function(t,e,r){return r.map(function(i){return i.value})}}])})(),A7=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r,i){var a;r instanceof Dr&&(r=null);var o=(a=r)===null||a===void 0?void 0:a.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])})(),S7=(function(){function n(){et(this,n),this.mixer=yb}return nt(n,[{key:"calculator",value:function(t,e,r){return r.value}}])})(),C7=(function(){function n(){et(this,n),this.mixer=bb(0,1)}return nt(n,[{key:"calculator",value:function(t,e,r){return r.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,r=e.offsetPath,i=e.offsetDistance;if(r){var a=r.nodeName;if(a===X.LINE||a===X.PATH||a===X.POLYLINE){var o=r.getPoint(i);o&&t.setLocalPosition(o.x,o.y)}}}}])})(),N7=(function(){function n(){et(this,n),this.mixer=bb(0,1)}return nt(n,[{key:"calculator",value:function(t,e,r){return r.value}}])})(),T7=(function(){function n(){et(this,n),this.parser=l_,this.mixer=e7}return nt(n,[{key:"calculator",value:function(t,e,r){return r instanceof Dr&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new as(0,0,0,0)}:r}}])})(),M7=nt(function n(){et(this,n),this.mixer=r7}),_7=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.mixer=bb(0,1/0),e}return zt(t,n),nt(t)})(_1),O7=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r,i){return r instanceof Dr?r.value==="unset"?"":r.value:"".concat(r)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])})(),P7=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r,i){var a=i.getAttribute("text");if(a){var o=a;r.value==="capitalize"?o=a.charAt(0).toUpperCase()+a.slice(1):r.value==="lowercase"?o=a.toLowerCase():r.value==="uppercase"&&(o=a.toUpperCase()),i.parsedStyle.text=o}return r.value}}])})(),gp=new WeakMap;function R7(n,t,e){if(n){var r=typeof n=="string"?document.getElementById(n):n;gp.has(r)&&gp.get(r).destroy(e),gp.set(r,t)}}var Eb=typeof window<"u"&&typeof window.document<"u";function D7(n){return!!n.getAttribute}function L7(n,t){for(var e=0,r=n.length;e<r;){var i=e+r>>>1;g_(n[i],t)<0?e=i+1:r=i}return e}function g_(n,t){var e=Number(n.parsedStyle.zIndex||0),r=Number(t.parsedStyle.zIndex||0);if(e===r){var i=n.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(n)-a.indexOf(t)}}return e-r}function v_(n){var t=n;do{var e,r=(e=t.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(r)return t;t=t.parentElement}while(t!==null);return null}var z2="px";function I7(n,t,e){Eb&&n.style&&(n.style.width=t+z2,n.style.height=e+z2)}function m_(n,t){if(Eb)return document.defaultView.getComputedStyle(n,null).getPropertyValue(t)}function j7(n){var t=m_(n,"width");return t==="auto"?n.offsetWidth:parseFloat(t)}function B7(n){var t=m_(n,"height");return t==="auto"?n.offsetHeight:parseFloat(t)}var z7=1,F7={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},O1=typeof performance=="object"&&performance.now?performance:Date;function rh(n){return n.nodeName===X.FRAGMENT?!0:n.getRootNode().nodeName===X.FRAGMENT}function ho(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",t=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!t&&!t.isNone,o=!!e&&!e.isNone;return n==="visiblepainted"||n==="painted"||n==="auto"?(r=a,i=o):n==="visiblefill"||n==="fill"?r=!0:n==="visiblestroke"||n==="stroke"?i=!0:(n==="visible"||n==="all")&&(r=!0,i=!0),[r,i]}var G7=1,V7=function(){return G7++},pi=typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:{},U7=Date.now(),W7=function(){return pi.performance&&typeof pi.performance.now=="function"?pi.performance.now():Date.now()-U7},ou={},F2=Date.now(),Y7=function(n){if(typeof n!="function")throw new TypeError("".concat(n," is not a function"));var t=Date.now(),e=t-F2,r=e>16?0:16-e,i=V7();return ou[i]=n,Object.keys(ou).length>1||setTimeout(function(){F2=t;var a=ou;ou={},Object.keys(a).forEach(function(o){return a[o](W7())})},r),i},$7=function(n){delete ou[n]},H7=["","webkit","moz","ms","o"],y_=function(n){return typeof n!="string"?Y7:n===""?pi.requestAnimationFrame:pi["".concat(n,"RequestAnimationFrame")]},X7=function(n){return typeof n!="string"?$7:n===""?pi.cancelAnimationFrame:pi["".concat(n,"CancelAnimationFrame")]||pi["".concat(n,"CancelRequestAnimationFrame")]},q7=function(n,t){for(var e=0;n[e]!==void 0;){if(t(n[e]))return n[e];e+=1}},b_=q7(H7,function(n){return!!y_(n)}),wb=y_(b_),x_=X7(b_);pi.requestAnimationFrame=wb;pi.cancelAnimationFrame=x_;var K7=(function(){function n(){et(this,n),this.callbacks=[]}return nt(n,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Promise.all(this.callbacks.map(function(i){return i.apply(void 0,e)}))}}])})(),Z7=(function(){function n(){et(this,n),this.callbacks=[]}return nt(n,[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(function(){var t=ya(fn().mark(function r(){var i,a,o,s,u=arguments;return fn().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.callbacks.length){c.next=6;break}return c.next=1,(i=this.callbacks)[0].apply(i,u);case 1:a=c.sent,o=0;case 2:if(!(o<this.callbacks.length-1)){c.next=5;break}return s=this.callbacks[o],c.next=3,s(a);case 3:a=c.sent;case 4:o++,c.next=2;break;case 5:return c.abrupt("return",a);case 6:return c.abrupt("return",null);case 7:case"end":return c.stop()}},r,this)}));function e(){return t.apply(this,arguments)}return e})()}])})(),Ln=(function(){function n(){et(this,n),this.callbacks=[]}return nt(n,[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=arguments;this.callbacks.forEach(function(a){a.apply(void 0,i)})}}])})(),vp=(function(){function n(){et(this,n),this.callbacks=[]}return nt(n,[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(this.callbacks.length){for(var i=arguments,a=this.callbacks[0].apply(void 0,i),o=0;o<this.callbacks.length-1;o++){var s=this.callbacks[o];a=s(a)}return a}return null}}])})(),J7=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Q7=/([\"\'])[^\'\"]+\1/;function G2(n){var t=n.fontSize,e=t===void 0?16:t,r=n.fontFamily,i=r===void 0?"sans-serif":r,a=n.fontStyle,o=a===void 0?"normal":a,s=n.fontVariant,u=s===void 0?"normal":s,c=n.fontWeight,l=c===void 0?"normal":c;return{fontSize:e,fontFamily:i,fontStyle:o,fontVariant:u,fontWeight:l}}var V2=Ye(function(n){for(var t=G2(n),e=t.fontSize,r=t.fontFamily,i=t.fontStyle,a=t.fontVariant,o=t.fontWeight,s=Xt(e)&&"".concat(e,"px")||"16px",u=r.split(","),c=u.length-1;c>=0;c--){var l=u[c].trim();!Q7.test(l)&&J7.indexOf(l)<0&&(l='"'.concat(l,'"')),u[c]=l}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(u.join(","))},function(n){var t=G2(n),e=t.fontSize,r=t.fontFamily,i=t.fontStyle,a=t.fontVariant,o=t.fontWeight;return"".concat(i,"_").concat(a,"_").concat(o,"_").concat(e,"_").concat(r)}),tG=1e-6,Xs=function(n){return Math.max(n,tG)};function mp(n,t,e){return va(n),n[4]=Math.tan(t),n[1]=Math.tan(e),n}var Ue=pe(),eG=pe(),nG={scale:function(n){Ua(Ue,[n[0].value,n[1].value,1].map(function(t){return Xs(t)}))},scaleX:function(n){Ua(Ue,[n[0].value,1,1].map(function(t){return Xs(t)}))},scaleY:function(n){Ua(Ue,[1,n[0].value,1].map(function(t){return Xs(t)}))},scaleZ:function(n){Ua(Ue,[1,1,n[0].value].map(function(t){return Xs(t)}))},scale3d:function(n){Ua(Ue,[n[0].value,n[1].value,n[2].value].map(function(t){return Xs(t)}))},translate:function(n){ia(Ue,[n[0].value,n[1].value,0])},translateX:function(n){ia(Ue,[n[0].value,0,0])},translateY:function(n){ia(Ue,[0,n[0].value,0])},translateZ:function(n){ia(Ue,[0,0,n[0].value])},translate3d:function(n){ia(Ue,[n[0].value,n[1].value,n[2].value])},rotate:function(n){l1(Ue,de(Xn(n[0])))},rotateX:function(n){gM(Ue,de(Xn(n[0])))},rotateY:function(n){vM(Ue,de(Xn(n[0])))},rotateZ:function(n){l1(Ue,de(Xn(n[0])))},rotate3d:function(n){pM(Ue,de(Xn(n[3])),[n[0].value,n[1].value,n[2].value])},skew:function(n){mp(Ue,de(n[0].value),de(n[1].value))},skewX:function(n){mp(Ue,de(n[0].value),0)},skewY:function(n){mp(Ue,0,de(n[0].value))},matrix:function(n){c1(Ue,n[0].value,n[1].value,0,0,n[2].value,n[3].value,0,0,0,0,1,0,n[4].value,n[5].value,0,1)},matrix3d:function(n){c1.apply(Zj,[Ue].concat(Ht(n.map(function(t){return t.value}))))}},rG=Ee(1,1,1),iG=Yt(),U2={translate:function(n,t){rt.sceneGraphService.setLocalScale(n,rG,!1),rt.sceneGraphService.setLocalEulerAngles(n,iG,void 0,void 0,!1),rt.sceneGraphService.setLocalPosition(n,[t[0].value,t[1].value,0],!1),rt.sceneGraphService.dirtyLocalTransform(n,n.transformable)}};function E_(n,t){if(n.length){if(n.length===1&&U2[n[0].t]){U2[n[0].t](t,n[0].d);return}for(var e=va(eG),r=0;r<n.length;r++){var i=n[r],a=i.t,o=i.d,s=nG[a];s&&(s(o),AM(e,e,Ue))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var aG=(function(){function n(){et(this,n),this.parser=i7,this.mixer=f7}return nt(n,[{key:"calculator",value:function(t,e,r,i){return r instanceof Dr?[]:r}},{key:"postProcessor",value:function(t){E_(t.parsedStyle.transform,t)}}])})(),oG=(function(){function n(){et(this,n)}return nt(n,[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===ht.kPixels&&e[1].unit===ht.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])})(),sG=(function(){function n(){et(this,n)}return nt(n,[{key:"calculator",value:function(t,e,r,i){return r.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,r=e.renderable,i=e.sortable;r&&e.dirty(),i&&(i.dirty=!0,i.dirtyReason=Jl.Z_INDEX_CHANGED)}}}])})(),uG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t,e){var r=t.cx,i=r===void 0?0:r,a=t.cy,o=a===void 0?0:a,s=t.r,u=s===void 0?0:s;return{cx:i,cy:o,hwidth:u,hheight:u}}}])})(),cG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t,e){var r=t.cx,i=r===void 0?0:r,a=t.cy,o=a===void 0?0:a,s=t.rx,u=s===void 0?0:s,c=t.ry,l=c===void 0?0:c;return{cx:i,cy:o,hwidth:u,hheight:l}}}])})(),lG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t){var e=t.x1,r=t.y1,i=t.x2,a=t.y2,o=Math.min(e,i),s=Math.max(e,i),u=Math.min(r,a),c=Math.max(r,a),l=s-o,d=c-u,p=l/2,g=d/2;return{cx:o+p,cy:u+g,hwidth:p,hheight:g}}}])})(),hG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t){var e=t.d,r=e.rect,i=r.x,a=r.y,o=r.width,s=r.height,u=o/2,c=s/2;return{cx:i+u,cy:a+c,hwidth:u,hheight:c}}}])})(),dG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t){if(t.points&&yi(t.points.points)){var e=t.points.points,r=Math.min.apply(Math,Ht(e.map(function(d){return d[0]}))),i=Math.max.apply(Math,Ht(e.map(function(d){return d[0]}))),a=Math.min.apply(Math,Ht(e.map(function(d){return d[1]}))),o=Math.max.apply(Math,Ht(e.map(function(d){return d[1]}))),s=i-r,u=o-a,c=s/2,l=u/2;return{cx:r+c,cy:a+l,hwidth:c,hheight:l}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])})(),fG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t,e){var r=t.x,i=r===void 0?0:r,a=t.y,o=a===void 0?0:a,s=t.src,u=t.width,c=u===void 0?0:u,l=t.height,d=l===void 0?0:l,p=c,g=d;return s&&!fe(s)&&(p||(p=s.width,t.width=p),g||(g=s.height,t.height=g)),{cx:i+p/2,cy:o+g/2,hwidth:p/2,hheight:g/2}}}])})(),pG=(function(){function n(t){et(this,n),this.globalRuntime=t}return nt(n,[{key:"isReadyToMeasure",value:function(t,e){var r=t.text;return r}},{key:"update",value:function(t,e){var r,i=t.text,a=t.textAlign,o=a===void 0?"start":a,s=t.lineWidth,u=s===void 0?1:s,c=t.textBaseline,l=c===void 0?"alphabetic":c,d=t.dx,p=d===void 0?0:d,g=t.dy,m=g===void 0?0:g,y=t.x,v=y===void 0?0:y,x=t.y,E=x===void 0?0:x;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var w=(e==null||(r=e.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0?void 0:r.getConfig())||{},S=w.offscreenCanvas,k=this.globalRuntime.textService.measureText(i,t,S);t.metrics=k;var A=k.width,N=k.height,T=A/2,O=N/2,M=v+T;o==="center"||o==="middle"?M+=u/2-T:(o==="right"||o==="end")&&(M+=u-T*2);var P=E-O;return l==="middle"?P+=O:l==="top"||l==="hanging"?P+=O*2:l==="alphabetic"||(l==="bottom"||l==="ideographic")&&(P+=0),p&&(M+=p),m&&(P+=m),{cx:M,cy:P,hwidth:T,hheight:O}}}])})(),gG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])})(),vG=(function(){function n(){et(this,n)}return nt(n,[{key:"update",value:function(t,e){var r=t.x,i=r===void 0?0:r,a=t.y,o=a===void 0?0:a,s=t.width,u=s===void 0?0:s,c=t.height,l=c===void 0?0:c;return{cx:i+u/2,cy:o+l/2,hwidth:u/2,hheight:l/2}}}])})(),Rh=(function(){function n(t){et(this,n),this.eventPhase=n.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new mn,this.page=new mn,this.canvas=new mn,this.viewport=new mn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return nt(n,[{key:"name",get:(function(){return this.type})},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:(function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path})},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:(function(){})},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(he)}}])})(),w_=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.client=new mn,e.movement=new mn,e.offset=new mn,e.global=new mn,e.screen=new mn,e}return zt(t,n),nt(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}},{key:"initMouseEvent",value:function(){throw new Error(he)}}])})(Rh),P1=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.width=0,e.height=0,e.isPrimary=!1,e}return zt(t,n),nt(t,[{key:"getCoalescedEvents",value:(function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]})},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])})(w_),R1=(function(n){function t(){return et(this,t),Bt(this,t,arguments)}return zt(t,n),nt(t,[{key:"clone",value:(function(){return this.manager.cloneWheelEvent(this)})}])})(w_),vn=(function(n){function t(e,r){var i;return et(this,t),i=Bt(this,t,[null]),i.type=e,i.detail=r,Object.assign(i,r),i}return zt(t,n),nt(t)})(Rh),k_=(function(){function n(){et(this,n),this.emitter=new aM}return nt(n,[{key:"on",value:(function(t,e,r){return this.addEventListener(t,e,r),this})},{key:"addEventListener",value:function(t,e,r){var i=!1,a=!1;if(Eu(r))i=r;else if(r){var o=r.capture;i=o===void 0?!1:o;var s=r.once;a=s===void 0?!1:s}i&&(t+="capture"),e=St(e)?e:e.handleEvent;var u=St(e)?void 0:e;return a?this.emitter.once(t,e,u):this.emitter.on(t,e,u),this}},{key:"off",value:function(t,e,r){return t?this.removeEventListener(t,e,r):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;(t=this.emitter)===null||t===void 0||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,r){var i;if(!this.emitter)return this;var a=Eu(r)?r:r==null?void 0:r.capture;a&&(t+="capture"),e=St(e)?e:(i=e)===null||i===void 0?void 0:i.handleEvent;var o=St(e)?void 0:e;return this.emitter.off(t,e,o),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new vn(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2?arguments[2]:void 0;if(r)return this.dispatchEventToSelf(t),!0;var i;if(this.document)i=this;else if(this.defaultView)i=this.defaultView;else{var a;i=(a=this.ownerDocument)===null||a===void 0?void 0:a.defaultView}if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],e||(t.target=this),t.manager.dispatchEvent(t,t.type,e)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])})(),Oe=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e.destroyed=!1,e}return zt(t,n),nt(t,[{key:"textContent",get:(function(){var e="";this.nodeName===X.TEXT&&(e+=this.style.text);var r=Wa(this.childNodes),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;a.nodeName===X.TEXT?e+=a.nodeValue:e+=a.textContent}}catch(o){r.e(o)}finally{r.f()}return e}),set:function(e){var r=this;this.childNodes.slice().forEach(function(i){r.removeChild(i)}),this.nodeName===X.TEXT&&(this.style.text="".concat(e))}},{key:"getRootNode",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(e):e.composed&&this.host?this.host.getRootNode(e):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(e){throw new Error(he)}},{key:"lookupNamespaceURI",value:function(e){throw new Error(he)}},{key:"lookupPrefix",value:function(e){throw new Error(he)}},{key:"normalize",value:function(){throw new Error(he)}},{key:"isEqualNode",value:function(e){return this===e}},{key:"isSameNode",value:function(e){return this.isEqualNode(e)}},{key:"parent",get:(function(){return this.parentNode})},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(e){if(e===this)return 0;for(var r=e,i=this,a=[r],o=[i];(s=r.parentNode)!==null&&s!==void 0?s:i.parentNode;){var s;r=r.parentNode?(a.push(r.parentNode),r.parentNode):r,i=i.parentNode?(o.push(i.parentNode),i.parentNode):i}if(r!==i)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var u=a.length>o.length?a:o,c=u===a?o:a;if(u[u.length-c.length]===c[0])return u===a?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var l=u.length-c.length,d=c.length-1;d>=0;d--){var p=c[d],g=u[l+d];if(g!==p){var m=p.parentNode.childNodes;return m.indexOf(p)<m.indexOf(g)?c===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:u===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:(function(e){return this.contains(e)})},{key:"contains",value:function(e){for(var r=e;r&&this!==r;)r=r.parentNode;return!!r}},{key:"getAncestor",value:function(e){for(var r=this;e>0&&r;)r=r.parentNode,e--;return r}},{key:"forEach",value:function(e){for(var r=[this];r.length>0;){var i=r.pop(),a=e(i);if(a===!1)break;for(var o=i.childNodes.length-1;o>=0;o--)r.push(i.childNodes[o])}}}],[{key:"isNode",value:function(e){return!!e.childNodes}}])})(k_);Oe.DOCUMENT_POSITION_DISCONNECTED=1;Oe.DOCUMENT_POSITION_PRECEDING=2;Oe.DOCUMENT_POSITION_FOLLOWING=4;Oe.DOCUMENT_POSITION_CONTAINS=8;Oe.DOCUMENT_POSITION_CONTAINED_BY=16;Oe.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var mG=2048,yG=(function(){function n(t,e){var r=this;et(this,n),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=pe(),this.tmpVec3=Yt(),this.onPointerDown=function(i){var a=r.createPointerEvent(i);if(r.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")r.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;r.dispatchEvent(a,o?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=a.composedPath(),r.freeEvent(a)},this.onPointerUp=function(i){var a=O1.now(),o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(o,"pointerup"),o.pointerType==="touch")r.dispatchEvent(o,"touchend");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var s=o.button===2;r.dispatchEvent(o,s?"rightup":"mouseup")}var u=r.trackingData(i.pointerId),c=r.findMountedTarget(u.pressTargetsByButton[i.button]),l=c;if(c&&!o.composedPath().includes(c)){for(var d=c;d&&!o.composedPath().includes(d);){if(o.currentTarget=d,r.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch")r.notifyTarget(o,"touchendoutside");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var p=o.button===2;r.notifyTarget(o,p?"rightupoutside":"mouseupoutside")}Oe.isNode(d)&&(d=d.parentNode)}delete u.pressTargetsByButton[i.button],l=d}if(l){var g,m=r.clonePointerEvent(o,"click");m.target=l,m.path=[],u.clicksByButton[i.button]||(u.clicksByButton[i.button]={clickCount:0,target:m.target,timeStamp:a});var y=r.context.renderingContext.root.ownerDocument.defaultView,v=u.clicksByButton[i.button];v.target===m.target&&a-v.timeStamp<y.getConfig().dblClickSpeed?++v.clickCount:v.clickCount=1,v.target=m.target,v.timeStamp=a,m.detail=v.clickCount,(g=o.detail)!==null&&g!==void 0&&g.preventClick||(!r.context.config.useNativeClickEvent&&(m.pointerType==="mouse"||m.pointerType==="touch")&&r.dispatchEvent(m,"click"),r.dispatchEvent(m,"pointertap")),r.freeEvent(m)}r.freeEvent(o)},this.onPointerMove=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),o=a.pointerType==="mouse"||a.pointerType==="pen",s=r.trackingData(i.pointerId),u=r.findMountedTarget(s.overTargets);if(s.overTargets&&u!==a.target){var c=i.type==="mousemove"?"mouseout":"pointerout",l=r.createPointerEvent(i,c,u||void 0);if(r.dispatchEvent(l,"pointerout"),o&&r.dispatchEvent(l,"mouseout"),!a.composedPath().includes(u)){var d=r.createPointerEvent(i,"pointerleave",u||void 0);for(d.eventPhase=d.AT_TARGET;d.target&&!a.composedPath().includes(d.target);)d.currentTarget=d.target,r.notifyTarget(d),o&&r.notifyTarget(d,"mouseleave"),Oe.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(l)}if(u!==a.target){var p=i.type==="mousemove"?"mouseover":"pointerover",g=r.clonePointerEvent(a,p);r.dispatchEvent(g,"pointerover"),o&&r.dispatchEvent(g,"mouseover");for(var m=u&&Oe.isNode(u)&&u.parentNode;m&&m!==(Oe.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&m!==a.target;)m=m.parentNode;var y=!m||m===(Oe.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(y){var v=r.clonePointerEvent(a,"pointerenter");for(v.eventPhase=v.AT_TARGET;v.target&&v.target!==u&&v.target!==(Oe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)v.currentTarget=v.target,r.notifyTarget(v),o&&r.notifyTarget(v,"mouseenter"),Oe.isNode(v.target)&&(v.target=v.target.parentNode);r.freeEvent(v)}r.freeEvent(g)}r.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&r.dispatchEvent(a,"touchmove"),o&&(r.dispatchEvent(a,"mousemove"),r.cursor=r.getCursor(a.target)),s.overTargets=a.composedPath(),r.freeEvent(a)},this.onPointerOut=function(i){var a=r.trackingData(i.pointerId);if(a.overTargets){var o=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(a.overTargets),u=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(u),o&&r.dispatchEvent(u,"mouseout");var c=r.createPointerEvent(i,"pointerleave",s||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(Oe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),o&&r.notifyTarget(c,"mouseleave"),Oe.isNode(c.target)&&(c.target=c.target.parentNode);a.overTargets=null,r.freeEvent(u),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var a=r.trackingData(i.pointerId),o=r.createPointerEvent(i),s=o.pointerType==="mouse"||o.pointerType==="pen";r.dispatchEvent(o,"pointerover"),s&&r.dispatchEvent(o,"mouseover"),o.pointerType==="mouse"&&(r.cursor=r.getCursor(o.target));var u=r.clonePointerEvent(o,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==(Oe.isNode(r.rootTarget)&&r.rootTarget.parentNode);)u.currentTarget=u.target,r.notifyTarget(u),s&&r.notifyTarget(u,"mouseenter"),Oe.isNode(u.target)&&(u.target=u.target.parentNode);a.overTargets=o.composedPath(),r.freeEvent(o),r.freeEvent(u)},this.onPointerUpOutside=function(i){var a=r.trackingData(i.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(o){for(var u=o;u;)s.currentTarget=u,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),Oe.isNode(u)&&(u=u.parentNode);delete a.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var a=r.createWheelEvent(i);r.dispatchEvent(a),r.freeEvent(a)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var a=r.createPointerEvent(i);r.dispatchEvent(a),r.freeEvent(a)}},this.onPointerCancel=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(a),r.freeEvent(a)},this.globalRuntime=t,this.context=e}return nt(n,[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,r=1,i=this.context.contextService.getDomElement();if(i&&t){var a=i.offsetWidth,o=i.offsetHeight;a&&o&&(e=t.width/a,r=t.height/o)}return{scaleX:e,scaleY:r,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),r=e.scaleX,i=e.scaleY,a=e.bbox;return new mn((t.x-((a==null?void 0:a.left)||0))/r,(t.y-((a==null?void 0:a.top)||0))/i)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),r=e.scaleX,i=e.scaleY,a=e.bbox;return new mn((t.x+((a==null?void 0:a.left)||0))*r,(t.y+((a==null?void 0:a.top)||0))*i)}},{key:"viewport2Canvas",value:function(t){var e=t.x,r=t.y,i=this.rootTarget.defaultView,a=i.getCamera(),o=this.context.config,s=o.width,u=o.height,c=a.getPerspectiveInverse(),l=a.getWorldTransform(),d=Nn(this.tmpMatrix,l,c),p=kn(this.tmpVec3,e/s*2-1,(1-r/u)*2-1,0);return Tn(p,p,d),new mn(p[0],p[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView,r=e.getCamera(),i=r.getPerspective(),a=r.getViewTransform(),o=Nn(this.tmpMatrix,i,a),s=kn(this.tmpVec3,t.x,t.y,0);Tn(this.tmpVec3,this.tmpVec3,o);var u=this.context.config,c=u.width,l=u.height;return new mn((s[0]+1)/2*c,(1-(s[1]+1)/2)*l)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(r,i){return r.priority-i.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var r=0,i=e.length;r<i;r++)e[r].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,r){if(!r)t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);else{t.eventPhase=t.AT_TARGET;var i=this.rootTarget.defaultView||null;t.currentTarget=i,this.notifyListeners(t,e)}}},{key:"propagate",value:function(t,e){if(t.target){var r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!(t.propagationStopped||t.propagationImmediatelyStopped)){var a=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=a+1;o<r.length;o++)if(t.currentTarget=r[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],r=this.rootTarget.defaultView||null;if(r&&r===t)return e.unshift(r.document),e;for(var i=0;i<mG&&t!==this.rootTarget;i++)Oe.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return r&&e.push(r),e}},{key:"hitTest",value:function(t){var e=t.viewportX,r=t.viewportY,i=this.context.config,a=i.width,o=i.height,s=i.disableHitTesting;return e<0||r<0||e>a||r>o?null:!s&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var r,i=e==null?void 0:e.target;if((r=i)!==null&&r!==void 0&&r.shadowRoot&&(i=e.composedPath()[0]),i){if(i===t)return!0;if(t&&t.contains)return t.contains(i)}return e!=null&&e.composedPath?e.composedPath().indexOf(t)>-1:!1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,r=t.nativeEvent.composedPath();e<r.length;e++){var i=r[e],a=this.nativeHTMLMap.get(i);if(a)return a}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,r,i){var a=this.allocateEvent(P1);this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t;var o=this.getExistedHTML(a),s=this.context.contextService.getDomElement();return a.target=r??(o||this.isNativeEventFromCanvas(s,a.nativeEvent)&&this.pickTarget(a)||i),typeof e=="string"&&(a.type=e),a}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(R1);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var r=this.getExistedHTML(e),i=this.context.contextService.getDomElement();return e.target=r||this.isNativeEventFromCanvas(i,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(R1);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var r=this.allocateEvent(P1);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=e??r.type,r}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=O1.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=e??t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var r=t.currentTarget.emitter,i=r._events[e];if(i)if("fn"in i)i.once&&r.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var a=0;a<i.length&&!t.propagationImmediatelyStopped;a++)i[a].once&&r.removeListener(e,i[a].fn,void 0,!0),i[a].fn.call(t.currentTarget||i[a].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],r=t.length-2;r>=0;r--){var i=t[r];if(i===this.rootTarget||Oe.isNode(i)&&i.parentNode===e)e=t[r];else break}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var r=D7(e)&&e.getAttribute("cursor");if(r)return r;e=Oe.isNode(e)&&e.parentNode}}}])})(),kb=(function(){function n(){et(this,n)}return nt(n,[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||rt.offscreenCanvas)this.canvas=t||rt.offscreenCanvas,this.context=this.canvas.getContext("2d",Lt({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",Lt({willReadFrequently:!0},e)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch{this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",Lt({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context?this.context:(this.getOrCreateCanvas(t,e),this.context)}}],[{key:"createCanvas",value:(function(){try{return new window.OffscreenCanvas(0,0)}catch{}try{return document.createElement("canvas")}catch{}return null})}])})(),Jo=(function(n){return n[n.CAMERA_CHANGED=0]="CAMERA_CHANGED",n[n.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",n[n.NONE=2]="NONE",n})({}),bG=(function(){function n(t,e){et(this,n),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ln,initAsync:new K7,dirtycheck:new vp,cull:new vp,beginFrame:new Ln,beforeRender:new Ln,render:new Ln,afterRender:new Ln,endFrame:new Ln,destroy:new Ln,pick:new Z7,pickSync:new vp,pointerDown:new Ln,pointerUp:new Ln,pointerMove:new Ln,pointerOut:new Ln,pointerOver:new Ln,pointerWheel:new Ln,pointerCancel:new Ln,click:new Ln},this.globalRuntime=t,this.context=e}return nt(n,[{key:"init",value:function(t){var e=this,r=Lt(Lt({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,e.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(i){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var t=this.context.config.renderer,e=t.getConfig(),r=e.enableDirtyRectangleRendering;return!r||this.context.renderingContext.renderReasons.has(Jo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var a=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(a.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),a.renderReasons.size&&this.inited){a.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=a.renderReasons.size===1&&a.renderReasons.has(Jo.CAMERA_CHANGED),s=!t.disableRenderHooks||!o;s&&this.renderDisplayObject(a.root,t,a),this.hooks.beginFrame.call(e),s&&a.renderListCurrentFrame.forEach(function(u){i.hooks.beforeRender.call(u),i.hooks.render.call(u),i.hooks.afterRender.call(u)}),this.hooks.endFrame.call(e),a.renderListCurrentFrame=[],a.renderReasons.clear(),r()}}},{key:"renderDisplayObject",value:function(t,e,r){var i=this,a=e.renderer.getConfig(),o=a.enableDirtyCheck,s=a.enableCulling;function u(m){var y=m.renderable,v=m.sortable,x=o?y.dirty||r.dirtyRectangleRenderingDisabled?m:null:m,E=null;x&&(E=s?i.hooks.cull.call(x,i.context.camera):x,E&&(i.stats.rendered+=1,r.renderListCurrentFrame.push(E))),m.dirty(!1),v.renderOrder=i.zIndexCounter,i.zIndexCounter+=1,i.stats.total+=1,v.dirty&&(i.sort(m,v),v.dirty=!1,v.dirtyChildren=[],v.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l,d=c.pop();u(d);for(var p=((l=d.sortable)===null||l===void 0||(l=l.sorted)===null||l===void 0?void 0:l.length)>0?d.sortable.sorted:d.childNodes,g=p.length-1;g>=0;g--)c.push(p[g])}}},{key:"sort",value:function(t,e){var r,i;(e==null||(r=e.sorted)===null||r===void 0?void 0:r.length)>0&&e.dirtyReason!==Jl.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(a){var o=e.sorted.indexOf(a);o>-1&&e.sorted.splice(o,1);var s=t.childNodes.indexOf(a);if(s>-1)if(e.sorted.length===0)e.sorted.push(a);else{var u=L7(e.sorted,a);e.sorted.splice(u,0,a)}}):e.sorted=t.childNodes.slice().sort(g_),((i=e.sorted)===null||i===void 0?void 0:i.length)>0&&t.childNodes.filter(function(a){return a.parsedStyle.zIndex}).length===0&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Jo.DISPLAY_OBJECT_CHANGED)}}])})(),xG=/\[\s*(.*)=(.*)\s*\]/,EG=(function(){function n(){et(this,n)}return nt(n,[{key:"selectOne",value:function(t,e){var r=this;if(t.startsWith("."))return e.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(s){return s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?e.find(function(s){return e!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):null}return e.find(function(s){return e!==s&&s.nodeName===t})}},{key:"selectAll",value:function(t,e){var r=this;if(t.startsWith("."))return e.findAll(function(s){return e!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(s){return e!==s&&s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,o=i.value;return a?e.findAll(function(s){return e!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):[]}return e.findAll(function(s){return e!==s&&s.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i==="name"?e.name===a:this.attributeToString(e,i)===a}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(xG),r="",i="";return e&&e.length>2&&(r=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:r,value:i}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var r=t.getAttribute(e);return Tt(r)?"":r.toString?r.toString():""}}])})(),Wt=(function(n){return n.ATTR_MODIFIED="DOMAttrModified",n.INSERTED="DOMNodeInserted",n.MOUNTED="DOMNodeInsertedIntoDocument",n.REMOVED="removed",n.UNMOUNTED="DOMNodeRemovedFromDocument",n.REPARENT="reparent",n.DESTROY="destroy",n.BOUNDS_CHANGED="bounds-changed",n.CULLED="culled",n})({}),gi=(function(n){function t(e,r,i,a,o,s,u,c){var l;return et(this,t),l=Bt(this,t,[null]),l.relatedNode=r,l.prevValue=i,l.newValue=a,l.attrName=o,l.attrChange=s,l.prevParsedValue=u,l.newParsedValue=c,l.type=e,l}return zt(t,n),nt(t)})(Rh);gi.ADDITION=2;gi.MODIFICATION=1;gi.REMOVAL=3;var wG=new gi(Wt.REPARENT,null,"","","",0,"",""),kG=fb(),Xc=Yt(),AG=Ee(1,1,1),SG=pe(),CG=fb(),ja=Yt(),NG=pe(),Ba=He(),TG=Yt(),MG=He(),_G=Yt(),qs=Yt(),za=Yt(),qc=pe(),W2=He(),Y2=He(),Kc=He(),Zc={affectChildren:!0},OG=(function(){function n(t){et(this,n),this.pendingEvents=new Map,this.boundsChangedEvent=new vn(Wt.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=t}return nt(n,[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,r){var i,a=!1;t.parentNode&&(a=t.parentNode!==e,this.detach(t));var o=t.nodeName===X.FRAGMENT,s=rh(e);t.parentNode=e;var u=o?t.childNodes:[t];Xt(r)?u.forEach(function(m){e.childNodes.splice(r,0,m),m.parentNode=e}):u.forEach(function(m){e.childNodes.push(m),m.parentNode=e});var c=e,l=c.sortable;if((l!=null&&(i=l.sorted)!==null&&i!==void 0&&i.length||l.dirty||t.parsedStyle.zIndex)&&(l.dirtyChildren.indexOf(t)===-1&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=Jl.ADDED),!s){if(o)this.dirtifyFragment(t);else{var d=t.transformable;d&&this.dirtyWorldTransform(t,d)}if(a){var p,g=((p=e.ownerDocument)===null||p===void 0||(p=p.defaultView)===null||p===void 0||(p=p.getConfig())===null||p===void 0||(p=p.future)===null||p===void 0?void 0:p.experimentalCancelEventPropagation)===!0;t.dispatchEvent(wG,g,g)}}}},{key:"detach",value:function(t){var e,r;if(t.parentNode){var i=t.transformable,a=t.parentNode,o=a.sortable;(o!=null&&(e=o.sorted)!==null&&e!==void 0&&e.length||(r=t.style)!==null&&r!==void 0&&r.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=Jl.REMOVED);var s=t.parentNode.childNodes.indexOf(t);s>-1&&t.parentNode.childNodes.splice(s,1),i&&this.dirtyWorldTransform(t,i),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return b2(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=t.transformable;qs[0]=e[0],qs[1]=e[1],qs[2]=(r=e[2])!==null&&r!==void 0?r:0,!Ys(a.localPosition,qs)&&(ui(a.localPosition,qs),i&&this.dirtyLocalTransform(t,a))}},{key:"translateLocal",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=Ee(e,r,i));var a=t.transformable;Ys(e,Xc)||(rB(e,e,a.localRotation),da(a.localPosition,a.localPosition,e),this.dirtyLocalTransform(t,a))}},{key:"setLocalRotation",value:function(t,e,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof e=="number"&&(e=CM(Ba,e,r,i,a));var s=t.transformable;Gc(s.localRotation,e),o&&this.dirtyLocalTransform(t,s)}},{key:"rotateLocal",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=Ee(e,r,i));var a=t.transformable;Fc(Y2,e[0],e[1],e[2]),t2(a.localRotation,a.localRotation,Y2),this.dirtyLocalTransform(t,a)}},{key:"setLocalScale",value:function(t,e){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=t.transformable;kn(ja,e[0],e[1],(r=e[2])!==null&&r!==void 0?r:a.localScale[2]),!Ys(ja,a.localScale)&&(ui(a.localScale,ja),i&&this.dirtyLocalTransform(t,a))}},{key:"scaleLocal",value:function(t,e){var r,i=t.transformable;Jj(i.localScale,i.localScale,kn(ja,e[0],e[1],(r=e[2])!==null&&r!==void 0?r:1)),this.dirtyLocalTransform(t,i)}},{key:"setLocalSkew",value:function(t,e,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof e=="number"&&(e=hB(CG,e,r));var a=t.transformable;lB(a.localSkew,e),i&&this.dirtyLocalTransform(t,a)}},{key:"setLocalEulerAngles",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof e=="number"&&(e=Ee(e,r,i));var o=t.transformable;Fc(o.localRotation,e[0],e[1],e[2]),a&&this.dirtyLocalTransform(t,o)}},{key:"setLocalTransform",value:function(t,e){var r=Ul(TG,e),i=Wl(MG,e),a=rs(_G,e);this.setLocalScale(t,a,!1),this.setLocalPosition(t,r,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,AG,!1),this.setLocalPosition(t,Xc,!1),this.setLocalEulerAngles(t,Xc,void 0,void 0,!1),this.setLocalSkew(t,kG,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return Ul(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Wl(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return rs(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.transformable;return!e.localDirtyFlag&&!e.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t)),e.worldTransform}},{key:"setPosition",value:function(t,e){var r,i=t.transformable;if(za[0]=e[0],za[1]=e[1],za[2]=(r=e[2])!==null&&r!==void 0?r:0,!Ys(this.getPosition(t),za)){if(ui(i.position,za),t.parentNode===null||!t.parentNode.transformable)ui(i.localPosition,za);else{var a=t.parentNode.transformable;ns(qc,a.worldTransform),si(qc,qc),Tn(i.localPosition,za,qc)}this.dirtyLocalTransform(t,i)}}},{key:"translate",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=kn(ja,e,r,i)),!Ys(e,Xc)&&(da(ja,this.getPosition(t),e),this.setPosition(t,ja))}},{key:"setRotation",value:function(t,e,r,i,a){var o=t.transformable;if(typeof e=="number"&&(e=cB(e,r,i,a)),t.parentNode===null||!t.parentNode.transformable)this.setLocalRotation(t,e);else{var s=this.getRotation(t.parentNode);Gc(Ba,s),np(Ba,Ba),fa(o.localRotation,Ba,e),$l(o.localRotation,o.localRotation),this.dirtyLocalTransform(t,o)}}},{key:"rotate",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=Ee(e,r,i));var a=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.rotateLocal(t,e);else{var o=Ba;Fc(o,e[0],e[1],e[2]);var s=this.getRotation(t),u=this.getRotation(t.parentNode);Gc(Kc,u),np(Kc,Kc),fa(o,Kc,o),fa(a.localRotation,o,s),$l(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}}},{key:"setOrigin",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=[e,r,i]);var a=t.transformable;if(!(e[0]===a.origin[0]&&e[1]===a.origin[1]&&e[2]===a.origin[2])){var o=a.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtyLocalTransform(t,a)}}},{key:"setEulerAngles",value:function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof e=="number"&&(e=Ee(e,r,i));var a=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.setLocalEulerAngles(t,e);else{Fc(a.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);Gc(W2,np(Ba,o)),t2(a.localRotation,a.localRotation,W2),this.dirtyLocalTransform(t,a)}}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2?arguments[2]:void 0,i=this.getGeometryBounds(t,e);if(!ye.isEmpty(i)){var a=r||new ye;return a.setFromTransformedAABB(i,this.getWorldTransform(t)),a}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=t,i=r.geometry;i.dirty&&rt.styleValueRegistry.updateGeometry(t);var a=e?i.renderBounds:i.contentBounds||null;return a||new ye}},{key:"getBounds",value:function(t){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t,a=i.renderable;if(!a.boundsDirty&&!r&&a.bounds)return a.bounds;if(!a.renderBoundsDirty&&r&&a.renderBounds)return a.renderBounds;var o=r?a.renderBounds:a.bounds,s=this.getTransformedGeometryBounds(t,r,o),u=t.childNodes;if(u.forEach(function(d){var p=e.getBounds(d,r);p&&(s?s.add(p):(s=o||new ye,s.update(p.center,p.halfExtents)))}),s||(s=new ye),r){var c=v_(t);if(c){var l=c.parsedStyle.clipPath.getBounds(r);s?l&&(s=l.intersection(s)):s.update(l.center,l.halfExtents)}}return r?(a.renderBounds=s,a.renderBoundsDirty=!1):(a.bounds=s,a.boundsDirty=!1),s}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=SG;t.parentNode.transformable&&(e=si(NG,this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!ye.isEmpty(r)){var i=new ye;return i.setFromTransformedAABB(r,e),i}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,r,i=this.getGeometryBounds(t);ye.isEmpty(i)||(r=new ye,r.setFromTransformedAABB(i,this.getWorldTransform(t)));var a=(e=t.ownerDocument)===null||e===void 0||(e=e.defaultView)===null||e===void 0?void 0:e.getContextService().getBoundingClientRect();if(r){var o=r.getMin(),s=Pt(o,2),u=s[0],c=s[1],l=r.getMax(),d=Pt(l,2),p=d[0],g=d[1];return new as(u+((a==null?void 0:a.left)||0),c+((a==null?void 0:a.top)||0),p-u,g-c)}return new as((a==null?void 0:a.left)||0,(a==null?void 0:a.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,r=(e=t.parentNode)===null||e===void 0?void 0:e.transformable;b2(t.transformable),Jz(t.transformable,r)}},{key:"internalUpdateElement",value:function(t,e){var r,i,a,o,s=((r=t.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig())===null||r===void 0||(r=r.future)===null||r===void 0?void 0:r.experimentalAttributeUpdateOptimization)===!0,u=e[e.length-1],c=(u==null?void 0:u.transformDirty)||((i=t.transformable)===null||i===void 0?void 0:i.localDirtyFlag);if(t.transformable){var l;(l=t.transformable).dirtyFlag||(l.dirtyFlag=c)}if(this.internalUpdateTransform(t),c){var d;(d=t.dirty)===null||d===void 0||d.call(t,!0,!0)}var p=((a=t.renderable)===null||a===void 0?void 0:a.boundsDirty)||((o=t.renderable)===null||o===void 0?void 0:o.renderBoundsDirty);if((c||p)&&(u==null?void 0:u.shapeUpdated)===!1&&s)for(var g=e.length-1;g>=0;){var m,y,v=e[g];if(v.shapeUpdated)break;(m=(y=v.node).dirty)===null||m===void 0||m.call(y,!0,!0),v.shapeUpdated=!0,g-=1}return c}},{key:"syncHierarchy",value:function(t){for(var e,r,i=[t],a=t.parentNode?[{node:t.parentNode,transformDirty:((e=t.parentNode.transformable)===null||e===void 0?void 0:e.localDirtyFlag)||((r=t.parentNode.transformable)===null||r===void 0?void 0:r.dirtyFlag),shapeUpdated:!1}]:[];i.length>0;){for(var o=i.pop(),s=a[a.length-1];a.length>0&&o.parentNode!==s.node;)s=a.pop();var u=this.internalUpdateElement(o,a);if(o.childNodes.length>0){for(var c=o.childNodes.length-1;c>=0;c--)i.push(o.childNodes[c]);a.push({node:o,transformDirty:u,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){rh(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtifyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtifyWorldInternal",value:function(t,e){var r,i=this,a=((r=t.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig())===null||r===void 0||(r=r.future)===null||r===void 0?void 0:r.experimentalAttributeUpdateOptimization)===!0;e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),a||t.childNodes.forEach(function(o){var s=o.transformable;i.dirtifyWorldInternal(o,s)}))}},{key:"dirtyToRoot",value:function(t){for(var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t,a=((e=t.ownerDocument)===null||e===void 0||(e=e.defaultView)===null||e===void 0||(e=e.getConfig())===null||e===void 0||(e=e.future)===null||e===void 0?void 0:e.experimentalAttributeUpdateOptimization)===!0;i;){var o,s;if((o=(s=i).dirty)===null||o===void 0||o.call(s,!0,!0),a)break;i=i.parentNode}r&&t.forEach(function(u){var c;(c=u.dirty)===null||c===void 0||c.call(u,!0,!0)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,r)}},{key:"dirtifyFragment",value:function(t){var e,r,i=t.transformable;i&&(i.dirtyFlag=!0,i.localDirtyFlag=!0),(e=(r=t).dirty)===null||e===void 0||e.call(r,!0,!0);for(var a=t.childNodes.length,o=0;o<a;o++)this.dirtifyFragment(t.childNodes[o]);t.nodeName===X.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,r,i,a=function(o,s){if(!(!o.isConnected||e.has(o)||o.nodeName===X.FRAGMENT)){if(t.boundsChangedEvent.detail=s,t.boundsChangedEvent.target=o,o.isMutationObserved)o.dispatchEvent(t.boundsChangedEvent);else{if(r===void 0){var u;r=((u=o.ownerDocument.defaultView)===null||u===void 0||(u=u.getConfig())===null||u===void 0||(u=u.future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0}o.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0,r)}e.add(o)}};this.pendingEvents.forEach(function(o,s){if(s.nodeName!==X.FRAGMENT){if(i===void 0){var u;i=((u=s.ownerDocument)===null||u===void 0||(u=u.defaultView)===null||u===void 0||(u=u.getConfig())===null||u===void 0||(u=u.future)===null||u===void 0?void 0:u.experimentalAttributeUpdateOptimization)===!0}Zc.affectChildren=o,i?a(s,Zc):o?s.forEach(function(c){a(c,Zc)}):a(s,Zc)}}),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,r,i){if(e&&e!==r){var a=this.displayObjectDependencyMap.get(e);if(a&&a[t]){var o=a[t].indexOf(i);a[t].splice(o,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}}},{key:"informDependentDisplayObjects",value:function(t){var e,r=this,i=this.displayObjectDependencyMap.get(t);if(i){var a=(e=t.ownerDocument)===null||e===void 0||(e=e.defaultView)===null||e===void 0||(e=e.getConfig())===null||e===void 0||(e=e.future)===null||e===void 0?void 0:e.experimentalCancelEventPropagation;Object.keys(i).forEach(function(o){i[o].forEach(function(s){r.dirtyToRoot(s,!0),s.dispatchEvent(new gi(Wt.ATTR_MODIFIED,s,r,r,o,gi.MODIFICATION,r,r),a,a),s.isCustomElement&&s.isConnected&&s.attributeChangedCallback&&s.attributeChangedCallback(o,r,r)})})}}}])})(),$2=(function(){function n(t){if(et(this,n),t<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map}return nt(n,[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var r=this.cache.keys().next().value;this.cache.delete(r)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])})(),Fa={MetricsString:"|\xC9q\xC5",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},H2=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,PG=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,RG=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,DG=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,LG=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,IG=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,jG=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,BG=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,zG=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,FG=new RegExp("".concat(PG.source,"|").concat(DG.source,"|").concat(IG.source,"|").concat(BG.source)),GG=new RegExp("".concat(RG.source,"|").concat(LG.source,"|").concat(jG.source,"|").concat(zG.source)),VG=(function(){function n(t){var e=this;et(this,n),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return e.isBreakingSpace(i)?!1:!!(r&&(GG.exec(i)||FG.exec(r)))},this.trimByKinsokuShorui=function(r){var i=Ht(r),a=i[i.length-2];if(!a)return r;var o=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=o+i[i.length-1],i},this.runtime=t,this.charWidthCache=new $2(100)}return nt(n,[{key:"measureFont",value:(function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),a=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});a.font=t;var o=Fa.MetricsString+Fa.BaselineSymbol,s=Math.ceil(a.measureText(o).width),u=Math.ceil(a.measureText(Fa.BaselineSymbol).width),c=Fa.HeightMultiplier*u;u=u*Fa.BaselineMultiplier|0,i.width=s,i.height=c,a.fillStyle="#f00",a.fillRect(0,0,s,c),a.font=t,a.textBaseline="alphabetic",a.fillStyle="#000",a.fillText(o,0,u);var l=a.getImageData(0,0,s||1,c||1).data,d=l.length,p=s*4,g=0,m=0,y=!1;for(g=0;g<u;++g){for(var v=0;v<p;v+=4)if(l[m+v]!==255){y=!0;break}if(!y)m+=p;else break}for(r.ascent=u-g,m=d-p,y=!1,g=c;g>u;--g){for(var x=0;x<p;x+=4)if(l[m+x]!==255){y=!0;break}if(!y)m-=p;else break}return r.descent=g-u,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[t]=r,r})},{key:"measureText",value:function(t,e,r){var i=e.fontSize,a=i===void 0?16:i,o=e.wordWrap,s=o===void 0?!1:o,u=e.lineHeight,c=e.lineWidth,l=c===void 0?1:c,d=e.textBaseline,p=d===void 0?"alphabetic":d,g=e.textAlign,m=g===void 0?"start":g,y=e.letterSpacing,v=y===void 0?0:y,x=e.textPath,E=e.leading,w=E===void 0?0:E,S=V2(e),k=this.measureFont(S,r);k.fontSize===0&&(k.fontSize=a,k.ascent=a);var A=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);A.font=S,e.isOverflowing=!1;var N=s?this.wordWrap(t,e,r):t,T=N.split(/(?:\r\n|\r|\n)/),O=new Array(T.length),M=0;if(x){x.getTotalLength();for(var P=0;P<T.length;P++)A.measureText(T[P]).width+(T[P].length-1)*v}else{for(var L=0;L<T.length;L++){var j=A.measureText(T[L]).width+(T[L].length-1)*v;O[L]=j,M=Math.max(M,j)}var z=M+l,U=u||k.fontSize+l,J=Math.max(U,k.fontSize+l)+(T.length-1)*(U+w);U+=w;var W=0;return p==="middle"?W=-J/2:p==="bottom"||p==="alphabetic"||p==="ideographic"?W=-J:(p==="top"||p==="hanging")&&(W=0),{font:S,width:z,height:J,lines:T,lineWidths:O,lineHeight:U,maxLineWidth:M,fontProperties:k,lineMetrics:O.map(function(at,ut){var yt=0;return m==="center"||m==="middle"?yt-=at/2:(m==="right"||m==="end")&&(yt-=at),new as(yt-l/2,W+ut*U,at+l,U)})}}}},{key:"wordWrap",value:function(t,e,r){var i=this,a=Array.from(t);if(a.length===0)return"";var o=this,s=e.wordWrapWidth,u=s===void 0?0:s,c=e.letterSpacing,l=c===void 0?0:c,d=e.maxLines,p=d===void 0?1/0:d,g=e.textOverflow,m=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),y=u+l,v="";g==="ellipsis"?v="...":g&&g!=="clip"&&(v=g);var x=[""],E=0,w=0,S=-1,k=V2(e),A=this.charWidthCache.get(k);A||(A=new $2(500),this.charWidthCache.put(k,A));var N=function(W){return i.getFromCache(W,l,A,m)},T=N(v);function O(W,at,ut,yt){for(;N(W)<yt&&at<a.length-1&&!o.isNewline(a[at+1]);)at+=1,W+=a[at];for(;N(W)>yt&&at>=ut;)at-=1,W=W.slice(0,-1);return{lineTxt:W,txtLastCharIndex:at}}function M(W,at){if(!(T<=0||T>y)){if(!x[W]){x[W]=v;return}var ut=O(x[W],at,S+1,y-T);x[W]=ut.lineTxt+v}}for(var P=0;P<a.length;P++){var L=a[P],j=a[P-1],z=a[P+1],U=N(L);if(this.isNewline(L)){if(E+1>=p){P<a.length-1&&M(E,P-1),e.isOverflowing=!0;break}S=P-1,E+=1,w=0,x[E]="";continue}if(U>y){M(E,P-1),e.isOverflowing=!0;break}if(w>0&&w+U>y){var J=O(x[E],P-1,S+1,y);if(J.txtLastCharIndex!==P-1){if(x[E]=J.lineTxt,J.txtLastCharIndex===a.length-1)break;P=J.txtLastCharIndex+1,L=a[P],j=a[P-1],z=a[P+1],U=N(L)}if(E+1>=p){M(E,P-1),e.isOverflowing=!0;break}if(S=P-1,E+=1,w=0,x[E]="",this.isBreakingSpace(L))continue;this.canBreakInLastChar(L)||(x=this.trimToBreakable(x),w=this.sumTextWidthByCache(x[E]||"",N)),this.shouldBreakByKinsokuShorui(L,z)&&(x=this.trimByKinsokuShorui(x),w+=N(j||""))}w+=U,x[E]+=L}return x.join(`
27
+ `)}},{key:"isBreakingSpace",value:function(t){return typeof t!="string"?!1:Fa.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return typeof t!="string"?!1:Fa.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=Ht(t),r=e[e.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return e;var a=r.slice(i,i+1),o=this.isBreakingSpace(a),s=i+1,u=i+(o?0:1);return e[e.length-1]+=r.slice(s,r.length),e[e.length-2]=r.slice(0,u),e}},{key:"canBreakInLastChar",value:function(t){return!(t&&H2.test(t))}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(r,i){return r+e(i)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!H2.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,r,i){var a=r.get(t);if(typeof a!="number"){var o=t.length*e,s=i.measureText(t);a=s.width+o,r.put(t,a)}return a}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])})(),rt={},UG=(function(n){var t=new fG,e=new dG;return n={},ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(n,X.FRAGMENT,null),X.CIRCLE,new uG),X.ELLIPSE,new cG),X.RECT,t),X.IMAGE,t),X.GROUP,new gG),X.LINE,new lG),X.TEXT,new pG(rt)),X.POLYLINE,e),X.POLYGON,e),ft(ft(ft(n,X.PATH,new hG),X.HTML,new vG),X.MESH,null)})(),WG=(function(n){var t=new x7,e=new _1;return n={},ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(n,ct.PERCENTAGE,null),ct.NUMBER,new S7),ct.ANGLE,new y7),ct.DEFINED_PATH,new b7),ct.PAINT,t),ct.COLOR,t),ct.FILTER,new E7),ct.LENGTH,e),ct.LENGTH_PERCENTAGE,e),ct.LENGTH_PERCENTAGE_12,new w7),ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(n,ct.LENGTH_PERCENTAGE_14,new k7),ct.COORDINATE,new _1),ct.OFFSET_DISTANCE,new C7),ct.OPACITY_VALUE,new N7),ct.PATH,new T7),ct.LIST_OF_POINTS,new M7),ct.SHADOW_BLUR,new _7),ct.TEXT,new O7),ct.TEXT_TRANSFORM,new P7),ct.TRANSFORM,new aG),ft(ft(ft(n,ct.TRANSFORM_ORIGIN,new oG),ct.Z_INDEX,new sG),ct.MARKER,new A7)})(),YG=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}};rt.CameraContribution=KM;rt.AnimationTimeline=null;rt.EasingFunction=null;rt.offscreenCanvasCreator=new kb;rt.sceneGraphSelector=new EG;rt.sceneGraphService=new OG(rt);rt.textService=new VG(rt);rt.geometryUpdaterFactory=UG;rt.CSSPropertySyntaxFactory=WG;rt.styleValueRegistry=new v7(rt);rt.layoutRegistry=null;rt.globalThis=YG();rt.enableStyleSyntax=!0;rt.enableSizeAttenuation=!1;var $G=0,D1=new gi(Wt.INSERTED,null,"","","",0,"",""),L1=new gi(Wt.REMOVED,null,"","","",0,"",""),A_=new vn(Wt.DESTROY),HG=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.entity=$G++,e.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.cullable={strategy:qz.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.style={},e.computedStyle={},e.parsedStyle={},e.attributes={},e}return zt(t,n),nt(t,[{key:"dirty",value:(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.renderable.dirty=e,r&&(this.renderable.boundsDirty=e,this.renderable.renderBoundsDirty=e)})},{key:"className",get:(function(){return this.getAttribute("class")||""}),set:function(e){this.setAttribute("class",e)}},{key:"classList",get:(function(){return this.className.split(" ").filter(function(e){return e!==""})})},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var e=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[e+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var e=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[e-1]||null}return null}},{key:"cloneNode",value:function(e){throw new Error(he)}},{key:"appendChild",value:function(e,r){var i;if(e.destroyed)throw new Error(Bz);return rt.sceneGraphService.attach(e,this,r),(i=this.ownerDocument)!==null&&i!==void 0&&i.defaultView&&(!rh(this)&&e.nodeName===X.FRAGMENT?this.ownerDocument.defaultView.mountFragment(e):this.ownerDocument.defaultView.mountChildren(e)),this.isMutationObserved&&(D1.relatedNode=this,e.dispatchEvent(D1)),e}},{key:"insertBefore",value:function(e,r){if(!r)this.appendChild(e);else{e.parentElement&&e.parentElement.removeChild(e);var i=this.childNodes.indexOf(r);i===-1?this.appendChild(e):this.appendChild(e,i)}return e}},{key:"replaceChild",value:function(e,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(e,i),r}},{key:"removeChild",value:function(e){var r,i,a=((r=this.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig().future)===null||r===void 0?void 0:r.experimentalCancelEventPropagation)===!0;return L1.relatedNode=this,e.dispatchEvent(L1,a,a),(i=e.ownerDocument)!==null&&i!==void 0&&i.defaultView&&e.ownerDocument.defaultView.unmountChildren(e),rt.sceneGraphService.detach(e),e}},{key:"removeChildren",value:function(){for(var e=this.childNodes.length-1;e>=0;e--){var r=this.childNodes[e];this.removeChild(r)}}},{key:"destroyChildren",value:function(){for(var e=this.childNodes.length-1;e>=0;e--){var r=this.childNodes[e];r.childNodes.length>0&&r.destroyChildren(),r.destroy()}}},{key:"matches",value:function(e){return rt.sceneGraphService.matches(e,this)}},{key:"getElementById",value:function(e){return rt.sceneGraphService.querySelector("#".concat(e),this)}},{key:"getElementsByName",value:function(e){return rt.sceneGraphService.querySelectorAll('[name="'.concat(e,'"]'),this)}},{key:"getElementsByClassName",value:function(e){return rt.sceneGraphService.querySelectorAll(".".concat(e),this)}},{key:"getElementsByTagName",value:function(e){return rt.sceneGraphService.querySelectorAll(e,this)}},{key:"querySelector",value:function(e){return rt.sceneGraphService.querySelector(e,this)}},{key:"querySelectorAll",value:function(e){return rt.sceneGraphService.querySelectorAll(e,this)}},{key:"closest",value:function(e){var r=this;do{if(rt.sceneGraphService.matches(e,r))return r;r=r.parentElement}while(r!==null);return null}},{key:"find",value:function(e){var r=this,i=null;return this.forEach(function(a){return a!==r&&e(a)?(i=a,!1):!0}),i}},{key:"findAll",value:function(e){var r=this,i=[];return this.forEach(function(a){a!==r&&e(a)&&i.push(a)}),i}},{key:"after",value:function(){var e=this;if(this.parentNode){for(var r=this.parentNode.childNodes.indexOf(this),i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];a.forEach(function(s,u){var c;return(c=e.parentNode)===null||c===void 0?void 0:c.appendChild(s,r+u+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var e,r=this.parentNode.childNodes.indexOf(this),i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=a[0],u=a.slice(1);this.parentNode.appendChild(s,r),(e=s).after.apply(e,Ht(u))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var e=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];i.forEach(function(o){return e.appendChild(o)})}},{key:"prepend",value:function(){for(var e=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];i.forEach(function(o,s){return e.appendChild(o,s)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var e,r=((e=this.ownerDocument)===null||e===void 0||(e=e.defaultView)===null||e===void 0||(e=e.getConfig().future)===null||e===void 0?void 0:e.experimentalCancelEventPropagation)===!0;this.destroyChildren(),this.dispatchEvent(A_,r,r),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return rt.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return rt.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return rt.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return rt.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return rt.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:(function(){return new Map(Object.entries(this.computedStyle))})},{key:"getAttributeNames",value:(function(){return Object.keys(this.attributes)})},{key:"getAttribute",value:function(e){if(typeof e!="symbol"){var r=this.attributes[e];return r}}},{key:"hasAttribute",value:function(e){return this.getAttributeNames().includes(e)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(e){this.setAttribute(e,null),delete this.attributes[e]}},{key:"setAttribute",value:function(e,r,i,a){this.attributes[e]=r}},{key:"getAttributeNS",value:function(e,r){throw new Error(he)}},{key:"getAttributeNode",value:function(e){throw new Error(he)}},{key:"getAttributeNodeNS",value:function(e,r){throw new Error(he)}},{key:"hasAttributeNS",value:function(e,r){throw new Error(he)}},{key:"removeAttributeNS",value:function(e,r){throw new Error(he)}},{key:"removeAttributeNode",value:function(e){throw new Error(he)}},{key:"setAttributeNS",value:function(e,r,i){throw new Error(he)}},{key:"setAttributeNode",value:function(e){throw new Error(he)}},{key:"setAttributeNodeNS",value:function(e){throw new Error(he)}},{key:"toggleAttribute",value:function(e,r){throw new Error(he)}}])})(Oe);function te(n){return!!(n!=null&&n.nodeName)}var XG=rt.globalThis.Proxy?rt.globalThis.Proxy:function(){},ri=new gi(Wt.ATTR_MODIFIED,null,null,null,null,gi.MODIFICATION,null,null),Ks=Yt(),qG=He(),Pe=(function(n){function t(e){var r;return et(this,t),r=Bt(this,t),r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=e,r.id=e.id||"",r.name=e.name||"",(e.className||e.class)&&(r.className=e.className||e.class),r.nodeName=e.type||X.GROUP,e.initialParsedStyle&&Object.assign(r.parsedStyle,e.initialParsedStyle),r.initAttributes(e.style),rt.enableStyleSyntax&&(r.style=new XG({setProperty:function(i,a){r.setAttribute(i,a)},getPropertyValue:function(i){return r.getAttribute(i)},removeProperty:function(i){r.removeAttribute(i)},item:function(){return""}},{get:function(i,a){return i[a]!==void 0?i[a]:r.getAttribute(a)},set:function(i,a,o){return r.setAttribute(a,o),!0}})),r}return zt(t,n),nt(t,[{key:"destroy",value:function(){c2(t,"destroy",this)([]),this.getAnimations().forEach(function(e){e.cancel()})}},{key:"cloneNode",value:function(e,r){var i=Lt({},this.attributes);for(var a in i){var o=i[a];te(o)&&a!=="clipPath"&&a!=="offsetPath"&&a!=="textPath"&&(i[a]=o.cloneNode(e)),r&&(i[a]=r(a,o))}var s=new this.constructor(Lt(Lt({},this.config),{},{style:i}));return s.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(u){if(!u.style.isMarker){var c=u.cloneNode(e);s.appendChild(c)}}),s}},{key:"initAttributes",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={forceUpdateGeometry:!0};rt.styleValueRegistry.processProperties(this,e,r),this.dirty()}},{key:"setAttribute",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;Ce(r)||(i||r!==this.attributes[e])&&(this.internalSetAttribute(e,r,{memoize:a}),c2(t,"setAttribute",this)([e,r]))}},{key:"internalSetAttribute",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.attributes[e],o=this.parsedStyle[e];rt.styleValueRegistry.processProperties(this,ft({},e,r),i),this.dirty();var s=this.parsedStyle[e];if(this.isConnected)if(ri.relatedNode=this,ri.prevValue=a,ri.newValue=r,ri.attrName=e,ri.prevParsedValue=o,ri.newParsedValue=s,this.isMutationObserved)this.dispatchEvent(ri);else{var u,c=((u=this.ownerDocument.defaultView.getConfig().future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0;ri.target=this,this.ownerDocument.defaultView.dispatchEvent(ri,!0,c)}if(this.isCustomElement&&this.isConnected||!this.isCustomElement){var l,d;(l=(d=this).attributeChangedCallback)===null||l===void 0||l.call(d,e,a,r,o,s)}}},{key:"getBBox",value:function(){var e=this.getBounds(),r=e.getMin(),i=Pt(r,2),a=i[0],o=i[1],s=e.getMax(),u=Pt(s,2),c=u[0],l=u[1];return new as(a,o,c-a,l-o)}},{key:"setOrigin",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return rt.sceneGraphService.setOrigin(this,In(e,r,i,!1)),this}},{key:"getOrigin",value:function(){return rt.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return rt.sceneGraphService.setPosition(this,In(e,r,i,!1)),this}},{key:"setLocalPosition",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return rt.sceneGraphService.setLocalPosition(this,In(e,r,i,!1)),this}},{key:"translate",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return rt.sceneGraphService.translate(this,In(e,r,i,!1)),this}},{key:"translateLocal",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return rt.sceneGraphService.translateLocal(this,In(e,r,i,!1)),this}},{key:"getPosition",value:function(){return rt.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return rt.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(e,r,i){return this.scaleLocal(e,r,i)}},{key:"scaleLocal",value:function(e,r,i){return typeof e=="number"&&(r=r||e,i=i||e,e=In(e,r,i,!1)),rt.sceneGraphService.scaleLocal(this,e),this}},{key:"setLocalScale",value:function(e,r,i){return typeof e=="number"&&(r=r||e,i=i||e,e=In(e,r,i,!1)),rt.sceneGraphService.setLocalScale(this,e),this}},{key:"getLocalScale",value:function(){return rt.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return rt.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var e=up(Ks,rt.sceneGraphService.getWorldTransform(this)),r=Pt(e,3),i=r[2];return Mr(i)}},{key:"getLocalEulerAngles",value:function(){var e=up(Ks,rt.sceneGraphService.getLocalRotation(this)),r=Pt(e,3),i=r[2];return Mr(i)}},{key:"setEulerAngles",value:function(e){return rt.sceneGraphService.setEulerAngles(this,0,0,e),this}},{key:"setLocalEulerAngles",value:function(e){return rt.sceneGraphService.setLocalEulerAngles(this,0,0,e),this}},{key:"rotateLocal",value:function(e,r,i){return Tt(r)&&Tt(i)?rt.sceneGraphService.rotateLocal(this,0,0,e):rt.sceneGraphService.rotateLocal(this,e,r,i),this}},{key:"rotate",value:function(e,r,i){return Tt(r)&&Tt(i)?rt.sceneGraphService.rotate(this,0,0,e):rt.sceneGraphService.rotate(this,e,r,i),this}},{key:"setRotation",value:function(e,r,i,a){return rt.sceneGraphService.setRotation(this,e,r,i,a),this}},{key:"setLocalRotation",value:function(e,r,i,a){return rt.sceneGraphService.setLocalRotation(this,e,r,i,a),this}},{key:"setLocalSkew",value:function(e,r){return rt.sceneGraphService.setLocalSkew(this,e,r),this}},{key:"getRotation",value:function(){return rt.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return rt.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return rt.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return rt.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return rt.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(e){return rt.sceneGraphService.setLocalTransform(this,e),this}},{key:"resetLocalTransform",value:function(){rt.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(e,r){var i,a=(i=this.ownerDocument)===null||i===void 0?void 0:i.timeline;return a?a.play(this,e,r):null}},{key:"isVisible",value:function(){var e;return((e=this.parsedStyle)===null||e===void 0?void 0:e.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(e){this.style.pointerEvents=e?"auto":"none"}},{key:"isInteractive",value:function(){var e;return((e=this.parsedStyle)===null||e===void 0?void 0:e.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,Ht(this.parentNode.children.map(function(e){return Number(e.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,Ht(this.parentNode.children.map(function(e){return Number(e.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var e=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i[0],s=i[1];return o?An(o)?(Object.keys(o).forEach(function(u){e.setAttribute(u,o[u])}),this):i.length===2?(this.setAttribute(o,s),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(e){var r=e||this.getWorldTransform(),i=Ul(Ks,r),a=Pt(i,2),o=a[0],s=a[1],u=rs(Ks,r),c=Pt(u,2),l=c[0],d=c[1],p=Wl(qG,r),g=up(Ks,p),m=Pt(g,3),y=m[0],v=m[2];return Wz(y||v,o,s,l,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(e){var r=v2(e),i=Pt(r,5),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4];this.setEulerAngles(c).setPosition(a,o).setLocalScale(s,u)}},{key:"setLocalMatrix",value:function(e){var r=v2(e),i=Pt(r,5),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4];this.setLocalEulerAngles(c).setLocalPosition(a,o).setLocalScale(s,u)}},{key:"show",value:function(){this.forEach(function(e){e.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(e){e.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(e){return this.children[e]||null}},{key:"add",value:function(e,r){return this.appendChild(e,r)}},{key:"set",value:function(e,r){this.config[e]=r}},{key:"get",value:function(e){return this.config[e]}},{key:"moveTo",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(e,r,i),this}},{key:"move",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(e,r,i),this}},{key:"setZIndex",value:function(e){return this.style.zIndex=e,this}}])})(HG);Pe.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var ao=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),Bt(this,t,[Lt({type:X.CIRCLE},e)])}return zt(t,n),nt(t)})(Pe);ao.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var KG=["style"],Ab=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=lo(r,KG);return et(this,t),e=Bt(this,t,[Lt({style:i},a)]),e.isCustomElement=!0,e}return zt(t,n),nt(t)})(Pe);Ab.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Sb=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),Bt(this,t,[Lt({type:X.ELLIPSE},e)])}return zt(t,n),nt(t)})(Pe);Sb.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var ZG=(function(n){function t(){return et(this,t),Bt(this,t,[{type:X.FRAGMENT}])}return zt(t,n),nt(t)})(Pe);ZG.PARSED_STYLE_LIST=new Set(["class","className"]);var vi=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),Bt(this,t,[Lt({type:X.GROUP},e)])}return zt(t,n),nt(t)})(Pe);vi.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var JG=["style"],Cb=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=lo(r,JG);return et(this,t),e=Bt(this,t,[Lt({type:X.HTML,style:i},a)]),e.cullable.enable=!1,e}return zt(t,n),nt(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var e=si(pe(),this.parentNode.getWorldTransform()),r=this.getBounds();if(!ye.isEmpty(r)){var i=new ye;return i.setFromTransformedAABB(r,e),i}}return this.getBounds()}}])})(Pe);Cb.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var ju=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),Bt(this,t,[Lt({type:X.IMAGE},e)])}return zt(t,n),nt(t)})(Pe);ju.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var QG=["style"],Nb=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=lo(r,QG);et(this,t),e=Bt(this,t,[Lt({type:X.LINE,style:Lt({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),e.markerStartAngle=0,e.markerEndAngle=0;var o=e.parsedStyle,s=o.markerStart,u=o.markerEnd;return s&&te(s)&&(e.markerStartAngle=s.getLocalEulerAngles(),e.appendChild(s)),u&&te(u)&&(e.markerEndAngle=u.getLocalEulerAngles(),e.appendChild(u)),e.transformMarker(!0),e.transformMarker(!1),e}return zt(t,n),nt(t,[{key:"attributeChangedCallback",value:function(e,r,i,a,o){e==="x1"||e==="y1"||e==="x2"||e==="y2"||e==="markerStartOffset"||e==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):e==="markerStart"?(a&&te(a)&&(this.markerStartAngle=0,a.remove()),o&&te(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):e==="markerEnd"&&(a&&te(a)&&(this.markerEndAngle=0,a.remove()),o&&te(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(e){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,u=r.x1,c=r.x2,l=r.y1,d=r.y2,p=e?i:a;if(!(!p||!te(p))){var g=0,m,y,v,x,E,w;e?(v=u,x=l,m=c-u,y=d-l,E=o||0,w=this.markerStartAngle):(v=c,x=d,m=u-c,y=l-d,E=s||0,w=this.markerEndAngle),g=Math.atan2(y,m),p.setLocalEulerAngles(g*180/Math.PI+w),p.setLocalPosition(v+Math.cos(g)*E,x+Math.sin(g)*E)}}},{key:"getPoint",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.parsedStyle,a=i.x1,o=i.y1,s=i.x2,u=i.y2,c=YM(a,o,s,u,e),l=c.x,d=c.y,p=Tn(Yt(),Ee(l,d,0),r?this.getWorldTransform():this.getLocalTransform());return new mn(p[0],p[1])}},{key:"getPointAtLength",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(e/this.getTotalLength(),r)}},{key:"getTotalLength",value:function(){var e=this.parsedStyle,r=e.x1,i=e.y1,a=e.x2,o=e.y2;return WM(r,i,a,o)}}])})(Pe);Nb.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var tV=["style"],Ha=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=lo(r,tV);et(this,t),e=Bt(this,t,[Lt({type:X.PATH,style:i,initialParsedStyle:{miterLimit:4,d:Lt({},ZM)}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var o=e.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&te(s)&&(e.markerStartAngle=s.getLocalEulerAngles(),e.appendChild(s)),c&&te(c)&&e.placeMarkerMid(c),u&&te(u)&&(e.markerEndAngle=u.getLocalEulerAngles(),e.appendChild(u)),e.transformMarker(!0),e.transformMarker(!1),e}return zt(t,n),nt(t,[{key:"attributeChangedCallback",value:function(e,r,i,a,o){e==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):e==="markerStartOffset"||e==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):e==="markerStart"?(a&&te(a)&&(this.markerStartAngle=0,a.remove()),o&&te(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):e==="markerEnd"?(a&&te(a)&&(this.markerEndAngle=0,a.remove()),o&&te(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):e==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(e){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,u=e?i:a;if(!(!u||!te(u))){var c=0,l,d,p,g,m,y;if(e){var v=this.getStartTangent(),x=Pt(v,2),E=x[0],w=x[1];p=w[0],g=w[1],l=E[0]-w[0],d=E[1]-w[1],m=o||0,y=this.markerStartAngle}else{var S=this.getEndTangent(),k=Pt(S,2),A=k[0],N=k[1];p=N[0],g=N[1],l=A[0]-N[0],d=A[1]-N[1],m=s||0,y=this.markerEndAngle}c=Math.atan2(d,l),u.setLocalEulerAngles(c*180/Math.PI+y),u.setLocalPosition(p+Math.cos(c)*m,g+Math.sin(c)*m)}}},{key:"placeMarkerMid",value:function(e){var r=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(c){c.remove()}),e&&te(e))for(var i=1;i<r.length-1;i++){var a=Pt(r[i].currentPoint,2),o=a[0],s=a[1],u=i===1?e:e.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,s)}}},{key:"getTotalLength",value:function(){return T1(this)}},{key:"getPointAtLength",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.parsedStyle.d.absolutePath,a=lz(i,e),o=a.x,s=a.y,u=Tn(Yt(),Ee(o,s,0),r?this.getWorldTransform():this.getLocalTransform());return new mn(u[0],u[1])}},{key:"getPoint",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(e*T1(this),r)}},{key:"getStartTangent",value:function(){var e=this.parsedStyle.d.segments,r=[];if(e.length>1){var i=e[0].currentPoint,a=e[1].currentPoint,o=e[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r}},{key:"getEndTangent",value:function(){var e=this.parsedStyle.d.segments,r=e.length,i=[];if(r>1){var a=e[r-2].currentPoint,o=e[r-1].currentPoint,s=e[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i}}])})(Pe);Ha.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var eV=["style"],Bu=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=lo(r,eV);et(this,t),e=Bt(this,t,[Lt({type:X.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var o=e.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&te(s)&&(e.markerStartAngle=s.getLocalEulerAngles(),e.appendChild(s)),c&&te(c)&&e.placeMarkerMid(c),u&&te(u)&&(e.markerEndAngle=u.getLocalEulerAngles(),e.appendChild(u)),e.transformMarker(!0),e.transformMarker(!1),e}return zt(t,n),nt(t,[{key:"attributeChangedCallback",value:function(e,r,i,a,o){e==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):e==="markerStartOffset"||e==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):e==="markerStart"?(a&&te(a)&&(this.markerStartAngle=0,a.remove()),o&&te(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):e==="markerEnd"?(a&&te(a)&&(this.markerEndAngle=0,a.remove()),o&&te(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):e==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(e){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,u=r.points,c=u||{},l=c.points,d=e?i:a;if(!(!d||!te(d)||!l)){var p=0,g,m,y,v,x,E;if(y=l[0][0],v=l[0][1],e)g=l[1][0]-l[0][0],m=l[1][1]-l[0][1],x=o||0,E=this.markerStartAngle;else{var w=l.length;this.parsedStyle.isClosed?(g=l[w-1][0]-l[0][0],m=l[w-1][1]-l[0][1]):(y=l[w-1][0],v=l[w-1][1],g=l[w-2][0]-l[w-1][0],m=l[w-2][1]-l[w-1][1]),x=s||0,E=this.markerEndAngle}p=Math.atan2(m,g),d.setLocalEulerAngles(p*180/Math.PI+E),d.setLocalPosition(y+Math.cos(p)*x,v+Math.sin(p)*x)}}},{key:"placeMarkerMid",value:function(e){var r=this.parsedStyle.points,i=r||{},a=i.points;if(this.markerMidList.forEach(function(l){l.remove()}),this.markerMidList=[],e&&te(e)&&a)for(var o=1;o<(this.parsedStyle.isClosed?a.length:a.length-1);o++){var s=a[o][0],u=a[o][1],c=o===1?e:e.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s,u)}}}])})(Pe);Bu.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var nV=["style"],Tb=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.style,i=lo(e,nV);return et(this,t),Bt(this,t,[Lt({type:X.POLYLINE,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return zt(t,n),nt(t,[{key:"getTotalLength",value:function(){return HF(this)}},{key:"getPointAtLength",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(e/this.getTotalLength(),r)}},{key:"getPoint",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var a=[],o=0,s,u,c=this.getTotalLength();i.forEach(function(v,x){i[x+1]&&(s=[0,0],s[0]=o/c,u=WM(v[0],v[1],i[x+1][0],i[x+1][1]),o+=u,s[1]=o/c,a.push(s))}),this.parsedStyle.points.segments=a}var l=0,d=0;this.parsedStyle.points.segments.forEach(function(v,x){e>=v[0]&&e<=v[1]&&(l=(e-v[0])/(v[1]-v[0]),d=x)});var p=YM(i[d][0],i[d][1],i[d+1][0],i[d+1][1],l),g=p.x,m=p.y,y=Tn(Yt(),Ee(g,m,0),r?this.getWorldTransform():this.getLocalTransform());return new mn(y[0],y[1])}},{key:"getStartTangent",value:function(){var e=this.parsedStyle.points.points,r=[];return r.push([e[1][0],e[1][1]]),r.push([e[0][0],e[0][1]]),r}},{key:"getEndTangent",value:function(){var e=this.parsedStyle.points.points,r=e.length-1,i=[];return i.push([e[r-1][0],e[r-1][1]]),i.push([e[r][0],e[r][1]]),i}}])})(Bu);Tb.PARSED_STYLE_LIST=new Set([].concat(Ht(Bu.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var vs=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),Bt(this,t,[Lt({type:X.RECT},e)])}return zt(t,n),nt(t)})(Pe);vs.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var rV=["style"],ms=(function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.style,i=lo(e,rV);return et(this,t),Bt(this,t,[Lt({type:X.TEXT,style:Lt({fill:"black"},r)},i)])}return zt(t,n),nt(t,[{key:"getComputedTextLength",value:function(){var e;return this.getGeometryBounds(),((e=this.parsedStyle.metrics)===null||e===void 0?void 0:e.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var e;return this.getGeometryBounds(),((e=this.parsedStyle.metrics)===null||e===void 0?void 0:e.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])})(Pe);ms.PARSED_STYLE_LIST=new Set([].concat(Ht(Pe.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var iV=(function(){function n(){et(this,n),this.registry={},this.define(X.CIRCLE,ao),this.define(X.ELLIPSE,Sb),this.define(X.RECT,vs),this.define(X.IMAGE,ju),this.define(X.LINE,Nb),this.define(X.GROUP,vi),this.define(X.PATH,Ha),this.define(X.POLYGON,Bu),this.define(X.POLYLINE,Tb),this.define(X.TEXT,ms),this.define(X.HTML,Cb)}return nt(n,[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])})(),S_=(function(n){function t(){var e;et(this,t),e=Bt(this,t),e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new rt.AnimationTimeline(e)}catch{}var r={};return xb.forEach(function(i){var a=i.n,o=i.inh,s=i.d;o&&s&&(r[a]=St(s)?s(X.GROUP):s)}),e.documentElement=new vi({id:"g-root",style:r}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return zt(t,n),nt(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:(function(e,r){if(e==="svg")return this.documentElement;var i=this.defaultView.customElements.get(e);i||(console.warn("Unsupported tagName: ",e),i=e==="tspan"?ms:vi);var a=new i(r);return a.ownerDocument=this,a})},{key:"createElementNS",value:function(e,r,i){return this.createElement(r,i)}},{key:"cloneNode",value:function(e){throw new Error(he)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch{}}},{key:"elementsFromBBox",value:function(e,r,i,a){var o=this.defaultView.context.rBushRoot,s=o.search({minX:e,minY:r,maxX:i,maxY:a}),u=[];return s.forEach(function(c){var l=c.displayObject,d=l.parsedStyle.pointerEvents,p=d===void 0?"auto":d,g=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(p);(!g||g&&l.isVisible())&&!l.isCulled()&&l.isInteractive()&&u.push(l)}),u.sort(function(c,l){return l.sortable.renderOrder-c.sortable.renderOrder}),u}},{key:"elementFromPointSync",value:function(e,r){var i=this.defaultView.canvas2Viewport({x:e,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),u=s.width,c=s.height;if(a<0||o<0||a>u||o>c)return null;var l=this.defaultView.viewport2Client({x:a,y:o}),d=l.x,p=l.y,g=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:e,y:r,viewportX:a,viewportY:o,clientX:d,clientY:p},picked:[]}),m=g.picked;return m&&m[0]||this.documentElement}},{key:"elementFromPoint",value:(function(){var e=ya(fn().mark(function i(a,o){var s,u,c,l,d,p,g,m,y,v,x;return fn().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(s=this.defaultView.canvas2Viewport({x:a,y:o}),u=s.x,c=s.y,l=this.defaultView.getConfig(),d=l.width,p=l.height,!(u<0||c<0||u>d||c>p)){E.next=1;break}return E.abrupt("return",null);case 1:return g=this.defaultView.viewport2Client({x:u,y:c}),m=g.x,y=g.y,E.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:u,viewportY:c,clientX:m,clientY:y},picked:[]});case 2:return v=E.sent,x=v.picked,E.abrupt("return",x&&x[0]||this.documentElement);case 3:case"end":return E.stop()}},i,this)}));function r(i,a){return e.apply(this,arguments)}return r})()},{key:"elementsFromPointSync",value:function(e,r){var i=this.defaultView.canvas2Viewport({x:e,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),u=s.width,c=s.height;if(a<0||o<0||a>u||o>c)return[];var l=this.defaultView.viewport2Client({x:a,y:o}),d=l.x,p=l.y,g=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:e,y:r,viewportX:a,viewportY:o,clientX:d,clientY:p},picked:[]}),m=g.picked;return m[m.length-1]!==this.documentElement&&m.push(this.documentElement),m}},{key:"elementsFromPoint",value:(function(){var e=ya(fn().mark(function i(a,o){var s,u,c,l,d,p,g,m,y,v,x;return fn().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(s=this.defaultView.canvas2Viewport({x:a,y:o}),u=s.x,c=s.y,l=this.defaultView.getConfig(),d=l.width,p=l.height,!(u<0||c<0||u>d||c>p)){E.next=1;break}return E.abrupt("return",[]);case 1:return g=this.defaultView.viewport2Client({x:u,y:c}),m=g.x,y=g.y,E.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:u,viewportY:c,clientX:m,clientY:y},picked:[]});case 2:return v=E.sent,x=v.picked,x[x.length-1]!==this.documentElement&&x.push(this.documentElement),E.abrupt("return",x);case 3:case"end":return E.stop()}},i,this)}));function r(i,a){return e.apply(this,arguments)}return r})()},{key:"appendChild",value:function(e,r){throw new Error(Bo)}},{key:"insertBefore",value:function(e,r){throw new Error(Bo)}},{key:"removeChild",value:function(e,r){throw new Error(Bo)}},{key:"replaceChild",value:function(e,r,i){throw new Error(Bo)}},{key:"append",value:function(){throw new Error(Bo)}},{key:"prepend",value:function(){throw new Error(Bo)}},{key:"getElementById",value:function(e){return this.documentElement.getElementById(e)}},{key:"getElementsByName",value:function(e){return this.documentElement.getElementsByName(e)}},{key:"getElementsByTagName",value:function(e){return this.documentElement.getElementsByTagName(e)}},{key:"getElementsByClassName",value:function(e){return this.documentElement.getElementsByClassName(e)}},{key:"querySelector",value:function(e){return this.documentElement.querySelector(e)}},{key:"querySelectorAll",value:function(e){return this.documentElement.querySelectorAll(e)}},{key:"find",value:function(e){return this.documentElement.find(e)}},{key:"findAll",value:function(e){return this.documentElement.findAll(e)}}])})(Oe),C_=(function(){function n(t){et(this,n),this.strategies=t}return nt(n,[{key:"apply",value:function(t){var e=t.config,r=t.camera,i=t.renderingService,a=t.renderingContext,o=this.strategies;i.hooks.cull.tap(n.tag,function(s){if(s){var u,c=s.cullable;if(o.length===0?c.visible=a.unculledEntities.indexOf(s.entity)>-1:c.visible=o.every(function(d){return d.isVisible(r,s)}),!s.isCulled()&&s.isVisible())return s;var l=((u=e.future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0;return s.dispatchEvent(new vn(Wt.CULLED),l,l),null}return s}),i.hooks.afterRender.tap(n.tag,function(s){s.cullable.visibilityPlaneMask=-1})}}])})();C_.tag="Culling";var N_=(function(){function n(){var t=this;et(this,n),this.autoPreventDefault=!1,this.rootPointerEvent=new P1(null),this.rootWheelEvent=new R1(null),this.onPointerMove=function(e){var r,i=(r=t.context.renderingContext.root)===null||r===void 0||(r=r.ownerDocument)===null||r===void 0?void 0:r.defaultView;if(!(i.supportsTouchEvents&&e.pointerType==="touch")){var a=t.normalizeToPointerEvent(e,i),o=Wa(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,c=t.bootstrapEvent(t.rootPointerEvent,u,i,e);t.context.eventService.mapEvent(c)}}catch(l){o.e(l)}finally{o.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var r,i=(r=t.context.renderingContext.root)===null||r===void 0||(r=r.ownerDocument)===null||r===void 0?void 0:r.defaultView,a=t.normalizeToPointerEvent(e,i),o=Wa(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,c=t.bootstrapEvent(t.rootPointerEvent,u,i,e);t.context.eventService.mapEvent(c)}}catch(l){o.e(l)}finally{o.f()}t.setCursor(t.context.eventService.cursor)}}return nt(n,[{key:"apply",value:function(t){var e=this;this.context=t;var r=t.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(a){var o=e.context.renderingService.hooks.pickSync.call({position:a,picked:[],topmost:!0}),s=o.picked;return s[0]||null}),r.hooks.pointerWheel.tap(n.tag,function(a){var o=e.normalizeWheelEvent(a);e.context.eventService.mapEvent(o)}),r.hooks.pointerDown.tap(n.tag,function(a){if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var o=e.normalizeToPointerEvent(a,i);if(e.autoPreventDefault&&o[0].isNormalized){var s=a.cancelable||!("cancelable"in a);s&&a.preventDefault()}var u=Wa(o),c;try{for(u.s();!(c=u.n()).done;){var l=c.value,d=e.bootstrapEvent(e.rootPointerEvent,l,i,a);e.context.eventService.mapEvent(d)}}catch(p){u.e(p)}finally{u.f()}e.setCursor(e.context.eventService.cursor)}}),r.hooks.pointerUp.tap(n.tag,function(a){if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var o=e.context.contextService.getDomElement(),s=e.context.eventService.isNativeEventFromCanvas(o,a),u=s?"":"outside",c=e.normalizeToPointerEvent(a,i),l=Wa(c),d;try{for(l.s();!(d=l.n()).done;){var p=d.value,g=e.bootstrapEvent(e.rootPointerEvent,p,i,a);g.type+=u,e.context.eventService.mapEvent(g)}}catch(m){l.e(m)}finally{l.f()}e.setCursor(e.context.eventService.cursor)}}),r.hooks.pointerMove.tap(n.tag,this.onPointerMove),r.hooks.pointerOver.tap(n.tag,this.onPointerMove),r.hooks.pointerOut.tap(n.tag,this.onPointerMove),r.hooks.click.tap(n.tag,this.onClick),r.hooks.pointerCancel.tap(n.tag,function(a){var o=e.normalizeToPointerEvent(a,i),s=Wa(o),u;try{for(s.s();!(u=s.n()).done;){var c=u.value,l=e.bootstrapEvent(e.rootPointerEvent,c,i,a);e.context.eventService.mapEvent(l)}}catch(d){s.e(d)}finally{s.f()}e.setCursor(e.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,r,i){t.view=r,t.originalEvent=null,t.nativeEvent=i,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var a=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=a.x,s=a.y;t.viewport.x=o,t.viewport.y=s;var u=this.context.eventService.viewport2Canvas(t.viewport),c=u.x,l=u.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=F7[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=r.x,a=r.y;e.viewport.x=i,e.viewport.y=a;var o=this.context.eventService.viewport2Canvas(e.viewport),s=o.x,u=o.y;return e.canvas.x=s,e.canvas.y=u,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=O1.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var r=[];if(e.isTouchEvent(t))for(var i=0;i<t.changedTouches.length;i++){var a=t.changedTouches[i];Ce(a.button)&&(a.button=0),Ce(a.buttons)&&(a.buttons=1),Ce(a.isPrimary)&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),Ce(a.width)&&(a.width=a.radiusX||1),Ce(a.height)&&(a.height=a.radiusY||1),Ce(a.tiltX)&&(a.tiltX=0),Ce(a.tiltY)&&(a.tiltY=0),Ce(a.pointerType)&&(a.pointerType="touch"),Ce(a.pointerId)&&(a.pointerId=a.identifier||0),Ce(a.pressure)&&(a.pressure=a.force||.5),Ce(a.twist)&&(a.twist=0),Ce(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=t.type,r.push(a)}else if(e.isMouseEvent(t)){var o=t;Ce(o.isPrimary)&&(o.isPrimary=!0),Ce(o.width)&&(o.width=1),Ce(o.height)&&(o.height=1),Ce(o.tiltX)&&(o.tiltX=0),Ce(o.tiltY)&&(o.tiltY=0),Ce(o.pointerType)&&(o.pointerType="mouse"),Ce(o.pointerId)&&(o.pointerId=z7),Ce(o.pressure)&&(o.pressure=.5),Ce(o.twist)&&(o.twist=0),Ce(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,r.push(o)}else r.push(t);return r}}])})();N_.tag="Event";var aV=[X.CIRCLE,X.ELLIPSE,X.IMAGE,X.RECT,X.LINE,X.POLYLINE,X.POLYGON,X.TEXT,X.PATH,X.HTML],oV=(function(){function n(){et(this,n)}return nt(n,[{key:"isVisible",value:function(t,e){var r,i=e.cullable;if(!i.enable)return!0;var a=e.getRenderBounds();if(ye.isEmpty(a))return!1;var o=t.getFrustum(),s=(r=e.parentNode)===null||r===void 0||(r=r.cullable)===null||r===void 0?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,a,s||jo.INDETERMINATE,o.planes),i.visible=i.visibilityPlaneMask!==jo.OUTSIDE,i.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,r,i){if(r===jo.OUTSIDE||r===jo.INSIDE)return r;for(var a=jo.INSIDE,o=aV.indexOf(t.nodeName)>-1,s=0,u=i.length;s<u;++s){var c=1<<s;if((r&c)!==0&&!(o&&(s===4||s===5))){var l=i[s],d=l.normal,p=l.distance;if(ci(d,e.getPositiveFarPoint(i[s]))+p<0)return jo.OUTSIDE;ci(d,e.getNegativeFarPoint(i[s]))+p<0&&(a|=c)}}return a}}])})(),T_=(function(){function n(){et(this,n),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return nt(n,[{key:"apply",value:function(t){var e=this,r,i,a=t.config,o=t.renderingService,s=t.renderingContext,u=t.rBushRoot,c=s.root.ownerDocument.defaultView;this.rBush=u;var l=function(v){o.dirtify()},d=function(v){e.syncTasks.set(v.target,v.detail.affectChildren),o.dirtify()},p=function(v){var x=v.target;rt.enableSizeAttenuation&&rt.styleValueRegistry.updateSizeAttenuation(x,c.getCamera().getZoom())},g=function(v){var x=v.target,E=x.rBushNode;E!=null&&E.aabb&&e.rBush.remove(E.aabb),e.syncTasks.delete(x),rt.sceneGraphService.dirtyToRoot(x),o.dirtify()};o.hooks.init.tap(n.tag,function(){c.addEventListener(Wt.MOUNTED,p),c.addEventListener(Wt.UNMOUNTED,g),c.addEventListener(Wt.ATTR_MODIFIED,l),c.addEventListener(Wt.BOUNDS_CHANGED,d)}),o.hooks.destroy.tap(n.tag,function(){c.removeEventListener(Wt.MOUNTED,p),c.removeEventListener(Wt.UNMOUNTED,g),c.removeEventListener(Wt.ATTR_MODIFIED,l),c.removeEventListener(Wt.BOUNDS_CHANGED,d),e.syncTasks.clear()});var m=(r=rt.globalThis.requestIdleCallback)!==null&&r!==void 0?r:wb.bind(rt.globalThis),y=((i=a.future)===null||i===void 0?void 0:i.experimentalRICSyncRTree)===!0;o.hooks.endFrame.tap(n.tag,function(){e.isFirstTimeRendering?(e.isFirstTimeRendering=!1,e.syncing=!0,m(function(){e.syncRTree(!0),e.isFirstTimeRenderingFinished=!0})):y&&rt.globalThis.requestIdleCallback&&rt.globalThis.cancelIdleCallback?(rt.globalThis.cancelIdleCallback(e.ricSyncRTreeId),e.ricSyncRTreeId=rt.globalThis.requestIdleCallback(function(){return e.syncRTree()})):e.syncRTree()})}},{key:"syncNode",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.isConnected){var r=t.rBushNode;r.aabb&&this.rBush.remove(r.aabb);var i=t.getRenderBounds();if(i){var a=t.renderable;e&&(a.dirtyRenderBounds||(a.dirtyRenderBounds=new ye),a.dirtyRenderBounds.update(i.center,i.halfExtents));var o=i.getMin(),s=Pt(o,2),u=s[0],c=s[1],l=i.getMax(),d=Pt(l,2),p=d[0],g=d[1];r.aabb||(r.aabb={}),r.aabb.displayObject=t,r.aabb.minX=u,r.aabb.minY=c,r.aabb.maxX=p,r.aabb.maxY=g}if(r.aabb&&!isNaN(r.aabb.maxX)&&!isNaN(r.aabb.maxX)&&!isNaN(r.aabb.minX)&&!isNaN(r.aabb.minY))return r.aabb}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!e&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var r=[],i=new Set,a=function(o){if(!i.has(o)&&o.renderable){var s=t.syncNode(o,e);s&&(r.push(s),i.add(o))}};this.syncTasks.forEach(function(o,s){o&&s.forEach(a);for(var u=s;u;)a(u),u=u.parentElement}),this.rBush.load(r),r.length=0,this.syncing=!1}}}])})();T_.tag="Prepare";var cr=(function(n){return n.READY="ready",n.BEFORE_RENDER="beforerender",n.RERENDER="rerender",n.AFTER_RENDER="afterrender",n.BEFORE_DESTROY="beforedestroy",n.AFTER_DESTROY="afterdestroy",n.RESIZE="resize",n.DIRTY_RECTANGLE="dirtyrectangle",n.RENDERER_CHANGED="rendererchanged",n})({}),X2=500,sV=.1,uV=1e3,Jc=new vn(Wt.MOUNTED),Qc=new vn(Wt.UNMOUNTED),yp=new vn(cr.BEFORE_RENDER),q2=new vn(cr.RERENDER),bp=new vn(cr.AFTER_RENDER),I1=(function(n){function t(e){var r;et(this,t),r=Bt(this,t),r.Element=Pe,r.inited=!1,r.context={};var i=e.container,a=e.canvas,o=e.renderer,s=e.width,u=e.height,c=e.background,l=e.cursor,d=e.supportsMutipleCanvasesInOneContainer,p=e.cleanUpOnDestroy,g=p===void 0?!0:p,m=e.offscreenCanvas,y=e.devicePixelRatio,v=e.requestAnimationFrame,x=e.cancelAnimationFrame,E=e.createImage,w=e.supportsTouchEvents,S=e.supportsPointerEvents,k=e.isTouchEvent,A=e.isMouseEvent,N=e.dblClickSpeed,T=s,O=u,M=y||Eb&&window.devicePixelRatio||1;return M=M>=1?Math.ceil(M):1,a&&(T=s||j7(a)||a.width/M,O=u||B7(a)||a.height/M),r.customElements=new iV,r.devicePixelRatio=M,r.requestAnimationFrame=v??wb.bind(rt.globalThis),r.cancelAnimationFrame=x??x_.bind(rt.globalThis),r.createImage=E??function(){return new window.Image},r.supportsTouchEvents=w??"ontouchstart"in rt.globalThis,r.supportsPointerEvents=S??!!rt.globalThis.PointerEvent,r.isTouchEvent=k??function(P){return r.supportsTouchEvents&&P instanceof rt.globalThis.TouchEvent},r.isMouseEvent=A??function(P){return!rt.globalThis.MouseEvent||P instanceof rt.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(P instanceof rt.globalThis.PointerEvent))},m&&(rt.offscreenCanvas=m),r.document=new S_,r.document.defaultView=r,d||R7(i,r,g),r.initRenderingContext(Lt(Lt({},e),{},{width:T,height:O,background:c??"transparent",cursor:l??"default",cleanUpOnDestroy:g,devicePixelRatio:M,requestAnimationFrame:r.requestAnimationFrame,cancelAnimationFrame:r.cancelAnimationFrame,createImage:r.createImage,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,isTouchEvent:r.isTouchEvent,isMouseEvent:r.isMouseEvent,dblClickSpeed:N??200})),r.initDefaultCamera(T,O,o.clipSpaceNearZ),r.initRenderer(o,!0),r}return zt(t,n),nt(t,[{key:"initRenderingContext",value:function(e){this.context.config=e,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(e,r,i){var a=this,o=new rt.CameraContribution;o.clipSpaceNearZ=i,o.setType(le.EXPLORING,k1.DEFAULT).setPosition(e/2,r/2,X2).setFocalPoint(e/2,r/2,0).setOrthographic(e/-2,e/2,r/2,r/-2,sV,uV),o.canvas=this,o.eventEmitter.on(qM.UPDATED,function(){a.context.renderingContext.renderReasons.add(Jo.CAMERA_CHANGED),rt.enableSizeAttenuation&&a.getConfig().renderer.getConfig().enableSizeAttenuation&&a.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var e=this.getCamera().getZoom();this.document.documentElement.forEach(function(r){rt.styleValueRegistry.updateSizeAttenuation(r,e)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){e.resolveReadyPromise=function(){r(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1?arguments[1]:void 0;Ye.clearCache();var a=((e=this.getConfig().future)===null||e===void 0?void 0:e.experimentalCancelEventPropagation)===!0;i||this.dispatchEvent(new vn(cr.BEFORE_DESTROY),a,a),this.frameId&&this.cancelAnimationFrame(this.frameId);var o=this.getRoot();r&&(this.unmountChildren(o),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),i||this.dispatchEvent(new vn(cr.AFTER_DESTROY),a,a);var s=function(u){u.currentTarget=null,u.manager=null,u.target=null,u.relatedNode=null};s(Jc),s(Qc),s(yp),s(q2),s(bp),s(ri),s(D1),s(L1),s(A_),rt.textService.clearCache()}},{key:"changeSize",value:function(e,r){this.resize(e,r)}},{key:"resize",value:function(e,r){var i,a=this.context.config;a.width=e,a.height=r,this.getContextService().resize(e,r);var o=this.context.camera,s=o.getProjectionMode();o.setPosition(e/2,r/2,X2).setFocalPoint(e/2,r/2,0),s===Nr.ORTHOGRAPHIC?o.setOrthographic(e/-2,e/2,r/2,r/-2,o.getNear(),o.getFar()):o.setAspect(e/r);var u=((i=a.future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(new vn(cr.RESIZE,{width:e,height:r}),u,u)}},{key:"appendChild",value:function(e,r){return this.document.documentElement.appendChild(e,r)}},{key:"insertBefore",value:function(e,r){return this.document.documentElement.insertBefore(e,r)}},{key:"removeChild",value:function(e){return this.document.documentElement.removeChild(e)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(e){var r,i=this;e&&(yp.detail=e,bp.detail=e);var a=((r=this.getConfig().future)===null||r===void 0?void 0:r.experimentalCancelEventPropagation)===!0;this.dispatchEvent(yp,a,a);var o=this.getRenderingService();o.render(this.getConfig(),e,function(){i.dispatchEvent(q2,a,a)}),this.dispatchEvent(bp,a,a)}},{key:"run",value:function(){var e=this,r=function(i,a){e.render(a),e.frameId=e.requestAnimationFrame(r)};r()}},{key:"initRenderer",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Pz,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new N_,new T_,new C_([new oV])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(Lt(Lt({},rt),this.context)),this.context.renderingService=new bG(rt,this.context),this.context.eventService=new yG(rt,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(e,i,!0)):this.context.contextService.initAsync().then(function(){r.initRenderingService(e,i)}).catch(function(a){console.error(a)})}},{key:"initRenderingService",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){var o;r.inited=!0;var s=((o=r.getConfig().future)===null||o===void 0?void 0:o.experimentalCancelEventPropagation)===!0;i?a?r.requestAnimationFrame(function(){r.dispatchEvent(new vn(cr.READY),s,s)}):r.dispatchEvent(new vn(cr.READY),s,s):r.dispatchEvent(new vn(cr.RENDERER_CHANGED),s,s),r.readyPromise&&r.resolveReadyPromise(),i||r.getRoot().forEach(function(u){var c,l;(c=(l=u).dirty)===null||c===void 0||c.call(l,!0,!0)}),r.mountChildren(r.getRoot()),e.getConfig().enableAutoRendering&&r.run()})}},{key:"loadRendererContainerModule",value:function(e){var r=this,i=e.getPlugins();i.forEach(function(a){a.context=r.context,a.init(rt)})}},{key:"setRenderer",value:function(e){var r=this.getConfig();if(r.renderer!==e){var i=r.renderer;r.renderer=e,this.destroy(!1,!0),Ht((i==null?void 0:i.getPlugins())||[]).reverse().forEach(function(a){a.destroy(rt)}),this.initRenderer(e)}}},{key:"setCursor",value:function(e){var r=this.getConfig();r.cursor=e,this.getContextService().applyCursorStyle(e)}},{key:"unmountChildren",value:function(e){var r=this;if(e.childNodes.forEach(function(o){r.unmountChildren(o)}),this.inited){if(e.isMutationObserved)e.dispatchEvent(Qc);else{var i,a=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;Qc.target=e,this.dispatchEvent(Qc,!0,a)}e!==this.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}e.isCustomElement&&e.disconnectedCallback&&e.disconnectedCallback()}},{key:"mountChildren",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rh(e);if(this.inited){if(!e.isConnected&&(e.ownerDocument=this.document,e.isConnected=!0,!i))if(e.isMutationObserved)e.dispatchEvent(Jc);else{var a,o=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;Jc.target=e,this.dispatchEvent(Jc,!0,o)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",e.nodeName);e.childNodes.forEach(function(s){r.mountChildren(s,i)}),e.isCustomElement&&e.connectedCallback&&e.connectedCallback()}},{key:"mountFragment",value:function(e){this.mountChildren(e,!1)}},{key:"client2Viewport",value:function(e){return this.getEventService().client2Viewport(e)}},{key:"viewport2Client",value:function(e){return this.getEventService().viewport2Client(e)}},{key:"viewport2Canvas",value:function(e){return this.getEventService().viewport2Canvas(e)}},{key:"canvas2Viewport",value:function(e){return this.getEventService().canvas2Viewport(e)}},{key:"getPointByClient",value:function(e,r){return this.client2Viewport({x:e,y:r})}},{key:"getClientByPoint",value:function(e,r){return this.viewport2Client({x:e,y:r})}}])})(k_);/*!
28
+ * @antv/g-camera-api
29
+ * @description A simple implementation of Camera API.
30
+ * @version 2.0.41
31
+ * @date 7/30/2025, 1:34:37 PM
32
+ * @author AntVis
33
+ * @docs https://g.antv.antgroup.com/
34
+ */var cV=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.landmarks=[],e}return zt(t,n),nt(t,[{key:"rotate",value:(function(e,r,i){if(this.relElevation=qo(r),this.relAzimuth=qo(e),this.relRoll=qo(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===le.EXPLORING){var a=sa(He(),[1,0,0],de((this.rotateWorld?1:-1)*this.relElevation)),o=sa(He(),[0,1,0],de((this.rotateWorld?1:-1)*this.relAzimuth)),s=sa(He(),[0,0,1],de(this.relRoll)),u=fa(He(),o,a);u=fa(He(),u,s);var c=db(pe(),u);Xo(this.matrix,this.matrix,[0,0,-this.distance]),Nn(this.matrix,this.matrix,c),Xo(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===le.ORBITING||this.type===le.EXPLORING?this._getPosition():this.type===le.TRACKING&&this._getFocalPoint(),this._update(),this})},{key:"pan",value:function(e,r){var i=In(e,r,0),a=_i(this.position);return da(a,a,Yl(Yt(),this.right,i[0])),da(a,a,Yl(Yt(),this.up,i[1])),this._setPosition(a),this.triggerUpdate(),this}},{key:"dolly",value:function(e){var r=this.forward,i=_i(this.position),a=e*this.dollyingStep,o=this.distance+e*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*r[0],i[1]+=a*r[1],i[2]+=a*r[2],this._setPosition(i),this.type===le.ORBITING||this.type===le.EXPLORING?this._getDistance():this.type===le.TRACKING&&da(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(e){var r,i,a,o,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.position,c=u===void 0?this.position:u,l=s.focalPoint,d=l===void 0?this.focalPoint:l,p=s.roll,g=s.zoom,m=new rt.CameraContribution;m.setType(this.type,void 0),m.setPosition(c[0],(r=c[1])!==null&&r!==void 0?r:this.position[1],(i=c[2])!==null&&i!==void 0?i:this.position[2]),m.setFocalPoint(d[0],(a=d[1])!==null&&a!==void 0?a:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),m.setRoll(p??this.roll),m.setZoom(g??this.zoom);var y={name:e,matrix:sM(m.getWorldTransform()),right:_i(m.right),up:_i(m.up),forward:_i(m.forward),position:_i(m.getPosition()),focalPoint:_i(m.getFocalPoint()),distanceVector:_i(m.getDistanceVector()),distance:m.getDistance(),dollyingStep:m.getDollyingStep(),azimuth:m.getAzimuth(),elevation:m.getElevation(),roll:m.getRoll(),relAzimuth:m.relAzimuth,relElevation:m.relElevation,relRoll:m.relRoll,zoom:m.getZoom()};return this.landmarks.push(y),y}},{key:"gotoLandmark",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=fe(e)?this.landmarks.find(function(M){return M.name===e}):e;if(a){var o=Xt(i)?{duration:i}:i,s=o.easing,u=s===void 0?"linear":s,c=o.duration,l=c===void 0?100:c,d=o.easingFunction,p=d===void 0?void 0:d,g=o.onfinish,m=g===void 0?void 0:g,y=o.onframe,v=y===void 0?void 0:y,x=.01;this.cancelLandmarkAnimation();var E=a.position,w=a.focalPoint,S=a.zoom,k=a.roll,A=p||rt.EasingFunction(u),N,T=function(){r.setFocalPoint(w),r.setPosition(E),r.setRoll(k),r.setZoom(S),r.computeMatrix(),r.triggerUpdate(),m==null||m()};if(l===0)return T();var O=function(M){N===void 0&&(N=M);var P=M-N;if(P>=l){T();return}var L=A(P/l),j=Yt(),z=Yt(),U=1,J=0;f1(j,r.focalPoint,w,L),f1(z,r.position,E,L),J=r.roll*(1-L)+k*L,U=r.zoom*(1-L)+S*L,r.setFocalPoint(j),r.setPosition(z),r.setRoll(J),r.setZoom(U);var W=Qw(j,w)+Qw(z,E);if(W<=x&&S===void 0&&k===void 0)return T();r.computeMatrix(),r.triggerUpdate(),P<l&&(v==null||v(L),r.landmarkAnimationID=r.canvas.requestAnimationFrame(O))};this.canvas.requestAnimationFrame(O)}}}])})(KM);rt.CameraContribution=cV;/*!
35
+ * @antv/g-web-animations-api
36
+ * @description A simple implementation of Web Animations API.
37
+ * @version 2.1.28
38
+ * @date 7/30/2025, 1:36:24 PM
39
+ * @author AntVis
40
+ * @docs https://g.antv.antgroup.com/
41
+ */var xp=(function(n){function t(e,r,i,a){var o;return et(this,t),o=Bt(this,t,[e]),o.currentTime=i,o.timelineTime=a,o.target=r,o.type="finish",o.bubbles=!1,o.currentTarget=r,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=i,o.timelineTime=a,o}return zt(t,n),nt(t)})(Rh),lV=0,hV=(function(){function n(t,e){var r;et(this,n),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(lV++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((r=this.effect)===null||r===void 0?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return nt(n,[{key:"pending",get:(function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending})},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:(function(){var t=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,r){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){r(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise})},{key:"finished",get:function(){var t=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,r){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){r(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var e;this._startTime=Number((e=this.timeline)===null||e===void 0?void 0:e.currentTime)-t/this.playbackRate}this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(t!==null){if(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),e!==null&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if((t=this.effect.target)!==null&&t!==void 0&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,r=this.pending?"pending":this.playState;return this.readyPromise&&r!==e&&(r==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):e==="pending"?this.resolveReadyPromise():r==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&r!==e&&(r==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):r==="finished"?this.resolveFinishedPromise():e==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=r,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new xp(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t,e=(t=this.effect)===null||t===void 0?void 0:t.target;return e.getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);e!==-1&&t.splice(e,1)}},{key:"tick",value:function(t,e){!this._idle&&!this._paused&&(this._startTime===null?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(he)}},{key:"addEventListener",value:function(t,e,r){throw new Error(he)}},{key:"removeEventListener",value:function(t,e,r){throw new Error(he)}},{key:"dispatchEvent",value:function(t){throw new Error(he)}},{key:"commitStyles",value:(function(){throw new Error(he)})},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var t;this._inEffect=!!((t=this.effect)!==null&&t!==void 0&&t.update(-1))}else{var e;this._inEffect=!!((e=this.effect)!==null&&e!==void 0&&e.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new xp(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new xp(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}}}])})(),dV=4,fV=.001,pV=1e-7,gV=10,su=11,tl=1/(su-1),vV=typeof Float32Array=="function",M_=function(n,t){return 1-3*t+3*n},__=function(n,t){return 3*t-6*n},O_=function(n){return 3*n},ih=function(n,t,e){return((M_(t,e)*n+__(t,e))*n+O_(t))*n},P_=function(n,t,e){return 3*M_(t,e)*n*n+2*__(t,e)*n+O_(t)},mV=function(n,t,e,r,i){var a,o,s=0;do o=t+(e-t)/2,a=ih(o,r,i)-n,a>0?e=o:t=o;while(Math.abs(a)>pV&&++s<gV);return o},yV=function(n,t,e,r){for(var i=0;i<dV;++i){var a=P_(t,e,r);if(a===0)return t;var o=ih(t,e,r)-n;t-=o/a}return t},Mb=function(n,t,e,r){if(!(n>=0&&n<=1&&e>=0&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===r)return function(s){return s};for(var i=vV?new Float32Array(su):new Array(su),a=0;a<su;++a)i[a]=ih(a*tl,n,e);var o=function(s){for(var u=0,c=1,l=su-1;c!==l&&i[c]<=s;++c)u+=tl;--c;var d=(s-i[c])/(i[c+1]-i[c]),p=u+d*tl,g=P_(p,n,e);return g>=fV?yV(s,p,n,e):g===0?p:mV(s,u,u+tl,n,e)};return function(s){return s===0||s===1?s:ih(o(s),t,r)}},bV=function(n){return n=n.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),n.charAt(0)==="-"?n.substring(1):n},el=function(n){return Math.pow(n,2)},nl=function(n){return Math.pow(n,3)},rl=function(n){return Math.pow(n,4)},il=function(n){return Math.pow(n,5)},al=function(n){return Math.pow(n,6)},ol=function(n){return 1-Math.cos(n*Math.PI/2)},sl=function(n){return 1-Math.sqrt(1-n*n)},ul=function(n){return n*n*(3*n-2)},cl=function(n){for(var t,e=4;n<((t=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((t*3-2)/22-n,2)},ll=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=Pt(t,2),r=e[0],i=r===void 0?1:r,a=e[1],o=a===void 0?.5:a,s=dn(Number(i),1,10),u=dn(Number(o),.1,2);return n===0||n===1?n:-s*Math.pow(2,10*(n-1))*Math.sin((n-1-u/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/u)},Zs=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2?arguments[2]:void 0,r=Pt(t,4),i=r[0],a=i===void 0?1:i,o=r[1],s=o===void 0?100:o,u=r[2],c=u===void 0?10:u,l=r[3],d=l===void 0?0:l;a=dn(a,.1,1e3),s=dn(s,.1,1e3),c=dn(c,.1,1e3),d=dn(d,.1,1e3);var p=Math.sqrt(s/a),g=c/(2*Math.sqrt(s*a)),m=g<1?p*Math.sqrt(1-g*g):0,y=1,v=g<1?(g*p+-d)/m:-d+p,x=e?e*n/1e3:n;return g<1?x=Math.exp(-x*g*p)*(y*Math.cos(m*x)+v*Math.sin(m*x)):x=(y+v*x)*Math.exp(-x*p),n===0||n===1?n:1-x},Ep=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=t,r=Pt(e,2),i=r[0],a=i===void 0?10:i,o=r[1],s=o==="start"?Math.ceil:Math.floor;return s(dn(n,0,1)*a)/a},K2=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=Pt(t,4),r=e[0],i=e[1],a=e[2],o=e[3];return Mb(r,i,a,o)(n)},hl=Mb(.42,0,1,1),kr=function(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return 1-n(1-t,e,r)}},Ar=function(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return t<.5?n(t*2,e,r)/2:1-n(t*-2+2,e,r)/2}},Sr=function(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return t<.5?(1-n(1-t*2,e,r))/2:(n(t*2-1,e,r)+1)/2}},Z2={steps:Ep,"step-start":function(n){return Ep(n,[1,"start"])},"step-end":function(n){return Ep(n,[1,"end"])},linear:function(n){return n},"cubic-bezier":K2,ease:function(n){return K2(n,[.25,.1,.25,1])},in:hl,out:kr(hl),"in-out":Ar(hl),"out-in":Sr(hl),"in-quad":el,"out-quad":kr(el),"in-out-quad":Ar(el),"out-in-quad":Sr(el),"in-cubic":nl,"out-cubic":kr(nl),"in-out-cubic":Ar(nl),"out-in-cubic":Sr(nl),"in-quart":rl,"out-quart":kr(rl),"in-out-quart":Ar(rl),"out-in-quart":Sr(rl),"in-quint":il,"out-quint":kr(il),"in-out-quint":Ar(il),"out-in-quint":Sr(il),"in-expo":al,"out-expo":kr(al),"in-out-expo":Ar(al),"out-in-expo":Sr(al),"in-sine":ol,"out-sine":kr(ol),"in-out-sine":Ar(ol),"out-in-sine":Sr(ol),"in-circ":sl,"out-circ":kr(sl),"in-out-circ":Ar(sl),"out-in-circ":Sr(sl),"in-back":ul,"out-back":kr(ul),"in-out-back":Ar(ul),"out-in-back":Sr(ul),"in-bounce":cl,"out-bounce":kr(cl),"in-out-bounce":Ar(cl),"out-in-bounce":Sr(cl),"in-elastic":ll,"out-elastic":kr(ll),"in-out-elastic":Ar(ll),"out-in-elastic":Sr(ll),spring:Zs,"spring-in":Zs,"spring-out":kr(Zs),"spring-in-out":Ar(Zs),"spring-out-in":Sr(Zs)},xV=function(n){return bV(n).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},EV=function(n){return Z2[xV(n)]||Z2.linear},wV=function(n){return n},kV=1,AV=.5,J2=0;function Q2(n,t){return function(e){if(e>=1)return 1;var r=1/n;return e+=t*r,e-e%r}}var dl="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",SV=new RegExp("cubic-bezier\\(".concat(dl,",").concat(dl,",").concat(dl,",").concat(dl,"\\)")),CV=/steps\(\s*(\d+)\s*\)/,NV=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function _b(n){var t=SV.exec(n);if(t)return Mb.apply(void 0,Ht(t.slice(1).map(Number)));var e=CV.exec(n);if(e)return Q2(Number(e[1]),J2);var r=NV.exec(n);return r?Q2(Number(r[1]),{start:kV,middle:AV,end:J2}[r[2]]):EV(n)}function TV(n){return Math.abs(MV(n)/(n.playbackRate||1))}function MV(n){var t;return n.duration===0||n.iterations===0?0:(n.duration==="auto"?0:Number(n.duration))*((t=n.iterations)!==null&&t!==void 0?t:1)}var R_=0,Ob=1,Dh=2,D_=3;function _V(n,t,e){if(t===null)return R_;var r=e.endTime;return t<Math.min(e.delay,r)?Ob:t>=Math.min(e.delay+n+e.endDelay,r)?Dh:D_}function OV(n,t,e,r,i){switch(r){case Ob:return t==="backwards"||t==="both"?0:null;case D_:return e-i;case Dh:return t==="forwards"||t==="both"?n:null;case R_:return null}}function PV(n,t,e,r,i){var a=i;return n===0?t!==Ob&&(a+=e):a+=r/n,a}function RV(n,t,e,r,i,a){var o=n===1/0?t%1:n%1;return o===0&&e===Dh&&r!==0&&(i!==0||a===0)&&(o=1),o}function DV(n,t,e,r){return n===Dh&&t===1/0?1/0:e===1?Math.floor(r)-1:Math.floor(r)}function LV(n,t,e){var r=n;if(n!=="normal"&&n!=="reverse"){var i=t;n==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?e:1-e}function IV(n,t,e){var r=_V(n,t,e),i=OV(n,e.fill,t,r,e.delay);if(i===null)return null;var a=e.duration==="auto"?0:e.duration,o=PV(a,r,e.iterations,i,e.iterationStart),s=RV(o,e.iterationStart,r,e.iterations,i,a),u=DV(r,e.iterations,s,o),c=LV(e.direction,u,s);return e.currentIteration=u,e.progress=c,e.easingFunction(c)}function jV(n,t,e){var r=BV(n,t),i=zV(r,e);return function(a,o){if(o!==null)i.filter(function(u){return o>=u.applyFrom&&o<u.applyTo}).forEach(function(u){var c=o-u.startOffset,l=u.endOffset-u.startOffset,d=l===0?0:c/l;a.setAttribute(u.property,u.interpolation(d),!1,!1)});else for(var s in r)L_(s)&&a.setAttribute(s,null)}}function L_(n){return n!=="offset"&&n!=="easing"&&n!=="composite"&&n!=="computedOffset"}function BV(n,t){for(var e={},r=0;r<n.length;r++)for(var i in n[r])if(L_(i)){var a={offset:n[r].offset,computedOffset:n[r].computedOffset,easing:n[r].easing,easingFunction:_b(n[r].easing)||t.easingFunction,value:n[r][i]};e[i]=e[i]||[],e[i].push(a)}return e}function zV(n,t){var e=[];for(var r in n)for(var i=n[r],a=0;a<i.length-1;a++){var o=a,s=a+1,u=i[o].computedOffset,c=i[s].computedOffset,l=u,d=c;a===0&&(l=-1/0,c===0&&(s=o)),a===i.length-2&&(d=1/0,u===1&&(o=s)),e.push({applyFrom:l,applyTo:d,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:FV(r,i[o].value,i[s].value,t)})}return e.sort(function(p,g){return p.startOffset-g.startOffset}),e}var tk=function(n,t,e){return function(r){var i=I_(n,t,r);return Xt(i)?i:e(i)}};function FV(n,t,e,r){var i=f_[n];if(i&&i.syntax&&i.int){var a=rt.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(t,r):t,u=o?o(e,r):e,c=a.mixer(s,u,r);if(c){var l=tk.apply(void 0,Ht(c));return function(d){return d===0?t:d===1?e:l(d)}}}}return tk(!1,!0,function(d){return d?e:t})}function I_(n,t,e){if(typeof n=="number"&&typeof t=="number")return n*(1-e)+t*e;if(typeof n=="boolean"&&typeof t=="boolean"||typeof n=="string"&&typeof t=="string")return e<.5?n:t;if(Array.isArray(n)&&Array.isArray(t)){for(var r=n.length,i=t.length,a=Math.max(r,i),o=[],s=0;s<a;s++)o.push(I_(n[s<r?s:r-1],t[s<i?s:i-1],e));return o}throw new Error("Mismatched interpolation arguments ".concat(n,":").concat(t))}var GV=(function(){function n(){et(this,n),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=wV,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return nt(n,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=_b(t),this._easing=t}}])})();function VV(n){var t=[];for(var e in n)if(!(e in["easing","offset","composite"])){var r=n[e];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!t[a]){var o={};"offset"in n&&(o.offset=Number(n.offset)),"easing"in n&&(o.easing=n.easing),"composite"in n&&(o.composite=n.composite),t[a]=o}r[a]!==void 0&&r[a]!==null&&(t[a][e]=r[a])}}return t.sort(function(s,u){return(s.computedOffset||0)-(u.computedOffset||0)}),t}function ek(n,t){if(n===null)return[];Array.isArray(n)||(n=VV(n));for(var e=n.map(function(u){var c={};t!=null&&t.composite&&(c.composite="auto");for(var l in u){var d=u[l];if(l==="offset"){if(d!==null){if(d=Number(d),!isFinite(d))throw new Error("Keyframe offsets must be numbers.");if(d<0||d>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=d}}else if(l==="composite"&&["replace","add","accumulate","auto"].indexOf(d)===-1)throw new Error("".concat(d," compositing is not supported"));c[l]=d}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(t==null?void 0:t.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),r=!0,i=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(Tt(o))r=!1;else{if(o<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}e=e.filter(function(u){return Number(u.offset)>=0&&Number(u.offset)<=1});function s(){var u,c=e,l=c.length;if(e[l-1].computedOffset=Number((u=e[l-1].offset)!==null&&u!==void 0?u:1),l>1){var d;e[0].computedOffset=Number((d=e[0].offset)!==null&&d!==void 0?d:0)}for(var p=0,g=Number(e[0].computedOffset),m=1;m<l;m++){var y=e[m].computedOffset;if(!Tt(y)&&!Tt(g)){for(var v=1;v<m-p;v++)e[p+v].computedOffset=g+(Number(y)-g)*v/(m-p);p=m,g=Number(y)}}}return r||s(),e}var UV="backwards|forwards|both|none".split("|"),WV="reverse|alternate|alternate-reverse".split("|");function YV(n,t){var e=new GV;return typeof n=="number"&&!isNaN(n)?e.duration=n:n!==void 0&&Object.keys(n).forEach(function(r){if(n[r]!==void 0&&n[r]!==null&&n[r]!=="auto"){if((typeof e[r]=="number"||r==="duration")&&(typeof n[r]!="number"||isNaN(n[r]))||r==="fill"&&UV.indexOf(n[r])===-1||r==="direction"&&WV.indexOf(n[r])===-1)return;e[r]=n[r]}}),e}function $V(n,t){return n=HV(n??{duration:"auto"}),YV(n)}function HV(n){return typeof n=="number"&&(isNaN(n)?n={duration:"auto"}:n={duration:n}),n}var XV=(function(){function n(t,e,r){var i=this;et(this,n),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=$V(r),this.timing.effect=this,this.timing.activeDuration=TV(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ek(e,this.timing),this.interpolations=jV(this.normalizedKeyframes,this.timing,this.target);var a=rt.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,s){return s==="duration"?o.duration==="auto"?0:o.duration:s==="fill"?o.fill==="auto"?"none":o.fill:s==="localTime"?i.animation&&i.animation.currentTime||null:s==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:s==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[s]},set:function(){return!0}}):this.timing}return nt(n,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return t===null?!1:(this.timeFraction=IV(this.timing.activeDuration,t,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=ek(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(r){e.timing[r]=t[r]})}}])})();function nk(n,t){return Number(n.id)-Number(t.id)}var qV=(function(){function n(t){var e=this;et(this,n),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(r){e.currentTime=r,e.discardAnimations(),e.animations.length===0?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(r){var i=e.rafCallbacks;e.rafCallbacks=[],r<Number(e.currentTime)&&(r=Number(e.currentTime)),e.animations.sort(nk),e.animations=e.tick(r,!0,e.animations)[0],i.forEach(function(a){a[1](r)}),e.applyPendingEffects()},this.document=t}return nt(n,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,r){var i=new XV(t,e,r),a=new hV(i,this);return this.animations.push(a),this.restartWebAnimationsNextTick(),a.updatePromises(),a.play(),a.updatePromises(),a}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var r=t.targetAnimations();r.sort(nk);var i=this.tick(Number(this.currentTime),!1,r.slice())[1];i.forEach(function(a){var o=e.animations.indexOf(a);o!==-1&&e.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){t==null||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return t.playState!=="finished"&&t.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(r){e.updateAnimationsPromises(),t(r),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,r){var i=this,a,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var s=[],u=[],c=[],l=[];return r.forEach(function(d){d.tick(t,e),d._inEffect?(u.push(d.effect),d.markTarget()):(s.push(d.effect),d.unmarkTarget()),d._needsTick&&(i.ticking=!0);var p=d._inEffect||d._needsTick;d._inTimeline=p,p?c.push(d):l.push(d)}),(a=this.pendingEffects).push.apply(a,s),(o=this.pendingEffects).push.apply(o,u),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,l]}}])})();rt.EasingFunction=_b;rt.AnimationTimeline=qV;const KV={duration:500},ZV={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"};var Se;(function(n){n.NodeAdded="NodeAdded",n.NodeUpdated="NodeUpdated",n.NodeRemoved="NodeRemoved",n.EdgeAdded="EdgeAdded",n.EdgeUpdated="EdgeUpdated",n.EdgeRemoved="EdgeRemoved",n.ComboAdded="ComboAdded",n.ComboUpdated="ComboUpdated",n.ComboRemoved="ComboRemoved"})(Se||(Se={}));var $n;(function(n){n.DRAW="draw",n.COLLAPSE="collapse",n.EXPAND="expand",n.TRANSFORM="transform"})($n||($n={}));var Nu;(function(n){n.CLICK="canvas:click",n.DBLCLICK="canvas:dblclick",n.POINTER_OVER="canvas:pointerover",n.POINTER_LEAVE="canvas:pointerleave",n.POINTER_ENTER="canvas:pointerenter",n.POINTER_MOVE="canvas:pointermove",n.POINTER_OUT="canvas:pointerout",n.POINTER_DOWN="canvas:pointerdown",n.POINTER_UP="canvas:pointerup",n.CONTEXT_MENU="canvas:contextmenu",n.DRAG_START="canvas:dragstart",n.DRAG="canvas:drag",n.DRAG_END="canvas:dragend",n.DRAG_ENTER="canvas:dragenter",n.DRAG_OVER="canvas:dragover",n.DRAG_LEAVE="canvas:dragleave",n.DROP="canvas:drop",n.WHEEL="canvas:wheel"})(Nu||(Nu={}));var j1;(function(n){n.CLICK="combo:click",n.DBLCLICK="combo:dblclick",n.POINTER_OVER="combo:pointerover",n.POINTER_LEAVE="combo:pointerleave",n.POINTER_ENTER="combo:pointerenter",n.POINTER_MOVE="combo:pointermove",n.POINTER_OUT="combo:pointerout",n.POINTER_DOWN="combo:pointerdown",n.POINTER_UP="combo:pointerup",n.CONTEXT_MENU="combo:contextmenu",n.DRAG_START="combo:dragstart",n.DRAG="combo:drag",n.DRAG_END="combo:dragend",n.DRAG_ENTER="combo:dragenter",n.DRAG_OVER="combo:dragover",n.DRAG_LEAVE="combo:dragleave",n.DROP="combo:drop"})(j1||(j1={}));var st;(function(n){n.CLICK="click",n.DBLCLICK="dblclick",n.POINTER_OVER="pointerover",n.POINTER_LEAVE="pointerleave",n.POINTER_ENTER="pointerenter",n.POINTER_MOVE="pointermove",n.POINTER_OUT="pointerout",n.POINTER_DOWN="pointerdown",n.POINTER_UP="pointerup",n.CONTEXT_MENU="contextmenu",n.DRAG_START="dragstart",n.DRAG="drag",n.DRAG_END="dragend",n.DRAG_ENTER="dragenter",n.DRAG_OVER="dragover",n.DRAG_LEAVE="dragleave",n.DROP="drop",n.KEY_DOWN="keydown",n.KEY_UP="keyup",n.WHEEL="wheel",n.PINCH="pinch"})(st||(st={}));var $o;(function(n){n.KEY_DOWN="keydown",n.KEY_UP="keyup"})($o||($o={}));var gt;(function(n){n.BEFORE_CANVAS_INIT="beforecanvasinit",n.AFTER_CANVAS_INIT="aftercanvasinit",n.BEFORE_SIZE_CHANGE="beforesizechange",n.AFTER_SIZE_CHANGE="aftersizechange",n.BEFORE_ELEMENT_CREATE="beforeelementcreate",n.AFTER_ELEMENT_CREATE="afterelementcreate",n.BEFORE_ELEMENT_UPDATE="beforeelementupdate",n.AFTER_ELEMENT_UPDATE="afterelementupdate",n.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",n.AFTER_ELEMENT_DESTROY="afterelementdestroy",n.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",n.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",n.BEFORE_DRAW="beforedraw",n.AFTER_DRAW="afterdraw",n.BEFORE_RENDER="beforerender",n.AFTER_RENDER="afterrender",n.BEFORE_ANIMATE="beforeanimate",n.AFTER_ANIMATE="afteranimate",n.BEFORE_LAYOUT="beforelayout",n.AFTER_LAYOUT="afterlayout",n.BEFORE_STAGE_LAYOUT="beforestagelayout",n.AFTER_STAGE_LAYOUT="afterstagelayout",n.BEFORE_TRANSFORM="beforetransform",n.AFTER_TRANSFORM="aftertransform",n.BATCH_START="batchstart",n.BATCH_END="batchend",n.BEFORE_DESTROY="beforedestroy",n.AFTER_DESTROY="afterdestroy",n.BEFORE_RENDERER_CHANGE="beforerendererchange",n.AFTER_RENDERER_CHANGE="afterrendererchange"})(gt||(gt={}));const me="combo",Yr="tree";var Kt;(function(n){n.NODE="node",n.EDGE="edge",n.COMBO="combo",n.THEME="theme",n.PALETTE="palette",n.LAYOUT="layout",n.BEHAVIOR="behavior",n.PLUGIN="plugin",n.ANIMATION="animation",n.TRANSFORM="transform",n.SHAPE="shape"})(Kt||(Kt={}));const B1={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function ji(n,t){var e;const r=(e=B1[n])===null||e===void 0?void 0:e[t];if(r)return r}const JV="5.0.50",QV="G6";function Li(n){return`[${QV} v${JV}] ${n}`}const ka={mute:!1,debug:n=>{console.debug(Li(n))},info:n=>{console.info(Li(n))},warn:n=>{console.warn(Li(n))},error:n=>{console.error(Li(n))}};function j_(n){const{theme:t}=n;return t?ji(Kt.THEME,t)||(ka.warn(`The theme of ${t} is not registered.`),{}):{}}function Pb(n,t){if(Array.isArray(n)&&n.length===0)return null;const e=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n.slice(1):t||[];return new Proxy(e,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...o)=>{i[a](...o),r.forEach(s=>{var u;return(u=s[a])===null||u===void 0?void 0:u.call(s,...o)})}:a==="finished"?Promise.all([e.finished,...r.map(o=>o.finished)]):Reflect.get(i,a)},set(i,a,o){return["onframe","onfinish"].includes(a)||r.forEach(s=>{s[a]=o}),Reflect.set(i,a,o)}})}function z1(n){const t=n.reduce((r,i)=>(Object.entries(i).forEach(([a,o])=>{r[a]===void 0?r[a]=[o]:r[a].push(o)}),r),{});Object.entries(t).forEach(([r,i])=>{(i.length!==n.length||i.some(a=>Tt(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(r)&&Jn(a,i[0])))&&delete t[r]});const e=Object.entries(t).reduce((r,[i,a])=>(a.forEach((o,s)=>{r[s]?r[s][i]=o:r[s]={[i]:o}}),r),[]);return n.length!==0&&e.length===0&&e.push({_:0},{_:0}),e}function ah(n){switch(n){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function B_(n,t){const{animation:e}=n;if(e===!1||t===!1)return!1;const r=Object.assign({},KV);return An(e)&&Object.assign(r,e),An(t)&&Object.assign(r,t),r}function tU(n){return typeof n=="string"?ji(Kt.ANIMATION,n)||(ka.warn(`The animation of ${n} is not registered.`),[]):n}function eU(n,t,e,r){var i,a;const{animation:o}=n;if(o===!1||r===!1)return[];const s=(i=n==null?void 0:n[t])===null||i===void 0?void 0:i.animation;if(s===!1)return[];const u=s==null?void 0:s[e];if(u===!1)return[];const c=(a=j_(n)[t])===null||a===void 0?void 0:a.animation,l=(p=[])=>tU(p).map(g=>Object.assign(Object.assign(Object.assign(Object.assign({},ZV),An(o)&&o),g),An(r)&&r));if(u)return l(u);if(!c)return[];const d=c[e];return d===!1?[]:l(d)}function z_(n,t,e,r=[]){if(!r&&n===0&&t===0&&e===0)return null;if(Array.isArray(r)){let a=-1;const o=[];for(let s=0;s<r.length;s++){const u=r[s];if(u[0]==="translate"){if(u[1]===n&&u[2]===t)return null;a=s,o.push(["translate",n,t])}else if(u[0]==="translate3d"){if(u[1]===n&&u[2]===t&&u[3]===e)return null;a=s,o.push(["translate3d",n,t,e??0])}else o.push(u)}return a===-1&&o.splice(0,0,Xt(e)?["translate3d",n,t,e??0]:["translate",n,t]),o.length===0?null:o}const i=r?r.replace(/translate(3d)?\([^)]*\)/g,""):"";return e===0?`translate(${n}, ${t})${i}`:`translate3d(${n}, ${t}, ${e})${i}`}var nU=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const rU=(n,t,e)=>{if(!e.length)return null;const[r,i]=t,a=c=>{var l;if(c){const d=n.getShape(c);if(!d)return null;const p=`get${Hl(c)}Style`,g=((l=n==null?void 0:n[p])===null||l===void 0?void 0:l.bind(n))||(v=>v),m=(g==null?void 0:g(r))||{},y=(g==null?void 0:g(i))||{};return{shape:d,fromStyle:m,toStyle:y}}else return{shape:n,fromStyle:r,toStyle:i}};let o;const s=e.map(c=>{var{fields:l,shape:d}=c,p=nU(c,["fields","shape","states"]);const g=a(d);if(!g)return null;const{shape:m,fromStyle:y,toStyle:v}=g,x=[{},{}];if(l.forEach(w=>{var S,k;Object.assign(x[0],{[w]:(S=y[w])!==null&&S!==void 0?S:ah(w)}),Object.assign(x[1],{[w]:(k=v[w])!==null&&k!==void 0?k:ah(w)})}),x.some(w=>Object.keys(w).some(S=>["x","y","z"].includes(S)))){const{x:w=0,y:S=0,z:k,transform:A=""}=m.attributes||{};x.forEach(N=>{var T,O,M;N.transform=z_((T=N.x)!==null&&T!==void 0?T:w,(O=N.y)!==null&&O!==void 0?O:S,(M=N.z)!==null&&M!==void 0?M:k,A)})}const E=m.animate(z1(x),p);return d===void 0&&(o=E),E}).filter(Boolean),u=o||(s==null?void 0:s[0]);return u?Pb(u,s.filter(c=>c!==c)):null};function iU(n){return"source"in n&&"target"in n}function aU(n){return n.length===2}function ss(n){return n instanceof Float32Array?!0:Array.isArray(n)&&(n.length===2||n.length===3)?n.every(t=>typeof t=="number"):!1}function mi(n,t,e){return n>=t&&n<=e}function zi(n=0){if(Array.isArray(n)){const[t=0,e=t,r=t,i=e]=n;return[t,e,r,i]}return[n,n,n,n]}function oU(n=0){const t=zi(n);return t[0]+t[2]}function Fi(n){return n.max[0]-n.min[0]}function Gi(n){return n.max[1]-n.min[1]}function zu(n){return[Fi(n),Gi(n)]}function ca(n,t){const e=ss(n)?Rb(n):n.getShape("key").getBounds();return t?Aa(e,t):e}function Rb(n){const[t,e,r=0]=n,i=new ye;return i.setMinMax([t,e,r],[t,e,r]),i}function Aa(n,t){const[e,r,i,a]=zi(t),[o,s,u]=n.min,[c,l,d]=n.max,p=new ye;return p.setMinMax([o-a,s-e,u],[c+r,l+i,d]),p}function Fu(n){if(n.length===0)return new ye;if(n.length===1)return n[0];const t=new ye;t.setMinMax(n[0].min,n[0].max);for(let e=1;e<n.length;e++){const r=n[e];t.setMinMax([Math.min(t.min[0],r.min[0]),Math.min(t.min[1],r.min[1]),Math.min(t.min[2],r.min[2])],[Math.max(t.max[0],r.max[0]),Math.max(t.max[1],r.max[1]),Math.max(t.max[2],r.max[2])])}return t}function sU(n,t){const[e,r]=n.min,[i,a]=n.max,[o,s]=t.min,[u,c]=t.max;return e>=o&&i<=u&&r>=s&&a<=c}function Xr(n,t){return mi(n[0],t.min[0],t.max[0])&&mi(n[1],t.min[1],t.max[1])}function F_(n,t,e=!1){const{min:[r,i],max:[a,o]}=t,s=(n[1]===i||n[1]===o)&&(e||mi(n[0],r,a)),u=(n[0]===r||n[0]===a)&&(e||mi(n[1],i,o));return s||u}function uU(n,t){return!Xr(n,t)}function oh(n,t){const{center:e}=t;return n[0]===e[0]&&n[1]===e[1]}function vu(n,t){const[e,r]=n,[i,a]=t.min,[o,s]=t.max,u=e-i,c=o-e,l=r-a,d=s-r,p=Math.min(u,c,l,d);return p===u?"left":p===c?"right":p===l?"top":p===d?"bottom":"left"}function Qa(n,t){const e=g1(n);if(Xr(n,t))switch(vu(n,t)){case"left":e[0]=t.min[0];break;case"right":e[0]=t.max[0];break;case"top":e[1]=t.min[1];break;case"bottom":e[1]=t.max[1];break}else{const[r,i]=n,[a,o]=t.min,[s,u]=t.max;e[0]=mi(r,a,s)?r:r<a?a:s,e[1]=mi(i,o,u)?i:i<o?o:u}return e}function cU(n){const{min:[t,e],max:[r,i]}=n,a=[t,i],o=[r,i],s=[r,e],u=[t,e];return[[a,o],[o,s],[s,u],[u,a]]}var lU=function(n,t,e){t===void 0&&(t=[]);var r=t.filter(function(a){return a.source===n||a.target===n});{var i=function(a){return a.target===n};return r.filter(i).map(function(a){return a.source})}},hU=function(n,t){return t.filter(function(e){return e.source===n})},dU=function(n,t){return t.filter(function(e){return e.source===n||e.target===n})},fU=function(n){var t={},e=n.nodes,r=e===void 0?[]:e,i=n.edges,a=i===void 0?[]:i;return r.forEach(function(o){t[o.id]={degree:0,inDegree:0,outDegree:0}}),a.forEach(function(o){t[o.source].degree++,t[o.source].outDegree++,t[o.target].degree++,t[o.target].inDegree++}),t},pU={}.toString,gU=function(n,t){return pU.call(n)==="[object "+t+"]"};const vU=(function(n){return Array.isArray?Array.isArray(n):gU(n,"Array")});var mU=function(n,t,e){for(var r=1/0,i,a=0;a<t.length;a++){var o=t[a].id;!e[o]&&n[o]<=r&&(r=n[o],i=t[a])}return i},yU=function(n,t,e,r){var i=n.nodes,a=i===void 0?[]:i,o=n.edges,s=o===void 0?[]:o,u={},c={},l={};a.forEach(function(x,E){var w=x.id;c[w]=1/0,w===t&&(c[w]=0)});for(var d=a.length,p=function(x){var E=mU(c,a,u),w=E.id;if(u[w]=!0,c[w]===1/0)return"continue";var S=[];e?S=hU(w,s):S=dU(w,s),S.forEach(function(k){var A=k.target,N=k.source,T=A===w?N:A,O=r&&k[r]?k[r]:1;c[T]>c[E.id]+O?(c[T]=c[E.id]+O,l[T]=[E.id]):c[T]===c[E.id]+O&&l[T].push(E.id)})},g=0;g<d;g++)p();l[t]=[t];var m={};for(var y in c)c[y]!==1/0&&G_(t,y,l,m);var v={};for(var y in m)v[y]=m[y][0];return{length:c,path:v,allPath:m}};function G_(n,t,e,r){if(n===t)return[n];if(r[t])return r[t];for(var i=[],a=0,o=e[t];a<o.length;a++){var s=o[a],u=G_(n,s,e,r);if(!u)return;for(var c=0,l=u;c<l.length;c++){var d=l[c];vU(d)?i.push(Sn(Sn([],d,!0),[t],!1)):i.push([d,t])}}return r[t]=i,r[t]}var V_=function(n,t,e,r,i){var a=yU(n,t,r,i),o=a.length,s=a.path,u=a.allPath;return{length:o[e],path:s[e],allPath:u[e]}},bU=function(n,t,e){typeof t!="number"&&(t=1e-6),typeof e!="number"&&(e=.85);for(var r=1,i=0,a=1e3,o=n.nodes,s=o===void 0?[]:o,u=n.edges,c=u===void 0?[]:u,l=s.length,d,p={},g={},m=0;m<l;++m){var y=s[m],v=y.id;p[v]=1/l,g[v]=1/l}for(var x=fU(n);a>0&&r>t;){i=0;for(var m=0;m<l;++m){var y=s[m],v=y.id;if(d=0,x[y.id].inDegree===0)p[v]=0;else{for(var E=lU(v,c),w=0;w<E.length;++w){var S=E[w],k=x[S].outDegree;k>0&&(d+=g[S]/k)}p[v]=e*d,i+=p[v]}}i=(1-i)/l,r=0;for(var m=0;m<l;++m){var y=s[m],v=y.id;d=p[v]+i,r+=Math.abs(d-g[v]),g[v]=d}a-=1}return g};function Z(n){if(n.id!==void 0)return n.id;if(n.source!==void 0&&n.target!==void 0)return`${n.source}-${n.target}`;throw new Error(Li("The datum does not have available id."))}function fl(n){return n.combo}function xU(n,t){const e={nodes:(n.nodes||[]).map(Z),edges:(n.edges||[]).map(Z),combos:(n.combos||[]).map(Z)};return t?Object.values(e).flat():e}const U_=(n,t,e)=>{var r;switch(e.type){case"degree":{const i=new Map;return(r=n.nodes)===null||r===void 0||r.forEach(a=>{const o=t(Z(a),e.direction).length;i.set(Z(a),o)}),i}case"betweenness":return EU(n,e.directed,e.weightPropertyName);case"closeness":return wU(n,e.directed,e.weightPropertyName);case"eigenvector":return AU(n,e.directed);case"pagerank":return kU(n,e.epsilon,e.linkProb);default:return W_(n)}},W_=n=>{var t;const e=new Map;return(t=n.nodes)===null||t===void 0||t.forEach(r=>{e.set(Z(r),0)}),e},EU=(n,t,e)=>{const r=W_(n),{nodes:i=[]}=n;return i.forEach(a=>{i.forEach(o=>{if(a!==o){const{allPath:s}=V_(n,Z(a),Z(o),t,e),u=s.length;s.flat().forEach(c=>{c!==Z(a)&&c!==Z(o)&&r.set(c,r.get(c)+1/u)})}})}),r},wU=(n,t,e)=>{const r=new Map,{nodes:i=[]}=n;return i.forEach(a=>{const o=i.reduce((s,u)=>{if(a!==u){const{length:c}=V_(n,Z(a),Z(u),t,e);s+=c}return s},0);r.set(Z(a),1/o)}),r},kU=(n,t,e)=>{var r;const i=new Map,a=bU(n,t,e);return(r=n.nodes)===null||r===void 0||r.forEach(o=>{i.set(Z(o),a[Z(o)])}),i},AU=(n,t)=>{const{nodes:e=[]}=n,r=SU(n,t),i=CU(r,e.length),a=new Map;return e.forEach((o,s)=>{a.set(Z(o),i[s])}),a},SU=(n,t)=>{const{nodes:e=[],edges:r=[]}=n,i=Array(e.length).fill(null).map(()=>Array(e.length).fill(0));return r.forEach(({source:a,target:o})=>{const s=e.findIndex(c=>Z(c)===a),u=e.findIndex(c=>Z(c)===o);t?i[s][u]=1:(i[s][u]=1,i[u][s]=1)}),i},CU=(n,t,e=100,r=1e-6)=>{let i=Array(t).fill(1),a=1/0;for(let o=0;o<e&&a>r;o++){const s=Array(t).fill(0);for(let c=0;c<t;c++)for(let l=0;l<t;l++)s[c]+=n[c][l]*i[l];const u=Math.sqrt(s.reduce((c,l)=>c+l*l,0));for(let c=0;c<t;c++)s[c]/=u;a=Math.sqrt(s.reduce((c,l,d)=>c+(l-i[d])*l,0)),i=s}return i};function mu(n,t,e,r=Jn){const i=new Map(n.map(p=>[e(p),p])),a=new Map(t.map(p=>[e(p),p])),o=new Set(i.keys()),s=new Set(a.keys()),u=[],c=[],l=[],d=[];return s.forEach(p=>{o.has(p)?r(i.get(p),a.get(p))?d.push(a.get(p)):c.push(a.get(p)):u.push(a.get(p))}),o.forEach(p=>{s.has(p)||l.push(i.get(p))}),{enter:u,exit:l,keep:d,update:c}}function oo(n,t,e){const r=i=>{e&&!e(i)||(i.style.visibility=t)};n.forEach(i=>{r(i)})}function NU(n,t,e){const r={},i=a=>(a in r||(r[a]=0),`${t}-${a}-${r[a]++}`);return e.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(n):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class Db{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=NU(this.context.graph,this.category,t),{enter:r,update:i,exit:a,keep:o}=mu(this.extensions,e,s=>s.key);this.createExtensions(r),this.updateExtensions([...i,...o]),this.destroyExtensions(a),this.extensions=e}createExtension(t){const{category:e}=this,{key:r,type:i}=t,a=ji(e,i);if(!a)return ka.warn(`The extension ${i} of ${e} is not registered.`);const o=new a(this.context,t);o.initialized=!0,this.extensionMap[r]=o}createExtensions(t){t.forEach(e=>this.createExtension(e))}updateExtension(t){const{key:e}=t,r=this.extensionMap[e];r&&r.update(t)}updateExtensions(t){t.forEach(e=>this.updateExtension(e))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.initialized&&!e.destroyed&&e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach(({key:e})=>this.destroyExtension(e))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class Lb{constructor(t,e){this.events=[],this.initialized=!1,this.destroyed=!1,this.context=t,this.options=e}update(t){this.options=Object.assign(this.options,t)}destroy(){this.context={},this.options={},this.destroyed=!0}}class bi extends Lb{}class Lh extends bi{constructor(t,e){super(t,Object.assign({},Lh.defaultOptions,e)),this.isOverlapping=(r,i)=>i.some(a=>r.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=r=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],r.forEach(o=>{const s=o.getShape("label").getRenderBounds();i.isInViewport(s,!0)&&!this.isOverlapping(s,this.occupiedBounds)?(a.show.push(o),this.occupiedBounds.push(Aa(s,this.options.padding))):a.hide.push(o)}),a},this.hideLabelIfExceedViewport=(r,i)=>{const{exit:a}=mu(r,i,o=>o.id);a==null||a.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(r,i)=>{const{model:a}=this.context,o=a.getData(),s=a.getRelatedEdgesData.bind(a);return r.map(u=>(this.nodeCentralities.has(u.id)||(this.nodeCentralities=U_(o,s,i)),{node:u,centrality:this.nodeCentralities.get(u.id)})).sort((u,c)=>c.centrality-u.centrality).map(u=>u.node)},this.sortLabelElementsInView=r=>{const{sort:i,sortNode:a,sortCombo:o,sortEdge:s}=this.options,{model:u}=this.context;if(St(i))return r.sort((y,v)=>i(u.getElementDataById(y.id),u.getElementDataById(v.id)));const{node:c=[],edge:l=[],combo:d=[]}=Mh(r,y=>y.type),p=St(o)?d.sort((y,v)=>o(...u.getComboData([y.id,v.id]))):d,g=St(a)?c.sort((y,v)=>a(...u.getNodeData([y.id,v.id]))):this.sortNodesByCentrality(c,a),m=St(s)?l.sort((y,v)=>s(...u.getEdgeData([y.id,v.id]))):l;return[...p,...g,...m]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=r=>{var i;if(((i=r.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(r)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const o=this.sortLabelElementsInView(this.labelElementsInView),{show:s,hide:u}=this.detectLabelCollision(o);for(let c=s.length-1;c>=0;c--)this.showLabel(s[c]);u.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=r=>{const i=r.getShape("label");i&&oo(i,"hidden"),this.hiddenElements.set(r.id,r)},this.showLabel=r=>{const i=r.getShape("label");i&&oo(i,"visible"),r.toFront(),this.hiddenElements.delete(r.id)},this.onTransform=IB(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=r=>{this.enableToggle&&this.onToggleVisibility(r)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=r=>{this.onToggleVisibility(r),this.enableToggle=!0},this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:t}=this.context.element,e=[];for(const r in t){const i=t[r];i.isVisible()&&i.getShape("label")&&e.push(i)}return e}getLabelElementsInView(){const t=this.context.viewport;return this.getLabelElements().filter(e=>t.isInViewport(e.getShape("key").getRenderBounds()))}bindEvents(){const{graph:t}=this.context;t.on(gt.BEFORE_RENDER,this.onBeforeRender),t.on(gt.AFTER_RENDER,this.onAfterRender),t.on(gt.AFTER_DRAW,this.toggle),t.on(gt.AFTER_LAYOUT,this.toggle),t.on(gt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(gt.BEFORE_RENDER,this.onBeforeRender),t.off(gt.AFTER_RENDER,this.onAfterRender),t.off(gt.AFTER_DRAW,this.toggle),t.off(gt.AFTER_LAYOUT,this.toggle),t.off(gt.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Lh.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};const rk=[0,0,0];function rn(n,t){return n.map((e,r)=>e+t[r])}function Mn(n,t){return n.map((e,r)=>e-t[r])}function us(n,t){return typeof t=="number"?n.map(e=>e*t):n.map((e,r)=>e*t[r])}function sh(n,t){return typeof t=="number"?n.map(e=>e/t):n.map((e,r)=>e/t[r])}function TU(n,t){const e=lh(n),r=lh(t);return[e[1]*r[2]-e[2]*r[1],e[2]*r[0]-e[0]*r[2],e[0]*r[1]-e[1]*r[0]]}function Bi(n,t){return Math.sqrt(n.reduce((e,r,i)=>e+Math.pow(r-t[i]||0,2),0))}function uh(n,t){return n.reduce((e,r,i)=>e+Math.abs(r-t[i]),0)}function Y_(n){const t=n.reduce((e,r)=>e+Math.pow(r,2),0);return n.map(e=>e/Math.sqrt(t))}function MU(n,t,e=!1){const r=n[0]*t[1]-n[1]*t[0];let i=Math.acos(us(n,t).reduce((a,o)=>a+o,0)/(Bi(n,rk)*Bi(t,rk)));return e&&r<0&&(i=2*Math.PI-i),i}function _U(n,t=!0){return t?[-n[1],n[0]]:[n[1],-n[0]]}function wp(n,t){return n.map(e=>e%t)}function ch(n){return[n[0],n[1]]}function lh(n){return aU(n)?[n[0],n[1],0]:n}function OU(n){const[t,e]=n;return!t&&!e?0:Math.atan2(e,t)}function $_(n,t){const[e,r]=n;if(t%360===0)return[e,r];const i=t*Math.PI/180,a=Math.cos(i),o=Math.sin(i);return[e*a-r*o,e*o+r*a]}function H_(n,t){const[e,r]=n,[i,a]=t,o=Mn(e,r),s=Mn(i,a);return TU(o,s).every(u=>u===0)}function X_(n,t,e=!1){if(H_(n,t))return;const[r,i]=n,[a,o]=t,s=((r[0]-a[0])*(a[1]-o[1])-(r[1]-a[1])*(a[0]-o[0]))/((r[0]-i[0])*(a[1]-o[1])-(r[1]-i[1])*(a[0]-o[0])),u=o[0]-a[0]?(r[0]-a[0]+s*(i[0]-r[0]))/(o[0]-a[0]):(r[1]-a[1]+s*(i[1]-r[1]))/(o[1]-a[1]);if(!(!e&&(!mi(s,0,1)||!mi(u,0,1))))return[r[0]+s*(i[0]-r[0]),r[1]+s*(i[1]-r[1])]}function q_(n){if(Array.isArray(n))return mi(n[0],0,1)&&mi(n[1],0,1)?n:[.5,.5];const t=n.split("-"),e=t.includes("left")?0:t.includes("right")?1:.5,r=t.includes("top")?0:t.includes("bottom")?1:.5;return[e,r]}function _r(n){const{x:t=0,y:e=0,z:r=0}=n.style||{};return[+t,+e,+r]}function PU(n){const{x:t,y:e,z:r}=n.style||{};return t!==void 0||e!==void 0||r!==void 0}function RU(n,t){const[e,r]=t,{min:i,max:a}=n;return[i[0]+e*(a[0]-i[0]),i[1]+r*(a[1]-i[1])]}function aa(n,t="center"){const e=q_(t);return RU(n,e)}function oi(n){var t;return[n.x,n.y,(t=n.z)!==null&&t!==void 0?t:0]}function Js(n){var t;return{x:n[0],y:n[1],z:(t=n[2])!==null&&t!==void 0?t:0}}function Qs(n,t=0){return n.map(e=>parseFloat(e.toFixed(t)))}function pa(n,t,e,r=!1){if(Jn(n,t))return n;const i=r?Mn(n,t):Mn(t,n),a=Y_(i),o=[a[0]*e,a[1]*e];return rn(ch(n),o)}function K_(n,t){return n[1]===t[1]}function DU(n,t){return n[0]===t[0]}function LU(n,t){return K_(n,t)||DU(n,t)}function IU(n,t,e){return H_([n,t],[t,e])}function Z_(n,t){return[2*t[0]-n[0],2*t[1]-n[1]]}function jU(n,t,e,r=!0,i=!1){for(let a=0;a<e.length;a++){let o=e[a],s=e[(a+1)%e.length];r&&(o=rn(t,o),s=rn(t,s));const u=i?Z_(n,t):n,c=X_([t,u],[o,s]);if(c)return{point:c,line:[o,s]}}return{point:t,line:void 0}}function BU(n,t,e=!1){const r=aa(t,"center"),i=[aa(t,"left-top"),aa(t,"right-top"),aa(t,"right-bottom"),aa(t,"left-bottom")];return jU(n,r,i,!1,e).point}function J_(n,t,e=!1){const r=t.center,i=e?Z_(n,r):n,a=Mn(i,t.center),o=Math.atan2(a[1],a[0]);if(isNaN(o))return r;const s=Fi(t)/2,u=Gi(t)/2,c=r[0]+s*Math.cos(o),l=r[1]+u*Math.sin(o);return[c,l]}function zU(n,t){let e=1/0,r=[n[0],t[0]];return n.forEach(i=>{t.forEach(a=>{const o=Bi(i,a);o<e&&(e=o,r=[i,a])})}),r}class We{constructor(t,e,r){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,We.instance)return We.callbacks[this.phase].push(r),We.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),We.instance=this,We.callbacks[this.phase].push(r)}bindEvents(){const{emitter:t}=this;t.on(st.POINTER_DOWN,this.onPointerDown),t.on(st.POINTER_MOVE,this.onPointerMove),t.on(st.POINTER_UP,this.onPointerUp)}updatePointerPosition(t,e,r){const i=this.pointerByTouch.findIndex(a=>a.pointerId===t);i>=0&&(this.pointerByTouch[i]={x:e,y:r,pointerId:t})}onPointerDown(t){const{x:e,y:r}=t.client||{};if(!(e===void 0||r===void 0)&&(this.pointerByTouch.push({x:e,y:r,pointerId:t.pointerId}),t.pointerType==="touch"&&this.pointerByTouch.length===2)){We.isPinching=!0;const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(i*i+a*a),We.callbacks.pinchstart.forEach(o=>o(t,{scale:0}))}}onPointerMove(t){if(this.pointerByTouch.length!==2||this.initialDistance===null)return;const{x:e,y:r}=t.client||{};if(e===void 0||r===void 0)return;this.updatePointerPosition(t.pointerId,e,r);const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(i*i+a*a)/this.initialDistance;We.callbacks.pinchmove.forEach(s=>s(t,{scale:(o-1)*5}))}onPointerUp(t){var e;We.callbacks.pinchend.forEach(r=>r(t,{scale:0})),We.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(e=We.instance)===null||e===void 0||e.tryDestroy()}destroy(){this.emitter.off(st.POINTER_DOWN,this.onPointerDown),this.emitter.off(st.POINTER_MOVE,this.onPointerMove),this.emitter.off(st.POINTER_UP,this.onPointerUp),We.instance=null}off(t,e){const r=We.callbacks[t].indexOf(e);r>-1&&We.callbacks[t].splice(r,1),this.tryDestroy()}tryDestroy(){Object.values(We.callbacks).every(t=>t.length===0)&&this.destroy()}}We.isPinching=!1;We.instance=null;We.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const ik=n=>n.map(t=>fe(t)?t.toLocaleLowerCase():t);class Ih{constructor(t){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=e=>{e!=null&&e.key&&(this.recordKey.add(e.key),this.trigger(e))},this.onKeyUp=e=>{e!=null&&e.key&&this.recordKey.delete(e.key)},this.onWheel=e=>{this.triggerExtendKey(st.WHEEL,e)},this.onDrag=e=>{this.triggerExtendKey(st.DRAG,e)},this.handlePinch=(e,r)=>{this.triggerExtendKey(st.PINCH,Object.assign(Object.assign({},e),r))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){t.length!==0&&(t.includes(st.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new We(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach((r,i)=>{Jn(i,t)&&(!e||e===r)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(t){const e=ik(Array.from(this.recordKey)).sort(),r=ik(t).sort();return Jn(e,r)}bindEvents(){var t;const{emitter:e}=this;e.on(st.KEY_DOWN,this.onKeyDown),e.on(st.KEY_UP,this.onKeyUp),e.on(st.WHEEL,this.onWheel),e.on(st.DRAG,this.onDrag),(t=globalThis.addEventListener)===null||t===void 0||t.call(globalThis,"focus",this.onFocus)}trigger(t){this.map.forEach((e,r)=>{this.match(r)&&e(t)})}triggerExtendKey(t,e){this.map.forEach((r,i)=>{i.includes(t)&&Jn(Array.from(this.recordKey),i.filter(a=>a!==t))&&r(e)})}destroy(){var t,e;this.unbindAll(),this.emitter.off(st.KEY_DOWN,this.onKeyDown),this.emitter.off(st.KEY_UP,this.onKeyUp),this.emitter.off(st.WHEEL,this.onWheel),this.emitter.off(st.DRAG,this.onDrag),(t=this.pinchHandler)===null||t===void 0||t.off("pinchmove",this.boundHandlePinch),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"blur",this.onFocus)}}const FU=.8,so=["node","edge","combo"];function Qo(n,t,e,r,i=0){r==="TB"&&t(n,i);const a=e(n);if(a)for(const o of a)Qo(o,t,e,r,i+1);r==="BT"&&t(n,i)}function GU(n,t,e){const r=[[n,0]];for(;r.length;){const[i,a]=r.shift();t(i,a);const o=e(i);if(o)for(const s of o)r.push([s,a+1])}}function Q_(n,t,e,r,i="both"){if(t==="combo"||t==="node")return kp(n,e,r,i);const a=n.getEdgeData(e);if(!a)return[];const o=kp(n,a.source,r-1,i),s=kp(n,a.target,r-1,i);return Array.from(new Set([...o,...s,e]))}function kp(n,t,e,r="both"){const i=new Set,a=new Set,o=new Set;return GU(t,(s,u)=>{u>e||(o.add(s),n.getRelatedEdgesData(s,r).forEach(c=>{const l=Z(c);!a.has(l)&&u<e&&(o.add(l),a.add(l))}))},s=>n.getRelatedEdgesData(s,r).map(u=>u.source===s?u.target:u.source).filter(u=>i.has(u)?!1:(i.add(u),!0))),Array.from(o)}function Ap(n){return n.states||[]}var pl=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class jh extends bi{constructor(t,e){super(t,Object.assign({},jh.defaultOptions,e)),this.onClickSelect=r=>pl(this,void 0,void 0,function*(){var i,a;this.validate(r)&&(yield this.updateState(r),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,r))}),this.onClickCanvas=r=>pl(this,void 0,void 0,function*(){var i,a;this.validate(r)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,r))}),this.shortcut=new Ih(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),so.forEach(e=>{t.on(`${e}:${st.CLICK}`,this.onClickSelect)}),t.on(Nu.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:t,trigger:e}=this.options;return t&&this.shortcut.match(e)}getNeighborIds(t){const{target:e,targetType:r}=t,{graph:i}=this.context,{degree:a}=this.options;return Q_(i,r,e.id,typeof a=="function"?a(t):a).filter(o=>o!==e.id)}updateState(t){return pl(this,void 0,void 0,function*(){const{state:e,unselectedState:r,neighborState:i,animation:a}=this.options;if(!e&&!i&&!r)return;const{target:o}=t,{graph:s}=this.context,u=s.getElementData(o.id),c=Ap(u).includes(e)?"unselect":"select",l={},d=this.isMultipleSelect,p=[o.id],g=this.getNeighborIds(t);if(d)if(Object.assign(l,this.getDataStates()),c==="select"){const m=(y,v)=>{y.forEach(x=>{const E=new Set(s.getElementState(x));E.add(v),E.delete(r),l[x]=Array.from(E)})};m(p,e),m(g,i),r&&Object.keys(l).forEach(y=>{const v=l[y];!v.includes(e)&&!v.includes(i)&&!v.includes(r)&&l[y].push(r)})}else{const m=l[o.id];l[o.id]=m.filter(y=>y!==e&&y!==i),m.includes(r)||l[o.id].push(r),g.forEach(y=>{l[y]=l[y].filter(v=>v!==i),l[y].includes(e)||l[y].push(r)})}else if(c==="select"){Object.assign(l,this.getClearStates(!!r));const m=(y,v)=>{y.forEach(x=>{l[x]||(l[x]=s.getElementState(x)),l[x].push(v)})};m(p,e),m(g,i),r&&Object.keys(l).forEach(y=>{!p.includes(y)&&!g.includes(y)&&l[y].push(r)})}else Object.assign(l,this.getClearStates());yield s.setElementState(l,a)})}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:r,combos:i}=t.getData(),a={};return[...e,...r,...i].forEach(o=>{a[Z(o)]=Ap(o)}),a}getClearStates(t=!1){const{graph:e}=this.context,{state:r,unselectedState:i,neighborState:a}=this.options,o=new Set([r,i,a]),{nodes:s,edges:u,combos:c}=e.getData(),l={};return[...s,...u,...c].forEach(d=>{const p=Ap(d),g=p.filter(m=>!o.has(m));(t||g.length!==p.length)&&(l[Z(d)]=g)}),l}clearState(){return pl(this,void 0,void 0,function*(){const{graph:t}=this.context;yield t.setElementState(this.getClearStates(),this.options.animation)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;so.forEach(e=>{t.off(`${e}:${st.CLICK}`,this.onClickSelect)}),t.off(Nu.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}jh.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function ba(n){var t;return!!(!((t=n.style)===null||t===void 0)&&t.collapsed)}function hh(n,t){if(!n.startsWith(t))return!1;const e=n[t.length];return e>="A"&&e<="Z"}function VU(n,t){return`${t}${Hl(n)}`}function UU(n,t,e=!0){if(!t||!hh(n,t))return n;const r=n.slice(t.length);return e?AB(r):r}function Cn(n,t){const e=Object.entries(n).reduce((r,[i,a])=>(i==="className"||i==="class"||hh(i,t)&&Object.assign(r,{[UU(i,t)]:a}),r),{});if("opacity"in n){const r=VU("opacity",t),i=n.opacity;if(r in n){const a=n[r];Object.assign(e,{opacity:i*a})}else Object.assign(e,{opacity:i})}return e}function F1(n,t){const e=t.length;return Object.keys(n).reduce((r,i)=>{if(i.startsWith(t)){const a=i.slice(e);r[a]=n[i]}return r},{})}function tO(n,t){const e=typeof t=="string"?[t]:t,r={};return Object.keys(n).forEach(i=>{e.find(a=>i.startsWith(a))||(r[i]=n[i])}),r}function ga(n=0){if(typeof n=="number")return[n,n,n];const[t,e=t,r=t]=n;return[t,e,r]}var WU=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function ak(n,t){const{datum:e,graph:r}=t;return typeof n=="function"?n.call(r,e):Object.fromEntries(Object.entries(n).map(([i,a])=>typeof a=="function"?[i,a.call(r,e)]:[i,a]))}function fr(n,t){const e=(n==null?void 0:n.style)||{},r=(t==null?void 0:t.style)||{};for(const i in e)i in r||(r[i]=e[i]);return Object.assign({},n,t,{style:r})}function YU(n){return WU(n,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function $U(n,t){const e=ga(n);let r={};return t.text&&!t.fontSize&&(r={fontSize:Math.min(...e)*.5}),t.src&&(!t.width||!t.height)&&(r={width:e[0]*.5,height:e[1]*.5}),r}function ok(n){if(n)return typeof n=="string"||typeof n=="function"||Array.isArray(n)?{type:"group",field:t=>t.id,color:n,invert:!1}:n}function HU(n,t){if(!t)return{};const{type:e,color:r,field:i,invert:a}=t,o=u=>{const c=typeof r=="string"?ji("palette",r):r;if(typeof c=="function"){const l={};return u.forEach(([d,p])=>{l[d]=c(a?1-p:p)}),l}else if(Array.isArray(c)){const l=a?[...c].reverse():c,d={};return u.forEach(([p,g])=>{d[p]=l[g%c.length]}),d}return{}},s=(u,c)=>{var l;return typeof u=="string"?(l=c.data)===null||l===void 0?void 0:l[u]:u==null?void 0:u(c)};if(e==="group"){const u=Mh(n,p=>{if(!i)return"default";const g=s(i,p);return g?String(g):"default"}),c=Object.keys(u),l=o(c.map((p,g)=>[p,g])),d={};return Object.entries(u).forEach(([p,g])=>{g.forEach(m=>{d[Z(m)]=l[p]})}),d}else if(e==="value"){const[u,c]=n.reduce(([d,p],g)=>{const m=s(i,g);if(typeof m!="number")throw new Error(Li(`Palette field ${i} is not a number`));return[Math.min(d,m),Math.max(p,m)]},[1/0,-1/0]),l=c-u;return o(n.map(d=>[d.id,(s(i,d)-u)/l]))}}function XU(n){const t=typeof n=="string"?ji("palette",n):n;if(typeof t!="function")return t}function eO(n,t){let e=2*n;return typeof t=="string"?e=n*Number(t.replace("%",""))/100:typeof t=="number"&&(e=t),isNaN(e)&&(e=2*n),e}function qU(n,t,e=1,r=!1){const i=r?e:1,a=(n.max[0]-n.min[0])*i;return eO(a,t)}function KU(n,t,e=1){const r=Bi(n[0],n[1])*e;return eO(r,t)}class Bh extends Ab{constructor(t){sk(t.style),super(t),this.shapeMap={},this.animateMap={},this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,r,i,a){var o,s,u,c,l,d,p,g;const m=this.shapeMap[t];if(r===!1){m&&((o=a==null?void 0:a.beforeDestroy)===null||o===void 0||o.call(a,m),i.removeChild(m),delete this.shapeMap[t],(s=a==null?void 0:a.afterDestroy)===null||s===void 0||s.call(a,m));return}const y=typeof e=="string"?ji(Kt.SHAPE,e):e;if(!y)throw new Error(Li(`Shape ${e} not found`));if(!m||m.destroyed||!(m instanceof y)){m&&((u=a==null?void 0:a.beforeDestroy)===null||u===void 0||u.call(a,m),m==null||m.destroy(),(c=a==null?void 0:a.afterDestroy)===null||c===void 0||c.call(a,m)),(l=a==null?void 0:a.beforeCreate)===null||l===void 0||l.call(a);const v=new y({className:t,style:r});return i.appendChild(v),this.shapeMap[t]=v,(d=a==null?void 0:a.afterCreate)===null||d===void 0||d.call(a,v),v}return(p=a==null?void 0:a.beforeUpdate)===null||p===void 0||p.call(a,m),H1(m,r),(g=a==null?void 0:a.afterUpdate)===null||g===void 0||g.call(a,m),m}update(t={}){const e=Object.assign({},this.attributes,t);sk(e),SY(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return YU(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(t.length===0)return null;const r=[];if(t[0].x!==void 0||t[0].y!==void 0||t[0].z!==void 0){const{x:a=0,y:o=0,z:s=0}=this.attributes;t.forEach(u=>{const{x:c=a,y:l=o,z:d=s}=u;Object.assign(u,{transform:d?[["translate3d",c,l,d]]:[["translate",c,l]]})})}const i=super.animate(t,e);if(i&&(Sp(this,i),r.push(i)),Array.isArray(t)&&t.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some(o=>!a.includes(o))){Object.entries(this.shapeMap).forEach(([s,u])=>{const c=`get${Hl(s)}Style`,l=this[c];if(St(l)){const d=t.map(g=>l.call(this,Object.assign(Object.assign({},this.attributes),g))),p=u.animate(z1(d),e);p&&(Sp(u,p),r.push(p))}});const o=(s,u)=>{if(!PM(s)){const c=`get${Hl(u)}Style`,l=this[c];if(St(l)){const d=t.map(p=>l.call(this,Object.assign(Object.assign({},this.attributes),p)));Object.entries(d[0]).map(([p])=>{const g=d.map(y=>y[p]),m=s[p];if(m){const y=m.animate(z1(g),e);y&&(Sp(m,y),r.push(y))}})}}};this.compositeShapes.forEach(([s,u])=>{const c=F1(this.shapeMap,u);o(c,s)})}}return Pb(r)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;oo(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function Sp(n,t){t==null||t.finished.then(()=>{const e=n.activeAnimations.findIndex(r=>r===t);e>-1&&n.activeAnimations.splice(e,1)})}function sk(n){if(!n)return{};if("x"in n||"y"in n||"z"in n){const{x:t=0,y:e=0,z:r,transform:i}=n,a=z_(t,e,r,i);a&&(n.transform=a)}return n}var ZU=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class xa extends Bh{constructor(t){super(fr({style:xa.defaultStyleProps},t))}isTextStyle(t){return hh(t,"label")}isBackgroundStyle(t){return hh(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),r=ZU(e,["padding"]);return tO(r,"background")}getBackgroundStyle(t){if(t.background===!1)return!1;const e=this.getGraphicStyle(t),{wordWrap:r,wordWrapWidth:i,padding:a}=e,o=Cn(e,"background"),{min:[s,u],center:[c,l],halfExtents:[d,p]}=this.shapeMap.text.getGeometryBounds(),[g,m,y,v]=zi(a),x=d*2+v+m,{width:E,height:w}=o;E&&w?Object.assign(o,{x:c-Number(E)/2,y:l-Number(w)/2}):Object.assign(o,{x:s-v,y:u-g,width:r?Math.min(x,i+v+m):x,height:p*2+g+y});const{radius:S}=o;if(typeof S=="string"&&S.endsWith("%")){const k=Number(S.replace("%",""))/100;o.radius=Math.min(+o.width,+o.height)*k}return o}render(t=this.parsedAttributes,e=this){this.upsert("text",ms,this.getTextStyle(t),e),this.upsert("background",vs,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}xa.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class Gu extends Bh{constructor(t){super(fr({style:Gu.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",xa,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}Gu.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function JU(n){const t=[];let e=n.parentNode;for(;e;)t.push(e),e=e.parentNode;return t}let QU=class extends ju{constructor(n){super(n),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},Wo=this,this.isMutationObserved=!0,this.addEventListener(Wt.MOUNTED,this.onMounted),this.addEventListener(Wt.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:n,clipPath:t,width:e=0,height:r=0}=this.attributes;if(n&&e&&r){const[i,a]=this.getBounds().min,o={x:i,y:a,radius:n,width:e,height:r};if(t)Object.assign(this.parsedStyle.clipPath.style,o);else{const s=new vs({style:o});this.style.clipPath=s}}else t&&(this.style.clipPath=null)}};const G1=new WeakMap;let Wo=null;const nO=n=>{if(Wo&&JU(Wo).includes(n)){const t=G1.get(n);t?t.includes(Wo)||t.push(Wo):G1.set(n,[Wo])}},rO=n=>{const t=G1.get(n);t&&t.forEach(e=>e.handleRadius())};class iO extends Bh{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:r=0}=t,i=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-r/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?QU:ms,this.getIconStyle(t),e)}}class aO extends Bh{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(t,e){const r=super.animate(t,e);return r&&(r.onframe=()=>this.onframe(),r.finished.then(()=>this.onframe())),r}}var gl=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class ys extends aO{constructor(t){super(fr({style:ys.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return ga(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(tO(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Cn(this.getGraphicStyle(t),"label"),{placement:r,maxWidth:i,offsetX:a,offsetY:o}=e,s=gl(e,["placement","maxWidth","offsetX","offsetY"]),u=this.getShape("key").getLocalBounds();return Object.assign(wk(u,r,a,o),{wordWrapWidth:qU(u,i)},s)}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),{fill:r}=e,i=gl(e,["fill"]),a=Cn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:r}),a)}getIconStyle(t){if(t.icon===!1||!t.iconText&&!t.iconSrc)return!1;const e=Cn(this.getGraphicStyle(t),"icon");return Object.assign($U(t.size,e),e)}getBadgesStyle(t){var e;const r=F1(this.shapeMap,"badge-"),i={};if(Object.keys(r).forEach(d=>{i[d]=!1}),t.badge===!1||!(!((e=t.badges)===null||e===void 0)&&e.length))return i;const{badges:a=[],badgePalette:o,opacity:s=1}=t,u=gl(t,["badges","badgePalette","opacity"]),c=XU(o),l=Cn(this.getGraphicStyle(u),"badge");return a.forEach((d,p)=>{i[p]=Object.assign(Object.assign({backgroundFill:c?c[p%(c==null?void 0:c.length)]:void 0,opacity:s},l),this.getBadgeStyle(d))}),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:r="top",offsetX:i,offsetY:a}=t,o=gl(t,["placement","offsetX","offsetY"]),s=wk(e.getLocalBounds(),r,i,a,!0);return Object.assign(Object.assign({},s),o)}getPortsStyle(t){var e;const r=this.getPorts(),i={};if(Object.keys(r).forEach(s=>{i[s]=!1}),t.port===!1||!(!((e=t.ports)===null||e===void 0)&&e.length))return i;const a=Cn(this.getGraphicStyle(t),"port"),{ports:o=[]}=t;return o.forEach((s,u)=>{const c=s.key||u,l=Object.assign(Object.assign({},a),s);if(wO(l))i[c]=!1;else{const[d,p]=this.getPortXY(t,s);i[c]=Object.assign({transform:[["translate",d,p]]},l)}}),i}getPortXY(t,e){const{placement:r="left"}=e,i=this.getShape("key");return wY(tW(this.context,i),r)}getPorts(){return F1(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return BU(t,r,e)}drawHaloShape(t,e){const r=this.getHaloStyle(t),i=this.getShape("key");this.upsert("halo",i.constructor,r,e)}drawIconShape(t,e){const r=this.getIconStyle(t);this.upsert("icon",iO,r,e),nO(this)}drawBadgeShapes(t,e){const r=this.getBadgesStyle(t);Object.keys(r).forEach(i=>{const a=r[i];this.upsert(`badge-${i}`,Gu,a,e)})}drawPortShapes(t,e){const r=this.getPortsStyle(t);Object.keys(r).forEach(i=>{const a=r[i],o=`port-${i}`;this.upsert(o,ao,a,e)})}drawLabelShape(t,e){const r=this.getLabelStyle(t);this.upsert("label",xa,r,e)}_drawKeyShape(t,e){return this.drawKeyShape(t,e)}render(t=this.parsedAttributes,e=this){this._drawKeyShape(t,e),this.getShape("key")&&(this.drawHaloShape(t,e),this.drawIconShape(t,e),this.drawBadgeShapes(t,e),this.drawLabelShape(t,e),this.drawPortShapes(t,e))}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&rO(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}ys.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};function tW(n,t){if(!n)return t.getLocalBounds();const e=n.canvas.getLayer(),r=t.cloneNode();oo(r,"hidden"),e.appendChild(r);const i=r.getLocalBounds();return r.destroy(),i}class zh extends ys{constructor(t){super(fr({style:zh.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",ao,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{r:Math.min(...this.getSize(t))/2})}getIconStyle(t){const e=super.getIconStyle(t),{r}=this.getShape("key").attributes,i=r*2*FU;return e?Object.assign({width:i,height:i},e):!1}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return J_(t,r,e)}}zh.defaultStyleProps={size:32};/*!
42
+ * @antv/g-plugin-canvas-path-generator
43
+ * @description A G plugin of path generator with Canvas2D API
44
+ * @version 2.1.22
45
+ * @date 7/30/2025, 1:35:25 PM
46
+ * @author AntVis
47
+ * @docs https://g.antv.antgroup.com/
48
+ */function eW(n,t){var e=t.cx,r=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,o=t.r;n.arc(r,a,o,0,Math.PI*2,!1)}function nW(n,t){var e=t.cx,r=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,o=t.rx,s=t.ry;if(n.ellipse)n.ellipse(r,a,o,s,0,0,Math.PI*2,!1);else{var u=o>s?o:s,c=o>s?1:o/s,l=o>s?s/o:1;n.save(),n.scale(c,l),n.arc(r,a,u,0,Math.PI*2)}}function rW(n,t){var e=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.markerStart,s=t.markerEnd,u=t.markerStartOffset,c=t.markerEndOffset,l=0,d=0,p=0,g=0,m=0,y,v;o&&te(o)&&u&&(y=i-e,v=a-r,m=Math.atan2(v,y),l=Math.cos(m)*(u||0),d=Math.sin(m)*(u||0)),s&&te(s)&&c&&(y=e-i,v=r-a,m=Math.atan2(v,y),p=Math.cos(m)*(c||0),g=Math.sin(m)*(c||0)),n.moveTo(e+l,r+d),n.lineTo(i+p,a+g)}function iW(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,o=t.d,s=o.absolutePath,u=o.segments,c=0,l=0,d=0,p=0,g=0,m,y;if(e&&te(e)&&i){var v=e.parentNode.getStartTangent(),x=Pt(v,2),E=x[0],w=x[1];m=E[0]-w[0],y=E[1]-w[1],g=Math.atan2(y,m),c=Math.cos(g)*(i||0),l=Math.sin(g)*(i||0)}if(r&&te(r)&&a){var S=r.parentNode.getEndTangent(),k=Pt(S,2),A=k[0],N=k[1];m=A[0]-N[0],y=A[1]-N[1],g=Math.atan2(y,m),d=Math.cos(g)*(a||0),p=Math.sin(g)*(a||0)}for(var T=0;T<s.length;T++){var O=s[T],M=O[0],P=s[T+1],L=T===0&&(c!==0||l!==0),j=(T===s.length-1||P&&(P[0]==="M"||P[0]==="Z"))&&d!==0&&p!==0,z=L?[c,l]:[0,0],U=Pt(z,2),J=U[0],W=U[1],at=j?[d,p]:[0,0],ut=Pt(at,2),yt=ut[0],kt=ut[1];switch(M){case"M":n.moveTo(O[1]+J,O[2]+W);break;case"L":n.lineTo(O[1]+yt,O[2]+kt);break;case"Q":n.quadraticCurveTo(O[1],O[2],O[3]+yt,O[4]+kt);break;case"C":n.bezierCurveTo(O[1],O[2],O[3],O[4],O[5]+yt,O[6]+kt);break;case"A":{var It=u[T].arcParams,ee=It.cx,$=It.cy,Y=It.rx,F=It.ry,K=It.startAngle,ot=It.endAngle,dt=It.xRotation,mt=It.sweepFlag;if(n.ellipse)n.ellipse(ee,$,Y,F,dt,K,ot,!!(1-mt));else{var Ot=Y>F?Y:F,ne=Y>F?1:Y/F,Qt=Y>F?F/Y:1;n.translate(ee,$),n.rotate(dt),n.scale(ne,Qt),n.arc(0,0,Ot,K,ot,!!(1-mt)),n.scale(1/ne,1/Qt),n.rotate(-dt),n.translate(-ee,-$)}j&&n.lineTo(O[6]+d,O[7]+p);break}case"Z":n.closePath();break}}}function aW(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,o=t.points.points,s=o.length,u=o[0][0],c=o[0][1],l=o[s-1][0],d=o[s-1][1],p=0,g=0,m=0,y=0,v=0,x,E;e&&te(e)&&i&&(x=o[1][0]-o[0][0],E=o[1][1]-o[0][1],v=Math.atan2(E,x),p=Math.cos(v)*(i||0),g=Math.sin(v)*(i||0)),r&&te(r)&&a&&(x=o[s-1][0]-o[0][0],E=o[s-1][1]-o[0][1],v=Math.atan2(E,x),m=Math.cos(v)*(a||0),y=Math.sin(v)*(a||0)),n.moveTo(u+(p||m),c+(g||y));for(var w=1;w<s-1;w++){var S=o[w];n.lineTo(S[0],S[1])}n.lineTo(l,d)}function oW(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,o=t.points.points,s=o.length,u=o[0][0],c=o[0][1],l=o[s-1][0],d=o[s-1][1],p=0,g=0,m=0,y=0,v=0,x,E;e&&te(e)&&i&&(x=o[1][0]-o[0][0],E=o[1][1]-o[0][1],v=Math.atan2(E,x),p=Math.cos(v)*(i||0),g=Math.sin(v)*(i||0)),r&&te(r)&&a&&(x=o[s-2][0]-o[s-1][0],E=o[s-2][1]-o[s-1][1],v=Math.atan2(E,x),m=Math.cos(v)*(a||0),y=Math.sin(v)*(a||0)),n.moveTo(u+p,c+g);for(var w=1;w<s-1;w++){var S=o[w];n.lineTo(S[0],S[1])}n.lineTo(l+m,d+y)}function sW(n,t){var e=t.x,r=e===void 0?0:e,i=t.y,a=i===void 0?0:i,o=t.radius,s=t.width,u=t.height,c=s,l=u,d=o&&o.some(function(k){return k!==0});if(!d)n.rect(r,a,c,l);else{var p=s>0?1:-1,g=u>0?1:-1,m=p+g===0,y=o.map(function(k){return dn(k,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))}),v=Pt(y,4),x=v[0],E=v[1],w=v[2],S=v[3];n.moveTo(p*x+r,a),n.lineTo(c-p*E+r,a),E!==0&&n.arc(c-p*E+r,g*E+a,E,-g*Math.PI/2,p>0?0:Math.PI,m),n.lineTo(c+r,l-g*w+a),w!==0&&n.arc(c-p*w+r,l-g*w+a,w,p>0?0:Math.PI,g>0?Math.PI/2:1.5*Math.PI,m),n.lineTo(p*S+r,l+a),S!==0&&n.arc(p*S+r,l-g*S+a,S,g>0?Math.PI/2:-Math.PI/2,p>0?Math.PI:0,m),n.lineTo(r,g*x+a),x!==0&&n.arc(p*x+r,g*x+a,x,p>0?Math.PI:0,g>0?Math.PI*1.5:Math.PI/2,m)}}var uW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="canvas-path-generator",e}return zt(t,n),nt(t,[{key:"init",value:function(){var e,r=(e={},ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(e,X.CIRCLE,eW),X.ELLIPSE,nW),X.RECT,sW),X.LINE,rW),X.POLYLINE,oW),X.POLYGON,aW),X.PATH,iW),X.TEXT,void 0),X.GROUP,void 0),X.IMAGE,void 0),ft(ft(ft(e,X.HTML,void 0),X.MESH,void 0),X.FRAGMENT,void 0));this.context.pathGeneratorFactory=r}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])})(wa);/*!
49
+ * @antv/g-plugin-canvas-picker
50
+ * @description A G plugin for picking in canvas
51
+ * @version 2.1.27
52
+ * @date 7/30/2025, 1:37:32 PM
53
+ * @author AntVis
54
+ * @docs https://g.antv.antgroup.com/
55
+ */var cW=Yt(),lW=Yt(),hW=Yt(),dW=pe(),oO=(function(){function n(){var t=this;et(this,n),this.isHit=function(e,r,i,a){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var s=si(dW,i),u=Tn(lW,kn(hW,r[0],r[1],0),s);if(o(e,new mn(u[0],u[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,r){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[e.nodeName];return a&&(i.beginPath(),a(i,e.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return nt(n,[{key:"apply",value:function(t,e){var r,i=this,a=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=e;var s=(r=o.root)===null||r===void 0?void 0:r.ownerDocument;a.hooks.pick.tapPromise(n.tag,(function(){var u=ya(fn().mark(function c(l){return fn().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",i.pick(s,l));case 1:case"end":return d.stop()}},c)}));return function(c){return u.apply(this,arguments)}})()),a.hooks.pickSync.tap(n.tag,function(u){return i.pick(s,u)})}},{key:"pick",value:function(t,e){var r=e.topmost,i=e.position,a=i.x,o=i.y,s=kn(cW,a,o,0),u=t.elementsFromBBox(s[0],s[1],s[0],s[1]),c=[],l=Wa(u),d;try{for(l.s();!(d=l.n()).done;){var p=d.value,g=p.getWorldTransform(),m=this.isHit(p,s,g,!1);if(m){var y=v_(p);if(y){var v=y.parsedStyle.clipPath,x=this.isHit(v,s,v.getWorldTransform(),!0);if(x){if(r)return e.picked=[p],e;c.push(p)}}else{if(r)return e.picked=[p],e;c.push(p)}}}}catch(E){l.e(E)}finally{l.f()}return e.picked=c,e}}])})();oO.tag="CanvasPicker";function fW(n,t,e){var r=n.parsedStyle,i=r.cx,a=i===void 0?0:i,o=r.cy,s=o===void 0?0:o,u=r.r,c=r.fill,l=r.stroke,d=r.lineWidth,p=d===void 0?1:d,g=r.increasedLineWidthForHitTesting,m=g===void 0?0:g,y=r.pointerEvents,v=y===void 0?"auto":y,x=(p+m)/2,E=Ii(a,s,t.x,t.y),w=ho(v,c,l),S=Pt(w,2),k=S[0],A=S[1];return k&&A||e?E<=u+x:k?E<=u:A?E>=u-x&&E<=u+x:!1}function vl(n,t,e,r){return n/(e*e)+t/(r*r)}function pW(n,t,e){var r=n.parsedStyle,i=r.cx,a=i===void 0?0:i,o=r.cy,s=o===void 0?0:o,u=r.rx,c=r.ry,l=r.fill,d=r.stroke,p=r.lineWidth,g=p===void 0?1:p,m=r.increasedLineWidthForHitTesting,y=m===void 0?0:m,v=r.pointerEvents,x=v===void 0?"auto":v,E=t.x,w=t.y,S=ho(x,l,d),k=Pt(S,2),A=k[0],N=k[1],T=(g+y)/2,O=(E-a)*(E-a),M=(w-s)*(w-s);return A&&N||e?vl(O,M,u+T,c+T)<=1:A?vl(O,M,u,c)<=1:N?vl(O,M,u-T,c-T)>=1&&vl(O,M,u+T,c+T)<=1:!1}function Xa(n,t,e,r,i,a){return i>=n&&i<=n+e&&a>=t&&a<=t+r}function gW(n,t,e,r,i,a,o){var s=i/2;return Xa(n-s,t-s,e,i,a,o)||Xa(n+e-s,t-s,i,r,a,o)||Xa(n+s,t+r-s,e,i,a,o)||Xa(n-s,t+s,i,r,a,o)}function ml(n,t,e,r,i,a,o,s){var u=(Math.atan2(s-t,o-n)+Math.PI*2)%(Math.PI*2),c={x:n+e*Math.cos(u),y:t+e*Math.sin(u)};return Ii(c.x,c.y,o,s)<=a/2}function la(n,t,e,r,i,a,o){var s=Math.min(n,e),u=Math.max(n,e),c=Math.min(t,r),l=Math.max(t,r),d=i/2;return a>=s-d&&a<=u+d&&o>=c-d&&o<=l+d?xz(n,t,e,r,a,o)<=i/2:!1}function sO(n,t,e,r,i){var a=n.length;if(a<2)return!1;for(var o=0;o<a-1;o++){var s=n[o][0],u=n[o][1],c=n[o+1][0],l=n[o+1][1];if(la(s,u,c,l,t,e,r))return!0}if(i){var d=n[0],p=n[a-1];if(la(d[0],d[1],p[0],p[1],t,e,r))return!0}return!1}var vW=1e-6;function Cp(n){return Math.abs(n)<vW?0:n<0?-1:1}function mW(n,t,e){return(e[0]-n[0])*(t[1]-n[1])===(t[0]-n[0])*(e[1]-n[1])&&Math.min(n[0],t[0])<=e[0]&&e[0]<=Math.max(n[0],t[0])&&Math.min(n[1],t[1])<=e[1]&&e[1]<=Math.max(n[1],t[1])}function uO(n,t,e){var r=!1,i=n.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=n[a],s=n[(a+1)%i];if(mW(o,s,[t,e]))return!0;Cp(o[1]-e)>0!=Cp(s[1]-e)>0&&Cp(t-(e-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function uk(n,t,e){for(var r=!1,i=0;i<n.length;i++){var a=n[i];if(r=uO(a,t,e),r)break}return r}function yW(n,t,e){var r=n.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2,u=r.lineWidth,c=u===void 0?1:u,l=r.increasedLineWidthForHitTesting,d=l===void 0?0:l,p=r.pointerEvents,g=p===void 0?"auto":p,m=r.fill,y=r.stroke,v=ho(g,m,y),x=Pt(v,2),E=x[1];return!E&&!e||!c?!1:la(i,a,o,s,c+d,t.x,t.y)}function bW(n,t,e,r,i){for(var a=!1,o=t/2,s=0;s<n.length;s++){var u=n[s],c=u.currentPoint,l=u.params,d=u.prePoint,p=u.box;if(!(p&&!Xa(p.x-o,p.y-o,p.width+t,p.height+t,e,r)))switch(u.command){case"L":case"Z":if(a=la(d[0],d[1],c[0],c[1],t,e,r),a)return!0;break;case"Q":var g=Nz(d[0],d[1],l[1],l[2],l[3],l[4],e,r);if(a=g<=t/2,a)return!0;break;case"C":var m=h2(d[0],d[1],l[1],l[2],l[3],l[4],l[5],l[6],e,r,i);if(a=m<=t/2,a)return!0;break;case"A":u.cubicParams||(u.cubicParams=pb(d[0],d[1],l[1],l[2],l[3],l[4],l[5],l[6],l[7],void 0));for(var y=u.cubicParams,v=d,x=0;x<y.length;x+=6){var E=h2(v[0],v[1],y[x],y[x+1],y[x+2],y[x+3],y[x+4],y[x+5],e,r,i);if(v=[y[x+4],y[x+5]],a=E<=t/2,a)return!0}break}}return a}function xW(n,t,e,r,i,a){var o=n.parsedStyle,s=o.lineWidth,u=s===void 0?1:s,c=o.increasedLineWidthForHitTesting,l=c===void 0?0:c,d=o.stroke,p=o.fill,g=o.d,m=o.pointerEvents,y=m===void 0?"auto":m,v=g.segments,x=g.hasArc,E=g.polylines,w=g.polygons,S=ho(y,(w==null?void 0:w.length)&&p,d),k=Pt(S,2),A=k[0],N=k[1],T=T1(n),O=!1;return A||e?(x?O=r(n,t):O=uk(w,t.x,t.y)||uk(E,t.x,t.y),O):((N||e)&&(O=bW(v,u+l,t.x,t.y,T)),O)}function EW(n,t,e){var r=n.parsedStyle,i=r.stroke,a=r.fill,o=r.lineWidth,s=o===void 0?1:o,u=r.increasedLineWidthForHitTesting,c=u===void 0?0:u,l=r.points,d=r.pointerEvents,p=d===void 0?"auto":d,g=ho(p,a,i),m=Pt(g,2),y=m[0],v=m[1],x=!1;return(v||e)&&(x=sO(l.points,s+c,t.x,t.y,!0)),!x&&(y||e)&&(x=uO(l.points,t.x,t.y)),x}function wW(n,t,e){var r=n.parsedStyle,i=r.lineWidth,a=i===void 0?1:i,o=r.increasedLineWidthForHitTesting,s=o===void 0?0:o,u=r.points,c=r.pointerEvents,l=c===void 0?"auto":c,d=r.fill,p=r.stroke,g=ho(l,d,p),m=Pt(g,2),y=m[1];return!y&&!e||!a?!1:sO(u.points,a+s,t.x,t.y,!1)}function kW(n,t,e,r,i){var a=n.parsedStyle,o=a.radius,s=a.fill,u=a.stroke,c=a.lineWidth,l=c===void 0?1:c,d=a.increasedLineWidthForHitTesting,p=d===void 0?0:d,g=a.x,m=g===void 0?0:g,y=a.y,v=y===void 0?0:y,x=a.width,E=a.height,w=a.pointerEvents,S=w===void 0?"auto":w,k=ho(S,s,u),A=Pt(k,2),N=A[0],T=A[1],O=o&&o.some(function(j){return j!==0}),M=l+p;if(O){var P=!1;return(T||e)&&(P=AW(m,v,x,E,o.map(function(j){return dn(j,0,Math.min(Math.abs(x)/2,Math.abs(E)/2))}),M,t.x,t.y)),!P&&(N||e)&&(P=r(n,t)),P}else{var L=M/2;if(N&&T||e)return Xa(m-L,v-L,x+L,E+L,t.x,t.y);if(N)return Xa(m,v,x,E,t.x,t.y);if(T)return gW(m,v,x,E,M,t.x,t.y)}return!1}function AW(n,t,e,r,i,a,o,s){var u=Pt(i,4),c=u[0],l=u[1],d=u[2],p=u[3];return la(n+c,t,n+e-l,t,a,o,s)||la(n+e,t+l,n+e,t+r-d,a,o,s)||la(n+e-d,t+r,n+p,t+r,a,o,s)||la(n,t+r-p,n,t+c,a,o,s)||ml(n+e-l,t+l,l,1.5*Math.PI,2*Math.PI,a,o,s)||ml(n+e-d,t+r-d,d,0,.5*Math.PI,a,o,s)||ml(n+p,t+r-p,p,.5*Math.PI,Math.PI,a,o,s)||ml(n+c,t+c,c,Math.PI,1.5*Math.PI,a,o,s)}function SW(n,t,e,r,i,a){var o=n.parsedStyle,s=o.pointerEvents,u=s===void 0?"auto":s,c=o.x,l=c===void 0?0:c,d=o.y,p=d===void 0?0:d,g=o.width,m=o.height;if(u==="non-transparent-pixel"){var y=i.config.offscreenCanvas,v=a.offscreenCanvasCreator.getOrCreateCanvas(y),x=a.offscreenCanvasCreator.getOrCreateContext(y,{willReadFrequently:!0});v.width=g,v.height=m,i.defaultStyleRendererFactory[X.IMAGE].render(x,Lt(Lt({},n.parsedStyle),{},{x:0,y:0}),n,void 0,void 0,void 0);var E=x.getImageData(t.x-l,t.y-p,1,1).data;return E.every(function(w){return w!==0})}return!0}function CW(n,t,e,r){var i=n.getGeometryBounds();return t.x>=i.min[0]&&t.y>=i.min[1]&&t.x<=i.max[0]&&t.y<=i.max[1]}var NW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="canvas-picker",e}return zt(t,n),nt(t,[{key:"init",value:function(){var e,r=(e={},ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(e,X.CIRCLE,fW),X.ELLIPSE,pW),X.RECT,kW),X.LINE,yW),X.POLYLINE,wW),X.POLYGON,EW),X.PATH,xW),X.TEXT,CW),X.GROUP,null),X.IMAGE,SW),ft(ft(e,X.HTML,null),X.MESH,null));this.context.pointInPathPickerFactory=r,this.addRenderingPlugin(new oO)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])})(wa);function ni(n,t){if(!{}.hasOwnProperty.call(n,t))throw new TypeError("attempted to use private field on non-instance");return n}var TW=0;function MW(n){return"__private_"+TW+++"_"+n}/*!
56
+ * @antv/g-plugin-image-loader
57
+ * @description A G plugin for loading image
58
+ * @version 2.1.26
59
+ * @date 7/30/2025, 1:35:52 PM
60
+ * @author AntVis
61
+ * @docs https://g.antv.antgroup.com/
62
+ */var _W=(function(){function n(){et(this,n),this.cacheStore=new Map}return nt(n,[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,r){return this.cacheStore.has(t)?!1:(this.cacheStore.set(t,{value:e,counter:new Set([r.entity])}),this.onRefAdded(r),!0)}},{key:"get",value:function(t,e){var r=this.cacheStore.get(t);return r?(r.counter.has(e.entity)||(r.counter.add(e.entity),this.onRefAdded(e)),r.value):null}},{key:"update",value:function(t,e,r){var i=this.cacheStore.get(t);return i?(i.value=Lt(Lt({},i.value),e),i.counter.has(r.entity)||(i.counter.add(r.entity),this.onRefAdded(r)),!0):!1}},{key:"release",value:function(t,e){var r=this.cacheStore.get(t);return r?(r.counter.delete(e.entity),r.counter.size<=0&&this.cacheStore.delete(t),!0):!1}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(r){e.release(r,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])})(),Np=[],Tp=[],V1=(function(){function n(){et(this,n)}return nt(n,null,[{key:"stop",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.api;n.rafId&&(t.cancelAnimationFrame(n.rafId),n.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.api;Np.length<=0&&Tp.length<=0||(Tp.forEach(function(e){return e()}),Tp=Np.splice(0,n.TASK_NUM_PER_FRAME),n.rafId=t.requestAnimationFrame(function(){n.executeTask(t)}))}},{key:"sliceImage",value:function(t,e,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:n.api,s=t.naturalWidth||t.width,u=t.naturalHeight||t.height,c=e-a,l=r-a,d=Math.ceil(s/c),p=Math.ceil(u/l),g={tileSize:[e,r],gridSize:[p,d],tiles:Array(p).fill(null).map(function(){return Array(d).fill(null)})},m=function(v){for(var x=function(w){Np.push(function(){var S=w*c,k=v*l,A=[Math.min(e,s-S),Math.min(r,u-k)],N=A[0],T=A[1],O=o.createCanvas();O.width=e,O.height=r;var M=O.getContext("2d");M.drawImage(t,S,k,N,T,0,0,N,T),g.tiles[v][w]={x:S,y:k,tileX:w,tileY:v,data:O},i()})},E=0;E<d;E++)x(E)},y=0;y<p;y++)m(y);return n.stop(),n.executeTask(),g}}])})();V1.TASK_NUM_PER_FRAME=10;var or=new _W;or.onRefAdded=function(n){var t=this;n.addEventListener(Wt.DESTROY,function(){t.releaseRef(n)},{once:!0})};var Ib=(function(){function n(t,e){et(this,n),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e}return nt(n,[{key:"getImageSync",value:function(t,e,r){var i=fe(t)?t:t.src;if(or.has(i)){var a=or.get(i,e);if(a.img.complete)return r==null||r(a),a}return this.getOrCreateImage(t,e).then(function(o){r==null||r(o)}).catch(function(o){console.error(o)}),null}},{key:"getOrCreateImage",value:function(t,e){var r=this,i=fe(t)?t:t.src;if(!fe(t)&&!or.has(i)){var a={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:yl(t)};or.put(i,a,e)}if(or.has(i)){var o=or.get(i,e);return o.img.complete?Promise.resolve(o):new Promise(function(s,u){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=yl(o.img),s(o)}),o.img.addEventListener("error",function(c){u(c)})})}return new Promise(function(s,u){var c=r.context.config.createImage();if(c){var l={img:c,size:[0,0],tileSize:yl(c)};or.put(i,l,e),c.onload=function(){l.size=[c.naturalWidth||c.width,c.naturalHeight||c.height],l.tileSize=yl(l.img),s(l)},c.onerror=function(d){u(d)},c.crossOrigin="Anonymous",c.src=i}})}},{key:"createDownSampledImage",value:(function(){var t=ya(fn().mark(function r(i,a){var o,s,u,c,l,d,p,g,m,y,v,x,E,w;return fn().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=1,this.getOrCreateImage(i,a);case 1:if(o=S.sent,!(typeof o.downSamplingRate<"u")){S.next=2;break}return S.abrupt("return",o);case 2:if(s=this.context.config.enableLargeImageOptimization,u=typeof s=="boolean"?{}:s,c=u.maxDownSampledImageSize,l=c===void 0?2048:c,d=u.downSamplingRateThreshold,p=d===void 0?.5:d,g=this.runtime.globalThis.createImageBitmap,m=Pt(o.size,2),y=m[0],v=m[1],x=o.img,E=Math.min((l+l)/(y+v),Math.max(.01,Math.min(p,.5))),w=Lt(Lt({},o),{},{downSamplingRate:E}),or.update(o.img.src,w,a),!g){S.next=7;break}return S.prev=3,S.next=4,g(o.img,{resizeWidth:y*E,resizeHeight:v*E});case 4:x=S.sent,S.next=6;break;case 5:S.prev=5,S.catch(3),E=1;case 6:S.next=8;break;case 7:E=1;case 8:return w=Lt(Lt({},this.getImageSync(i,a)),{},{downSampled:x,downSamplingRate:E}),or.update(o.img.src,w,a),S.abrupt("return",w);case 9:case"end":return S.stop()}},r,this,[[3,5]])}));function e(r,i){return t.apply(this,arguments)}return e})()},{key:"createImageTiles",value:(function(){var t=ya(fn().mark(function r(i,a,o,s){var u,c,l,d,p;return fn().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=1,this.getOrCreateImage(i,s);case 1:return u=g.sent,c=s.ownerDocument.defaultView,l=c.requestAnimationFrame,d=c.cancelAnimationFrame,V1.api={requestAnimationFrame:l,cancelAnimationFrame:d,createCanvas:function(){return kb.createCanvas()}},p=Lt(Lt({},u),V1.sliceImage(u.img,u.tileSize[0],u.tileSize[0],o)),or.update(u.img.src,p,s),g.abrupt("return",p);case 2:case"end":return g.stop()}},r,this)}));function e(r,i,a,o){return t.apply(this,arguments)}return e})()},{key:"releaseImage",value:function(t,e){or.release(fe(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){or.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,r,i,a,o,s){var u=this.generatePatternKey(e);if(u&&this.patternCache[u])return this.patternCache[u];var c=e.image,l=e.repetition,d=e.transform,p,g=!1;if(fe(c)){var m=this.getImageSync(c,t,s);p=m==null?void 0:m.img}else i?(p=i,g=!0):p=c;var y=p&&r.createPattern(p,l);if(y){var v;d?v=E_(d_(d),new Pe({})):v=va(pe()),g&&hM(v,v,[1/a,1/a,1]),y.setTransform({a:v[0],b:v[1],c:v[4],d:v[5],e:v[12]+o[0],f:v[13]+o[1]})}return u&&y&&(this.patternCache[u]=y),y}},{key:"getOrCreateGradient",value:function(t,e){var r=this.generateGradientKey(t),i=t.type,a=t.steps,o=t.min,s=t.width,u=t.height,c=t.angle,l=t.cx,d=t.cy,p=t.size;if(this.gradientCache[r])return this.gradientCache[r];var g=null;if(i===ua.LinearGradient){var m=NF(o,s,u,c),y=m.x1,v=m.y1,x=m.x2,E=m.y2;g=e.createLinearGradient(y,v,x,E)}else if(i===ua.RadialGradient){var w=TF(o,s,u,l,d,p),S=w.x,k=w.y,A=w.r;g=e.createRadialGradient(S,k,0,S,k,A)}return g&&(a.forEach(function(N){var T=N.offset,O=N.color;if(T.unit===ht.kPercentage){var M;(M=g)===null||M===void 0||M.addColorStop(T.value/100,O.toString())}}),this.gradientCache[r]=g),this.gradientCache[r]}},{key:"generateGradientKey",value:function(t){var e=t.type,r=t.min,i=t.width,a=t.height,o=t.steps,s=t.angle,u=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((s==null?void 0:s.toString())||0,"-").concat((u==null?void 0:u.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat((l==null?void 0:l.toString())||0,"-").concat(r[0],"-").concat(r[1],"-").concat(i,"-").concat(a,"-").concat(o.map(function(d){var p=d.offset,g=d.color;return"".concat(p).concat(g)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,r=t.repetition;if(fe(e))return"pattern-".concat(e,"-").concat(r);if(e.nodeName==="rect")return"pattern-".concat(e.entity,"-").concat(r)}}])})();Ib.isSupportTile=!!kb.createCanvas();function yl(n){if(!n.complete)return[0,0];var t=n.naturalWidth||n.width,e=n.naturalHeight||n.height,r=256;return[256,512].forEach(function(i){var a=Math.ceil(e/i),o=Math.ceil(t/i);a*o<1e3&&(r=i)}),[r,r]}var cO=(function(){function n(){et(this,n)}return nt(n,[{key:"apply",value:function(t){var e=t.renderingService,r=t.renderingContext,i=t.imagePool,a=r.root.ownerDocument.defaultView,o=function(c,l,d){var p=c.parsedStyle,g=p.width,m=p.height;g&&!m?c.setAttribute("height",d/l*g):!g&&m&&c.setAttribute("width",l/d*m)},s=function(c){var l=c.target,d=l.nodeName,p=l.attributes;if(d===X.IMAGE){var g=p.src,m=p.keepAspectRatio;i.getImageSync(g,l,function(y){var v=y.img,x=v.width,E=v.height;m&&o(l,x,E),l.renderable.dirty=!0,e.dirtify()})}},u=function(c){var l=c.target,d=c.attrName,p=c.prevValue,g=c.newValue;l.nodeName!==X.IMAGE||d!=="src"||(p!==g&&i.releaseImage(p,l),fe(g)&&i.getOrCreateImage(g,l).then(function(m){var y=m.img,v=y.width,x=y.height;l.attributes.keepAspectRatio&&o(l,v,x),l.renderable.dirty=!0,e.dirtify()}).catch(function(){}))};e.hooks.init.tap(n.tag,function(){a.addEventListener(Wt.MOUNTED,s),a.addEventListener(Wt.ATTR_MODIFIED,u)}),e.hooks.destroy.tap(n.tag,function(){a.removeEventListener(Wt.MOUNTED,s),a.removeEventListener(Wt.ATTR_MODIFIED,u)})}}])})();cO.tag="LoadImage";var OW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="image-loader",e}return zt(t,n),nt(t,[{key:"init",value:function(e){this.context.imagePool=new Ib(this.context,e),this.addRenderingPlugin(new cO)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(wa);/*!
63
+ * @antv/g-plugin-canvas-renderer
64
+ * @description A G plugin of renderer implementation with Canvas2D API
65
+ * @version 2.3.3
66
+ * @date 7/30/2025, 1:36:40 PM
67
+ * @author AntVis
68
+ * @docs https://g.antv.antgroup.com/
69
+ */var Ve=MW("renderState"),lO=(function(){function n(t){et(this,n),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Ve,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=pe(),this.dprMatrix=pe(),this.tmpMat4=pe(),this.vec3a=Yt(),this.vec3b=Yt(),this.vec3c=Yt(),this.vec3d=Yt(),this.canvasRendererPluginOptions=t}return nt(n,[{key:"apply",value:function(t,e){var r=this;this.context=t;var i=this.context,a=i.config,o=i.camera,s=i.renderingService,u=i.renderingContext,c=i.rBushRoot,l=i.pathGeneratorFactory,d=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=c,this.pathGeneratorFactory=l;var p=t.contextService,g=u.root.ownerDocument.defaultView,m=function(E){var w=E.target,S=w.rBushNode;S!=null&&S.aabb&&r.removedRBushNodeAABBs.push(S.aabb)},y=function(E){var w=E.target,S=w.rBushNode;S.aabb&&r.removedRBushNodeAABBs.push(S.aabb)};s.hooks.init.tap(n.tag,function(){g.addEventListener(Wt.UNMOUNTED,m),g.addEventListener(Wt.CULLED,y);var E=p.getDPR(),w=a.width,S=a.height,k=p.getContext();r.clearRect(k,0,0,w*E,S*E,a.background)}),s.hooks.destroy.tap(n.tag,function(){g.removeEventListener(Wt.UNMOUNTED,m),g.removeEventListener(Wt.CULLED,y),r.renderQueue=[],r.removedRBushNodeAABBs=[],ni(r,Ve)[Ve]={restoreStack:[],prevObject:null,currentContext:null}});var v=function(){var E,w=p.getContext(),S=p.getDPR(),k=a.width,A=a.height,N=r.canvasRendererPluginOptions,T=N.dirtyObjectNumThreshold,O=N.dirtyObjectRatioThreshold,M=s.getStats(),P=M.total,L=M.rendered,j=L/P;r.clearFullScreen=r.clearFullScreenLastFrame||!((E=g.context.renderingPlugins[1])!==null&&E!==void 0&&E.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||L>T&&j>O,w&&(typeof w.resetTransform=="function"?w.resetTransform():w.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(w,0,0,k*S,A*S,a.background))},x=function(E,w){for(var S=[E];S.length>0;){var k,A=S.pop();A.isVisible()&&!A.isCulled()&&(d?r.renderDisplayObjectOptimized(A,w,r.context,ni(r,Ve)[Ve],e):r.renderDisplayObject(A,w,r.context,ni(r,Ve)[Ve],e));for(var N=((k=A.sortable)===null||k===void 0||(k=k.sorted)===null||k===void 0?void 0:k.length)>0?A.sortable.sorted:A.childNodes,T=N.length-1;T>=0;T--)S.push(N[T])}};s.hooks.endFrame.tap(n.tag,function(){if(v(),u.root.childNodes.length===0){r.clearFullScreenLastFrame=!0;return}d=a.renderer.getConfig().enableRenderingOptimization,ni(r,Ve)[Ve]={restoreStack:[],prevObject:null,currentContext:ni(r,Ve)[Ve].currentContext},ni(r,Ve)[Ve].currentContext.clear(),r.clearFullScreenLastFrame=!1;var E=p.getContext(),w=p.getDPR();if(Ua(r.dprMatrix,[w,w,1]),Nn(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)d?(E.save(),x(u.root,E),E.restore()):x(u.root,E),r.removedRBushNodeAABBs=[];else{var S=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(Ht(r.removedRBushNodeAABBs.map(function(Y){var F=Y.minX,K=Y.minY,ot=Y.maxX,dt=Y.maxY,mt=new ye;return mt.setMinMax([F,K,0],[ot,dt,0]),mt}))));if(r.removedRBushNodeAABBs=[],ye.isEmpty(S)){r.renderQueue=[];return}var k=r.convertAABB2Rect(S),A=k.x,N=k.y,T=k.width,O=k.height,M=Tn(r.vec3a,[A,N,0],r.vpMatrix),P=Tn(r.vec3b,[A+T,N,0],r.vpMatrix),L=Tn(r.vec3c,[A,N+O,0],r.vpMatrix),j=Tn(r.vec3d,[A+T,N+O,0],r.vpMatrix),z=Math.min(M[0],P[0],j[0],L[0]),U=Math.min(M[1],P[1],j[1],L[1]),J=Math.max(M[0],P[0],j[0],L[0]),W=Math.max(M[1],P[1],j[1],L[1]),at=Math.floor(z),ut=Math.floor(U),yt=Math.ceil(J-z),kt=Math.ceil(W-U);E.save(),r.clearRect(E,at,ut,yt,kt,a.background),E.beginPath(),E.rect(at,ut,yt,kt),E.clip(),E.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var It=a.renderer.getConfig(),ee=It.enableDirtyRectangleRenderingDebug;ee&&g.dispatchEvent(new vn(cr.DIRTY_RECTANGLE,{dirtyRect:{x:at,y:ut,width:yt,height:kt}}));var $=r.searchDirtyObjects(S);$.sort(function(Y,F){return Y.sortable.renderOrder-F.sortable.renderOrder}).forEach(function(Y){Y&&Y.isVisible()&&!Y.isCulled()&&r.renderDisplayObject(Y,E,r.context,ni(r,Ve)[Ve],e)}),E.restore(),r.renderQueue.forEach(function(Y){r.saveDirtyAABB(Y)}),r.renderQueue=[]}ni(r,Ve)[Ve].restoreStack.forEach(function(){E.restore()}),ni(r,Ve)[Ve].restoreStack=[]}),s.hooks.render.tap(n.tag,function(E){r.clearFullScreen||r.renderQueue.push(E)})}},{key:"clearRect",value:function(t,e,r,i,a,o){t.clearRect(e,r,i,a),o&&(t.fillStyle=o,t.fillRect(e,r,i,a))}},{key:"renderDisplayObjectOptimized",value:function(t,e,r,i,a){var o=t.nodeName,s=!1,u=!1,c=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],d=t.parsedStyle.clipPath;if(d){s=!i.prevObject||!h1(d.getWorldTransform(),i.prevObject.getWorldTransform()),s&&(this.applyWorldTransform(e,d),i.prevObject=null);var p=this.pathGeneratorFactory[d.nodeName];p&&(e.save(),u=!0,e.beginPath(),p(e,d.parsedStyle),e.closePath(),e.clip())}if(c){s=!i.prevObject||!h1(t.getWorldTransform(),i.prevObject.getWorldTransform()),s&&this.applyWorldTransform(e,t);var g=!i.prevObject;if(!g){var m=i.prevObject.nodeName;o===X.TEXT?g=m!==X.TEXT:o===X.IMAGE?g=m!==X.IMAGE:g=m===X.TEXT||m===X.IMAGE}c.applyStyleToContext(e,t,g,i),i.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),o!==X.LINE&&o!==X.PATH&&o!==X.POLYLINE&&e.closePath()),c&&c.drawToContext(e,t,ni(this,Ve)[Ve],this,a),u&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,r,i,a){var o=t.nodeName,s=i.restoreStack[i.restoreStack.length-1];s&&!(t.compareDocumentPosition(s)&Oe.DOCUMENT_POSITION_CONTAINS)&&(e.restore(),i.restoreStack.pop());var u=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var d=this.pathGeneratorFactory[l.nodeName];d&&(e.save(),i.restoreStack.push(t),e.beginPath(),d(e,l.parsedStyle),e.closePath(),e.clip())}u&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),o!==X.LINE&&o!==X.PATH&&o!==X.POLYLINE&&e.closePath()),u&&(u.render(e,t.parsedStyle,t,r,this,a),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var r=e.parsedStyle,i=r.stroke,a=r.fill,o=r.opacity,s=r.lineDash,u=r.lineDashOffset;s&&t.setLineDash(s),Tt(u)||(t.lineDashOffset=u),Tt(o)||(t.globalAlpha*=o),!Tt(i)&&!Array.isArray(i)&&!i.isNone&&(t.strokeStyle=e.attributes.stroke),!Tt(a)&&!Array.isArray(a)&&!a.isNone&&(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),r=t.getMax(),i=Math.floor(e[0]),a=Math.floor(e[1]),o=Math.ceil(r[0]),s=Math.ceil(r[1]),u=o-i,c=s-a;return{x:i,y:a,width:u,height:c}}},{key:"mergeDirtyAABBs",value:function(t){var e=new ye;return t.forEach(function(r){var i=r.getRenderBounds();e.add(i);var a=r.renderable.dirtyRenderBounds;a&&e.add(a)}),e}},{key:"searchDirtyObjects",value:function(t){var e=t.getMin(),r=Pt(e,2),i=r[0],a=r[1],o=t.getMax(),s=Pt(o,2),u=s[0],c=s[1],l=this.rBush.search({minX:i,minY:a,maxX:u,maxY:c});return l.map(function(d){var p=d.displayObject;return p})}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new ye);var r=t.getRenderBounds();r&&e.dirtyRenderBounds.update(r.center,r.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,r){r?(ns(this.tmpMat4,e.getLocalTransform()),Nn(this.tmpMat4,r,this.tmpMat4),Nn(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ns(this.tmpMat4,e.getWorldTransform()),Nn(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new ye,e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return r.forEach(function(a){t.add(a)}),t}}])})();lO.tag="CanvasRenderer";function dh(n,t,e,r,i,a,o){var s,u;if(n.image.nodeName==="rect"){var c=n.image.parsedStyle,l=c.width,d=c.height;u=r.contextService.getDPR();var p=r.config.offscreenCanvas;s=a.offscreenCanvasCreator.getOrCreateCanvas(p),s.width=l*u,s.height=d*u;var g=a.offscreenCanvasCreator.getOrCreateContext(p),m={restoreStack:[],prevObject:null,currentContext:new Map};n.image.forEach(function(v){i.renderDisplayObject(v,g,r,m,a)}),m.restoreStack.forEach(function(){g.restore()})}var y=o.getOrCreatePatternSync(t,n,e,s,u,t.getGeometryBounds().min,function(){t.dirty(),r.renderingService.dirtify()});return y}function fh(n,t,e,r){var i;if(n.type===ua.LinearGradient||n.type===ua.RadialGradient){var a=t.getGeometryBounds(),o=a&&a.halfExtents[0]*2||1,s=a&&a.halfExtents[1]*2||1,u=a&&a.min||[0,0];i=r.getOrCreateGradient(Lt(Lt({type:n.type},n.value),{},{min:u,width:o,height:s}),e)}return i}var bl=["shadowBlur","shadowOffsetX","shadowOffsetY"],ck=["lineCap","lineJoin","miterLimit"],$e={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},lk={};function Le(n,t,e,r){var i=r.has(t)?r.get(t):$e[t];return i!==e&&(t==="lineDash"?n.setLineDash(e):n[t]=e,r.set(t,e)),i}var PW=(function(){function n(t){et(this,n),this.imagePool=t}return nt(n,[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,r,i,a,o){}},{key:"applyCommonStyleToContext",value:function(t,e,r,i){var a=r?lk:i.prevObject.parsedStyle,o=e.parsedStyle;(r||o.opacity!==a.opacity)&&Le(t,"globalAlpha",Tt(o.opacity)?$e.globalAlpha:o.opacity,i.currentContext),(r||o.blend!==a.blend)&&Le(t,"globalCompositeOperation",Tt(o.blend)?$e.globalCompositeOperation:o.blend,i.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,r,i){var a=r?lk:i.prevObject.parsedStyle,o=e.parsedStyle,s=o.lineWidth,u=s===void 0?$e.lineWidth:s,c=o.fill&&!o.fill.isNone,l=o.stroke&&!o.stroke.isNone&&u>0;if(l){if(r||e.attributes.stroke!==i.prevObject.attributes.stroke){var d=!Tt(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?e.attributes.stroke:$e.strokeStyle;Le(t,"strokeStyle",d,i.currentContext)}(r||o.lineWidth!==a.lineWidth)&&Le(t,"lineWidth",Tt(o.lineWidth)?$e.lineWidth:o.lineWidth,i.currentContext),(r||o.lineDash!==a.lineDash)&&Le(t,"lineDash",o.lineDash||$e.lineDash,i.currentContext),(r||o.lineDashOffset!==a.lineDashOffset)&&Le(t,"lineDashOffset",Tt(o.lineDashOffset)?$e.lineDashOffset:o.lineDashOffset,i.currentContext);for(var p=0;p<ck.length;p++){var g=ck[p];(r||o[g]!==a[g])&&Le(t,g,Tt(o[g])?$e[g]:o[g],i.currentContext)}}if(c&&(r||e.attributes.fill!==i.prevObject.attributes.fill)){var m=!Tt(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?e.attributes.fill:$e.fillStyle;Le(t,"fillStyle",m,i.currentContext)}}},{key:"applyStyleToContext",value:function(t,e,r,i){var a=e.nodeName;this.applyCommonStyleToContext(t,e,r,i),a===X.IMAGE||this.applyStrokeFillStyleToContext(t,e,r,i)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,r,i){var a=e.parsedStyle;if(r){Le(t,"shadowColor",a.shadowColor.toString(),i.currentContext);for(var o=0;o<bl.length;o++){var s=bl[o];Le(t,s,a[s]||$e[s],i.currentContext)}}a.filter&&a.filter.length&&Le(t,"filter",e.attributes.filter,i.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(e){Le(t,"shadowColor",$e.shadowColor,i.currentContext);for(var o=0;o<bl.length;o++){var s=bl[o];Le(t,s,$e[s],i.currentContext)}}if(r)if(e&&a){var u=t.filter;!Tt(u)&&u.indexOf("drop-shadow")>-1&&Le(t,"filter",u.replace(/drop-shadow\([^)]*\)/,"").trim()||$e.filter,i.currentContext)}else Le(t,"filter",$e.filter,i.currentContext)}},{key:"fillToContext",value:function(t,e,r,i,a){var o=this,s=e.parsedStyle,u=s.fill,c=s.fillRule,l=null;if(Array.isArray(u)&&u.length>0)u.forEach(function(p){var g=Le(t,"fillStyle",fh(p,e,t,o.imagePool),r.currentContext);l=l??g,c?t.fill(c):t.fill()});else{if(Su(u)){var d=dh(u,e,t,e.ownerDocument.defaultView.context,i,a,this.imagePool);d&&(t.fillStyle=d,l=!0)}c?t.fill(c):t.fill()}l!==null&&Le(t,"fillStyle",l,r.currentContext)}},{key:"strokeToContext",value:function(t,e,r,i,a){var o=this,s=e.parsedStyle.stroke,u=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(d){var p=Le(t,"strokeStyle",fh(d,e,t,o.imagePool),r.currentContext);u=u??p,t.stroke()});else{if(Su(s)){var c=dh(s,e,t,e.ownerDocument.defaultView.context,i,a,this.imagePool);if(c){var l=Le(t,"strokeStyle",c,r.currentContext);u=u??l}}t.stroke()}u!==null&&Le(t,"strokeStyle",u,r.currentContext)}},{key:"drawToContext",value:function(t,e,r,i,a){var o,s=e.nodeName,u=e.parsedStyle,c=u.opacity,l=c===void 0?$e.globalAlpha:c,d=u.fillOpacity,p=d===void 0?$e.fillOpacity:d,g=u.strokeOpacity,m=g===void 0?$e.strokeOpacity:g,y=u.lineWidth,v=y===void 0?$e.lineWidth:y,x=u.fill&&!u.fill.isNone,E=u.stroke&&!u.stroke.isNone&&v>0;if(!(!x&&!E)){var w=!Tt(u.shadowColor)&&u.shadowBlur>0,S=u.shadowType==="inner",k=((o=u.fill)===null||o===void 0?void 0:o.alpha)===0,A=!!(u.filter&&u.filter.length),N=w&&E&&(s===X.PATH||s===X.LINE||s===X.POLYLINE||k||S),T=null;if(x){N||this.applyShadowAndFilterStyleToContext(t,e,w,r);var O=l*p;T=Le(t,"globalAlpha",O,r.currentContext),this.fillToContext(t,e,r,i,a),N||this.clearShadowAndFilterStyleForContext(t,w,A,r)}if(E){var M=!1,P=l*m,L=Le(t,"globalAlpha",P,r.currentContext);if(T=x?T:L,N&&(this.applyShadowAndFilterStyleToContext(t,e,w,r),M=!0,S)){var j=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,r,i,a),t.globalCompositeOperation=j,this.clearShadowAndFilterStyleForContext(t,w,A,r,!0)}this.strokeToContext(t,e,r,i,a),M&&this.clearShadowAndFilterStyleForContext(t,w,A,r)}T!==null&&Le(t,"globalAlpha",T,r.currentContext)}}}])})(),jb=(function(n){function t(){return et(this,t),Bt(this,t,arguments)}return zt(t,n),nt(t,[{key:"render",value:function(e,r,i,a,o,s){var u=r.fill,c=r.fillRule,l=r.opacity,d=l===void 0?1:l,p=r.fillOpacity,g=p===void 0?1:p,m=r.stroke,y=r.strokeOpacity,v=y===void 0?1:y,x=r.lineWidth,E=x===void 0?1:x,w=r.lineCap,S=r.lineJoin,k=r.shadowType,A=r.shadowColor,N=r.shadowBlur,T=r.filter,O=r.miterLimit,M=u&&!u.isNone,P=m&&!m.isNone&&E>0,L=(u==null?void 0:u.alpha)===0,j=!!(T&&T.length),z=!Tt(A)&&N>0,U=i.nodeName,J=k==="inner",W=P&&z&&(U===X.PATH||U===X.LINE||U===X.POLYLINE||L||J);M&&(e.globalAlpha=d*g,W||ph(i,e,z),hO(e,i,u,c,a,o,s,this.imagePool),W||this.clearShadowAndFilter(e,j,z)),P&&(e.globalAlpha=d*v,e.lineWidth=E,Tt(O)||(e.miterLimit=O),Tt(w)||(e.lineCap=w),Tt(S)||(e.lineJoin=S),W&&(J&&(e.globalCompositeOperation="source-atop"),ph(i,e,!0),J&&(U1(e,i,m,a,o,s,this.imagePool),e.globalCompositeOperation=$e.globalCompositeOperation,this.clearShadowAndFilter(e,j,!0))),U1(e,i,m,a,o,s,this.imagePool))}},{key:"clearShadowAndFilter",value:function(e,r,i){if(i&&(e.shadowColor="transparent",e.shadowBlur=0),r){var a=e.filter;!Tt(a)&&a.indexOf("drop-shadow")>-1&&(e.filter=a.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])})(PW);function ph(n,t,e){var r=n.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,u=r.shadowOffsetY;i&&i.length&&(t.filter=n.style.filter),e&&(t.shadowColor=a.toString(),t.shadowBlur=o||0,t.shadowOffsetX=s||0,t.shadowOffsetY=u||0)}function hO(n,t,e,r,i,a,o,s){var u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(e)?e.forEach(function(c){n.fillStyle=fh(c,t,n,s),u||(r?n.fill(r):n.fill())}):(Su(e)&&(n.fillStyle=dh(e,t,n,i,a,o,s)),u||(r?n.fill(r):n.fill()))}function U1(n,t,e,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(e)?e.forEach(function(u){n.strokeStyle=fh(u,t,n,o),s||n.stroke()}):(Su(e)&&(n.strokeStyle=dh(e,t,n,r,i,a,o)),s||n.stroke())}function RW(n,t){var e=Pt(n,4),r=e[0],i=e[1],a=e[2],o=e[3],s=Pt(t,4),u=s[0],c=s[1],l=s[2],d=s[3],p=Math.max(r,u),g=Math.max(i,c),m=Math.min(r+a,u+l),y=Math.min(i+o,c+d);return m<=p||y<=g?null:[p,g,m-p,y-g]}function DW(n,t){var e=Tn(Yt(),[n[0],n[1],0],t),r=Tn(Yt(),[n[0]+n[2],n[1],0],t),i=Tn(Yt(),[n[0],n[1]+n[3],0],t),a=Tn(Yt(),[n[0]+n[2],n[1]+n[3],0],t);return[Math.min(e[0],r[0],i[0],a[0]),Math.min(e[1],r[1],i[1],a[1]),Math.max(e[0],r[0],i[0],a[0])-Math.min(e[0],r[0],i[0],a[0]),Math.max(e[1],r[1],i[1],a[1])-Math.min(e[1],r[1],i[1],a[1])]}var LW=(function(n){function t(){return et(this,t),Bt(this,t,arguments)}return zt(t,n),nt(t,[{key:"renderDownSampled",value:function(e,r,i,a){var o=a.src,s=a.imageCache;if(!s.downSampled){this.imagePool.createDownSampledImage(o,i).then(function(){i.ownerDocument&&(i.dirty(),i.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(u){console.error(u)});return}e.drawImage(s.downSampled,Math.floor(a.drawRect[0]),Math.floor(a.drawRect[1]),Math.ceil(a.drawRect[2]),Math.ceil(a.drawRect[3]))}},{key:"renderTile",value:function(e,r,i,a){var o=a.src,s=a.imageCache,u=a.imageRect,c=a.drawRect,l=s.size,d=e.getTransform(),p=d.a,g=d.b,m=d.c,y=d.d,v=d.e,x=d.f;if(e.resetTransform(),!(s!=null&&s.gridSize)){this.imagePool.createImageTiles(o,[],function(){i.ownerDocument&&(i.dirty(),i.ownerDocument.defaultView.context.renderingService.dirtify())},i).catch(function(z){console.error(z)});return}for(var E=[l[0]/u[2],l[1]/u[3]],w=[s.tileSize[0]/E[0],s.tileSize[1]/E[1]],S=[Math.floor((c[0]-u[0])/w[0]),Math.ceil((c[0]+c[2]-u[0])/w[0])],k=S[0],A=S[1],N=[Math.floor((c[1]-u[1])/w[1]),Math.ceil((c[1]+c[3]-u[1])/w[1])],T=N[0],O=N[1],M=T;M<=O;M++)for(var P=k;P<=A;P++){var L=s.tiles[M][P];if(L){var j=[Math.floor(u[0]+L.tileX*w[0]),Math.floor(u[1]+L.tileY*w[1]),Math.ceil(w[0]),Math.ceil(w[1])];e.drawImage(L.data,j[0],j[1],j[2],j[3])}}e.setTransform(p,g,m,y,v,x)}},{key:"render",value:function(e,r,i){var a=r.x,o=a===void 0?0:a,s=r.y,u=s===void 0?0:s,c=r.width,l=r.height,d=r.src,p=r.shadowColor,g=r.shadowBlur,m=this.imagePool.getImageSync(d,i),y=m==null?void 0:m.img,v=c,x=l;if(y){v||(v=y.width),x||(x=y.height);var E=!Tt(p)&&g>0;ph(i,e,E);try{var w=i.ownerDocument.defaultView.getContextService().getDomElement(),S=w.width,k=w.height,A=e.getTransform(),N=A.a,T=A.b,O=A.c,M=A.d,P=A.e,L=A.f,j=uM(N,O,0,0,T,M,0,0,0,0,1,0,P,L,0,1),z=DW([o,u,v,x],j),U=RW([0,0,S,k],z);if(!U)return;if(!i.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){t.renderFull(e,r,i,{image:y,drawRect:[o,u,v,x]});return}var J=z[2]/m.size[0];if(J<(m.downSamplingRate||.5)){this.renderDownSampled(e,r,i,{src:d,imageCache:m,drawRect:[o,u,v,x]});return}if(!Ib.isSupportTile){t.renderFull(e,r,i,{image:y,drawRect:[o,u,v,x]});return}this.renderTile(e,r,i,{src:d,imageCache:m,imageRect:z,drawRect:U})}catch{}}}},{key:"drawToContext",value:function(e,r,i,a,o){this.render(e,r.parsedStyle,r)}}],[{key:"renderFull",value:function(e,r,i,a){e.drawImage(a.image,Math.floor(a.drawRect[0]),Math.floor(a.drawRect[1]),Math.ceil(a.drawRect[2]),Math.ceil(a.drawRect[3]))}}])})(jb),IW=(function(n){function t(){return et(this,t),Bt(this,t,arguments)}return zt(t,n),nt(t,[{key:"render",value:function(e,r,i,a,o,s){i.getBounds();var u=r.lineWidth,c=u===void 0?1:u,l=r.textAlign,d=l===void 0?"start":l,p=r.textBaseline,g=p===void 0?"alphabetic":p,m=r.lineJoin,y=m===void 0?"miter":m,v=r.miterLimit,x=v===void 0?10:v,E=r.letterSpacing,w=E===void 0?0:E,S=r.stroke,k=r.fill,A=r.fillRule,N=r.fillOpacity,T=N===void 0?1:N,O=r.strokeOpacity,M=O===void 0?1:O,P=r.opacity,L=P===void 0?1:P,j=r.metrics,z=r.x,U=z===void 0?0:z,J=r.y,W=J===void 0?0:J,at=r.dx,ut=r.dy,yt=r.shadowColor,kt=r.shadowBlur,It=j.font,ee=j.lines,$=j.height,Y=j.lineHeight,F=j.lineMetrics;e.font=It,e.lineWidth=c,e.textAlign=d==="middle"?"center":d;var K=g;K==="alphabetic"&&(K="bottom"),e.lineJoin=y,Tt(x)||(e.miterLimit=x);var ot=W;g==="middle"?ot+=-$/2-Y/2:g==="bottom"||g==="alphabetic"||g==="ideographic"?ot+=-$:(g==="top"||g==="hanging")&&(ot+=-Y);var dt=U+(at||0);ot+=ut||0,ee.length===1&&(K==="bottom"?(K="middle",ot-=.5*$):K==="top"&&(K="middle",ot+=.5*$)),e.textBaseline=K;var mt=!Tt(yt)&&kt>0;ph(i,e,mt);for(var Ot=0;Ot<ee.length;Ot++){var ne=c/2+dt;ot+=Y,!Tt(S)&&!S.isNone&&c&&this.drawLetterSpacing(e,i,ee[Ot],F[Ot],d,ne,ot,w,k,A,T,S,M,L,!0,a,o,s),Tt(k)||this.drawLetterSpacing(e,i,ee[Ot],F[Ot],d,ne,ot,w,k,A,T,S,M,L,!1,a,o,s)}}},{key:"drawLetterSpacing",value:function(e,r,i,a,o,s,u,c,l,d,p,g,m,y,v,x,E,w){if(c===0){v?this.strokeText(e,r,i,s,u,g,m,x,E,w):this.fillText(e,r,i,s,u,l,d,p,y,x,E,w);return}var S=e.textAlign;e.textAlign="left";var k=s;o==="center"||o==="middle"?k=s-a.width/2:(o==="right"||o==="end")&&(k=s-a.width);for(var A=Array.from(i),N=e.measureText(i).width,T=0,O=0;O<A.length;++O){var M=A[O];v?this.strokeText(e,r,M,k,u,g,m,x,E,w):this.fillText(e,r,M,k,u,l,d,p,y,x,E,w),T=e.measureText(i.substring(O+1)).width,k+=N-T+c,N=T}e.textAlign=S}},{key:"fillText",value:function(e,r,i,a,o,s,u,c,l,d,p,g){hO(e,r,s,u,d,p,g,this.imagePool,!0);var m,y=!Tt(c)&&c!==1;y&&(m=e.globalAlpha,e.globalAlpha=c*l),e.fillText(i,a,o),y&&(e.globalAlpha=m)}},{key:"strokeText",value:function(e,r,i,a,o,s,u,c,l,d){U1(e,r,s,c,l,d,this.imagePool,!0);var p,g=!Tt(u)&&u!==1;g&&(p=e.globalAlpha,e.globalAlpha=u),e.strokeText(i,a,o),g&&(e.globalAlpha=p)}},{key:"drawToContext",value:function(e,r,i,a,o){this.render(e,r.parsedStyle,r,r.ownerDocument.defaultView.context,a,o)}}])})(jb),jW=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),e=Bt(this,t),e.name="canvas-renderer",e.options=r,e}return zt(t,n),nt(t,[{key:"init",value:function(){var e,r=Lt({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),i=this.context.imagePool,a=new jb(i),o=(e={},ft(ft(ft(ft(ft(ft(ft(ft(ft(ft(e,X.CIRCLE,a),X.ELLIPSE,a),X.RECT,a),X.IMAGE,new LW(i)),X.TEXT,new IW(i)),X.LINE,a),X.POLYLINE,a),X.POLYGON,a),X.PATH,a),X.GROUP,void 0),ft(ft(ft(e,X.HTML,void 0),X.MESH,void 0),X.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new lO(r))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])})(wa);/*!
70
+ * @antv/g-plugin-dom-interaction
71
+ * @description A G plugin
72
+ * @version 2.1.27
73
+ * @date 7/30/2025, 1:35:38 PM
74
+ * @author AntVis
75
+ * @docs https://g.antv.antgroup.com/
76
+ */var dO=(function(){function n(){et(this,n)}return nt(n,[{key:"apply",value:function(t,e){var r=this,i=t.renderingService,a=t.renderingContext,o=t.config;this.context=t;var s=a.root.ownerDocument.defaultView,u=function(A){i.hooks.pointerMove.call(A)},c=function(A){i.hooks.pointerUp.call(A)},l=function(A){i.hooks.pointerDown.call(A)},d=function(A){i.hooks.pointerOver.call(A)},p=function(A){i.hooks.pointerOut.call(A)},g=function(A){i.hooks.pointerCancel.call(A)},m=function(A){i.hooks.pointerWheel.call(A)},y=function(A){i.hooks.click.call(A)},v=function(A){e.globalThis.document.addEventListener("pointermove",u,!0),A.addEventListener("pointerdown",l,!0),A.addEventListener("pointerleave",p,!0),A.addEventListener("pointerover",d,!0),e.globalThis.addEventListener("pointerup",c,!0),e.globalThis.addEventListener("pointercancel",g,!0)},x=function(A){A.addEventListener("touchstart",l,!0),A.addEventListener("touchend",c,!0),A.addEventListener("touchmove",u,!0),A.addEventListener("touchcancel",g,!0)},E=function(A){e.globalThis.document.addEventListener("mousemove",u,!0),A.addEventListener("mousedown",l,!0),A.addEventListener("mouseout",p,!0),A.addEventListener("mouseover",d,!0),e.globalThis.addEventListener("mouseup",c,!0)},w=function(A){e.globalThis.document.removeEventListener("pointermove",u,!0),A.removeEventListener("pointerdown",l,!0),A.removeEventListener("pointerleave",p,!0),A.removeEventListener("pointerover",d,!0),e.globalThis.removeEventListener("pointerup",c,!0),e.globalThis.removeEventListener("pointercancel",g,!0)},S=function(A){A.removeEventListener("touchstart",l,!0),A.removeEventListener("touchend",c,!0),A.removeEventListener("touchmove",u,!0),A.removeEventListener("touchcancel",g,!0)},k=function(A){e.globalThis.document.removeEventListener("mousemove",u,!0),A.removeEventListener("mousedown",l,!0),A.removeEventListener("mouseout",p,!0),A.removeEventListener("mouseover",d,!0),e.globalThis.removeEventListener("mouseup",c,!0)};i.hooks.init.tap(n.tag,function(){var A=r.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="none",A.style.msTouchAction="none"):s.supportsPointerEvents&&(A.style.touchAction="none"),s.supportsPointerEvents?v(A):E(A),s.supportsTouchEvents&&x(A),o.useNativeClickEvent&&A.addEventListener("click",y,!0),A.addEventListener("wheel",m,{passive:!0,capture:!0})}),i.hooks.destroy.tap(n.tag,function(){var A=r.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="",A.style.msTouchAction=""):s.supportsPointerEvents&&(A.style.touchAction=""),s.supportsPointerEvents?w(A):k(A),s.supportsTouchEvents&&S(A),o.useNativeClickEvent&&A.removeEventListener("click",y,!0),A.removeEventListener("wheel",m,!0)})}}])})();dO.tag="DOMInteraction";var BW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="dom-interaction",e}return zt(t,n),nt(t,[{key:"init",value:function(){this.addRenderingPlugin(new dO)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(wa);/*!
77
+ * @antv/g-plugin-html-renderer
78
+ * @description A G plugin for rendering HTML
79
+ * @version 2.1.27
80
+ * @date 7/30/2025, 1:35:48 PM
81
+ * @author AntVis
82
+ * @docs https://g.antv.antgroup.com/
83
+ */var zW="g-canvas-camera",fO=(function(){function n(){et(this,n),this.displayObjectHTMLElementMap=new WeakMap}return nt(n,[{key:"joinTransformMatrix",value:(function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")})},{key:"apply",value:function(t,e){var r=this,i=t.camera,a=t.renderingContext,o=t.renderingService;this.context=t;var s=a.root.ownerDocument.defaultView,u=s.context.eventService.nativeHTMLMap,c=function(y,v){v.style.transform=r.joinTransformMatrix(y.getWorldTransform(),y.getOrigin())},l=function(y){var v=y.target;if(v.nodeName===X.HTML){r.$camera||(r.$camera=r.createCamera(i));var x=r.getOrCreateEl(v);r.$camera.appendChild(x),Object.keys(v.attributes).forEach(function(E){r.updateAttribute(E,v)}),c(v,x),u.set(x,v)}},d=function(y){var v=y.target;if(v.nodeName===X.HTML&&r.$camera){var x=r.getOrCreateEl(v);x&&(x.remove(),u.delete(x))}},p=function(y){var v=y.target;if(v.nodeName===X.HTML){var x=y.attrName;r.updateAttribute(x,v)}},g=function(y){var v=y.target,x=v.nodeName===X.FRAGMENT?v.childNodes:[v];x.forEach(function(E){if(E.nodeName===X.HTML){var w=r.getOrCreateEl(E);c(E,w)}})},m=function(){if(r.$camera){var y=r.context.config,v=y.width,x=y.height;r.$camera.parentElement.style.width="".concat(v||0,"px"),r.$camera.parentElement.style.height="".concat(x||0,"px")}};o.hooks.init.tap(n.tag,function(){s.addEventListener(cr.RESIZE,m),s.addEventListener(Wt.MOUNTED,l),s.addEventListener(Wt.UNMOUNTED,d),s.addEventListener(Wt.ATTR_MODIFIED,p),s.addEventListener(Wt.BOUNDS_CHANGED,g)}),o.hooks.endFrame.tap(n.tag,function(){r.$camera&&a.renderReasons.has(Jo.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),o.hooks.destroy.tap(n.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(cr.RESIZE,m),s.removeEventListener(Wt.MOUNTED,l),s.removeEventListener(Wt.UNMOUNTED,d),s.removeEventListener(Wt.ATTR_MODIFIED,p),s.removeEventListener(Wt.BOUNDS_CHANGED,g)})}},{key:"createCamera",value:function(t){var e=this.context.config,r=e.document,i=e.width,a=e.height,o=this.context.contextService.getDomElement(),s=o.parentNode;if(s){var u=zW,c=s.querySelector("#".concat(u));if(!c){var l=(r||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(i||0,"px"),l.style.height="".concat(a||0,"px");var d=(r||document).createElement("div");c=d,d.id=u,d.style.position="absolute",d.style.left="".concat(o.offsetLeft||0,"px"),d.style.top="".concat(o.offsetTop||0,"px"),d.style.transformOrigin="left top",d.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),d.style.pointerEvents="none",d.style.width="100%",d.style.height="100%",l.appendChild(d),s.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,r=this.displayObjectHTMLElementMap.get(t);return r||(r=(e||document).createElement("div"),t.parsedStyle.$el=r,this.displayObjectHTMLElementMap.set(t,r),t.id&&(r.id=t.id),t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),r}},{key:"updateAttribute",value:function(t,e){var r=this.getOrCreateEl(e);switch(t){case"innerHTML":var i=e.parsedStyle.innerHTML;fe(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"x":r.style.left="".concat(e.parsedStyle.x,"px");break;case"y":r.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var a=e.parsedStyle.transformOrigin;r.style["transform-origin"]="".concat(a[0].buildCSSText(null,null,"")," ").concat(a[1].buildCSSText(null,null,""));break;case"width":var o=e.parsedStyle.width;r.style.width=Xt(o)?"".concat(o,"px"):o.toString();break;case"height":var s=e.parsedStyle.height;r.style.height=Xt(s)?"".concat(s,"px"):s.toString();break;case"zIndex":var u=e.parsedStyle.zIndex;r.style["z-index"]="".concat(u);break;case"visibility":var c=e.parsedStyle.visibility;r.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,d=l===void 0?"auto":l;r.style.pointerEvents=d;break;case"opacity":var p=e.parsedStyle.opacity;r.style.opacity="".concat(p);break;case"fill":var g=e.parsedStyle.fill,m="";eh(g)?g.isNone?m="transparent":m=e.getAttribute("fill"):Array.isArray(g)&&(m=e.getAttribute("fill")),r.style.background=m;break;case"stroke":var y=e.parsedStyle.stroke,v="";eh(y)?y.isNone?v="transparent":v=e.getAttribute("stroke"):Array.isArray(y)&&(v=e.getAttribute("stroke")),r.style["border-color"]=v,r.style["border-style"]="solid";break;case"lineWidth":var x=e.parsedStyle.lineWidth;r.style["border-width"]="".concat(x||0,"px");break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":var E=e.style.filter;r.style.filter=E;break;default:!Tt(e.style[t])&&e.style[t]!==""&&(r.style[t]=e.style[t])}}}])})();fO.tag="HTMLRendering";var FW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="html-renderer",e}return zt(t,n),nt(t,[{key:"init",value:function(){this.addRenderingPlugin(new fO)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(wa);/*!
84
+ * @antv/g-canvas
85
+ * @description A renderer implemented by Canvas 2D API
86
+ * @version 2.0.48
87
+ * @date 7/30/2025, 1:38:18 PM
88
+ * @author AntVis
89
+ * @docs https://g.antv.antgroup.com/
90
+ */var GW=(function(){function n(t){et(this,n),this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return nt(n,[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,r=t.canvas;if(r)this.$canvas=r,e&&r.parentElement!==e&&e.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=fe(e)?document.getElementById(e):e,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var r=this.canvasConfig.devicePixelRatio;this.dpr=r,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,I7(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Jo.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(function(){var t=ya(fn().mark(function r(){var i,a,o,s=arguments;return fn().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=s.length>0&&s[0]!==void 0?s[0]:{},a=i.type,o=i.encoderOptions,u.abrupt("return",this.context.canvas.toDataURL(a,o));case 1:case"end":return u.stop()}},r,this)}));function e(){return t.apply(this,arguments)}return e})()}])})(),VW=(function(n){function t(){var e;et(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=Bt(this,t,[].concat(i)),e.name="canvas-context-register",e}return zt(t,n),nt(t,[{key:"init",value:function(){this.context.ContextService=GW}},{key:"destroy",value:function(){delete this.context.ContextService}}])})(wa),gh=(function(n){function t(e){var r;return et(this,t),r=Bt(this,t,[e]),r.registerPlugin(new VW),r.registerPlugin(new OW),r.registerPlugin(new uW),r.registerPlugin(new jW),r.registerPlugin(new BW),r.registerPlugin(new NW),r.registerPlugin(new FW),r}return zt(t,n),nt(t)})(Rz),hk=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Fh extends ys{constructor(t){super(fr({style:Fh.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:r=[]}=t;return r.length===0?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:r}=t,[i,a,o,s]=zi(e);return rn(ga(r),[s+a,i+o,0])}getCollapsedKeySize(t){return ga(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[Fi(e),Gi(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:r}=t,i=e.map(o=>this.context.element.getElement(o)).filter(Boolean);if(i.length===0){const o=new ye,{x:s=0,y:u=0,size:c}=t,[l,d]=ga(c);return o.setMinMax([s-l/2,u-d/2,0],[s+l/2,u+d/2,0]),o}const a=Fu(i.map(o=>o.getBounds()));return r?Aa(a,r):a}drawCollapsedMarkerShape(t,e){const r=this.getCollapsedMarkerStyle(t);this.upsert("collapsed-marker",iO,r,e),nO(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Cn(this.getGraphicStyle(t),"collapsedMarker"),{type:r}=e,i=hk(e,["type"]),a=this.getShape("key"),[o,s]=aa(a.getLocalBounds(),"center"),u=Object.assign(Object.assign({},i),{x:o,y:s});if(r){const c=this.getCollapsedMarkerText(r,t);Object.assign(u,{text:c})}return u}getCollapsedMarkerText(t,e){const{childrenData:r=[]}=e,{model:i}=this.context;return t==="descendant-count"?i.getDescendantsData(this.id).length.toString():t==="child-count"?r.length.toString():t==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(Z(a))==="node").length.toString():St(t)?t(r):""}getComboPosition(t){const{x:e=0,y:r=0,collapsed:i,childrenData:a=[]}=t;if(a.length===0)return[+e,+r,0];if(i){const{model:o}=this.context,s=o.getDescendantsData(this.id).filter(u=>!o.isCombo(Z(u)));if(s.length>0&&s.some(PU)){const u=s.reduce((c,l)=>rn(c,_r(l)),[0,0,0]);return sh(u,s.length)}return[+e,+r,0]}return this.getContentBBox(t).center}getComboStyle(t){const[e,r]=this.getComboPosition(t);return{x:e,y:r,transform:[["translate",e,r]]}}updateComboPosition(t){const e=this.getComboStyle(t);Object.assign(this.style,e);const{x:r,y:i}=e;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:r,y:i}}),rO(this)}render(t,e=this){super.render(t,e),this.drawCollapsedMarkerShape(t,e)}update(t={}){super.update(t),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(t,e){const r=super.animate(this.attributes.collapsed?t:t.map(i=>{var a=hk(i,["x","y","z","transform"]);return a}),e);return r&&new Proxy(r,{set:(i,a,o)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,o))})}}Fh.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};const UW={padding:10};function dk(n,t,e,r,i,a){const{padding:o}=Object.assign(UW,a),s=ca(e,o),u=ca(r,o),c=[n,...i,t];let l=null;const d=[];for(let p=0,g=c.length;p<g-1;p++){const m=p+1,y=c[p],v=c[m],x=LU(y,v);let E=null;if(p===0)if(m===g-1)if(s.intersects(u))E=Mp(y,v,s,u);else if(!oh(y,s)&&!oh(v,u)){const w=Qa(y,s),S=Qa(v,u);E=pk(w,S,Kn(w,S)),E.points.unshift(w),E.points.push(S)}else x||(E=YW(y,v,s,u));else Xr(v,s)?E=Mp(y,v,s,ca(v,o),l):x||(E=Pl(y,v,s));else m===g-1?Xr(y,u)?E=Mp(y,v,ca(y,o),u,l):x||(E=pO(y,v,u,l)):x||(E=pk(y,v,l));E?(d.push(...E.points),l=E.direction):l=Kn(y,v),m<g-1&&d.push(v)}return d.map(ch)}const WW={N:"S",S:"N",W:"E",E:"W"},fk={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Kn(n,t){const[e,r]=n,[i,a]=t;return e===i?r>a?"N":"S":r===a?e>i?"W":"E":null}function W1(n,t){return t==="N"||t==="S"?Gi(n):Fi(n)}function pk(n,t,e){const r=[n[0],t[1]],i=[t[0],n[1]],a=Kn(n,r),o=Kn(n,i),s=e?WW[e]:null,u=a===e||a!==s&&o!==e?r:i;return{points:[u],direction:Kn(u,t)}}function Pl(n,t,e){if(oh(n,e)){const r=Tu(n,t,e);return{points:[r],direction:Kn(r,t)}}else{const r=Qa(n,e),i=["left","right"].includes(vu(n,e))?[t[0],r[1]]:[r[0],t[1]];return{points:[i],direction:Kn(i,t)}}}function pO(n,t,e,r){const i=oh(t,e)?t:Qa(t,e),a=[[i[0],n[1]],[n[0],i[1]]],o=a.filter(u=>uU(u,e)&&!F_(u,e,!0)),s=o.filter(u=>Kn(u,n)!==r);if(s.length>0){const u=s.find(c=>Kn(n,c)===r)||s[0];return{points:[u],direction:Kn(u,t)}}else{const u=mB(a,o)[0],c=pa(t,u,W1(e,r)/2);return{points:[Tu(c,n,e),c],direction:Kn(c,t)}}}function YW(n,t,e,r){let i=Pl(n,t,e);const a=lh(i.points[0]);if(Xr(a,r)){i=Pl(t,n,r);const o=lh(i.points[0]);if(Xr(o,e)){const s=pa(n,a,W1(e,Kn(n,a))/2),u=pa(t,o,W1(r,Kn(t,o))/2),c=[(s[0]+u[0])/2,(s[1]+u[1])/2],l=Pl(n,c,e),d=pO(c,t,r,l.direction);i.points=[l.points[0],d.points[0]],i.direction=d.direction}}return i}function Mp(n,t,e,r,i){const a=Fu([e,r]),o=Bi(t,a.center)>Bi(n,a.center),[s,u]=o?[t,n]:[n,t],c=Gi(a)+Fi(a);let l;if(i){const g=[s[0]+c*Math.cos(fk[i]),s[1]+c*Math.sin(fk[i])];l=pa(Qa(g,a),g,.01)}else l=pa(Qa(s,a),s,-.01);let d=Tu(l,u,a),p=[Qs(l,2),Qs(d,2)];if(Jn(Qs(l),Qs(d))){const g=MU(Mn(l,s),[1,0,0])+Math.PI/2;d=[u[0]+c*Math.cos(g),u[1]+c*Math.sin(g),0],d=Qs(pa(Qa(d,a),u,-.01),2);const m=Tu(l,d,a);p=[l,m,d]}return{points:o?p.reverse():p,direction:Kn(o?l:d,t)}}function Tu(n,t,e){let r=[n[0],t[1]];return Xr(r,e)&&(r=[t[0],n[1]]),r}function gO(n,t,e,r,i){let a=typeof t=="number"?t:.5;t==="start"&&(a=0),t==="end"&&(a=.99);const o=oi(n.getPoint(a)),s=oi(n.getPoint(a+.01));let u=t==="start"?"left":t==="end"?"right":"center";if(K_(o,s)||!e){const[g,m]=gk(n,a,r,i);return{transform:[["translate",g,m]],textAlign:u}}let c=Math.atan2(s[1]-o[1],s[0]-o[0]);s[0]<o[0]&&(u=u==="center"?u:u==="left"?"right":"left",r*=-1,c+=Math.PI);const[l,d]=gk(n,a,r,i,c),p=[["translate",l,d],["rotate",c/Math.PI*180]];return{textAlign:u,transform:p}}function $W(n,t,e,r,i){var a,o;const s=((a=n.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,u=((o=n.label)===null||o===void 0?void 0:o.getGeometryBounds().halfExtents[0])*2||0;return gO(n.key,e,!0,(u?(u/2+s/2)*(t==="suffix"?1:-1):0)+r,i)}function gk(n,t,e,r,i){const[a,o]=oi(n.getPoint(t));let s=e,u=r;return i&&(s=e*Math.cos(i)-r*Math.sin(i),u=e*Math.sin(i)+r*Math.cos(i)),[a+s,o+u]}function Y1(n,t,e,r){if(Jn(n,t))return n;const i=Mn(t,n),a=[n[0]+e*i[0],n[1]+e*i[1]],o=Y_(_U(i,!1));return a[0]+=r*o[0],a[1]+=r*o[1],a}function HW(n){return Xt(n)?[n,-n]:n}function XW(n){return Xt(n)?[n,1-n]:n}function qW(n,t,e){return[["M",n[0],n[1]],["Q",e[0],e[1],t[0],t[1]]]}function vO(n,t,e){return[["M",n[0],n[1]],["C",e[0][0],e[0][1],e[1][0],e[1][1],t[0],t[1]]]}function mO(n,t=0,e=!1){const r=n.length-1,i=n[0],a=n[r],o=n.slice(1,r),s=[["M",i[0],i[1]]];return o.forEach((u,c)=>{const l=o[c-1]||i,d=o[c+1]||a;if(!IU(l,u,d)&&t){const[p,g]=KW(l,u,d,t);s.push(["L",p[0],p[1]],["Q",u[0],u[1],g[0],g[1]],["L",g[0],g[1]])}else s.push(["L",u[0],u[1]])}),s.push(["L",a[0],a[1]]),e&&s.push(["Z"]),s}function KW(n,t,e,r){const i=uh(n,t),a=uh(e,t),o=Math.min(r,Math.min(i,a)/2),s=[t[0]-o/i*(t[0]-n[0]),t[1]-o/i*(t[1]-n[1])],u=[t[0]-o/a*(t[0]-e[0]),t[1]-o/a*(t[1]-e[1])];return[s,u]}const ZW=n=>{const t=Math.PI/2,e=Gi(n)/2,r=Fi(n)/2,i=Math.atan2(e,r)/2,a=Math.atan2(r,e)/2;return{top:[-t-a,-t+a],"top-right":[-t+a,-i],"right-top":[-t+a,-i],right:[-i,i],"bottom-right":[i,t-a],"right-bottom":[i,t-a],bottom:[t-a,t+a],"bottom-left":[t+a,Math.PI-i],"left-bottom":[t+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-t-a],"left-top":[Math.PI+i,-t-a]}};function yO(n,t,e,r,i){const a=ca(n),o=n.getCenter();let s=r&&Ea(r),u=i&&Ea(i);if(!s||!u){const c=ZW(a),l=c[t][0],d=c[t][1],[p,g]=zu(a),m=Math.max(p,g),y=rn(o,[m*Math.cos(l),m*Math.sin(l),0]),v=rn(o,[m*Math.cos(d),m*Math.sin(d),0]);s=$1(n,y),u=$1(n,v),e||([s,u]=[u,s])}return[s,u]}function JW(n,t,e,r,i,a){const o=n.getPorts()[i||a],s=n.getPorts()[a||i];let[u,c]=yO(n,t,e,o,s);const l=QW(n,u,c,r);return o&&(u=Mu(o,l[0])),s&&(c=Mu(s,l.at(-1))),vO(u,c,l)}function QW(n,t,e,r){const i=n.getCenter();if(Jn(t,e)){const a=Mn(t,i),o=[r*Math.sign(a[0])||r/2,r*Math.sign(a[1])||-r/2,0];return[rn(t,o),rn(e,us(o,[1,-1,1]))]}return[pa(i,t,Bi(i,t)+r),pa(i,e,Bi(i,e)+r)]}function tY(n,t,e,r,i,a,o){const s=zb(n),u=s[a||o],c=s[o||a];let[l,d]=yO(n,e,r,u,c);const p=eY(n,l,d,i);return u&&(l=Mu(u,p[0])),c&&(d=Mu(c,p.at(-1))),mO([l,...p,d],t)}function eY(n,t,e,r){const i=[],a=ca(n);if(Jn(t,e))switch(vu(t,a)){case"left":i.push([t[0]-r,t[1]]),i.push([t[0]-r,t[1]+r]),i.push([t[0],t[1]+r]);break;case"right":i.push([t[0]+r,t[1]]),i.push([t[0]+r,t[1]+r]),i.push([t[0],t[1]+r]);break;case"top":i.push([t[0],t[1]-r]),i.push([t[0]+r,t[1]-r]),i.push([t[0]+r,t[1]]);break;case"bottom":i.push([t[0],t[1]+r]),i.push([t[0]+r,t[1]+r]),i.push([t[0]+r,t[1]]);break}else{const o=vu(t,a),s=vu(e,a);if(o===s){const u=o;let c,l;switch(u){case"left":c=Math.min(t[0],e[0])-r,i.push([c,t[1]]),i.push([c,e[1]]);break;case"right":c=Math.max(t[0],e[0])+r,i.push([c,t[1]]),i.push([c,e[1]]);break;case"top":l=Math.min(t[1],e[1])-r,i.push([t[0],l]),i.push([e[0],l]);break;case"bottom":l=Math.max(t[1],e[1])+r,i.push([t[0],l]),i.push([e[0],l]);break}}else{const u=(p,g)=>({left:[g[0]-r,g[1]],right:[g[0]+r,g[1]],top:[g[0],g[1]-r],bottom:[g[0],g[1]+r]})[p],c=u(o,t),l=u(s,e),d=Tu(c,l,a);i.push(c,d,l)}}return i}function nY(n,t){const e=new Set,r=new Set,i=new Set;return n.forEach(a=>{t(a).forEach(o=>{e.add(o),n.includes(o.source)&&n.includes(o.target)?r.add(o):i.add(o)})}),{edges:Array.from(e),internal:Array.from(r),external:Array.from(i)}}function vk(n,t){const e=[];let r=n;for(;r;){e.push(r);const i=t(Z(r));if(i)r=i;else break}if(e.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=e.reverse().findIndex(ba);return e[i]||e.at(-1)}return n}function rY(n,t){return t||(n<4?10:n===4?12:n*2.5)}const iY=(n,t)=>{const e=Math.max(n,t)/2;return[["M",-n/2,0],["A",e,e,0,1,0,2*e-n/2,0],["A",e,e,0,1,0,-n/2,0],["Z"]]},bO=(n,t)=>[["M",-n/2,0],["L",n/2,-t/2],["L",n/2,t/2],["Z"]],aY=(n,t)=>[["M",-n/2,0],["L",0,-t/2],["L",n/2,0],["L",0,t/2],["Z"]],oY=(n,t)=>[["M",-n/2,0],["L",n/2,-t/2],["L",4*n/5-n/2,0],["L",n/2,t/2],["Z"]],sY=(n,t)=>[["M",-n/2,-t/2],["L",n/2,-t/2],["L",n/2,t/2],["L",-n/2,t/2],["Z"]],uY=(n,t)=>{const e=n/2,r=n/7,i=n-r;return[["M",-e,0],["L",0,-t/2],["L",0,t/2],["Z"],["M",i-e,-t/2],["L",i+r-e,-t/2],["L",i+r-e,t/2],["L",i-e,t/2],["Z"]]},cY=(n,t)=>[["M",n/2,-t/2],["L",-n/2,0],["L",n/2,0],["L",-n/2,0],["L",n/2,t/2]],lY=Object.freeze(Object.defineProperty({__proto__:null,circle:iY,diamond:aY,rect:sY,simple:cY,triangle:bO,triangleRect:uY,vee:oY},Symbol.toStringTag,{value:"Module"}));var xl=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Sa extends aO{constructor(t){super(fr({style:Sa.defaultStyleProps},t)),this.type="edge"}get sourceNode(){const{sourceNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}get targetNode(){const{targetNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}getKeyStyle(t){const e=this.getGraphicStyle(t),{loop:r}=e,i=xl(e,["loop"]),{sourceNode:a,targetNode:o}=this,s={d:r&&xY(a,o)?this.getLoopPath(t):this.getKeyPath(t)};return Ha.PARSED_STYLE_LIST.forEach(u=>{u in i&&(s[u]=i[u])}),s}getLoopPath(t){const{sourcePort:e,targetPort:r}=t,i=this.sourceNode,a=ca(i),o=Math.max(Fi(a),Gi(a)),{placement:s,clockwise:u,dist:c=o}=Cn(this.getGraphicStyle(t),"loop");return JW(i,s,u,c,e,r)}getEndpoints(t,e=!0,r=[]){const{sourcePort:i,targetPort:a}=t,{sourceNode:o,targetNode:s}=this,[u,c]=kY(o,s,i,a);if(!e){const g=u?Ea(u):o.getCenter(),m=c?Ea(c):s.getCenter();return[g,m]}const l=typeof r=="function"?r():r,d=Ek(u||o,l[0]||c||s),p=Ek(c||s,l[l.length-1]||u||o);return[d,p]}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),r=Cn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),r)}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Cn(this.getGraphicStyle(t),"label"),{placement:r,offsetX:i,offsetY:a,autoRotate:o,maxWidth:s}=e,u=xl(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),c=gO(this.shapeMap.key,r,o,i,a),l=this.shapeMap.key.getLocalBounds(),d=KU([l.min,l.max],s);return Object.assign({wordWrapWidth:d},c,u)}getBadgeStyle(t){if(t.badge===!1||!t.badgeText)return!1;const e=Cn(t,"badge"),{offsetX:r,offsetY:i,placement:a}=e,o=xl(e,["offsetX","offsetY","placement"]);return Object.assign(o,$W(this.shapeMap,a,t.labelPlacement,r,i))}drawArrow(t,e){var r;const i=e==="start",a=t[e==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(a){const s=this.getArrowStyle(t,i),[u,c,l]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],d=o.parsedStyle[u];if(d)d.attr(s);else{const p=s.src?ju:Ha,g=new p({style:s});o.style[u]=g}o.style[c]=t[l]||s.width/2+ +s.lineWidth}else{const s=i?"markerStart":"markerEnd";(r=o.style[s])===null||r===void 0||r.destroy(),o.style[s]=null}}getArrowStyle(t,e){const r=this.getShape("key").attributes,i=e?"startArrow":"endArrow",a=Cn(this.getGraphicStyle(t),i),{size:o,type:s}=a,u=xl(a,["size","type"]),[c,l]=ga(rY(r.lineWidth,o)),d=(St(s)?s:lY[s]||bO)(c,l);return Object.assign(wu(r,["stroke","strokeOpacity","fillOpacity"]),{width:c,height:l},Object.assign({},d&&{d,fill:s==="simple"?"":r.stroke}),u)}drawLabelShape(t,e){const r=this.getLabelStyle(t);this.upsert("label",xa,r,e)}drawHaloShape(t,e){const r=this.getHaloStyle(t);this.upsert("halo",Ha,r,e)}drawBadgeShape(t,e){const r=this.getBadgeStyle(t);this.upsert("badge",Gu,r,e)}drawSourceArrow(t){this.drawArrow(t,"start")}drawTargetArrow(t){this.drawArrow(t,"end")}drawKeyShape(t,e){const r=this.getKeyStyle(t);return this.upsert("key",Ha,r,e)}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.getShape("key")&&(this.drawSourceArrow(t),this.drawTargetArrow(t),this.drawLabelShape(t,e),this.drawHaloShape(t,e),this.drawBadgeShape(t,e))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(t,e){const r=super.animate(t,e);return r&&new Proxy(r,{set:(i,a,o)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,o))})}}Sa.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class fo extends Sa{constructor(t){super(fr({style:fo.defaultStyleProps},t))}getKeyPath(t){const[e,r]=this.getEndpoints(t),{controlPoints:i,curvePosition:a,curveOffset:o}=t,s=this.getControlPoints(e,r,XW(a),HW(o),i);return vO(e,r,s)}getControlPoints(t,e,r,i,a){return(a==null?void 0:a.length)===2?a:[Y1(t,e,r[0],i[0]),Y1(t,e,r[1],i[1])]}}fo.defaultStyleProps={curvePosition:.5,curveOffset:20};class Gh extends fo{constructor(t){super(fr({style:Gh.defaultStyleProps},t))}getControlPoints(t,e,r,i){const a=e[0]-t[0];return[[t[0]+a*r[0]+i[0],t[1]],[e[0]-a*r[1]+i[1],e[1]]]}}Gh.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Vh extends fo{constructor(t){super(fr({style:Vh.defaultStyleProps},t))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(t){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(t);const e=_r(this.ref),r=this.sourceNode.getIntersectPoint(e,!0),i=this.targetNode.getIntersectPoint(e);return[r,i]}toRadialCoordinate(t){const e=_r(this.ref),r=Bi(t,e),i=OU(Mn(t,e));return[r,i]}getControlPoints(t,e,r,i){const[a,o]=this.toRadialCoordinate(t),[s]=this.toRadialCoordinate(e),u=s-a;return[[t[0]+(u*r[0]+i[0])*Math.cos(o),t[1]+(u*r[0]+i[0])*Math.sin(o)],[e[0]-(u*r[1]-i[0])*Math.cos(o),e[1]-(u*r[1]-i[0])*Math.sin(o)]]}}Vh.defaultStyleProps={curvePosition:.5,curveOffset:20};class Uh extends fo{constructor(t){super(fr({style:Uh.defaultStyleProps},t))}getControlPoints(t,e,r,i){const a=e[1]-t[1];return[[t[0],t[1]+a*r[0]+i[0]],[e[0],e[1]-a*r[1]+i[1]]]}}Uh.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Wh extends Sa{constructor(t){super(fr({style:Wh.defaultStyleProps},t))}getKeyPath(t){const[e,r]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",r[0],r[1]]]}}Wh.defaultStyleProps={};const hY={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:uh},Pi=n=>`${Math.round(n[0])}|||${Math.round(n[1])}`;function qa(n,t){const e=r=>Math.round(r/t);return Xt(n)?e(n):n.map(e)}function dY(n,t){const e=Math.abs(n-t);return e>Math.PI?2*Math.PI-e:e}function mk(n,t){const e=t[0]-n[0],r=t[1]-n[1];return!e&&!r?0:Math.atan2(r,e)}function xO(n,t,e,r){const i=mk(n,t),a=e[Pi(n)],o=mk(a||r,n);return dY(o,i)}const fY=(n,t)=>{const{offset:e,gridSize:r}=t,i={};return n.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const o=Aa(a.getRenderBounds(),e);for(let s=qa(o.min[0],r);s<=qa(o.max[0],r);s+=1)for(let u=qa(o.min[1],r);u<=qa(o.max[1],r);u+=1)i[`${s}|||${u}`]=!0}),i};function yk(n,t,e){return Math.min(...t.map(r=>e(n,r)))}function pY(n,t,e){let r=n[0],i=e(n[0],t);for(let a=0;a<n.length;a++){const o=n[a],s=e(o,t);s<i&&(r=o,i=s)}return r}const bk=(n,t,e,r)=>{if(!t)return[n];const{directionMap:i,offset:a}=r,o=Aa(t.getRenderBounds(),a),s=Object.keys(i).reduce((u,c)=>{if(e.includes(c)){const l=i[c],[d,p]=zu(o),g=[n[0]+l.stepX*d,n[1]+l.stepY*p],m=cU(o);for(let y=0;y<m.length;y++){const v=X_([n,g],m[y]);v&&F_(v,o)&&u.push(v)}}return u},[]);return Xr(n,o)||s.push(n),s.map(u=>qa(u,r.gridSize))},gY=(n,t,e,r,i,a,o)=>{const s=[];let u=[a[0]===r[0]?r[0]:n[0]*o,a[1]===r[1]?r[1]:n[1]*o];s.unshift(u);let c=n,l=t[Pi(c)];for(;l;){const g=l,m=c;xO(g,m,t,e)&&(u=[g[0]===m[0]?u[0]:g[0]*o,g[1]===m[1]?u[1]:g[1]*o],s.unshift(u)),l=t[Pi(g)],c=g}const d=i.map(g=>[g[0]*o,g[1]*o]),p=pY(d,u,uh);return s.unshift(p),s};function vY(n,t,e,r){const i=ch(n.getCenter()),a=ch(t.getCenter()),o=Object.assign(hY,r),{gridSize:s}=o,u=o.enableObstacleAvoidance?e:[n,t],c=fY(u,o),l=qa(i,s),d=qa(a,s),p=bk(i,n,o.startDirections,o),g=bk(a,t,o.endDirections,o);p.forEach(T=>delete c[Pi(T)]),g.forEach(T=>delete c[Pi(T)]);const m={},y={},v={},x={},E={},w=new mY;for(let T=0;T<p.length;T++){const O=p[T],M=Pi(O);m[M]=O,x[M]=0,E[M]=yk(O,g,o.distFunc),w.add({id:M,value:E[M]})}const S=g.map(T=>Pi(T));let k=o.maximumLoops,A,N=1/0;for(const[T,O]of Object.entries(m))E[T]<=N&&(N=E[T],A=O);for(;Object.keys(m).length>0&&k>0;){const T=w.minId(!1);if(T)A=m[T];else break;const O=Pi(A);if(S.includes(O))return gY(A,v,l,a,p,d,s);delete m[O],w.remove(O),y[O]=!0;for(const M of Object.values(o.directionMap)){const P=rn(A,[M.stepX,M.stepY]),L=Pi(P);if(y[L])continue;const j=xO(A,P,v,l);if(j>o.maxAllowedDirectionChange||c[L])continue;m[L]||(m[L]=P);const z=o.penalties[j],U=o.distFunc(A,P)+(isNaN(z)?s:z),J=x[O]+U,W=x[L];W&&J>=W||(v[L]=A,x[L]=J,E[L]=J+yk(P,g,o.distFunc),w.add({id:L,value:E[L]}))}k-=1}return[]}class mY{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let r=0,i=e-1;for(;i-r>1;){const a=Math.floor((r+i)/2);if(this.arr[a].value>t.value)i=a;else if(this.arr[a].value<t.value)r=a;else{this.arr.splice(a,0,t),this.map[t.id]=!0;return}}this.arr.splice(i,0,t),this.map[t.id]=!0}add(t){delete this.map[t.id];const e=this.arr.length;if(!e||this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)}remove(t){this.map[t]&&delete this.map[t]}_clearAndGetMinId(){let t;for(let e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t}_findFirstId(){for(;this.arr.length;){const t=this.arr.shift();if(this.map[t.id])return t.id}}minId(t){return t?this._clearAndGetMinId():this._findFirstId()}}class Yh extends Sa{constructor(t){super(fr({style:Yh.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:r,targetNode:i}=this,[a,o]=this.getEndpoints(t,!1);let s=[];if(!e)s=t.controlPoints;else if(e.type==="shortest-path"){const u=this.context.element.getNodes();s=vY(r,i,u,e),s.length||(s=dk(a,o,r,i,t.controlPoints,{padding:e.offset}))}else e.type==="orth"&&(s=dk(a,o,r,i,t.controlPoints,e));return s}getPoints(t){const e=this.getControlPoints(t),[r,i]=this.getEndpoints(t,!0,e);return[r,...e,i]}getKeyPath(t){const e=this.getPoints(t);return mO(e,t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:r,radius:i}=t,a=this.sourceNode,o=ca(a),s=Math.max(Fi(o),Gi(o))/4,{placement:u,clockwise:c,dist:l=s}=Cn(this.getGraphicStyle(t),"loop");return tY(a,i,u,c,l,e,r)}}Yh.defaultStyleProps={radius:0,controlPoints:[],router:!1};class $h extends Sa{constructor(t){super(fr({style:$h.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:r}=t,[i,a]=this.getEndpoints(t),o=t.controlPoint||Y1(i,a,e,r);return qW(i,a,o)}}$h.defaultStyleProps={curvePosition:.5,curveOffset:30};var yY=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function Vu(n){return n instanceof ys&&n.type==="node"}function EO(n){return n instanceof Sa}function Bb(n){return n instanceof Fh}function bY(n){return Vu(n)||EO(n)||Bb(n)}function xY(n,t){return!n||!t?!1:n===t}const EY={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],"left-top":[0,0],"top-left":[0,0],"left-bottom":[0,1],"bottom-left":[0,1],"right-top":[1,0],"top-right":[1,0],"right-bottom":[1,1],"bottom-right":[1,1],default:[.5,.5]};function wY(n,t,e=EY,r=!0){const i=[.5,.5],a=fe(t)?lr(e,t.toLocaleLowerCase(),i):t;if(!r&&fe(t))return a;const[o,s]=a||i;return[n.min[0]+Fi(n)*o,n.min[1]+Gi(n)*s]}function zb(n){if(!n)return{};const t=n.getPorts();return(n.attributes.ports||[]).forEach((e,r)=>{var i;const{key:a,placement:o}=e;wO(e)&&(t[i=a||r]||(t[i]=aa(n.getShape("key").getBounds(),o)))}),t}function wO(n){const{r:t}=n;return!t||Number(t)===0}function Ea(n){return ss(n)?n:n.getPosition()}function kY(n,t,e,r){const i=xk(n,t,e,r),a=xk(t,n,r,e);return[i,a]}function xk(n,t,e,r){const i=zb(n);if(e)return i[e];const a=Object.values(i);if(a.length===0)return;const o=a.map(c=>Ea(c)),s=AY(t,r),[u]=zU(o,s);return a.find(c=>Ea(c)===u)}function AY(n,t){const e=zb(n);if(t)return[Ea(e[t])];const r=Object.values(e);return r.length>0?r.map(i=>Ea(i)):[n.getCenter()]}function Ek(n,t){return Bb(n)||Vu(n)?$1(n,t):Mu(n,t)}function Mu(n,t){if(!n||!t)return[0,0,0];if(ss(n))return n;if(n.attributes.linkToCenter)return n.getPosition();const e=ss(t)?t:Vu(t)?t.getCenter():t.getPosition();return J_(e,n.getBounds())}function $1(n,t){if(!n||!t)return[0,0,0];const e=ss(t)?t:Vu(t)?t.getCenter():t.getPosition();return n.getIntersectPoint(e)||n.getCenter()}function wk(n,t="bottom",e=0,r=0,i=!1){const a=t.split("-"),[o,s]=aa(n,t),[u,c]=i?["bottom","top"]:["top","bottom"],l=a.includes("top")?c:a.includes("bottom")?u:"middle",d=a.includes("left")?"right":a.includes("right")?"left":"center";return{transform:[["translate",o+e,s+r]],textBaseline:l,textAlign:d}}function SY(n,t){const{zIndex:e,transform:r,transformOrigin:i,visibility:a,cursor:o,clipPath:s,component:u}=t,c=yY(t,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(n.attributes,c),r&&n.setAttribute("transform",r),Xt(e)&&n.setAttribute("zIndex",e),i&&n.setAttribute("transformOrigin",i),a&&n.setAttribute("visibility",a),o&&n.setAttribute("cursor",o),s&&n.setAttribute("clipPath",s),u&&n.setAttribute("component",u)}function H1(n,t){"update"in n?n.update(t):n.attr(t)}function CY(n){Xl(n,"__to_be_destroyed__",!0)}function Uu(n){return lr(n,"__to_be_destroyed__",!1)}var NY=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class _u extends bi{constructor(t,e){super(t,Object.assign({},_u.defaultOptions,e)),this.onCollapseExpand=r=>NY(this,void 0,void 0,function*(){if(!this.validate(r))return;const{target:i}=r;if(!bY(i))return;const a=i.id,{model:o,graph:s}=this.context,u=o.getElementDataById(a);if(!u)return!1;const{onCollapse:c,onExpand:l,animation:d,align:p}=this.options;ba(u)?(yield s.expandElement(a,{animation:d,align:p}),l==null||l(a)):(yield s.collapseElement(a,{animation:d,align:p}),c==null||c(a))}),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`node:${e}`,this.onCollapseExpand),t.on(`combo:${e}`,this.onCollapseExpand)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`node:${e}`,this.onCollapseExpand),t.off(`combo:${e}`,this.onCollapseExpand)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}_u.defaultOptions={enable:!0,animation:!0,trigger:st.DBLCLICK,align:!0};var kk=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Hh extends bi{constructor(t,e){super(t,Object.assign({},Hh.defaultOptions,e)),this.isDragging=!1,this.onDragStart=r=>{this.validate(r)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=r=>{var i,a,o,s;if(!this.isDragging||We.isPinching)return;const u=(a=(i=r.movement)===null||i===void 0?void 0:i.x)!==null&&a!==void 0?a:r.dx,c=(s=(o=r.movement)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:r.dy;(u|c)!==0&&this.translate([u,c],!1)},this.onDragEnd=()=>{var r,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(r=this.options).onFinish)===null||i===void 0||i.call(r)},this.invokeOnFinish=_h(()=>{var r,i;(i=(r=this.options).onFinish)===null||i===void 0||i.call(r)},300),this.shortcut=new Ih(t.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(An(t)){const{up:e=[],down:r=[],left:i=[],right:a=[]}=t;this.shortcut.bind(e,o=>this.onTranslate([0,1],o)),this.shortcut.bind(r,o=>this.onTranslate([0,-1],o)),this.shortcut.bind(i,o=>this.onTranslate([1,0],o)),this.shortcut.bind(a,o=>this.onTranslate([-1,0],o))}else{const{graph:e}=this.context;e.on(st.DRAG_START,this.onDragStart),e.on(st.DRAG,this.onDrag),e.on(st.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return kk(this,void 0,void 0,function*(){if(!this.validate(e))return;const{sensitivity:r}=this.options,i=r*-1;yield this.translate(us(t,i),this.options.animation),this.invokeOnFinish()})}translate(t,e){return kk(this,void 0,void 0,function*(){t=this.clampByDirection(t),t=this.clampByRange(t),t=this.clampByRotation(t),yield this.context.graph.translateBy(t,e)})}clampByRotation([t,e]){const r=this.context.graph.getRotation();return $_([t,e],r)}clampByDirection([t,e]){const{direction:r}=this.options;return r==="x"?e=0:r==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:r,canvas:i}=this.context,[a,o]=i.getSize(),[s,u,c,l]=zi(this.options.range),d=[o*s,a*u,o*c,a*l],p=Aa(Rb(r.getCanvasCenter()),d),g=Mn(r.getViewportCenter(),[t,e,0]);if(!Xr(g,p)){const{min:[m,y],max:[v,x]}=p;(g[0]<m&&t>0||g[0]>v&&t<0)&&(t=0),(g[1]<y&&e>0||g[1]>x&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return typeof e=="function"?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(st.DRAG_START,this.onDragStart),t.off(st.DRAG,this.onDrag),t.off(st.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Hh.defaultOptions={enable:n=>"targetType"in n?n.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var Ak=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Xh extends bi{constructor(t,e){super(t,Object.assign({},Xh.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=r=>Ak(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:o}=this.context,s=r.target.id;this.target.forEach(u=>{const c=a.getParentData(u,me);c&&Z(c)===s&&a.refreshComboData(s),a.setParent(u,s,me)}),yield(i=o==null?void 0:o.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=r=>{if(this.isDragging)return;const{type:i}=r,{canvas:a}=this.context,{cursor:o}=this.options;i===st.POINTER_ENTER?a.setCursor((o==null?void 0:o.grab)||"grab"):a.setCursor((o==null?void 0:o.default)||"default")},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t,canvas:e}=this.context,r=e.getLayer().getContextService().$canvas;r&&(r.addEventListener("blur",this.onDragEnd),r.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.on(`${i}:${st.DRAG_START}`,this.onDragStart),t.on(`${i}:${st.DRAG}`,this.onDrag),t.on(`${i}:${st.DRAG_END}`,this.onDragEnd),t.on(`${i}:${st.POINTER_ENTER}`,this.setCursor),t.on(`${i}:${st.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(t.on(j1.DROP,this.onDrop),t.on(Nu.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return sh([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:r,canvas:i,graph:a}=this.context;i.setCursor(((e=this.options.cursor)===null||e===void 0?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,r.startBatch();const o=t.target.id;a.getElementState(o).includes(this.options.state)?this.target=this.getSelectedNodeIDs([o]):this.target=[o],this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.options.shadow?this.moveShadow(e):this.moveElement(this.target,e)}onDragEnd(){var t,e,r;if(!this.enable)return;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:o=0,y:s=0}=this.shadow.attributes,[u,c]=Mn([+o,+s],this.shadowOrigin);this.moveElement(this.target,[u,c])}this.showEdges(),(e=(t=this.options).onFinish)===null||e===void 0||e.call(t,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((r=this.options.cursor)===null||r===void 0?void 0:r.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed||Uu(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}clampByRotation([t,e]){const r=this.context.graph.getRotation();return $_([t,e],r)}moveElement(t,e){return Ak(this,void 0,void 0,function*(){const{graph:r,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&t.forEach(o=>i.refreshComboData(o)),r.translateElementBy(Object.fromEntries(t.map(o=>[o,this.clampByRotation(e)])),!1)})}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:r=0}=this.shadow.attributes,[i,a]=t;this.shadow.attr({x:+e+i,y:+r+a})}createShadow(t){const e=Cn(this.options,"shadow"),r=Fu(t.map(c=>this.context.element.getElement(c).getBounds())),[i,a]=r.min;this.shadowOrigin=[i,a];const[o,s]=zu(r),u={width:o,height:s,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),u),{visibility:"visible"})):(this.shadow=new vs({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),u),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if(t==="none"||e)return;const{graph:r}=this.context;t==="all"?this.hiddenEdges=r.getEdgeData().map(Z):this.hiddenEdges=Array.from(new Set(this.target.map(i=>r.getRelatedEdgesData(i,t).map(Z)).flat())),r.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:t,canvas:e}=this.context,r=e.getLayer().getContextService().$canvas;r&&(r.removeEventListener("blur",this.onDragEnd),r.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.off(`${i}:${st.DRAG_START}`,this.onDragStart),t.off(`${i}:${st.DRAG}`,this.onDrag),t.off(`${i}:${st.DRAG_END}`,this.onDragEnd),t.off(`${i}:${st.POINTER_ENTER}`,this.setCursor),t.off(`${i}:${st.POINTER_LEAVE}`,this.setCursor)}),t.off(`combo:${st.DROP}`,this.onDrop),t.off(`canvas:${st.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),(t=this.shadow)===null||t===void 0||t.destroy(),super.destroy()}}Xh.defaultOptions={animation:!0,enable:n=>["node","combo"].includes(n.targetType),dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var TY="*",Fb=(function(){function n(){this._events={}}return n.prototype.on=function(t,e,r){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!r}),this},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.emit=function(t){for(var e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=this._events[t]||[],o=this._events[TY]||[],s=function(u){for(var c=u.length,l=0;l<c;l++)if(u[l]){var d=u[l],p=d.callback,g=d.once;g&&(u.splice(l,1),u.length===0&&delete e._events[t],c--,l--),p.apply(e,r)}};s(a),s(o)},n.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var r=this._events[t]||[],i=r.length,a=0;a<i;a++)r[a].callback===e&&(r.splice(a,1),i--,a--);r.length===0&&delete this._events[t]}return this},n.prototype.getEvents=function(){return this._events},n})();function X1(n,t,e,r){for(;n.length;){const i=n.shift();if(e(i))return!0;t.add(i.id),r(i.id).forEach(a=>{t.has(a.id)||(t.add(a.id),n.push(a))})}return!1}function vh(n,t,e,r){if(e(n))return!0;t.add(n.id);for(const i of r(n.id))if(!t.has(i.id)&&vh(i,t,e,r))return!0;return!1}const Sk=()=>!0;class MY{constructor(t){Te(this,"graph"),Te(this,"nodeFilter"),Te(this,"edgeFilter"),Te(this,"cacheEnabled"),Te(this,"inEdgesMap",new Map),Te(this,"outEdgesMap",new Map),Te(this,"bothEdgesMap",new Map),Te(this,"allNodesMap",new Map),Te(this,"allEdgesMap",new Map),Te(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()}),Te(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(i=>i.id))}),Te(this,"updateCache",i=>{const a=new Set;i.forEach(o=>{const s=this.bothEdgesMap.get(o);if(s&&s.forEach(u=>a.add(u.id)),!this.hasNode(o))this.inEdgesMap.delete(o),this.outEdgesMap.delete(o),this.bothEdgesMap.delete(o),this.allNodesMap.delete(o);else{const u=this.graph.getRelatedEdges(o,"in").filter(this.edgeFilter),c=this.graph.getRelatedEdges(o,"out").filter(this.edgeFilter),l=Array.from(new Set([...u,...c]));l.forEach(d=>a.add(d.id)),this.inEdgesMap.set(o,u),this.outEdgesMap.set(o,c),this.bothEdgesMap.set(o,l),this.allNodesMap.set(o,this.graph.getNode(o))}}),a.forEach(o=>{this.hasEdge(o)?this.allEdgesMap.set(o,this.graph.getEdge(o)):this.allEdgesMap.delete(o)})}),Te(this,"handleGraphChanged",i=>{const a=new Set;i.changes.forEach(o=>{switch(o.type){case"NodeAdded":a.add(o.value.id);break;case"NodeDataUpdated":a.add(o.id);break;case"EdgeAdded":a.add(o.value.source),a.add(o.value.target);break;case"EdgeUpdated":(o.propertyName==="source"||o.propertyName==="target")&&(a.add(o.oldValue),a.add(o.newValue));break;case"EdgeDataUpdated":if(i.graph.hasEdge(o.id)){const s=i.graph.getEdge(o.id);a.add(s.source),a.add(s.target)}break;case"EdgeRemoved":a.add(o.value.source),a.add(o.value.target);break;case"NodeRemoved":a.add(o.value.id);break}}),this.updateCache(a)}),this.graph=t.graph;const e=t.nodeFilter||Sk,r=t.edgeFilter||Sk;this.nodeFilter=e,this.edgeFilter=i=>{const{source:a,target:o}=this.graph.getEdgeDetail(i.id);return!e(a)||!e(o)?!1:r(i,a,o)},t.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):t.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}checkNodeExistence(t){this.getNode(t)}hasNode(t){if(!this.graph.hasNode(t))return!1;const e=this.graph.getNode(t);return this.nodeFilter(e)}areNeighbors(t,e){return this.checkNodeExistence(t),this.getNeighbors(e).some(r=>r.id===t)}getNode(t){const e=this.graph.getNode(t);if(!this.nodeFilter(e))throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){return this.checkNodeExistence(t),this.cacheEnabled?e==="in"?this.inEdgesMap.get(t):e==="out"?this.outEdgesMap.get(t):this.bothEdgesMap.get(t):this.graph.getRelatedEdges(t,e).filter(this.edgeFilter)}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const e=this.getRelatedEdges(t,"out").map(r=>this.getNode(r.target));return Array.from(new Set(e))}getPredecessors(t){const e=this.getRelatedEdges(t,"in").map(r=>this.getNode(r.source));return Array.from(new Set(e))}getNeighbors(t){const e=this.getPredecessors(t),r=this.getSuccessors(t);return Array.from(new Set([...e,...r]))}hasEdge(t){if(!this.graph.hasEdge(t))return!1;const e=this.graph.getEdge(t);return this.edgeFilter(e)}getEdge(t){const e=this.graph.getEdge(t);if(!this.edgeFilter(e))throw new Error("Edge not found for id: "+t);return e}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}hasTreeStructure(t){return this.graph.hasTreeStructure(t)}getRoots(t){return this.graph.getRoots(t).filter(this.nodeFilter)}getChildren(t,e){return this.checkNodeExistence(t),this.graph.getChildren(t,e).filter(this.nodeFilter)}getParent(t,e){this.checkNodeExistence(t);const r=this.graph.getParent(t,e);return!r||!this.nodeFilter(r)?null:r}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];X1([this.getNode(t)],new Set,e,i)}dfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];vh(this.getNode(t),new Set,e,i)}}let qh=class kO extends Fb{constructor(t){super(),Te(this,"nodeMap",new Map),Te(this,"edgeMap",new Map),Te(this,"inEdgesMap",new Map),Te(this,"outEdgesMap",new Map),Te(this,"bothEdgesMap",new Map),Te(this,"treeIndices",new Map),Te(this,"changes",[]),Te(this,"batchCount",0),Te(this,"onChanged",()=>{}),Te(this,"batch",e=>{this.batchCount+=1,e(),this.batchCount-=1,this.batchCount||this.commit()}),t&&(t.nodes&&this.addNodes(t.nodes),t.edges&&this.addEdges(t.edges),t.tree&&this.addTree(t.tree),t.onChanged&&(this.onChanged=t.onChanged))}commit(){const t=this.changes;this.changes=[];const e={graph:this,changes:t};this.emit("changed",e),this.onChanged(e)}reduceChanges(t){let e=[];return t.forEach(r=>{switch(r.type){case"NodeRemoved":{let i=!1;e=e.filter(a=>{if(a.type==="NodeAdded"){const o=a.value.id===r.value.id;return o&&(i=!0),!o}else{if(a.type==="NodeDataUpdated")return a.id!==r.value.id;if(a.type==="TreeStructureChanged")return a.nodeId!==r.value.id}return!0}),i||e.push(r);break}case"EdgeRemoved":{let i=!1;e=e.filter(a=>{if(a.type==="EdgeAdded"){const o=a.value.id===r.value.id;return o&&(i=!0),!o}else if(a.type==="EdgeDataUpdated"||a.type==="EdgeUpdated")return a.id!==r.value.id;return!0}),i||e.push(r);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const i=e.findIndex(o=>o.type===r.type&&o.id===r.id&&(r.propertyName===void 0||o.propertyName===r.propertyName)),a=e[i];a?r.propertyName!==void 0?a.newValue=r.newValue:(e.splice(i,1),e.push(r)):e.push(r);break}case"TreeStructureDetached":{e=e.filter(i=>i.type==="TreeStructureAttached"||i.type==="TreeStructureChanged"?i.treeKey!==r.treeKey:!0),e.push(r);break}case"TreeStructureChanged":{const i=e.find(a=>a.type==="TreeStructureChanged"&&a.treeKey===r.treeKey&&a.nodeId===r.nodeId);i?i.newParentId=r.newParentId:e.push(r);break}default:e.push(r);break}}),e}checkNodeExistence(t){this.getNode(t)}hasNode(t){return this.nodeMap.has(t)}areNeighbors(t,e){return this.getNeighbors(e).some(r=>r.id===t)}getNode(t){const e=this.nodeMap.get(t);if(!e)throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){if(this.checkNodeExistence(t),e==="in"){const r=this.inEdgesMap.get(t);return Array.from(r)}else if(e==="out"){const r=this.outEdgesMap.get(t);return Array.from(r)}else{const r=this.bothEdgesMap.get(t);return Array.from(r)}}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const e=this.getRelatedEdges(t,"out").map(r=>this.getNode(r.target));return Array.from(new Set(e))}getPredecessors(t){const e=this.getRelatedEdges(t,"in").map(r=>this.getNode(r.source));return Array.from(new Set(e))}getNeighbors(t){const e=this.getPredecessors(t),r=this.getSuccessors(t);return Array.from(new Set([...e,...r]))}doAddNode(t){if(this.hasNode(t.id))throw new Error("Node already exists: "+t.id);this.nodeMap.set(t.id,t),this.inEdgesMap.set(t.id,new Set),this.outEdgesMap.set(t.id,new Set),this.bothEdgesMap.set(t.id,new Set),this.treeIndices.forEach(e=>{e.childrenMap.set(t.id,new Set)}),this.changes.push({type:"NodeAdded",value:t})}addNodes(t){this.batch(()=>{for(const e of t)this.doAddNode(e)})}addNode(t){this.addNodes([t])}doRemoveNode(t){var r;const e=this.getNode(t);(r=this.bothEdgesMap.get(t))==null||r.forEach(i=>this.doRemoveEdge(i.id)),this.nodeMap.delete(t),this.treeIndices.forEach(i=>{var o,s;(o=i.childrenMap.get(t))==null||o.forEach(u=>{i.parentMap.delete(u.id)});const a=i.parentMap.get(t);a&&((s=i.childrenMap.get(a.id))==null||s.delete(e)),i.parentMap.delete(t),i.childrenMap.delete(t)}),this.bothEdgesMap.delete(t),this.inEdgesMap.delete(t),this.outEdgesMap.delete(t),this.changes.push({type:"NodeRemoved",value:e})}removeNodes(t){this.batch(()=>{t.forEach(e=>this.doRemoveNode(e))})}removeNode(t){this.removeNodes([t])}updateNodeDataProperty(t,e,r){const i=this.getNode(t);this.batch(()=>{const a=i.data[e],o=r;i.data[e]=o,this.changes.push({type:"NodeDataUpdated",id:t,propertyName:e,oldValue:a,newValue:o})})}mergeNodeData(t,e){this.batch(()=>{Object.entries(e).forEach(([r,i])=>{this.updateNodeDataProperty(t,r,i)})})}updateNodeData(...t){const e=t[0],r=this.getNode(e);if(typeof t[1]=="string"){this.updateNodeDataProperty(e,t[1],t[2]);return}let i;if(typeof t[1]=="function"){const a=t[1];i=a(r.data)}else typeof t[1]=="object"&&(i=t[1]);this.batch(()=>{const a=r.data,o=i;r.data=i,this.changes.push({type:"NodeDataUpdated",id:e,oldValue:a,newValue:o})})}checkEdgeExistence(t){if(!this.hasEdge(t))throw new Error("Edge not found for id: "+t)}hasEdge(t){return this.edgeMap.has(t)}getEdge(t){return this.checkEdgeExistence(t),this.edgeMap.get(t)}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}doAddEdge(t){if(this.hasEdge(t.id))throw new Error("Edge already exists: "+t.id);this.checkNodeExistence(t.source),this.checkNodeExistence(t.target),this.edgeMap.set(t.id,t);const e=this.inEdgesMap.get(t.target),r=this.outEdgesMap.get(t.source),i=this.bothEdgesMap.get(t.source),a=this.bothEdgesMap.get(t.target);e.add(t),r.add(t),i.add(t),a.add(t),this.changes.push({type:"EdgeAdded",value:t})}addEdges(t){this.batch(()=>{for(const e of t)this.doAddEdge(e)})}addEdge(t){this.addEdges([t])}doRemoveEdge(t){const e=this.getEdge(t),r=this.outEdgesMap.get(e.source),i=this.inEdgesMap.get(e.target),a=this.bothEdgesMap.get(e.source),o=this.bothEdgesMap.get(e.target);r.delete(e),i.delete(e),a.delete(e),o.delete(e),this.edgeMap.delete(t),this.changes.push({type:"EdgeRemoved",value:e})}removeEdges(t){this.batch(()=>{t.forEach(e=>this.doRemoveEdge(e))})}removeEdge(t){this.removeEdges([t])}updateEdgeSource(t,e){const r=this.getEdge(t);this.checkNodeExistence(e);const i=r.source,a=e;this.outEdgesMap.get(i).delete(r),this.bothEdgesMap.get(i).delete(r),this.outEdgesMap.get(a).add(r),this.bothEdgesMap.get(a).add(r),r.source=e,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"source",oldValue:i,newValue:a})})}updateEdgeTarget(t,e){const r=this.getEdge(t);this.checkNodeExistence(e);const i=r.target,a=e;this.inEdgesMap.get(i).delete(r),this.bothEdgesMap.get(i).delete(r),this.inEdgesMap.get(a).add(r),this.bothEdgesMap.get(a).add(r),r.target=e,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"target",oldValue:i,newValue:a})})}updateEdgeDataProperty(t,e,r){const i=this.getEdge(t);this.batch(()=>{const a=i.data[e],o=r;i.data[e]=o,this.changes.push({type:"EdgeDataUpdated",id:t,propertyName:e,oldValue:a,newValue:o})})}updateEdgeData(...t){const e=t[0],r=this.getEdge(e);if(typeof t[1]=="string"){this.updateEdgeDataProperty(e,t[1],t[2]);return}let i;if(typeof t[1]=="function"){const a=t[1];i=a(r.data)}else typeof t[1]=="object"&&(i=t[1]);this.batch(()=>{const a=r.data,o=i;r.data=i,this.changes.push({type:"EdgeDataUpdated",id:e,oldValue:a,newValue:o})})}mergeEdgeData(t,e){this.batch(()=>{Object.entries(e).forEach(([r,i])=>{this.updateEdgeDataProperty(t,r,i)})})}checkTreeExistence(t){if(!this.hasTreeStructure(t))throw new Error("Tree structure not found for treeKey: "+t)}hasTreeStructure(t){return this.treeIndices.has(t)}attachTreeStructure(t){this.treeIndices.has(t)||(this.treeIndices.set(t,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:t})}))}detachTreeStructure(t){this.checkTreeExistence(t),this.treeIndices.delete(t),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:t})})}addTree(t,e){this.batch(()=>{this.attachTreeStructure(e);const r=[],i=Array.isArray(t)?t:[t];for(;i.length;){const a=i.shift();r.push(a),a.children&&i.push(...a.children)}this.addNodes(r),r.forEach(a=>{var o;(o=a.children)==null||o.forEach(s=>{this.setParent(s.id,a.id,e)})})})}getRoots(t){return this.checkTreeExistence(t),this.getAllNodes().filter(e=>!this.getParent(e.id,t))}getChildren(t,e){this.checkNodeExistence(t),this.checkTreeExistence(e);const r=this.treeIndices.get(e).childrenMap.get(t);return Array.from(r||[])}getParent(t,e){return this.checkNodeExistence(t),this.checkTreeExistence(e),this.treeIndices.get(e).parentMap.get(t)||null}getAncestors(t,e){const r=[];let i=this.getNode(t),a;for(;a=this.getParent(i.id,e);)r.push(a),i=a;return r}setParent(t,e,r){var c,l;this.checkTreeExistence(r);const i=this.treeIndices.get(r);if(!i)return;const a=this.getNode(t),o=i.parentMap.get(t);if((o==null?void 0:o.id)===e)return;if(e==null){o&&((c=i.childrenMap.get(o.id))==null||c.delete(a)),i.parentMap.delete(t);return}const s=this.getNode(e);i.parentMap.set(t,s),o&&((l=i.childrenMap.get(o.id))==null||l.delete(a));let u=i.childrenMap.get(s.id);u||(u=new Set,i.childrenMap.set(s.id,u)),u.add(a),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:r,nodeId:t,oldParentId:o==null?void 0:o.id,newParentId:s.id})})}dfsTree(t,e,r){const i=a=>this.getChildren(a,r);return vh(this.getNode(t),new Set,e,i)}bfsTree(t,e,r){const i=a=>this.getChildren(a,r);return X1([this.getNode(t)],new Set,e,i)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];return X1([this.getNode(t)],new Set,e,i)}dfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];return vh(this.getNode(t),new Set,e,i)}clone(){const t=this.getAllNodes().map(i=>({...i,data:{...i.data}})),e=this.getAllEdges().map(i=>({...i,data:{...i.data}})),r=new kO({nodes:t,edges:e});return this.treeIndices.forEach(({parentMap:i,childrenMap:a},o)=>{const s=new Map;i.forEach((c,l)=>{s.set(l,r.getNode(c.id))});const u=new Map;a.forEach((c,l)=>{u.set(l,new Set(Array.from(c).map(d=>r.getNode(d.id))))}),r.treeIndices.set(o,{parentMap:s,childrenMap:u})}),r}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(t){return new MY({graph:this,...t})}};class AO{constructor(t,e){this.context=t,this.options=e||{}}}var _Y=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})},OY=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function PY(n){const{type:t}=n;return["compact-box","mindmap","dendrogram","indented"].includes(t)}function RY(n){return!Array.isArray(n)&&(n==null?void 0:n.preLayout)}function Rl(n){const{nodes:t,edges:e}=n,r={nodes:[],edges:[],combos:[]};return t.forEach(i=>{const a=i.data._isCombo?r.combos:r.nodes,{x:o,y:s,z:u=0}=i.data;a==null||a.push({id:i.id,style:{x:o,y:s,z:u}})}),e.forEach(i=>{const{id:a,source:o,target:s,data:{points:u=[],controlPoints:c=u.slice(1,u.length-1)}}=i;r.edges.push({id:a,source:o,target:s,style:Object.assign({},c!=null&&c.length?{controlPoints:c.map(oi)}:{})})}),r}function DY(n,t){class e extends AO{constructor(i,a){if(super(i,a),this.instance=new n({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const o=this.instance;this.stop=o.stop.bind(o),this.tick=s=>{const u=o.tick(s);return Rl(u)}}}execute(i,a){return _Y(this,void 0,void 0,function*(){return Rl(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions(ma({},this.options,a))))})}transformOptions(i){if(!("onTick"in i))return i;const a=i.onTick;return i.onTick=o=>a(Rl(o)),i}graphData2LayoutModel(i){const{nodes:a=[],edges:o=[],combos:s=[]}=i,u=a.map(g=>{const m=Z(g),{data:y,style:v,combo:x}=g,E=OY(g,["data","style","combo"]),w={id:m,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},y),{data:y}),x?{parentId:x}:{}),{style:v}),E)};return v!=null&&v.x&&Object.assign(w.data,{x:v.x}),v!=null&&v.y&&Object.assign(w.data,{y:v.y}),v!=null&&v.z&&Object.assign(w.data,{z:v.z}),w}),c=new Map(u.map(g=>[g.id,g])),l=o.filter(g=>{const{source:m,target:y}=g;return c.has(m)&&c.has(y)}).map(g=>{const{source:m,target:y,data:v,style:x}=g;return{id:Z(g),source:m,target:y,data:Object.assign({},v),style:Object.assign({},x)}}),d=s.map(g=>({id:Z(g),data:Object.assign({_isCombo:!0},g.data),style:Object.assign({},g.style)})),p=new qh({nodes:[...u,...d],edges:l});return t.model.model.hasTreeStructure(me)&&(p.attachTreeStructure(me),u.forEach(g=>{const m=t.model.model.getParent(g.id,me);m&&p.hasNode(m.id)&&p.setParent(g.id,m.id,me)})),p}}return e}var LY=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Kh extends bi{constructor(t,e){super(t,Object.assign({},Kh.defaultOptions,e)),this.focus=r=>LY(this,void 0,void 0,function*(){if(!this.validate(r))return;const{graph:i}=this.context;yield i.focusElement(r.target.id,this.options.animation)}),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),so.forEach(e=>{t.on(`${e}:${st.CLICK}`,this.focus)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;so.forEach(e=>{t.off(`${e}:${st.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),super.destroy()}}Kh.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class Zh extends bi{constructor(t,e){super(t,Object.assign({},Zh.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=r=>{this.isFrozen=r.type==="dragstart"},this.hoverElement=r=>{if(!this.validate(r))return;const i=r.type===st.POINTER_ENTER;this.updateElementsState(r,i);const{onHover:a,onHoverEnd:o}=this.options;i?a==null||a(r):o==null||o(r)},this.updateElementsState=(r,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:o,animation:s,inactiveState:u}=this.options,c=this.getActiveIds(r),l={};if(o&&Object.assign(l,this.getElementsState(c,o,i)),u){const d=xU(a.getData(),!0).filter(p=>!c.includes(p));Object.assign(l,this.getElementsState(d,u,i))}a.setElementState(l,s)},this.getElementsState=(r,i,a)=>{const{graph:o}=this.context,s={};return r.forEach(u=>{const c=o.getElementState(u);a?s[u]=c.includes(i)?c:[...c,i]:s[u]=c.filter(l=>l!==i)}),s},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),so.forEach(r=>{t.on(`${r}:${st.POINTER_ENTER}`,this.hoverElement),t.on(`${r}:${st.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.addEventListener(`${st.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${st.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:r,direction:i}=this.options,a=t.target.id;return r?Q_(e,t.targetType,a,typeof r=="function"?r(t):r,i):[a]}validate(t){if(this.destroyed||this.isFrozen||Uu(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;so.forEach(r=>{t.off(`${r}:${st.POINTER_ENTER}`,this.hoverElement),t.off(`${r}:${st.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.removeEventListener(`${st.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${st.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}Zh.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class Jh extends bi{constructor(t,e){super(t,Object.assign({},Jh.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(r,i,a)=>{r.filter(Boolean).forEach(o=>{i==="hidden"&&!o.isVisible()?this.hiddenShapes.push(o):i==="visible"&&this.hiddenShapes.includes(o)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(o),1):oo(o,i,a)})},this.filterShapes=(r,i)=>{if(St(i))return o=>!i(r,o);const a=i==null?void 0:i[r];return o=>o.className?!(a!=null&&a.includes(o.className)):!0},this.hideShapes=r=>{if(!this.validate(r)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=_h(r=>{if(!this.validate(r)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(gt.BEFORE_TRANSFORM,this.hideShapes),t.on(gt.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(gt.BEFORE_TRANSFORM,this.hideShapes),t.off(gt.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Jh.defaultOptions={enable:!0,debounce:200,shapes:n=>n==="node"};var Ck=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Qh extends bi{constructor(t,e){super(t,Object.assign({},Qh.defaultOptions,e)),this.onWheel=r=>Ck(this,void 0,void 0,function*(){this.options.preventDefault&&r.preventDefault();const i=r.deltaX,a=r.deltaY;yield this.scroll([-i,-a],r)}),this.shortcut=new Ih(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:r}=this.options;if(this.shortcut.unbindAll(),An(r)){(t=this.graphDom)===null||t===void 0||t.removeEventListener(st.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:o=[],right:s=[]}=r;this.shortcut.bind(i,u=>this.scroll([0,-10],u)),this.shortcut.bind(a,u=>this.scroll([0,10],u)),this.shortcut.bind(o,u=>this.scroll([-10,0],u)),this.shortcut.bind(s,u=>this.scroll([10,0],u))}else(e=this.graphDom)===null||e===void 0||e.addEventListener(st.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=us(t,e),t=this.clampByDirection(t),t=this.clampByRange(t),t}clampByDirection([t,e]){const{direction:r}=this.options;return r==="x"?e=0:r==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:r,canvas:i}=this.context,[a,o]=i.getSize(),[s,u,c,l]=zi(this.options.range),d=[o*s,a*u,o*c,a*l],p=Aa(Rb(r.getCanvasCenter()),d),g=Mn(r.getViewportCenter(),[t,e,0]);if(!Xr(g,p)){const{min:[m,y],max:[v,x]}=p;(g[0]<m&&t>0||g[0]>v&&t<0)&&(t=0),(g[1]<y&&e>0||g[1]>x&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return Ck(this,void 0,void 0,function*(){if(!this.validate(e))return;const{onFinish:r}=this.options,i=this.context.graph,a=this.formatDisplacement(t);yield i.translateBy(a,!1),r==null||r()})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.graphDom)===null||t===void 0||t.removeEventListener(st.WHEEL,this.onWheel),super.destroy()}}Qh.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var Nk=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class td extends bi{constructor(t,e){super(t,Object.assign({},td.defaultOptions,e)),this.zoom=(r,i,a)=>Nk(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:o}=this.context;let s=this.options.origin;!s&&"viewport"in i&&(s=oi(i.viewport));const{sensitivity:u,onFinish:c}=this.options,l=1+dn(r,-50,50)*u/100,d=o.getZoom();yield o.zoomTo(d*l,a,s),c==null||c()}),this.onReset=()=>Nk(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=r=>{this.options.preventDefault&&r.preventDefault()},this.shortcut=new Ih(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(this.shortcut.unbindAll(),Array.isArray(t))if(t.includes(st.PINCH))this.shortcut.bind([st.PINCH],e=>{this.zoom(e.scale,e,!1)});else{const e=this.context.canvas.getContainer();e==null||e.addEventListener(st.WHEEL,this.preventDefault),this.shortcut.bind([...t,st.WHEEL],r=>{const{deltaX:i,deltaY:a}=r;this.zoom(-(a??i),r,!1)})}if(typeof t=="object"){const{zoomIn:e=[],zoomOut:r=[],reset:i=[]}=t;this.shortcut.bind(e,a=>this.zoom(10,a,this.options.animation)),this.shortcut.bind(r,a=>this.zoom(-10,a,this.options.animation)),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return St(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.context.canvas.getContainer())===null||t===void 0||t.removeEventListener(st.WHEEL,this.preventDefault),super.destroy()}}td.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};function SO(n){if(!n)return[0,0,0];if(Xt(n))return[n,n,n];if(n.length===0)return[0,0,0];const[t,e=t,r=t]=n;return[t,e,r]}function _p(n,t){let e;return St(t)?e=t:Xt(t)?e=()=>t:e=()=>n,e}const IY=(n,t,e=10)=>{let r;const i=typeof t=="function"?t:()=>t||0;return n?Array.isArray(n)?r=a=>n:St(n)?r=n:r=a=>n:r=a=>{var o,s,u;if(!((o=a.data)===null||o===void 0)&&o.bboxSize)return(s=a.data)===null||s===void 0?void 0:s.bboxSize;if(!((u=a.data)===null||u===void 0)&&u.size){const c=a.data.size;return Array.isArray(c)?c:An(c)?[c.width,c.height]:c}return e},a=>{const o=r(a),s=i(a);return Math.max(...SO(o))+s}};function jY(n){const t=+this._x.call(null,n),e=+this._y.call(null,n);return CO(this.cover(t,e),t,e,n)}function CO(n,t,e,r){if(isNaN(t)||isNaN(e))return n;var i,a=n._root,o={data:r},s=n._x0,u=n._y0,c=n._x1,l=n._y1,d,p,g,m,y,v,x,E;if(!a)return n._root=o,n;for(;a.length;)if((y=t>=(d=(s+c)/2))?s=d:c=d,(v=e>=(p=(u+l)/2))?u=p:l=p,i=a,!(a=a[x=v<<1|y]))return i[x]=o,n;if(g=+n._x.call(null,a.data),m=+n._y.call(null,a.data),t===g&&e===m)return o.next=a,i?i[x]=o:n._root=o,n;do i=i?i[x]=new Array(4):n._root=new Array(4),(y=t>=(d=(s+c)/2))?s=d:c=d,(v=e>=(p=(u+l)/2))?u=p:l=p;while((x=v<<1|y)===(E=(m>=p)<<1|g>=d));return i[E]=a,i[x]=o,n}function BY(n){var t,e,r=n.length,i,a,o=new Array(r),s=new Array(r),u=1/0,c=1/0,l=-1/0,d=-1/0;for(e=0;e<r;++e)isNaN(i=+this._x.call(null,t=n[e]))||isNaN(a=+this._y.call(null,t))||(o[e]=i,s[e]=a,i<u&&(u=i),i>l&&(l=i),a<c&&(c=a),a>d&&(d=a));if(u>l||c>d)return this;for(this.cover(u,c).cover(l,d),e=0;e<r;++e)CO(this,o[e],s[e],n[e]);return this}function zY(n,t){if(isNaN(n=+n)||isNaN(t=+t))return this;var e=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(e))i=(e=Math.floor(n))+1,a=(r=Math.floor(t))+1;else{for(var o=i-e||1,s=this._root,u,c;e>n||n>=i||r>t||t>=a;)switch(c=(t<r)<<1|n<e,u=new Array(4),u[c]=s,s=u,o*=2,c){case 0:i=e+o,a=r+o;break;case 1:e=i-o,a=r+o;break;case 2:i=e+o,r=a-o;break;case 3:e=i-o,r=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=a,this}function FY(){var n=[];return this.visit(function(t){if(!t.length)do n.push(t.data);while(t=t.next)}),n}function GY(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function jn(n,t,e,r,i){this.node=n,this.x0=t,this.y0=e,this.x1=r,this.y1=i}function VY(n,t,e){var r,i=this._x0,a=this._y0,o,s,u,c,l=this._x1,d=this._y1,p=[],g=this._root,m,y;for(g&&p.push(new jn(g,i,a,l,d)),e==null?e=1/0:(i=n-e,a=t-e,l=n+e,d=t+e,e*=e);m=p.pop();)if(!(!(g=m.node)||(o=m.x0)>l||(s=m.y0)>d||(u=m.x1)<i||(c=m.y1)<a))if(g.length){var v=(o+u)/2,x=(s+c)/2;p.push(new jn(g[3],v,x,u,c),new jn(g[2],o,x,v,c),new jn(g[1],v,s,u,x),new jn(g[0],o,s,v,x)),(y=(t>=x)<<1|n>=v)&&(m=p[p.length-1],p[p.length-1]=p[p.length-1-y],p[p.length-1-y]=m)}else{var E=n-+this._x.call(null,g.data),w=t-+this._y.call(null,g.data),S=E*E+w*w;if(S<e){var k=Math.sqrt(e=S);i=n-k,a=t-k,l=n+k,d=t+k,r=g.data}}return r}function UY(n){if(isNaN(l=+this._x.call(null,n))||isNaN(d=+this._y.call(null,n)))return this;var t,e=this._root,r,i,a,o=this._x0,s=this._y0,u=this._x1,c=this._y1,l,d,p,g,m,y,v,x;if(!e)return this;if(e.length)for(;;){if((m=l>=(p=(o+u)/2))?o=p:u=p,(y=d>=(g=(s+c)/2))?s=g:c=g,t=e,!(e=e[v=y<<1|m]))return this;if(!e.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(r=t,x=v)}for(;e.data!==n;)if(i=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,i?(a?i.next=a:delete i.next,this):t?(a?t[v]=a:delete t[v],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(r?r[x]=e:this._root=e),this):(this._root=a,this)}function WY(n){for(var t=0,e=n.length;t<e;++t)this.remove(n[t]);return this}function YY(){return this._root}function $Y(){var n=0;return this.visit(function(t){if(!t.length)do++n;while(t=t.next)}),n}function HY(n){var t=[],e,r=this._root,i,a,o,s,u;for(r&&t.push(new jn(r,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!n(r=e.node,a=e.x0,o=e.y0,s=e.x1,u=e.y1)&&r.length){var c=(a+s)/2,l=(o+u)/2;(i=r[3])&&t.push(new jn(i,c,l,s,u)),(i=r[2])&&t.push(new jn(i,a,l,c,u)),(i=r[1])&&t.push(new jn(i,c,o,s,l)),(i=r[0])&&t.push(new jn(i,a,o,c,l))}return this}function XY(n){var t=[],e=[],r;for(this._root&&t.push(new jn(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,u=r.x1,c=r.y1,l=(o+u)/2,d=(s+c)/2;(a=i[0])&&t.push(new jn(a,o,s,l,d)),(a=i[1])&&t.push(new jn(a,l,s,u,d)),(a=i[2])&&t.push(new jn(a,o,d,l,c)),(a=i[3])&&t.push(new jn(a,l,d,u,c))}e.push(r)}for(;r=e.pop();)n(r.node,r.x0,r.y0,r.x1,r.y1);return this}function qY(n){return n[0]}function KY(n){return arguments.length?(this._x=n,this):this._x}function ZY(n){return n[1]}function JY(n){return arguments.length?(this._y=n,this):this._y}function ed(n,t,e){var r=new Gb(t??qY,e??ZY,NaN,NaN,NaN,NaN);return n==null?r:r.addAll(n)}function Gb(n,t,e,r,i,a){this._x=n,this._y=t,this._x0=e,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Tk(n){for(var t={data:n.data},e=t;n=n.next;)e=e.next={data:n.data};return t}var Bn=ed.prototype=Gb.prototype;Bn.copy=function(){var n=new Gb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,r;if(!t)return n;if(!t.length)return n._root=Tk(t),n;for(e=[{source:t,target:n._root=new Array(4)}];t=e.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?e.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=Tk(r));return n};Bn.add=jY;Bn.addAll=BY;Bn.cover=zY;Bn.data=FY;Bn.extent=GY;Bn.find=VY;Bn.remove=UY;Bn.removeAll=WY;Bn.root=YY;Bn.size=$Y;Bn.visit=HY;Bn.visitAfter=XY;Bn.x=KY;Bn.y=JY;function QY(n){const t=+this._x.call(null,n),e=+this._y.call(null,n),r=+this._z.call(null,n);return NO(this.cover(t,e,r),t,e,r,n)}function NO(n,t,e,r,i){if(isNaN(t)||isNaN(e)||isNaN(r))return n;var a,o=n._root,s={data:i},u=n._x0,c=n._y0,l=n._z0,d=n._x1,p=n._y1,g=n._z1,m,y,v,x,E,w,S,k,A,N,T;if(!o)return n._root=s,n;for(;o.length;)if((S=t>=(m=(u+d)/2))?u=m:d=m,(k=e>=(y=(c+p)/2))?c=y:p=y,(A=r>=(v=(l+g)/2))?l=v:g=v,a=o,!(o=o[N=A<<2|k<<1|S]))return a[N]=s,n;if(x=+n._x.call(null,o.data),E=+n._y.call(null,o.data),w=+n._z.call(null,o.data),t===x&&e===E&&r===w)return s.next=o,a?a[N]=s:n._root=s,n;do a=a?a[N]=new Array(8):n._root=new Array(8),(S=t>=(m=(u+d)/2))?u=m:d=m,(k=e>=(y=(c+p)/2))?c=y:p=y,(A=r>=(v=(l+g)/2))?l=v:g=v;while((N=A<<2|k<<1|S)===(T=(w>=v)<<2|(E>=y)<<1|x>=m));return a[T]=o,a[N]=s,n}function t$(n){Array.isArray(n)||(n=Array.from(n));const t=n.length,e=new Float64Array(t),r=new Float64Array(t),i=new Float64Array(t);let a=1/0,o=1/0,s=1/0,u=-1/0,c=-1/0,l=-1/0;for(let d=0,p,g,m,y;d<t;++d)isNaN(g=+this._x.call(null,p=n[d]))||isNaN(m=+this._y.call(null,p))||isNaN(y=+this._z.call(null,p))||(e[d]=g,r[d]=m,i[d]=y,g<a&&(a=g),g>u&&(u=g),m<o&&(o=m),m>c&&(c=m),y<s&&(s=y),y>l&&(l=y));if(a>u||o>c||s>l)return this;this.cover(a,o,s).cover(u,c,l);for(let d=0;d<t;++d)NO(this,e[d],r[d],i[d],n[d]);return this}function e$(n,t,e){if(isNaN(n=+n)||isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,i=this._y0,a=this._z0,o=this._x1,s=this._y1,u=this._z1;if(isNaN(r))o=(r=Math.floor(n))+1,s=(i=Math.floor(t))+1,u=(a=Math.floor(e))+1;else{for(var c=o-r||1,l=this._root,d,p;r>n||n>=o||i>t||t>=s||a>e||e>=u;)switch(p=(e<a)<<2|(t<i)<<1|n<r,d=new Array(8),d[p]=l,l=d,c*=2,p){case 0:o=r+c,s=i+c,u=a+c;break;case 1:r=o-c,s=i+c,u=a+c;break;case 2:o=r+c,i=s-c,u=a+c;break;case 3:r=o-c,i=s-c,u=a+c;break;case 4:o=r+c,s=i+c,a=u-c;break;case 5:r=o-c,s=i+c,a=u-c;break;case 6:o=r+c,i=s-c,a=u-c;break;case 7:r=o-c,i=s-c,a=u-c;break}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=i,this._z0=a,this._x1=o,this._y1=s,this._z1=u,this}function n$(){var n=[];return this.visit(function(t){if(!t.length)do n.push(t.data);while(t=t.next)}),n}function r$(n){return arguments.length?this.cover(+n[0][0],+n[0][1],+n[0][2]).cover(+n[1][0],+n[1][1],+n[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function be(n,t,e,r,i,a,o){this.node=n,this.x0=t,this.y0=e,this.z0=r,this.x1=i,this.y1=a,this.z1=o}function i$(n,t,e,r){var i,a=this._x0,o=this._y0,s=this._z0,u,c,l,d,p,g,m=this._x1,y=this._y1,v=this._z1,x=[],E=this._root,w,S;for(E&&x.push(new be(E,a,o,s,m,y,v)),r==null?r=1/0:(a=n-r,o=t-r,s=e-r,m=n+r,y=t+r,v=e+r,r*=r);w=x.pop();)if(!(!(E=w.node)||(u=w.x0)>m||(c=w.y0)>y||(l=w.z0)>v||(d=w.x1)<a||(p=w.y1)<o||(g=w.z1)<s))if(E.length){var k=(u+d)/2,A=(c+p)/2,N=(l+g)/2;x.push(new be(E[7],k,A,N,d,p,g),new be(E[6],u,A,N,k,p,g),new be(E[5],k,c,N,d,A,g),new be(E[4],u,c,N,k,A,g),new be(E[3],k,A,l,d,p,N),new be(E[2],u,A,l,k,p,N),new be(E[1],k,c,l,d,A,N),new be(E[0],u,c,l,k,A,N)),(S=(e>=N)<<2|(t>=A)<<1|n>=k)&&(w=x[x.length-1],x[x.length-1]=x[x.length-1-S],x[x.length-1-S]=w)}else{var T=n-+this._x.call(null,E.data),O=t-+this._y.call(null,E.data),M=e-+this._z.call(null,E.data),P=T*T+O*O+M*M;if(P<r){var L=Math.sqrt(r=P);a=n-L,o=t-L,s=e-L,m=n+L,y=t+L,v=e+L,i=E.data}}return i}const a$=(n,t,e,r,i,a)=>Math.sqrt((n-r)**2+(t-i)**2+(e-a)**2);function o$(n,t,e,r){const i=[],a=n-r,o=t-r,s=e-r,u=n+r,c=t+r,l=e+r;return this.visit((d,p,g,m,y,v,x)=>{if(!d.length)do{const E=d.data;a$(n,t,e,this._x(E),this._y(E),this._z(E))<=r&&i.push(E)}while(d=d.next);return p>u||g>c||m>l||y<a||v<o||x<s}),i}function s$(n){if(isNaN(p=+this._x.call(null,n))||isNaN(g=+this._y.call(null,n))||isNaN(m=+this._z.call(null,n)))return this;var t,e=this._root,r,i,a,o=this._x0,s=this._y0,u=this._z0,c=this._x1,l=this._y1,d=this._z1,p,g,m,y,v,x,E,w,S,k,A;if(!e)return this;if(e.length)for(;;){if((E=p>=(y=(o+c)/2))?o=y:c=y,(w=g>=(v=(s+l)/2))?s=v:l=v,(S=m>=(x=(u+d)/2))?u=x:d=x,t=e,!(e=e[k=S<<2|w<<1|E]))return this;if(!e.length)break;(t[k+1&7]||t[k+2&7]||t[k+3&7]||t[k+4&7]||t[k+5&7]||t[k+6&7]||t[k+7&7])&&(r=t,A=k)}for(;e.data!==n;)if(i=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,i?(a?i.next=a:delete i.next,this):t?(a?t[k]=a:delete t[k],(e=t[0]||t[1]||t[2]||t[3]||t[4]||t[5]||t[6]||t[7])&&e===(t[7]||t[6]||t[5]||t[4]||t[3]||t[2]||t[1]||t[0])&&!e.length&&(r?r[A]=e:this._root=e),this):(this._root=a,this)}function u$(n){for(var t=0,e=n.length;t<e;++t)this.remove(n[t]);return this}function c$(){return this._root}function l$(){var n=0;return this.visit(function(t){if(!t.length)do++n;while(t=t.next)}),n}function h$(n){var t=[],e,r=this._root,i,a,o,s,u,c,l;for(r&&t.push(new be(r,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=t.pop();)if(!n(r=e.node,a=e.x0,o=e.y0,s=e.z0,u=e.x1,c=e.y1,l=e.z1)&&r.length){var d=(a+u)/2,p=(o+c)/2,g=(s+l)/2;(i=r[7])&&t.push(new be(i,d,p,g,u,c,l)),(i=r[6])&&t.push(new be(i,a,p,g,d,c,l)),(i=r[5])&&t.push(new be(i,d,o,g,u,p,l)),(i=r[4])&&t.push(new be(i,a,o,g,d,p,l)),(i=r[3])&&t.push(new be(i,d,p,s,u,c,g)),(i=r[2])&&t.push(new be(i,a,p,s,d,c,g)),(i=r[1])&&t.push(new be(i,d,o,s,u,p,g)),(i=r[0])&&t.push(new be(i,a,o,s,d,p,g))}return this}function d$(n){var t=[],e=[],r;for(this._root&&t.push(new be(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,u=r.z0,c=r.x1,l=r.y1,d=r.z1,p=(o+c)/2,g=(s+l)/2,m=(u+d)/2;(a=i[0])&&t.push(new be(a,o,s,u,p,g,m)),(a=i[1])&&t.push(new be(a,p,s,u,c,g,m)),(a=i[2])&&t.push(new be(a,o,g,u,p,l,m)),(a=i[3])&&t.push(new be(a,p,g,u,c,l,m)),(a=i[4])&&t.push(new be(a,o,s,m,p,g,d)),(a=i[5])&&t.push(new be(a,p,s,m,c,g,d)),(a=i[6])&&t.push(new be(a,o,g,m,p,l,d)),(a=i[7])&&t.push(new be(a,p,g,m,c,l,d))}e.push(r)}for(;r=e.pop();)n(r.node,r.x0,r.y0,r.z0,r.x1,r.y1,r.z1);return this}function f$(n){return n[0]}function p$(n){return arguments.length?(this._x=n,this):this._x}function g$(n){return n[1]}function v$(n){return arguments.length?(this._y=n,this):this._y}function m$(n){return n[2]}function y$(n){return arguments.length?(this._z=n,this):this._z}function TO(n,t,e,r){var i=new Vb(t??f$,e??g$,r??m$,NaN,NaN,NaN,NaN,NaN,NaN);return n==null?i:i.addAll(n)}function Vb(n,t,e,r,i,a,o,s,u){this._x=n,this._y=t,this._z=e,this._x0=r,this._y0=i,this._z0=a,this._x1=o,this._y1=s,this._z1=u,this._root=void 0}function Mk(n){for(var t={data:n.data},e=t;n=n.next;)e=e.next={data:n.data};return t}var yn=TO.prototype=Vb.prototype;yn.copy=function(){var n=new Vb(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),t=this._root,e,r;if(!t)return n;if(!t.length)return n._root=Mk(t),n;for(e=[{source:t,target:n._root=new Array(8)}];t=e.pop();)for(var i=0;i<8;++i)(r=t.source[i])&&(r.length?e.push({source:r,target:t.target[i]=new Array(8)}):t.target[i]=Mk(r));return n};yn.add=QY;yn.addAll=t$;yn.cover=e$;yn.data=n$;yn.extent=r$;yn.find=i$;yn.findAllWithinRadius=o$;yn.remove=s$;yn.removeAll=u$;yn.root=c$;yn.size=l$;yn.visit=h$;yn.visitAfter=d$;yn.x=p$;yn.y=v$;yn.z=y$;const b$=.81,Op=.1;function x$(n,t,e,r,i=2){const a=t/e,o=n.getAllNodes(),s=o.map((l,d)=>{const{nodeStrength:p,x:g,y:m,z:y,size:v}=l.data;return{x:g,y:m,z:y,size:v,index:d,id:l.id,vx:0,vy:0,vz:0,weight:a*p}}),u=(i===2?ed(s,l=>l.x,l=>l.y):TO(s,l=>l.x,l=>l.y,l=>l.z)).visitAfter(E$),c=new Map;return s.forEach(l=>{c.set(l.id,l),k$(l,u,i)}),s.map((l,d)=>{const{id:p,data:g}=o[d],{mass:m=1}=g;r[p]={x:l.vx/m,y:l.vy/m,z:l.vz/m}}),r}function E$(n){let t=0,e=0,r=0,i=0,a=0;const o=n.length;if(o){for(let s=0;s<o;s++){const u=n[s];u&&u.weight&&(t+=u.weight,e+=u.x*u.weight,r+=u.y*u.weight,i+=u.z*u.weight,a+=u.size*u.weight)}n.x=e/t,n.y=r/t,n.z=i/t,n.size=a/t,n.weight=t}else{const s=n;n.x=s.data.x,n.y=s.data.y,n.z=s.data.z,n.size=s.data.size,n.weight=s.data.weight}}const w$=(n,t,e,r,i,a,o)=>{var s;if(((s=n.data)===null||s===void 0?void 0:s.id)===a.id)return;const u=[e,r,i][o-1],c=a.x-n.x||Op,l=a.y-n.y||Op,d=a.z-n.z||Op,p=[c,l,d],g=u-t;let m=0;for(let v=0;v<o;v++)m+=p[v]*p[v];const y=Math.sqrt(m)*m;if(g*g*b$<m){const v=n.weight/y;return a.vx+=c*v,a.vy+=l*v,a.vz+=d*v,!0}if(n.length)return!1;if(n.data!==a){const v=n.data.weight/y;a.vx+=c*v,a.vy+=l*v,a.vz+=d*v}};function k$(n,t,e){t.visit((r,i,a,o,s)=>w$(r,i,a,o,s,n,e))}const A$={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class S${constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},A$),t)}execute(t,e){return di(this,void 0,void 0,function*(){return this.genericForceLayout(!1,t,e)})}assign(t,e){return di(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let r=0;(this.judgingDistance>this.lastOptions.minMovement||r<1)&&r<t;r++)this.runOneStep(this.lastCalcGraph,this.lastGraph,r,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(r=>this.lastGraph.mergeNodeData(r.id,{x:r.data.x,y:r.data.y,z:this.options.dimensions===3?r.data.z:void 0})),e}genericForceLayout(t,e,r){return di(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),a=e.getAllNodes(),o=e.getAllEdges(),s=this.formatOptions(i,e),{dimensions:u,width:c,height:l,nodeSize:d,getMass:p,nodeStrength:g,edgeStrength:m,linkDistance:y}=s,v=a.map((T,O)=>Object.assign(Object.assign({},T),{data:Object.assign(Object.assign({},T.data),{x:Xt(T.data.x)?T.data.x:Math.random()*c,y:Xt(T.data.y)?T.data.y:Math.random()*l,z:Xt(T.data.z)?T.data.z:Math.random()*Math.sqrt(c*l),size:d(T)||30,mass:p(T),nodeStrength:g(T)})})),x=o.map(T=>Object.assign(Object.assign({},T),{data:Object.assign(Object.assign({},T.data),{edgeStrength:m(T),linkDistance:y(T,e.getNode(T.source),e.getNode(T.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:o},{nodes:[],edges:o};const E={};a.forEach((T,O)=>{E[T.id]={x:0,y:0,z:0}});const w=new qh({nodes:v,edges:x});this.formatCentripetal(s,w);const{maxIteration:S,minMovement:k,onTick:A}=s;if(this.lastLayoutNodes=v,this.lastLayoutEdges=x,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=w,this.lastOptions=s,this.lastVelMap=E,typeof window>"u")return;let N=0;return new Promise(T=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&T({nodes:Pp(e,v),edges:o}),this.runOneStep(w,e,N,E,s),this.updatePosition(e,w,E,s),t&&v.forEach(O=>e.mergeNodeData(O.id,{x:O.data.x,y:O.data.y,z:u===3?O.data.z:void 0})),A==null||A({nodes:Pp(e,v),edges:o}),N++,(N>=S||this.judgingDistance<k)&&(window.clearInterval(this.timeInterval),T({nodes:Pp(e,v),edges:o}))},0),this.running=!0})})}formatOptions(t,e){const r=Object.assign({},t),{width:i,height:a,getMass:o}=t;r.width=!i&&typeof window<"u"?window.innerWidth:i,r.height=!a&&typeof window<"u"?window.innerHeight:a,t.center||(r.center=[r.width/2,r.height/2]),o||(r.getMass=u=>{let c=1;Xt(u==null?void 0:u.data.mass)&&(c=u==null?void 0:u.data.mass);const l=e.getDegree(u.id,"both");return!l||l<5?c:l*5*c}),r.nodeSize=IY(t.nodeSize,t.nodeSpacing);const s=t.linkDistance?_p(1,t.linkDistance):u=>1+r.nodeSize(e.getNode(u.source))+r.nodeSize(e.getNode(u.target));return r.linkDistance=s,r.nodeStrength=_p(1,t.nodeStrength),r.edgeStrength=_p(1,t.edgeStrength),r}formatCentripetal(t,e){const{dimensions:r,centripetalOptions:i,center:a,clusterNodeStrength:o,leafCluster:s,clustering:u,nodeClusterBy:c}=t,l=e.getAllNodes(),d=i||{leaf:2,single:2,others:1,center:x=>({x:a[0],y:a[1],z:r===3?a[2]:void 0})};typeof o!="function"&&(t.clusterNodeStrength=x=>o);let p,g;if(s&&c&&(p=_k(e,c),g=Array.from(new Set(l==null?void 0:l.map(x=>x.data[c])))||[],t.centripetalOptions=Object.assign(d,{single:100,leaf:x=>{const{siblingLeaves:E,sameTypeLeaves:w}=p[x.id]||{};return(w==null?void 0:w.length)===(E==null?void 0:E.length)||(g==null?void 0:g.length)===1?1:t.clusterNodeStrength(x)},others:1,center:x=>{const E=e.getDegree(x.id,"both");if(!E)return{x:100,y:100,z:0};let w;if(E===1){const{sameTypeLeaves:S=[]}=p[x.id]||{};S.length===1?w=void 0:S.length>1&&(w=Ok(S))}else w=void 0;return{x:w==null?void 0:w.x,y:w==null?void 0:w.y,z:w==null?void 0:w.z}}})),u&&c){p||(p=_k(e,c)),g||(g=Array.from(new Set(l.map(E=>E.data[c])))),g=g.filter(E=>E!==void 0);const x={};g.forEach(E=>{const w=l.filter(S=>S.data[c]===E).map(S=>e.getNode(S.id));x[E]=Ok(w)}),t.centripetalOptions=Object.assign(d,{single:E=>t.clusterNodeStrength(E),leaf:E=>t.clusterNodeStrength(E),others:E=>t.clusterNodeStrength(E),center:E=>{const w=x[E.data[c]];return{x:w==null?void 0:w.x,y:w==null?void 0:w.y,z:w==null?void 0:w.z}}})}const{leaf:m,single:y,others:v}=t.centripetalOptions||{};m&&typeof m!="function"&&(t.centripetalOptions.leaf=()=>m),y&&typeof y!="function"&&(t.centripetalOptions.single=()=>y),v&&typeof v!="function"&&(t.centripetalOptions.others=()=>v)}runOneStep(t,e,r,i,a){const o={},s=t.getAllNodes(),u=t.getAllEdges();if(!(s!=null&&s.length))return;const{monitor:c}=a;if(this.calRepulsive(t,o,a),u&&this.calAttractive(t,o,a),this.calGravity(t,e,o,a),this.updateVelocity(t,o,i,a),c){const l=this.calTotalEnergy(o,s);c({energy:l,nodes:e.getAllNodes(),edges:e.getAllEdges(),iterations:r})}}calTotalEnergy(t,e){if(!(e!=null&&e.length))return 0;let r=0;return e.forEach((i,a)=>{const o=t[i.id].x,s=t[i.id].y,u=this.options.dimensions===3?t[i.id].z:0,c=o*o+s*s+u*u,{mass:l=1}=i.data;r+=l*c*.5}),r}calRepulsive(t,e,r){const{dimensions:i,factor:a,coulombDisScale:o}=r;x$(t,a,o*o,e,i)}calAttractive(t,e,r){const{dimensions:i,nodeSize:a}=r;t.getAllEdges().forEach((o,s)=>{const{source:u,target:c}=o,l=t.getNode(u),d=t.getNode(c);if(!l||!d)return;let p=d.data.x-l.data.x,g=d.data.y-l.data.y,m=i===3?d.data.z-l.data.z:0;!p&&!g&&(p=Math.random()*.01,g=Math.random()*.01,i===3&&!m&&(m=Math.random()*.01));const y=Math.sqrt(p*p+g*g+m*m);if(y<a(l)+a(d))return;const v=p/y,x=g/y,E=m/y,{linkDistance:w=200,edgeStrength:S=200}=o.data||{},k=(w-y)*S,A=l.data.mass||1,N=d.data.mass||1,T=1/A,O=1/N,M=v*k,P=x*k,L=E*k;e[u].x-=M*T,e[u].y-=P*T,e[u].z-=L*T,e[c].x+=M*O,e[c].y+=P*O,e[c].z+=L*O})}calGravity(t,e,r,i){const{getCenter:a}=i,o=t.getAllNodes(),s=e.getAllNodes(),u=e.getAllEdges(),{width:c,height:l,center:d,gravity:p,centripetalOptions:g}=i;o&&o.forEach(m=>{const{id:y,data:v}=m,{mass:x,x:E,y:w,z:S}=v,k=e.getNode(y);let A=0,N=0,T=0,O=p;const M=t.getDegree(y,"in"),P=t.getDegree(y,"out"),L=t.getDegree(y,"both"),j=a==null?void 0:a(k,L);if(j){const[z,U,J]=j;A=E-z,N=w-U,O=J}else A=E-d[0],N=w-d[1],T=S-d[2];if(O&&(r[y].x-=O*A/x,r[y].y-=O*N/x,r[y].z-=O*T/x),g){const{leaf:z,single:U,others:J,center:W}=g,{x:at,y:ut,z:yt,centerStrength:kt}=(W==null?void 0:W(k,s,u,c,l))||{x:0,y:0,z:0,centerStrength:0};if(!Xt(at)||!Xt(ut))return;const It=(E-at)/x,ee=(w-ut)/x,$=(S-yt)/x;if(kt&&(r[y].x-=kt*It,r[y].y-=kt*ee,r[y].z-=kt*$),L===0){const F=U(k);if(!F)return;r[y].x-=F*It,r[y].y-=F*ee,r[y].z-=F*$;return}if(M===0||P===0){const F=z(k,s,u);if(!F)return;r[y].x-=F*It,r[y].y-=F*ee,r[y].z-=F*$;return}const Y=J(k);if(!Y)return;r[y].x-=Y*It,r[y].y-=Y*ee,r[y].z-=Y*$}})}updateVelocity(t,e,r,i){const{damping:a,maxSpeed:o,interval:s,dimensions:u}=i,c=t.getAllNodes();c!=null&&c.length&&c.forEach(l=>{const{id:d}=l;let p=(r[d].x+e[d].x*s)*a||.01,g=(r[d].y+e[d].y*s)*a||.01,m=u===3?(r[d].z+e[d].z*s)*a||.01:0;const y=Math.sqrt(p*p+g*g+m*m);if(y>o){const v=o/y;p=v*p,g=v*g,m=v*m}r[d]={x:p,y:g,z:m}})}updatePosition(t,e,r,i){const{distanceThresholdMode:a,interval:o,dimensions:s}=i,u=e.getAllNodes();if(!(u!=null&&u.length)){this.judgingDistance=0;return}let c=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),u.forEach(l=>{const{id:d}=l,p=t.getNode(d);if(Xt(p.data.fx)&&Xt(p.data.fy)){e.mergeNodeData(d,{x:p.data.fx,y:p.data.fy,z:s===3?p.data.fz:void 0});return}const g=r[d].x*o,m=r[d].y*o,y=s===3?r[d].z*o:0;e.mergeNodeData(d,{x:l.data.x+g,y:l.data.y+m,z:l.data.z+y});const v=Math.sqrt(g*g+m*m+y*y);switch(a){case"max":this.judgingDistance<v&&(this.judgingDistance=v);break;case"min":this.judgingDistance>v&&(this.judgingDistance=v);break;default:c=c+v;break}}),(!a||a==="mean")&&(this.judgingDistance=c/u.length)}}const _k=(n,t)=>{const e=n.getAllNodes();if(!(e!=null&&e.length))return{};const r={};return e.forEach((i,a)=>{n.getDegree(i.id,"both")===1&&(r[i.id]=C$(n,"leaf",i,t))}),r},C$=(n,t,e,r)=>{const i=n.getDegree(e.id,"in"),a=n.getDegree(e.id,"out");let o=e,s=[];i===0?(o=n.getSuccessors(e.id)[0],s=n.getNeighbors(o.id)):a===0&&(o=n.getPredecessors(e.id)[0],s=n.getNeighbors(o.id)),s=s.filter(c=>n.getDegree(c.id,"in")===0||n.getDegree(c.id,"out")===0);const u=N$(n,t,r,e,s);return{coreNode:o,siblingLeaves:s,sameTypeLeaves:u}},N$=(n,t,e,r,i)=>{const a=r.data[e]||"";let o=(i==null?void 0:i.filter(s=>s.data[e]===a))||[];return o=o.filter(s=>n.getDegree(s.id,"in")===0||n.getDegree(s.id,"out")===0),o},Ok=n=>{const t={x:0,y:0};n.forEach(r=>{const{x:i,y:a}=r.data;t.x+=i||0,t.y+=a||0});const e=n.length||1;return{x:t.x/e,y:t.y/e}},Pp=(n,t)=>t.map(e=>{const{id:r,data:i}=e,a=n.getNode(r);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});function Pk(n){return!!n.tick&&!!n.stop}function T$(n,t){var e,r=1;n==null&&(n=0),t==null&&(t=0);function i(){var a,o=e.length,s,u=0,c=0;for(a=0;a<o;++a)s=e[a],u+=s.x,c+=s.y;for(u=(u/o-n)*r,c=(c/o-t)*r,a=0;a<o;++a)s=e[a],s.x-=u,s.y-=c}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(n=+a,i):n},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(r=+a,i):r},i}function on(n){return function(){return n}}function ha(n){return(n()-.5)*1e-6}function M$(n){return n.x+n.vx}function _$(n){return n.y+n.vy}function O$(n){var t,e,r,i=1,a=1;typeof n!="function"&&(n=on(n==null?1:+n));function o(){for(var c,l=t.length,d,p,g,m,y,v,x=0;x<a;++x)for(d=ed(t,M$,_$).visitAfter(s),c=0;c<l;++c)p=t[c],y=e[p.index],v=y*y,g=p.x+p.vx,m=p.y+p.vy,d.visit(E);function E(w,S,k,A,N){var T=w.data,O=w.r,M=y+O;if(T){if(T.index>p.index){var P=g-T.x-T.vx,L=m-T.y-T.vy,j=P*P+L*L;j<M*M&&(P===0&&(P=ha(r),j+=P*P),L===0&&(L=ha(r),j+=L*L),j=(M-(j=Math.sqrt(j)))/j*i,p.vx+=(P*=j)*(M=(O*=O)/(v+O)),p.vy+=(L*=j)*M,T.vx-=P*(M=1-M),T.vy-=L*M)}return}return S>g+M||A<g-M||k>m+M||N<m-M}}function s(c){if(c.data)return c.r=e[c.data.index];for(var l=c.r=0;l<4;++l)c[l]&&c[l].r>c.r&&(c.r=c[l].r)}function u(){if(t){var c,l=t.length,d;for(e=new Array(l),c=0;c<l;++c)d=t[c],e[d.index]=+n(d,c,t)}}return o.initialize=function(c,l){t=c,r=l,u()},o.iterations=function(c){return arguments.length?(a=+c,o):a},o.strength=function(c){return arguments.length?(i=+c,o):i},o.radius=function(c){return arguments.length?(n=typeof c=="function"?c:on(+c),u(),o):n},o}function P$(n){return n.index}function Rk(n,t){var e=n.get(t);if(!e)throw new Error("node not found: "+t);return e}function R$(n){var t=P$,e=d,r,i=on(30),a,o,s,u,c,l=1;n==null&&(n=[]);function d(v){return 1/Math.min(s[v.source.index],s[v.target.index])}function p(v){for(var x=0,E=n.length;x<l;++x)for(var w=0,S,k,A,N,T,O,M;w<E;++w)S=n[w],k=S.source,A=S.target,N=A.x+A.vx-k.x-k.vx||ha(c),T=A.y+A.vy-k.y-k.vy||ha(c),O=Math.sqrt(N*N+T*T),O=(O-a[w])/O*v*r[w],N*=O,T*=O,A.vx-=N*(M=u[w]),A.vy-=T*M,k.vx+=N*(M=1-M),k.vy+=T*M}function g(){if(o){var v,x=o.length,E=n.length,w=new Map(o.map((k,A)=>[t(k,A,o),k])),S;for(v=0,s=new Array(x);v<E;++v)S=n[v],S.index=v,typeof S.source!="object"&&(S.source=Rk(w,S.source)),typeof S.target!="object"&&(S.target=Rk(w,S.target)),s[S.source.index]=(s[S.source.index]||0)+1,s[S.target.index]=(s[S.target.index]||0)+1;for(v=0,u=new Array(E);v<E;++v)S=n[v],u[v]=s[S.source.index]/(s[S.source.index]+s[S.target.index]);r=new Array(E),m(),a=new Array(E),y()}}function m(){if(o)for(var v=0,x=n.length;v<x;++v)r[v]=+e(n[v],v,n)}function y(){if(o)for(var v=0,x=n.length;v<x;++v)a[v]=+i(n[v],v,n)}return p.initialize=function(v,x){o=v,c=x,g()},p.links=function(v){return arguments.length?(n=v,g(),p):n},p.id=function(v){return arguments.length?(t=v,p):t},p.iterations=function(v){return arguments.length?(l=+v,p):l},p.strength=function(v){return arguments.length?(e=typeof v=="function"?v:on(+v),m(),p):e},p.distance=function(v){return arguments.length?(i=typeof v=="function"?v:on(+v),y(),p):i},p}var D$={value:()=>{}};function MO(){for(var n=0,t=arguments.length,e={},r;n<t;++n){if(!(r=arguments[n]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new Dl(e)}function Dl(n){this._=n}function L$(n,t){return n.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Dl.prototype=MO.prototype={constructor:Dl,on:function(n,t){var e=this._,r=L$(n+"",e),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(n=r[a]).type)&&(i=I$(e[i],n.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(n=r[a]).type)e[i]=Dk(e[i],n.name,t);else if(t==null)for(i in e)e[i]=Dk(e[i],n.name,null);return this},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new Dl(n)},call:function(n,t){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,a;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(a=this._[n],r=0,i=a.length;r<i;++r)a[r].value.apply(t,e)},apply:function(n,t,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,a=r.length;i<a;++i)r[i].value.apply(t,e)}};function I$(n,t){for(var e=0,r=n.length,i;e<r;++e)if((i=n[e]).name===t)return i.value}function Dk(n,t,e){for(var r=0,i=n.length;r<i;++r)if(n[r].name===t){n[r]=D$,n=n.slice(0,r).concat(n.slice(r+1));break}return e!=null&&n.push({name:t,value:e}),n}var cs=0,uu=0,tu=0,_O=1e3,mh,cu,yh=0,uo=0,nd=0,Ou=typeof performance=="object"&&performance.now?performance:Date,OO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function PO(){return uo||(OO(j$),uo=Ou.now()+nd)}function j$(){uo=0}function q1(){this._call=this._time=this._next=null}q1.prototype=RO.prototype={constructor:q1,restart:function(n,t,e){if(typeof n!="function")throw new TypeError("callback is not a function");e=(e==null?PO():+e)+(t==null?0:+t),!this._next&&cu!==this&&(cu?cu._next=this:mh=this,cu=this),this._call=n,this._time=e,K1()},stop:function(){this._call&&(this._call=null,this._time=1/0,K1())}};function RO(n,t,e){var r=new q1;return r.restart(n,t,e),r}function B$(){PO(),++cs;for(var n=mh,t;n;)(t=uo-n._time)>=0&&n._call.call(void 0,t),n=n._next;--cs}function Lk(){uo=(yh=Ou.now())+nd,cs=uu=0;try{B$()}finally{cs=0,F$(),uo=0}}function z$(){var n=Ou.now(),t=n-yh;t>_O&&(nd-=t,yh=n)}function F$(){for(var n,t=mh,e,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:mh=e);cu=n,K1(r)}function K1(n){if(!cs){uu&&(uu=clearTimeout(uu));var t=n-uo;t>24?(n<1/0&&(uu=setTimeout(Lk,n-Ou.now()-nd)),tu&&(tu=clearInterval(tu))):(tu||(yh=Ou.now(),tu=setInterval(z$,_O)),cs=1,OO(Lk))}}const G$=1664525,V$=1013904223,Ik=4294967296;function U$(){let n=1;return()=>(n=(G$*n+V$)%Ik)/Ik}function W$(n){return n.x}function Y$(n){return n.y}var $$=10,H$=Math.PI*(3-Math.sqrt(5));function X$(n){var t,e=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,u=RO(d),c=MO("tick","end"),l=U$();n==null&&(n=[]);function d(){p(),c.call("tick",t),e<r&&(u.stop(),c.call("end",t))}function p(y){var v,x=n.length,E;y===void 0&&(y=1);for(var w=0;w<y;++w)for(e+=(a-e)*i,s.forEach(function(S){S(e)}),v=0;v<x;++v)E=n[v],E.fx==null?E.x+=E.vx*=o:(E.x=E.fx,E.vx=0),E.fy==null?E.y+=E.vy*=o:(E.y=E.fy,E.vy=0);return t}function g(){for(var y=0,v=n.length,x;y<v;++y){if(x=n[y],x.index=y,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),isNaN(x.x)||isNaN(x.y)){var E=$$*Math.sqrt(.5+y),w=y*H$;x.x=E*Math.cos(w),x.y=E*Math.sin(w)}(isNaN(x.vx)||isNaN(x.vy))&&(x.vx=x.vy=0)}}function m(y){return y.initialize&&y.initialize(n,l),y}return g(),t={tick:p,restart:function(){return u.restart(d),t},stop:function(){return u.stop(),t},nodes:function(y){return arguments.length?(n=y,g(),s.forEach(m),t):n},alpha:function(y){return arguments.length?(e=+y,t):e},alphaMin:function(y){return arguments.length?(r=+y,t):r},alphaDecay:function(y){return arguments.length?(i=+y,t):+i},alphaTarget:function(y){return arguments.length?(a=+y,t):a},velocityDecay:function(y){return arguments.length?(o=1-y,t):1-o},randomSource:function(y){return arguments.length?(l=y,s.forEach(m),t):l},force:function(y,v){return arguments.length>1?(v==null?s.delete(y):s.set(y,m(v)),t):s.get(y)},find:function(y,v,x){var E=0,w=n.length,S,k,A,N,T;for(x==null?x=1/0:x*=x,E=0;E<w;++E)N=n[E],S=y-N.x,k=v-N.y,A=S*S+k*k,A<x&&(T=N,x=A);return T},on:function(y,v){return arguments.length>1?(c.on(y,v),t):c.on(y)}}}function q$(){var n,t,e,r,i=on(-30),a,o=1,s=1/0,u=.81;function c(g){var m,y=n.length,v=ed(n,W$,Y$).visitAfter(d);for(r=g,m=0;m<y;++m)t=n[m],v.visit(p)}function l(){if(n){var g,m=n.length,y;for(a=new Array(m),g=0;g<m;++g)y=n[g],a[y.index]=+i(y,g,n)}}function d(g){var m=0,y,v,x=0,E,w,S;if(g.length){for(E=w=S=0;S<4;++S)(y=g[S])&&(v=Math.abs(y.value))&&(m+=y.value,x+=v,E+=v*y.x,w+=v*y.y);g.x=E/x,g.y=w/x}else{y=g,y.x=y.data.x,y.y=y.data.y;do m+=a[y.data.index];while(y=y.next)}g.value=m}function p(g,m,y,v){if(!g.value)return!0;var x=g.x-t.x,E=g.y-t.y,w=v-m,S=x*x+E*E;if(w*w/u<S)return S<s&&(x===0&&(x=ha(e),S+=x*x),E===0&&(E=ha(e),S+=E*E),S<o&&(S=Math.sqrt(o*S)),t.vx+=x*g.value*r/S,t.vy+=E*g.value*r/S),!0;if(!(g.length||S>=s)){(g.data!==t||g.next)&&(x===0&&(x=ha(e),S+=x*x),E===0&&(E=ha(e),S+=E*E),S<o&&(S=Math.sqrt(o*S)));do g.data!==t&&(w=a[g.data.index]*r/S,t.vx+=x*w,t.vy+=E*w);while(g=g.next)}}return c.initialize=function(g,m){n=g,e=m,l()},c.strength=function(g){return arguments.length?(i=typeof g=="function"?g:on(+g),l(),c):i},c.distanceMin=function(g){return arguments.length?(o=g*g,c):Math.sqrt(o)},c.distanceMax=function(g){return arguments.length?(s=g*g,c):Math.sqrt(s)},c.theta=function(g){return arguments.length?(u=g*g,c):Math.sqrt(u)},c}function K$(n,t,e){var r,i=on(.1),a,o;typeof n!="function"&&(n=on(+n)),t==null&&(t=0),e==null&&(e=0);function s(c){for(var l=0,d=r.length;l<d;++l){var p=r[l],g=p.x-t||1e-6,m=p.y-e||1e-6,y=Math.sqrt(g*g+m*m),v=(o[l]-y)*a[l]*c/y;p.vx+=g*v,p.vy+=m*v}}function u(){if(r){var c,l=r.length;for(a=new Array(l),o=new Array(l),c=0;c<l;++c)o[c]=+n(r[c],c,r),a[c]=isNaN(o[c])?0:+i(r[c],c,r)}}return s.initialize=function(c){r=c,u()},s.strength=function(c){return arguments.length?(i=typeof c=="function"?c:on(+c),u(),s):i},s.radius=function(c){return arguments.length?(n=typeof c=="function"?c:on(+c),u(),s):n},s.x=function(c){return arguments.length?(t=+c,s):t},s.y=function(c){return arguments.length?(e=+c,s):e},s}function Z$(n){var t=on(.1),e,r,i;typeof n!="function"&&(n=on(n==null?0:+n));function a(s){for(var u=0,c=e.length,l;u<c;++u)l=e[u],l.vx+=(i[u]-l.x)*r[u]*s}function o(){if(e){var s,u=e.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+n(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:on(+s),o(),a):t},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:on(+s),o(),a):n},a}function J$(n){var t=on(.1),e,r,i;typeof n!="function"&&(n=on(n==null?0:+n));function a(s){for(var u=0,c=e.length,l;u<c;++u)l=e[u],l.vy+=(i[u]-l.y)*r[u]*s}function o(){if(e){var s,u=e.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+n(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:on(+s),o(),a):t},a.y=function(s){return arguments.length?(n=typeof s=="function"?s:on(+s),o(),a):n},a}class Q${constructor(t){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:R$,manyBody:q$,center:T$,collide:O$,radial:K$,x:Z$,y:J$},this.options={link:{id:e=>e.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},ma(this.options,t),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(t,e){return di(this,void 0,void 0,function*(){return this.genericLayout(!1,t,e)})}assign(t,e){return di(this,void 0,void 0,function*(){yield this.genericLayout(!0,t,e)})}stop(){this.simulation.stop()}tick(t){return this.simulation.tick(t),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(t,e){const r=this.context.nodes.find(i=>i.id===t);r&&e.forEach((i,a)=>{if(typeof i=="number"||i===null){const o=["fx","fy","fz"][a];r[o]=i}})}getOptions(t){var e,r;const i=ma({},this.options,t);return i.collide&&((e=i.collide)===null||e===void 0?void 0:e.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(r=i.nodeSize)!==null&&r!==void 0?r:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(t,e,r){var i;return di(this,void 0,void 0,function*(){const a=this.getOptions(r),o=e.getAllNodes().map(({id:l,data:d})=>Object.assign(Object.assign({id:l},d),wu(d.data,this.config.inputNodeAttrs))),s=e.getAllEdges().map(l=>Object.assign({},l));Object.assign(this.context,{assign:t,nodes:o,edges:s,graph:e});const u=new Promise(l=>{this.resolver=l}),c=this.setSimulation(a);return c.nodes(o),(i=c.force("link"))===null||i===void 0||i.links(s),u})}getResult(){const{assign:t,nodes:e,edges:r,graph:i}=this.context,a=e.map(s=>({id:s.id,data:Object.assign(Object.assign({},s.data),wu(s,this.config.outputNodeAttrs))})),o=r.map(({id:s,source:u,target:c,data:l})=>({id:s,source:typeof u=="object"?u.id:u,target:typeof c=="object"?c.id:c,data:l}));return t&&a.forEach(s=>i.mergeNodeData(s.id,s.data)),{nodes:a,edges:o}}initSimulation(){return X$()}setSimulation(t){const e=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=e.on("tick",()=>{var r;return(r=t.onTick)===null||r===void 0?void 0:r.call(t,this.getResult())}).on("end",()=>{var r;return(r=this.resolver)===null||r===void 0?void 0:r.call(this,this.getResult())})),jk(e,this.config.simulationAttrs.map(r=>[r,t[r]])),Object.entries(this.forceMap).forEach(([r,i])=>{const a=r;if(t[r]){let o=e.force(a);o||(o=i(),e.force(a,o)),jk(o,Object.entries(t[a]))}else e.force(a,null)}),e}}const jk=(n,t)=>t.reduce((e,[r,i])=>!e[r]||i===void 0?e:e[r].call(n,i),n);function Ub(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Rp,Bk;function tH(){if(Bk)return Rp;Bk=1;function n(){this.__data__=[],this.size=0}return Rp=n,Rp}var Dp,zk;function bs(){if(zk)return Dp;zk=1;function n(t,e){return t===e||t!==t&&e!==e}return Dp=n,Dp}var Lp,Fk;function rd(){if(Fk)return Lp;Fk=1;var n=bs();function t(e,r){for(var i=e.length;i--;)if(n(e[i][0],r))return i;return-1}return Lp=t,Lp}var Ip,Gk;function eH(){if(Gk)return Ip;Gk=1;var n=rd(),t=Array.prototype,e=t.splice;function r(i){var a=this.__data__,o=n(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():e.call(a,o,1),--this.size,!0}return Ip=r,Ip}var jp,Vk;function nH(){if(Vk)return jp;Vk=1;var n=rd();function t(e){var r=this.__data__,i=n(r,e);return i<0?void 0:r[i][1]}return jp=t,jp}var Bp,Uk;function rH(){if(Uk)return Bp;Uk=1;var n=rd();function t(e){return n(this.__data__,e)>-1}return Bp=t,Bp}var zp,Wk;function iH(){if(Wk)return zp;Wk=1;var n=rd();function t(e,r){var i=this.__data__,a=n(i,e);return a<0?(++this.size,i.push([e,r])):i[a][1]=r,this}return zp=t,zp}var Fp,Yk;function id(){if(Yk)return Fp;Yk=1;var n=tH(),t=eH(),e=nH(),r=rH(),i=iH();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=n,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=r,a.prototype.set=i,Fp=a,Fp}var Gp,$k;function aH(){if($k)return Gp;$k=1;var n=id();function t(){this.__data__=new n,this.size=0}return Gp=t,Gp}var Vp,Hk;function oH(){if(Hk)return Vp;Hk=1;function n(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}return Vp=n,Vp}var Up,Xk;function sH(){if(Xk)return Up;Xk=1;function n(t){return this.__data__.get(t)}return Up=n,Up}var Wp,qk;function uH(){if(qk)return Wp;qk=1;function n(t){return this.__data__.has(t)}return Wp=n,Wp}var Yp,Kk;function DO(){if(Kk)return Yp;Kk=1;var n=typeof oa=="object"&&oa&&oa.Object===Object&&oa;return Yp=n,Yp}var $p,Zk;function Kr(){if(Zk)return $p;Zk=1;var n=DO(),t=typeof self=="object"&&self&&self.Object===Object&&self,e=n||t||Function("return this")();return $p=e,$p}var Hp,Jk;function xs(){if(Jk)return Hp;Jk=1;var n=Kr(),t=n.Symbol;return Hp=t,Hp}var Xp,Qk;function cH(){if(Qk)return Xp;Qk=1;var n=xs(),t=Object.prototype,e=t.hasOwnProperty,r=t.toString,i=n?n.toStringTag:void 0;function a(o){var s=e.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var l=r.call(o);return c&&(s?o[i]=u:delete o[i]),l}return Xp=a,Xp}var qp,t3;function lH(){if(t3)return qp;t3=1;var n=Object.prototype,t=n.toString;function e(r){return t.call(r)}return qp=e,qp}var Kp,e3;function po(){if(e3)return Kp;e3=1;var n=xs(),t=cH(),e=lH(),r="[object Null]",i="[object Undefined]",a=n?n.toStringTag:void 0;function o(s){return s==null?s===void 0?i:r:a&&a in Object(s)?t(s):e(s)}return Kp=o,Kp}var Zp,n3;function Lr(){if(n3)return Zp;n3=1;function n(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}return Zp=n,Zp}var Jp,r3;function Wu(){if(r3)return Jp;r3=1;var n=po(),t=Lr(),e="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=n(s);return u==r||u==i||u==e||u==a}return Jp=o,Jp}var Qp,i3;function hH(){if(i3)return Qp;i3=1;var n=Kr(),t=n["__core-js_shared__"];return Qp=t,Qp}var tg,a3;function dH(){if(a3)return tg;a3=1;var n=hH(),t=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function e(r){return!!t&&t in r}return tg=e,tg}var eg,o3;function LO(){if(o3)return eg;o3=1;var n=Function.prototype,t=n.toString;function e(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return eg=e,eg}var ng,s3;function fH(){if(s3)return ng;s3=1;var n=Wu(),t=dH(),e=Lr(),r=LO(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(p){if(!e(p)||t(p))return!1;var g=n(p)?l:a;return g.test(r(p))}return ng=d,ng}var rg,u3;function pH(){if(u3)return rg;u3=1;function n(t,e){return t==null?void 0:t[e]}return rg=n,rg}var ig,c3;function go(){if(c3)return ig;c3=1;var n=fH(),t=pH();function e(r,i){var a=t(r,i);return n(a)?a:void 0}return ig=e,ig}var ag,l3;function Wb(){if(l3)return ag;l3=1;var n=go(),t=Kr(),e=n(t,"Map");return ag=e,ag}var og,h3;function ad(){if(h3)return og;h3=1;var n=go(),t=n(Object,"create");return og=t,og}var sg,d3;function gH(){if(d3)return sg;d3=1;var n=ad();function t(){this.__data__=n?n(null):{},this.size=0}return sg=t,sg}var ug,f3;function vH(){if(f3)return ug;f3=1;function n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}return ug=n,ug}var cg,p3;function mH(){if(p3)return cg;p3=1;var n=ad(),t="__lodash_hash_undefined__",e=Object.prototype,r=e.hasOwnProperty;function i(a){var o=this.__data__;if(n){var s=o[a];return s===t?void 0:s}return r.call(o,a)?o[a]:void 0}return cg=i,cg}var lg,g3;function yH(){if(g3)return lg;g3=1;var n=ad(),t=Object.prototype,e=t.hasOwnProperty;function r(i){var a=this.__data__;return n?a[i]!==void 0:e.call(a,i)}return lg=r,lg}var hg,v3;function bH(){if(v3)return hg;v3=1;var n=ad(),t="__lodash_hash_undefined__";function e(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=n&&i===void 0?t:i,this}return hg=e,hg}var dg,m3;function xH(){if(m3)return dg;m3=1;var n=gH(),t=vH(),e=mH(),r=yH(),i=bH();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=n,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=r,a.prototype.set=i,dg=a,dg}var fg,y3;function EH(){if(y3)return fg;y3=1;var n=xH(),t=id(),e=Wb();function r(){this.size=0,this.__data__={hash:new n,map:new(e||t),string:new n}}return fg=r,fg}var pg,b3;function wH(){if(b3)return pg;b3=1;function n(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}return pg=n,pg}var gg,x3;function od(){if(x3)return gg;x3=1;var n=wH();function t(e,r){var i=e.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return gg=t,gg}var vg,E3;function kH(){if(E3)return vg;E3=1;var n=od();function t(e){var r=n(this,e).delete(e);return this.size-=r?1:0,r}return vg=t,vg}var mg,w3;function AH(){if(w3)return mg;w3=1;var n=od();function t(e){return n(this,e).get(e)}return mg=t,mg}var yg,k3;function SH(){if(k3)return yg;k3=1;var n=od();function t(e){return n(this,e).has(e)}return yg=t,yg}var bg,A3;function CH(){if(A3)return bg;A3=1;var n=od();function t(e,r){var i=n(this,e),a=i.size;return i.set(e,r),this.size+=i.size==a?0:1,this}return bg=t,bg}var xg,S3;function Yb(){if(S3)return xg;S3=1;var n=EH(),t=kH(),e=AH(),r=SH(),i=CH();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=n,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=r,a.prototype.set=i,xg=a,xg}var Eg,C3;function NH(){if(C3)return Eg;C3=1;var n=id(),t=Wb(),e=Yb(),r=200;function i(a,o){var s=this.__data__;if(s instanceof n){var u=s.__data__;if(!t||u.length<r-1)return u.push([a,o]),this.size=++s.size,this;s=this.__data__=new e(u)}return s.set(a,o),this.size=s.size,this}return Eg=i,Eg}var wg,N3;function sd(){if(N3)return wg;N3=1;var n=id(),t=aH(),e=oH(),r=sH(),i=uH(),a=NH();function o(s){var u=this.__data__=new n(s);this.size=u.size}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=r,o.prototype.has=i,o.prototype.set=a,wg=o,wg}var kg,T3;function $b(){if(T3)return kg;T3=1;function n(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}return kg=n,kg}var Ag,M3;function IO(){if(M3)return Ag;M3=1;var n=go(),t=(function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch{}})();return Ag=t,Ag}var Sg,_3;function ud(){if(_3)return Sg;_3=1;var n=IO();function t(e,r,i){r=="__proto__"&&n?n(e,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[r]=i}return Sg=t,Sg}var Cg,O3;function cd(){if(O3)return Cg;O3=1;var n=ud(),t=bs(),e=Object.prototype,r=e.hasOwnProperty;function i(a,o,s){var u=a[o];(!(r.call(a,o)&&t(u,s))||s===void 0&&!(o in a))&&n(a,o,s)}return Cg=i,Cg}var Ng,P3;function Yu(){if(P3)return Ng;P3=1;var n=cd(),t=ud();function e(r,i,a,o){var s=!a;a||(a={});for(var u=-1,c=i.length;++u<c;){var l=i[u],d=o?o(a[l],r[l],l,a,r):void 0;d===void 0&&(d=r[l]),s?t(a,l,d):n(a,l,d)}return a}return Ng=e,Ng}var Tg,R3;function TH(){if(R3)return Tg;R3=1;function n(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}return Tg=n,Tg}var Mg,D3;function xi(){if(D3)return Mg;D3=1;function n(t){return t!=null&&typeof t=="object"}return Mg=n,Mg}var _g,L3;function MH(){if(L3)return _g;L3=1;var n=po(),t=xi(),e="[object Arguments]";function r(i){return t(i)&&n(i)==e}return _g=r,_g}var Og,I3;function $u(){if(I3)return Og;I3=1;var n=MH(),t=xi(),e=Object.prototype,r=e.hasOwnProperty,i=e.propertyIsEnumerable,a=n((function(){return arguments})())?n:function(o){return t(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return Og=a,Og}var Pg,j3;function Ze(){if(j3)return Pg;j3=1;var n=Array.isArray;return Pg=n,Pg}var Rg={exports:{}},Dg,B3;function _H(){if(B3)return Dg;B3=1;function n(){return!1}return Dg=n,Dg}var z3;function Es(){return z3||(z3=1,(function(n,t){var e=Kr(),r=_H(),i=t&&!t.nodeType&&t,a=i&&!0&&n&&!n.nodeType&&n,o=a&&a.exports===i,s=o?e.Buffer:void 0,u=s?s.isBuffer:void 0,c=u||r;n.exports=c})(Rg,Rg.exports)),Rg.exports}var Lg,F3;function ld(){if(F3)return Lg;F3=1;var n=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function e(r,i){var a=typeof r;return i=i??n,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Lg=e,Lg}var Ig,G3;function Hb(){if(G3)return Ig;G3=1;var n=9007199254740991;function t(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=n}return Ig=t,Ig}var jg,V3;function OH(){if(V3)return jg;V3=1;var n=po(),t=Hb(),e=xi(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",u="[object Function]",c="[object Map]",l="[object Number]",d="[object Object]",p="[object RegExp]",g="[object Set]",m="[object String]",y="[object WeakMap]",v="[object ArrayBuffer]",x="[object DataView]",E="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",k="[object Int16Array]",A="[object Int32Array]",N="[object Uint8Array]",T="[object Uint8ClampedArray]",O="[object Uint16Array]",M="[object Uint32Array]",P={};P[E]=P[w]=P[S]=P[k]=P[A]=P[N]=P[T]=P[O]=P[M]=!0,P[r]=P[i]=P[v]=P[a]=P[x]=P[o]=P[s]=P[u]=P[c]=P[l]=P[d]=P[p]=P[g]=P[m]=P[y]=!1;function L(j){return e(j)&&t(j.length)&&!!P[n(j)]}return jg=L,jg}var Bg,U3;function hd(){if(U3)return Bg;U3=1;function n(t){return function(e){return t(e)}}return Bg=n,Bg}var zg={exports:{}},W3;function Xb(){return W3||(W3=1,(function(n,t){var e=DO(),r=t&&!t.nodeType&&t,i=r&&!0&&n&&!n.nodeType&&n,a=i&&i.exports===r,o=a&&e.process,s=(function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();n.exports=s})(zg,zg.exports)),zg.exports}var Fg,Y3;function Hu(){if(Y3)return Fg;Y3=1;var n=OH(),t=hd(),e=Xb(),r=e&&e.isTypedArray,i=r?t(r):n;return Fg=i,Fg}var Gg,$3;function jO(){if($3)return Gg;$3=1;var n=TH(),t=$u(),e=Ze(),r=Es(),i=ld(),a=Hu(),o=Object.prototype,s=o.hasOwnProperty;function u(c,l){var d=e(c),p=!d&&t(c),g=!d&&!p&&r(c),m=!d&&!p&&!g&&a(c),y=d||p||g||m,v=y?n(c.length,String):[],x=v.length;for(var E in c)(l||s.call(c,E))&&!(y&&(E=="length"||g&&(E=="offset"||E=="parent")||m&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||i(E,x)))&&v.push(E);return v}return Gg=u,Gg}var Vg,H3;function dd(){if(H3)return Vg;H3=1;var n=Object.prototype;function t(e){var r=e&&e.constructor,i=typeof r=="function"&&r.prototype||n;return e===i}return Vg=t,Vg}var Ug,X3;function BO(){if(X3)return Ug;X3=1;function n(t,e){return function(r){return t(e(r))}}return Ug=n,Ug}var Wg,q3;function PH(){if(q3)return Wg;q3=1;var n=BO(),t=n(Object.keys,Object);return Wg=t,Wg}var Yg,K3;function qb(){if(K3)return Yg;K3=1;var n=dd(),t=PH(),e=Object.prototype,r=e.hasOwnProperty;function i(a){if(!n(a))return t(a);var o=[];for(var s in Object(a))r.call(a,s)&&s!="constructor"&&o.push(s);return o}return Yg=i,Yg}var $g,Z3;function Vi(){if(Z3)return $g;Z3=1;var n=Wu(),t=Hb();function e(r){return r!=null&&t(r.length)&&!n(r)}return $g=e,$g}var Hg,J3;function Ca(){if(J3)return Hg;J3=1;var n=jO(),t=qb(),e=Vi();function r(i){return e(i)?n(i):t(i)}return Hg=r,Hg}var Xg,Q3;function RH(){if(Q3)return Xg;Q3=1;var n=Yu(),t=Ca();function e(r,i){return r&&n(i,t(i),r)}return Xg=e,Xg}var qg,tA;function DH(){if(tA)return qg;tA=1;function n(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}return qg=n,qg}var Kg,eA;function LH(){if(eA)return Kg;eA=1;var n=Lr(),t=dd(),e=DH(),r=Object.prototype,i=r.hasOwnProperty;function a(o){if(!n(o))return e(o);var s=t(o),u=[];for(var c in o)c=="constructor"&&(s||!i.call(o,c))||u.push(c);return u}return Kg=a,Kg}var Zg,nA;function vo(){if(nA)return Zg;nA=1;var n=jO(),t=LH(),e=Vi();function r(i){return e(i)?n(i,!0):t(i)}return Zg=r,Zg}var Jg,rA;function IH(){if(rA)return Jg;rA=1;var n=Yu(),t=vo();function e(r,i){return r&&n(i,t(i),r)}return Jg=e,Jg}var Qg={exports:{}},iA;function zO(){return iA||(iA=1,(function(n,t){var e=Kr(),r=t&&!t.nodeType&&t,i=r&&!0&&n&&!n.nodeType&&n,a=i&&i.exports===r,o=a?e.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(c,l){if(l)return c.slice();var d=c.length,p=s?s(d):new c.constructor(d);return c.copy(p),p}n.exports=u})(Qg,Qg.exports)),Qg.exports}var tv,aA;function FO(){if(aA)return tv;aA=1;function n(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}return tv=n,tv}var ev,oA;function GO(){if(oA)return ev;oA=1;function n(t,e){for(var r=-1,i=t==null?0:t.length,a=0,o=[];++r<i;){var s=t[r];e(s,r,t)&&(o[a++]=s)}return o}return ev=n,ev}var nv,sA;function VO(){if(sA)return nv;sA=1;function n(){return[]}return nv=n,nv}var rv,uA;function Kb(){if(uA)return rv;uA=1;var n=GO(),t=VO(),e=Object.prototype,r=e.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),n(i(o),function(s){return r.call(o,s)}))}:t;return rv=a,rv}var iv,cA;function jH(){if(cA)return iv;cA=1;var n=Yu(),t=Kb();function e(r,i){return n(r,t(r),i)}return iv=e,iv}var av,lA;function Zb(){if(lA)return av;lA=1;function n(t,e){for(var r=-1,i=e.length,a=t.length;++r<i;)t[a+r]=e[r];return t}return av=n,av}var ov,hA;function fd(){if(hA)return ov;hA=1;var n=BO(),t=n(Object.getPrototypeOf,Object);return ov=t,ov}var sv,dA;function UO(){if(dA)return sv;dA=1;var n=Zb(),t=fd(),e=Kb(),r=VO(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var s=[];o;)n(s,e(o)),o=t(o);return s}:r;return sv=a,sv}var uv,fA;function BH(){if(fA)return uv;fA=1;var n=Yu(),t=UO();function e(r,i){return n(r,t(r),i)}return uv=e,uv}var cv,pA;function WO(){if(pA)return cv;pA=1;var n=Zb(),t=Ze();function e(r,i,a){var o=i(r);return t(r)?o:n(o,a(r))}return cv=e,cv}var lv,gA;function YO(){if(gA)return lv;gA=1;var n=WO(),t=Kb(),e=Ca();function r(i){return n(i,e,t)}return lv=r,lv}var hv,vA;function zH(){if(vA)return hv;vA=1;var n=WO(),t=UO(),e=vo();function r(i){return n(i,e,t)}return hv=r,hv}var dv,mA;function FH(){if(mA)return dv;mA=1;var n=go(),t=Kr(),e=n(t,"DataView");return dv=e,dv}var fv,yA;function GH(){if(yA)return fv;yA=1;var n=go(),t=Kr(),e=n(t,"Promise");return fv=e,fv}var pv,bA;function $O(){if(bA)return pv;bA=1;var n=go(),t=Kr(),e=n(t,"Set");return pv=e,pv}var gv,xA;function VH(){if(xA)return gv;xA=1;var n=go(),t=Kr(),e=n(t,"WeakMap");return gv=e,gv}var vv,EA;function ws(){if(EA)return vv;EA=1;var n=FH(),t=Wb(),e=GH(),r=$O(),i=VH(),a=po(),o=LO(),s="[object Map]",u="[object Object]",c="[object Promise]",l="[object Set]",d="[object WeakMap]",p="[object DataView]",g=o(n),m=o(t),y=o(e),v=o(r),x=o(i),E=a;return(n&&E(new n(new ArrayBuffer(1)))!=p||t&&E(new t)!=s||e&&E(e.resolve())!=c||r&&E(new r)!=l||i&&E(new i)!=d)&&(E=function(w){var S=a(w),k=S==u?w.constructor:void 0,A=k?o(k):"";if(A)switch(A){case g:return p;case m:return s;case y:return c;case v:return l;case x:return d}return S}),vv=E,vv}var mv,wA;function UH(){if(wA)return mv;wA=1;var n=Object.prototype,t=n.hasOwnProperty;function e(r){var i=r.length,a=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(a.index=r.index,a.input=r.input),a}return mv=e,mv}var yv,kA;function HO(){if(kA)return yv;kA=1;var n=Kr(),t=n.Uint8Array;return yv=t,yv}var bv,AA;function Jb(){if(AA)return bv;AA=1;var n=HO();function t(e){var r=new e.constructor(e.byteLength);return new n(r).set(new n(e)),r}return bv=t,bv}var xv,SA;function WH(){if(SA)return xv;SA=1;var n=Jb();function t(e,r){var i=r?n(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}return xv=t,xv}var Ev,CA;function YH(){if(CA)return Ev;CA=1;var n=/\w*$/;function t(e){var r=new e.constructor(e.source,n.exec(e));return r.lastIndex=e.lastIndex,r}return Ev=t,Ev}var wv,NA;function $H(){if(NA)return wv;NA=1;var n=xs(),t=n?n.prototype:void 0,e=t?t.valueOf:void 0;function r(i){return e?Object(e.call(i)):{}}return wv=r,wv}var kv,TA;function XO(){if(TA)return kv;TA=1;var n=Jb();function t(e,r){var i=r?n(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}return kv=t,kv}var Av,MA;function HH(){if(MA)return Av;MA=1;var n=Jb(),t=WH(),e=YH(),r=$H(),i=XO(),a="[object Boolean]",o="[object Date]",s="[object Map]",u="[object Number]",c="[object RegExp]",l="[object Set]",d="[object String]",p="[object Symbol]",g="[object ArrayBuffer]",m="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",x="[object Int8Array]",E="[object Int16Array]",w="[object Int32Array]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",A="[object Uint16Array]",N="[object Uint32Array]";function T(O,M,P){var L=O.constructor;switch(M){case g:return n(O);case a:case o:return new L(+O);case m:return t(O,P);case y:case v:case x:case E:case w:case S:case k:case A:case N:return i(O,P);case s:return new L;case u:case d:return new L(O);case c:return e(O);case l:return new L;case p:return r(O)}}return Av=T,Av}var Sv,_A;function qO(){if(_A)return Sv;_A=1;var n=Lr(),t=Object.create,e=(function(){function r(){}return function(i){if(!n(i))return{};if(t)return t(i);r.prototype=i;var a=new r;return r.prototype=void 0,a}})();return Sv=e,Sv}var Cv,OA;function KO(){if(OA)return Cv;OA=1;var n=qO(),t=fd(),e=dd();function r(i){return typeof i.constructor=="function"&&!e(i)?n(t(i)):{}}return Cv=r,Cv}var Nv,PA;function XH(){if(PA)return Nv;PA=1;var n=ws(),t=xi(),e="[object Map]";function r(i){return t(i)&&n(i)==e}return Nv=r,Nv}var Tv,RA;function qH(){if(RA)return Tv;RA=1;var n=XH(),t=hd(),e=Xb(),r=e&&e.isMap,i=r?t(r):n;return Tv=i,Tv}var Mv,DA;function KH(){if(DA)return Mv;DA=1;var n=ws(),t=xi(),e="[object Set]";function r(i){return t(i)&&n(i)==e}return Mv=r,Mv}var _v,LA;function ZH(){if(LA)return _v;LA=1;var n=KH(),t=hd(),e=Xb(),r=e&&e.isSet,i=r?t(r):n;return _v=i,_v}var Ov,IA;function ZO(){if(IA)return Ov;IA=1;var n=sd(),t=$b(),e=cd(),r=RH(),i=IH(),a=zO(),o=FO(),s=jH(),u=BH(),c=YO(),l=zH(),d=ws(),p=UH(),g=HH(),m=KO(),y=Ze(),v=Es(),x=qH(),E=Lr(),w=ZH(),S=Ca(),k=vo(),A=1,N=2,T=4,O="[object Arguments]",M="[object Array]",P="[object Boolean]",L="[object Date]",j="[object Error]",z="[object Function]",U="[object GeneratorFunction]",J="[object Map]",W="[object Number]",at="[object Object]",ut="[object RegExp]",yt="[object Set]",kt="[object String]",It="[object Symbol]",ee="[object WeakMap]",$="[object ArrayBuffer]",Y="[object DataView]",F="[object Float32Array]",K="[object Float64Array]",ot="[object Int8Array]",dt="[object Int16Array]",mt="[object Int32Array]",Ot="[object Uint8Array]",ne="[object Uint8ClampedArray]",Qt="[object Uint16Array]",_t="[object Uint32Array]",wt={};wt[O]=wt[M]=wt[$]=wt[Y]=wt[P]=wt[L]=wt[F]=wt[K]=wt[ot]=wt[dt]=wt[mt]=wt[J]=wt[W]=wt[at]=wt[ut]=wt[yt]=wt[kt]=wt[It]=wt[Ot]=wt[ne]=wt[Qt]=wt[_t]=!0,wt[j]=wt[z]=wt[ee]=!1;function we(Et,ze,_n,zn,Je,Qe){var je,Fn=ze&A,sn=ze&N,Cs=ze&T;if(_n&&(je=Je?_n(Et,zn,Je,Qe):_n(Et)),je!==void 0)return je;if(!E(Et))return Et;var Zr=y(Et);if(Zr){if(je=p(Et),!Fn)return o(Et,je)}else{var On=d(Et),Yi=On==z||On==U;if(v(Et))return a(Et,Fn);if(On==at||On==O||Yi&&!Je){if(je=sn||Yi?{}:m(Et),!Fn)return sn?u(Et,i(je,Et)):s(Et,r(je,Et))}else{if(!wt[On])return Je?Et:{};je=g(Et,On,Fn)}}Qe||(Qe=new n);var bo=Qe.get(Et);if(bo)return bo;Qe.set(Et,je),w(Et)?Et.forEach(function(pr){je.add(we(pr,ze,_n,pr,Et,Qe))}):x(Et)&&Et.forEach(function(pr,jr){je.set(jr,we(pr,ze,_n,jr,Et,Qe))});var Ns=Cs?sn?l:c:sn?k:S,xo=Zr?void 0:Ns(Et);return t(xo||Et,function(pr,jr){xo&&(jr=pr,pr=Et[jr]),e(je,jr,we(pr,ze,_n,jr,Et,Qe))}),je}return Ov=we,Ov}var Pv,jA;function JH(){if(jA)return Pv;jA=1;var n=ZO(),t=4;function e(r){return n(r,t)}return Pv=e,Pv}var Rv,BA;function Qb(){if(BA)return Rv;BA=1;function n(t){return function(){return t}}return Rv=n,Rv}var Dv,zA;function QH(){if(zA)return Dv;zA=1;function n(t){return function(e,r,i){for(var a=-1,o=Object(e),s=i(e),u=s.length;u--;){var c=s[t?u:++a];if(r(o[c],c,o)===!1)break}return e}}return Dv=n,Dv}var Lv,FA;function tx(){if(FA)return Lv;FA=1;var n=QH(),t=n();return Lv=t,Lv}var Iv,GA;function ex(){if(GA)return Iv;GA=1;var n=tx(),t=Ca();function e(r,i){return r&&n(r,i,t)}return Iv=e,Iv}var jv,VA;function tX(){if(VA)return jv;VA=1;var n=Vi();function t(e,r){return function(i,a){if(i==null)return i;if(!n(i))return e(i,a);for(var o=i.length,s=r?o:-1,u=Object(i);(r?s--:++s<o)&&a(u[s],s,u)!==!1;);return i}}return jv=t,jv}var Bv,UA;function pd(){if(UA)return Bv;UA=1;var n=ex(),t=tX(),e=t(n);return Bv=e,Bv}var zv,WA;function mo(){if(WA)return zv;WA=1;function n(t){return t}return zv=n,zv}var Fv,YA;function JO(){if(YA)return Fv;YA=1;var n=mo();function t(e){return typeof e=="function"?e:n}return Fv=t,Fv}var Gv,$A;function QO(){if($A)return Gv;$A=1;var n=$b(),t=pd(),e=JO(),r=Ze();function i(a,o){var s=r(a)?n:t;return s(a,e(o))}return Gv=i,Gv}var HA,XA;function tP(){return XA||(XA=1,HA=QO()),HA}var Vv,qA;function eX(){if(qA)return Vv;qA=1;var n=pd();function t(e,r){var i=[];return n(e,function(a,o,s){r(a,o,s)&&i.push(a)}),i}return Vv=t,Vv}var Uv,KA;function nX(){if(KA)return Uv;KA=1;var n="__lodash_hash_undefined__";function t(e){return this.__data__.set(e,n),this}return Uv=t,Uv}var Wv,ZA;function rX(){if(ZA)return Wv;ZA=1;function n(t){return this.__data__.has(t)}return Wv=n,Wv}var Yv,JA;function eP(){if(JA)return Yv;JA=1;var n=Yb(),t=nX(),e=rX();function r(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new n;++a<o;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=e,Yv=r,Yv}var $v,QA;function iX(){if(QA)return $v;QA=1;function n(t,e){for(var r=-1,i=t==null?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}return $v=n,$v}var Hv,tS;function nP(){if(tS)return Hv;tS=1;function n(t,e){return t.has(e)}return Hv=n,Hv}var Xv,eS;function rP(){if(eS)return Xv;eS=1;var n=eP(),t=iX(),e=nP(),r=1,i=2;function a(o,s,u,c,l,d){var p=u&r,g=o.length,m=s.length;if(g!=m&&!(p&&m>g))return!1;var y=d.get(o),v=d.get(s);if(y&&v)return y==s&&v==o;var x=-1,E=!0,w=u&i?new n:void 0;for(d.set(o,s),d.set(s,o);++x<g;){var S=o[x],k=s[x];if(c)var A=p?c(k,S,x,s,o,d):c(S,k,x,o,s,d);if(A!==void 0){if(A)continue;E=!1;break}if(w){if(!t(s,function(N,T){if(!e(w,T)&&(S===N||l(S,N,u,c,d)))return w.push(T)})){E=!1;break}}else if(!(S===k||l(S,k,u,c,d))){E=!1;break}}return d.delete(o),d.delete(s),E}return Xv=a,Xv}var qv,nS;function aX(){if(nS)return qv;nS=1;function n(t){var e=-1,r=Array(t.size);return t.forEach(function(i,a){r[++e]=[a,i]}),r}return qv=n,qv}var Kv,rS;function nx(){if(rS)return Kv;rS=1;function n(t){var e=-1,r=Array(t.size);return t.forEach(function(i){r[++e]=i}),r}return Kv=n,Kv}var Zv,iS;function oX(){if(iS)return Zv;iS=1;var n=xs(),t=HO(),e=bs(),r=rP(),i=aX(),a=nx(),o=1,s=2,u="[object Boolean]",c="[object Date]",l="[object Error]",d="[object Map]",p="[object Number]",g="[object RegExp]",m="[object Set]",y="[object String]",v="[object Symbol]",x="[object ArrayBuffer]",E="[object DataView]",w=n?n.prototype:void 0,S=w?w.valueOf:void 0;function k(A,N,T,O,M,P,L){switch(T){case E:if(A.byteLength!=N.byteLength||A.byteOffset!=N.byteOffset)return!1;A=A.buffer,N=N.buffer;case x:return!(A.byteLength!=N.byteLength||!P(new t(A),new t(N)));case u:case c:case p:return e(+A,+N);case l:return A.name==N.name&&A.message==N.message;case g:case y:return A==N+"";case d:var j=i;case m:var z=O&o;if(j||(j=a),A.size!=N.size&&!z)return!1;var U=L.get(A);if(U)return U==N;O|=s,L.set(A,N);var J=r(j(A),j(N),O,M,P,L);return L.delete(A),J;case v:if(S)return S.call(A)==S.call(N)}return!1}return Zv=k,Zv}var Jv,aS;function sX(){if(aS)return Jv;aS=1;var n=YO(),t=1,e=Object.prototype,r=e.hasOwnProperty;function i(a,o,s,u,c,l){var d=s&t,p=n(a),g=p.length,m=n(o),y=m.length;if(g!=y&&!d)return!1;for(var v=g;v--;){var x=p[v];if(!(d?x in o:r.call(o,x)))return!1}var E=l.get(a),w=l.get(o);if(E&&w)return E==o&&w==a;var S=!0;l.set(a,o),l.set(o,a);for(var k=d;++v<g;){x=p[v];var A=a[x],N=o[x];if(u)var T=d?u(N,A,x,o,a,l):u(A,N,x,a,o,l);if(!(T===void 0?A===N||c(A,N,s,u,l):T)){S=!1;break}k||(k=x=="constructor")}if(S&&!k){var O=a.constructor,M=o.constructor;O!=M&&"constructor"in a&&"constructor"in o&&!(typeof O=="function"&&O instanceof O&&typeof M=="function"&&M instanceof M)&&(S=!1)}return l.delete(a),l.delete(o),S}return Jv=i,Jv}var Qv,oS;function uX(){if(oS)return Qv;oS=1;var n=sd(),t=rP(),e=oX(),r=sX(),i=ws(),a=Ze(),o=Es(),s=Hu(),u=1,c="[object Arguments]",l="[object Array]",d="[object Object]",p=Object.prototype,g=p.hasOwnProperty;function m(y,v,x,E,w,S){var k=a(y),A=a(v),N=k?l:i(y),T=A?l:i(v);N=N==c?d:N,T=T==c?d:T;var O=N==d,M=T==d,P=N==T;if(P&&o(y)){if(!o(v))return!1;k=!0,O=!1}if(P&&!O)return S||(S=new n),k||s(y)?t(y,v,x,E,w,S):e(y,v,N,x,E,w,S);if(!(x&u)){var L=O&&g.call(y,"__wrapped__"),j=M&&g.call(v,"__wrapped__");if(L||j){var z=L?y.value():y,U=j?v.value():v;return S||(S=new n),w(z,U,x,E,S)}}return P?(S||(S=new n),r(y,v,x,E,w,S)):!1}return Qv=m,Qv}var t0,sS;function iP(){if(sS)return t0;sS=1;var n=uX(),t=xi();function e(r,i,a,o,s){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:n(r,i,a,o,e,s)}return t0=e,t0}var e0,uS;function cX(){if(uS)return e0;uS=1;var n=sd(),t=iP(),e=1,r=2;function i(a,o,s,u){var c=s.length,l=c,d=!u;if(a==null)return!l;for(a=Object(a);c--;){var p=s[c];if(d&&p[2]?p[1]!==a[p[0]]:!(p[0]in a))return!1}for(;++c<l;){p=s[c];var g=p[0],m=a[g],y=p[1];if(d&&p[2]){if(m===void 0&&!(g in a))return!1}else{var v=new n;if(u)var x=u(m,y,g,a,o,v);if(!(x===void 0?t(y,m,e|r,u,v):x))return!1}}return!0}return e0=i,e0}var n0,cS;function aP(){if(cS)return n0;cS=1;var n=Lr();function t(e){return e===e&&!n(e)}return n0=t,n0}var r0,lS;function lX(){if(lS)return r0;lS=1;var n=aP(),t=Ca();function e(r){for(var i=t(r),a=i.length;a--;){var o=i[a],s=r[o];i[a]=[o,s,n(s)]}return i}return r0=e,r0}var i0,hS;function oP(){if(hS)return i0;hS=1;function n(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}return i0=n,i0}var a0,dS;function hX(){if(dS)return a0;dS=1;var n=cX(),t=lX(),e=oP();function r(i){var a=t(i);return a.length==1&&a[0][2]?e(a[0][0],a[0][1]):function(o){return o===i||n(o,i,a)}}return a0=r,a0}var o0,fS;function ks(){if(fS)return o0;fS=1;var n=po(),t=xi(),e="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&n(i)==e}return o0=r,o0}var s0,pS;function rx(){if(pS)return s0;pS=1;var n=Ze(),t=ks(),e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){if(n(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:r.test(a)||!e.test(a)||o!=null&&a in Object(o)}return s0=i,s0}var u0,gS;function dX(){if(gS)return u0;gS=1;var n=Yb(),t="Expected a function";function e(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=r.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(e.Cache||n),a}return e.Cache=n,u0=e,u0}var c0,vS;function fX(){if(vS)return c0;vS=1;var n=dX(),t=500;function e(r){var i=n(r,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return c0=e,c0}var l0,mS;function pX(){if(mS)return l0;mS=1;var n=fX(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=n(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(e,"$1"):s||o)}),a});return l0=r,l0}var h0,yS;function gd(){if(yS)return h0;yS=1;function n(t,e){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=e(t[r],r,t);return a}return h0=n,h0}var d0,bS;function gX(){if(bS)return d0;bS=1;var n=xs(),t=gd(),e=Ze(),r=ks(),i=n?n.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(e(s))return t(s,o)+"";if(r(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return d0=o,d0}var f0,xS;function sP(){if(xS)return f0;xS=1;var n=gX();function t(e){return e==null?"":n(e)}return f0=t,f0}var p0,ES;function vd(){if(ES)return p0;ES=1;var n=Ze(),t=rx(),e=pX(),r=sP();function i(a,o){return n(a)?a:t(a,o)?[a]:e(r(a))}return p0=i,p0}var g0,wS;function Xu(){if(wS)return g0;wS=1;var n=ks();function t(e){if(typeof e=="string"||n(e))return e;var r=e+"";return r=="0"&&1/e==-1/0?"-0":r}return g0=t,g0}var v0,kS;function md(){if(kS)return v0;kS=1;var n=vd(),t=Xu();function e(r,i){i=n(i,r);for(var a=0,o=i.length;r!=null&&a<o;)r=r[t(i[a++])];return a&&a==o?r:void 0}return v0=e,v0}var m0,AS;function vX(){if(AS)return m0;AS=1;var n=md();function t(e,r,i){var a=e==null?void 0:n(e,r);return a===void 0?i:a}return m0=t,m0}var y0,SS;function mX(){if(SS)return y0;SS=1;function n(t,e){return t!=null&&e in Object(t)}return y0=n,y0}var b0,CS;function uP(){if(CS)return b0;CS=1;var n=vd(),t=$u(),e=Ze(),r=ld(),i=Hb(),a=Xu();function o(s,u,c){u=n(u,s);for(var l=-1,d=u.length,p=!1;++l<d;){var g=a(u[l]);if(!(p=s!=null&&c(s,g)))break;s=s[g]}return p||++l!=d?p:(d=s==null?0:s.length,!!d&&i(d)&&r(g,d)&&(e(s)||t(s)))}return b0=o,b0}var x0,NS;function cP(){if(NS)return x0;NS=1;var n=mX(),t=uP();function e(r,i){return r!=null&&t(r,i,n)}return x0=e,x0}var E0,TS;function yX(){if(TS)return E0;TS=1;var n=iP(),t=vX(),e=cP(),r=rx(),i=aP(),a=oP(),o=Xu(),s=1,u=2;function c(l,d){return r(l)&&i(d)?a(o(l),d):function(p){var g=t(p,l);return g===void 0&&g===d?e(p,l):n(d,g,s|u)}}return E0=c,E0}var w0,MS;function lP(){if(MS)return w0;MS=1;function n(t){return function(e){return e==null?void 0:e[t]}}return w0=n,w0}var k0,_S;function bX(){if(_S)return k0;_S=1;var n=md();function t(e){return function(r){return n(r,e)}}return k0=t,k0}var A0,OS;function xX(){if(OS)return A0;OS=1;var n=lP(),t=bX(),e=rx(),r=Xu();function i(a){return e(a)?n(r(a)):t(a)}return A0=i,A0}var S0,PS;function Ui(){if(PS)return S0;PS=1;var n=hX(),t=yX(),e=mo(),r=Ze(),i=xX();function a(o){return typeof o=="function"?o:o==null?e:typeof o=="object"?r(o)?t(o[0],o[1]):n(o):i(o)}return S0=a,S0}var C0,RS;function hP(){if(RS)return C0;RS=1;var n=GO(),t=eX(),e=Ui(),r=Ze();function i(a,o){var s=r(a)?n:t;return s(a,e(o,3))}return C0=i,C0}var N0,DS;function EX(){if(DS)return N0;DS=1;var n=Object.prototype,t=n.hasOwnProperty;function e(r,i){return r!=null&&t.call(r,i)}return N0=e,N0}var T0,LS;function dP(){if(LS)return T0;LS=1;var n=EX(),t=uP();function e(r,i){return r!=null&&t(r,i,n)}return T0=e,T0}var M0,IS;function wX(){if(IS)return M0;IS=1;var n=qb(),t=ws(),e=$u(),r=Ze(),i=Vi(),a=Es(),o=dd(),s=Hu(),u="[object Map]",c="[object Set]",l=Object.prototype,d=l.hasOwnProperty;function p(g){if(g==null)return!0;if(i(g)&&(r(g)||typeof g=="string"||typeof g.splice=="function"||a(g)||s(g)||e(g)))return!g.length;var m=t(g);if(m==u||m==c)return!g.size;if(o(g))return!n(g).length;for(var y in g)if(d.call(g,y))return!1;return!0}return M0=p,M0}var _0,jS;function fP(){if(jS)return _0;jS=1;function n(t){return t===void 0}return _0=n,_0}var O0,BS;function pP(){if(BS)return O0;BS=1;var n=pd(),t=Vi();function e(r,i){var a=-1,o=t(r)?Array(r.length):[];return n(r,function(s,u,c){o[++a]=i(s,u,c)}),o}return O0=e,O0}var P0,zS;function gP(){if(zS)return P0;zS=1;var n=gd(),t=Ui(),e=pP(),r=Ze();function i(a,o){var s=r(a)?n:e;return s(a,t(o,3))}return P0=i,P0}var R0,FS;function kX(){if(FS)return R0;FS=1;function n(t,e,r,i){var a=-1,o=t==null?0:t.length;for(i&&o&&(r=t[++a]);++a<o;)r=e(r,t[a],a,t);return r}return R0=n,R0}var D0,GS;function AX(){if(GS)return D0;GS=1;function n(t,e,r,i,a){return a(t,function(o,s,u){r=i?(i=!1,o):e(r,o,s,u)}),r}return D0=n,D0}var L0,VS;function vP(){if(VS)return L0;VS=1;var n=kX(),t=pd(),e=Ui(),r=AX(),i=Ze();function a(o,s,u){var c=i(o)?n:r,l=arguments.length<3;return c(o,e(s,4),u,l,t)}return L0=a,L0}var I0,US;function SX(){if(US)return I0;US=1;var n=po(),t=Ze(),e=xi(),r="[object String]";function i(a){return typeof a=="string"||!t(a)&&e(a)&&n(a)==r}return I0=i,I0}var j0,WS;function CX(){if(WS)return j0;WS=1;var n=lP(),t=n("length");return j0=t,j0}var B0,YS;function NX(){if(YS)return B0;YS=1;var n="\\ud800-\\udfff",t="\\u0300-\\u036f",e="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+e+r,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+n+i+a+"]");function u(c){return s.test(c)}return B0=u,B0}var z0,$S;function TX(){if($S)return z0;$S=1;var n="\\ud800-\\udfff",t="\\u0300-\\u036f",e="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+e+r,a="\\ufe0e\\ufe0f",o="["+n+"]",s="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",c="(?:"+s+"|"+u+")",l="[^"+n+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",m=c+"?",y="["+a+"]?",v="(?:"+g+"(?:"+[l,d,p].join("|")+")"+y+m+")*",x=y+m+v,E="(?:"+[l+s+"?",s,d,p,o].join("|")+")",w=RegExp(u+"(?="+u+")|"+E+x,"g");function S(k){for(var A=w.lastIndex=0;w.test(k);)++A;return A}return z0=S,z0}var F0,HS;function MX(){if(HS)return F0;HS=1;var n=CX(),t=NX(),e=TX();function r(i){return t(i)?e(i):n(i)}return F0=r,F0}var G0,XS;function _X(){if(XS)return G0;XS=1;var n=qb(),t=ws(),e=Vi(),r=SX(),i=MX(),a="[object Map]",o="[object Set]";function s(u){if(u==null)return 0;if(e(u))return r(u)?i(u):u.length;var c=t(u);return c==a||c==o?u.size:n(u).length}return G0=s,G0}var V0,qS;function OX(){if(qS)return V0;qS=1;var n=$b(),t=qO(),e=ex(),r=Ui(),i=fd(),a=Ze(),o=Es(),s=Wu(),u=Lr(),c=Hu();function l(d,p,g){var m=a(d),y=m||o(d)||c(d);if(p=r(p,4),g==null){var v=d&&d.constructor;y?g=m?new v:[]:u(d)?g=s(v)?t(i(d)):{}:g={}}return(y?n:e)(d,function(x,E,w){return p(g,x,E,w)}),g}return V0=l,V0}var U0,KS;function PX(){if(KS)return U0;KS=1;var n=xs(),t=$u(),e=Ze(),r=n?n.isConcatSpreadable:void 0;function i(a){return e(a)||t(a)||!!(r&&a&&a[r])}return U0=i,U0}var W0,ZS;function ix(){if(ZS)return W0;ZS=1;var n=Zb(),t=PX();function e(r,i,a,o,s){var u=-1,c=r.length;for(a||(a=t),s||(s=[]);++u<c;){var l=r[u];i>0&&a(l)?i>1?e(l,i-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}return W0=e,W0}var Y0,JS;function RX(){if(JS)return Y0;JS=1;function n(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}return Y0=n,Y0}var $0,QS;function mP(){if(QS)return $0;QS=1;var n=RX(),t=Math.max;function e(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var o=arguments,s=-1,u=t(o.length-i,0),c=Array(u);++s<u;)c[s]=o[i+s];s=-1;for(var l=Array(i+1);++s<i;)l[s]=o[s];return l[i]=a(c),n(r,this,l)}}return $0=e,$0}var H0,tC;function DX(){if(tC)return H0;tC=1;var n=Qb(),t=IO(),e=mo(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:n(a),writable:!0})}:e;return H0=r,H0}var X0,eC;function LX(){if(eC)return X0;eC=1;var n=800,t=16,e=Date.now;function r(i){var a=0,o=0;return function(){var s=e(),u=t-(s-o);if(o=s,u>0){if(++a>=n)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return X0=r,X0}var q0,nC;function yP(){if(nC)return q0;nC=1;var n=DX(),t=LX(),e=t(n);return q0=e,q0}var K0,rC;function yd(){if(rC)return K0;rC=1;var n=mo(),t=mP(),e=yP();function r(i,a){return e(t(i,a,n),i+"")}return K0=r,K0}var Z0,iC;function bP(){if(iC)return Z0;iC=1;function n(t,e,r,i){for(var a=t.length,o=r+(i?1:-1);i?o--:++o<a;)if(e(t[o],o,t))return o;return-1}return Z0=n,Z0}var J0,aC;function IX(){if(aC)return J0;aC=1;function n(t){return t!==t}return J0=n,J0}var Q0,oC;function jX(){if(oC)return Q0;oC=1;function n(t,e,r){for(var i=r-1,a=t.length;++i<a;)if(t[i]===e)return i;return-1}return Q0=n,Q0}var tm,sC;function BX(){if(sC)return tm;sC=1;var n=bP(),t=IX(),e=jX();function r(i,a,o){return a===a?e(i,a,o):n(i,t,o)}return tm=r,tm}var em,uC;function zX(){if(uC)return em;uC=1;var n=BX();function t(e,r){var i=e==null?0:e.length;return!!i&&n(e,r,0)>-1}return em=t,em}var nm,cC;function FX(){if(cC)return nm;cC=1;function n(t,e,r){for(var i=-1,a=t==null?0:t.length;++i<a;)if(r(e,t[i]))return!0;return!1}return nm=n,nm}var rm,lC;function GX(){if(lC)return rm;lC=1;function n(){}return rm=n,rm}var im,hC;function VX(){if(hC)return im;hC=1;var n=$O(),t=GX(),e=nx(),r=1/0,i=n&&1/e(new n([,-0]))[1]==r?function(a){return new n(a)}:t;return im=i,im}var am,dC;function UX(){if(dC)return am;dC=1;var n=eP(),t=zX(),e=FX(),r=nP(),i=VX(),a=nx(),o=200;function s(u,c,l){var d=-1,p=t,g=u.length,m=!0,y=[],v=y;if(l)m=!1,p=e;else if(g>=o){var x=c?null:i(u);if(x)return a(x);m=!1,p=r,v=new n}else v=c?[]:y;t:for(;++d<g;){var E=u[d],w=c?c(E):E;if(E=l||E!==0?E:0,m&&w===w){for(var S=v.length;S--;)if(v[S]===w)continue t;c&&v.push(w),y.push(E)}else p(v,w,l)||(v!==y&&v.push(w),y.push(E))}return y}return am=s,am}var om,fC;function xP(){if(fC)return om;fC=1;var n=Vi(),t=xi();function e(r){return t(r)&&n(r)}return om=e,om}var sm,pC;function WX(){if(pC)return sm;pC=1;var n=ix(),t=yd(),e=UX(),r=xP(),i=t(function(a){return e(n(a,1,r,!0))});return sm=i,sm}var um,gC;function YX(){if(gC)return um;gC=1;var n=gd();function t(e,r){return n(r,function(i){return e[i]})}return um=t,um}var cm,vC;function EP(){if(vC)return cm;vC=1;var n=YX(),t=Ca();function e(r){return r==null?[]:n(r,t(r))}return cm=e,cm}var lm,mC;function Ir(){if(mC)return lm;mC=1;var n;if(typeof Ub=="function")try{n={clone:JH(),constant:Qb(),each:tP(),filter:hP(),has:dP(),isArray:Ze(),isEmpty:wX(),isFunction:Wu(),isUndefined:fP(),keys:Ca(),map:gP(),reduce:vP(),size:_X(),transform:OX(),union:WX(),values:EP()}}catch{}return n||(n=window._),lm=n,lm}var hm,yC;function ax(){if(yC)return hm;yC=1;var n=Ir();hm=i;var t="\0",e="\0",r="";function i(l){this._isDirected=n.has(l,"directed")?l.directed:!0,this._isMultigraph=n.has(l,"multigraph")?l.multigraph:!1,this._isCompound=n.has(l,"compound")?l.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[e]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(l){return this._label=l,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(l){return n.isFunction(l)||(l=n.constant(l)),this._defaultNodeLabelFn=l,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var l=this;return n.filter(this.nodes(),function(d){return n.isEmpty(l._in[d])})},i.prototype.sinks=function(){var l=this;return n.filter(this.nodes(),function(d){return n.isEmpty(l._out[d])})},i.prototype.setNodes=function(l,d){var p=arguments,g=this;return n.each(l,function(m){p.length>1?g.setNode(m,d):g.setNode(m)}),this},i.prototype.setNode=function(l,d){return n.has(this._nodes,l)?(arguments.length>1&&(this._nodes[l]=d),this):(this._nodes[l]=arguments.length>1?d:this._defaultNodeLabelFn(l),this._isCompound&&(this._parent[l]=e,this._children[l]={},this._children[e][l]=!0),this._in[l]={},this._preds[l]={},this._out[l]={},this._sucs[l]={},++this._nodeCount,this)},i.prototype.node=function(l){return this._nodes[l]},i.prototype.hasNode=function(l){return n.has(this._nodes,l)},i.prototype.removeNode=function(l){var d=this;if(n.has(this._nodes,l)){var p=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[l],this._isCompound&&(this._removeFromParentsChildList(l),delete this._parent[l],n.each(this.children(l),function(g){d.setParent(g)}),delete this._children[l]),n.each(n.keys(this._in[l]),p),delete this._in[l],delete this._preds[l],n.each(n.keys(this._out[l]),p),delete this._out[l],delete this._sucs[l],--this._nodeCount}return this},i.prototype.setParent=function(l,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(d))d=e;else{d+="";for(var p=d;!n.isUndefined(p);p=this.parent(p))if(p===l)throw new Error("Setting "+d+" as parent of "+l+" would create a cycle");this.setNode(d)}return this.setNode(l),this._removeFromParentsChildList(l),this._parent[l]=d,this._children[d][l]=!0,this},i.prototype._removeFromParentsChildList=function(l){delete this._children[this._parent[l]][l]},i.prototype.parent=function(l){if(this._isCompound){var d=this._parent[l];if(d!==e)return d}},i.prototype.children=function(l){if(n.isUndefined(l)&&(l=e),this._isCompound){var d=this._children[l];if(d)return n.keys(d)}else{if(l===e)return this.nodes();if(this.hasNode(l))return[]}},i.prototype.predecessors=function(l){var d=this._preds[l];if(d)return n.keys(d)},i.prototype.successors=function(l){var d=this._sucs[l];if(d)return n.keys(d)},i.prototype.neighbors=function(l){var d=this.predecessors(l);if(d)return n.union(d,this.successors(l))},i.prototype.isLeaf=function(l){var d;return this.isDirected()?d=this.successors(l):d=this.neighbors(l),d.length===0},i.prototype.filterNodes=function(l){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var p=this;n.each(this._nodes,function(y,v){l(v)&&d.setNode(v,y)}),n.each(this._edgeObjs,function(y){d.hasNode(y.v)&&d.hasNode(y.w)&&d.setEdge(y,p.edge(y))});var g={};function m(y){var v=p.parent(y);return v===void 0||d.hasNode(v)?(g[y]=v,v):v in g?g[v]:m(v)}return this._isCompound&&n.each(d.nodes(),function(y){d.setParent(y,m(y))}),d},i.prototype.setDefaultEdgeLabel=function(l){return n.isFunction(l)||(l=n.constant(l)),this._defaultEdgeLabelFn=l,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(l,d){var p=this,g=arguments;return n.reduce(l,function(m,y){return g.length>1?p.setEdge(m,y,d):p.setEdge(m,y),y}),this},i.prototype.setEdge=function(){var l,d,p,g,m=!1,y=arguments[0];typeof y=="object"&&y!==null&&"v"in y?(l=y.v,d=y.w,p=y.name,arguments.length===2&&(g=arguments[1],m=!0)):(l=y,d=arguments[1],p=arguments[3],arguments.length>2&&(g=arguments[2],m=!0)),l=""+l,d=""+d,n.isUndefined(p)||(p=""+p);var v=s(this._isDirected,l,d,p);if(n.has(this._edgeLabels,v))return m&&(this._edgeLabels[v]=g),this;if(!n.isUndefined(p)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(d),this._edgeLabels[v]=m?g:this._defaultEdgeLabelFn(l,d,p);var x=u(this._isDirected,l,d,p);return l=x.v,d=x.w,Object.freeze(x),this._edgeObjs[v]=x,a(this._preds[d],l),a(this._sucs[l],d),this._in[d][v]=x,this._out[l][v]=x,this._edgeCount++,this},i.prototype.edge=function(l,d,p){var g=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,l,d,p);return this._edgeLabels[g]},i.prototype.hasEdge=function(l,d,p){var g=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,l,d,p);return n.has(this._edgeLabels,g)},i.prototype.removeEdge=function(l,d,p){var g=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,l,d,p),m=this._edgeObjs[g];return m&&(l=m.v,d=m.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],l),o(this._sucs[l],d),delete this._in[d][g],delete this._out[l][g],this._edgeCount--),this},i.prototype.inEdges=function(l,d){var p=this._in[l];if(p){var g=n.values(p);return d?n.filter(g,function(m){return m.v===d}):g}},i.prototype.outEdges=function(l,d){var p=this._out[l];if(p){var g=n.values(p);return d?n.filter(g,function(m){return m.w===d}):g}},i.prototype.nodeEdges=function(l,d){var p=this.inEdges(l,d);if(p)return p.concat(this.outEdges(l,d))};function a(l,d){l[d]?l[d]++:l[d]=1}function o(l,d){--l[d]||delete l[d]}function s(l,d,p,g){var m=""+d,y=""+p;if(!l&&m>y){var v=m;m=y,y=v}return m+r+y+r+(n.isUndefined(g)?t:g)}function u(l,d,p,g){var m=""+d,y=""+p;if(!l&&m>y){var v=m;m=y,y=v}var x={v:m,w:y};return g&&(x.name=g),x}function c(l,d){return s(l,d.v,d.w,d.name)}return hm}var bC,xC;function $X(){return xC||(xC=1,bC="2.1.8"),bC}var EC,wC;function HX(){return wC||(wC=1,EC={Graph:ax(),version:$X()}),EC}var dm,kC;function XX(){if(kC)return dm;kC=1;var n=Ir(),t=ax();dm={write:e,read:a};function e(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return n.isUndefined(o.graph())||(s.value=n.clone(o.graph())),s}function r(o){return n.map(o.nodes(),function(s){var u=o.node(s),c=o.parent(s),l={v:s};return n.isUndefined(u)||(l.value=u),n.isUndefined(c)||(l.parent=c),l})}function i(o){return n.map(o.edges(),function(s){var u=o.edge(s),c={v:s.v,w:s.w};return n.isUndefined(s.name)||(c.name=s.name),n.isUndefined(u)||(c.value=u),c})}function a(o){var s=new t(o.options).setGraph(o.value);return n.each(o.nodes,function(u){s.setNode(u.v,u.value),u.parent&&s.setParent(u.v,u.parent)}),n.each(o.edges,function(u){s.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),s}return dm}var fm,AC;function qX(){if(AC)return fm;AC=1;var n=Ir();fm=t;function t(e){var r={},i=[],a;function o(s){n.has(r,s)||(r[s]=!0,a.push(s),n.each(e.successors(s),o),n.each(e.predecessors(s),o))}return n.each(e.nodes(),function(s){a=[],o(s),a.length&&i.push(a)}),i}return fm}var pm,SC;function wP(){if(SC)return pm;SC=1;var n=Ir();pm=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(e){return n.has(this._keyIndices,e)},t.prototype.priority=function(e){var r=this._keyIndices[e];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(e,r){var i=this._keyIndices;if(e=String(e),!n.has(i,e)){var a=this._arr,o=a.length;return i[e]=o,a.push({key:e,priority:r}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,r){var i=this._keyIndices[e];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},t.prototype._heapify=function(e){var r=this._arr,i=2*e,a=i+1,o=e;i<r.length&&(o=r[i].priority<r[o].priority?i:o,a<r.length&&(o=r[a].priority<r[o].priority?a:o),o!==e&&(this._swap(e,o),this._heapify(o)))},t.prototype._decrease=function(e){for(var r=this._arr,i=r[e].priority,a;e!==0&&(a=e>>1,!(r[a].priority<i));)this._swap(e,a),e=a},t.prototype._swap=function(e,r){var i=this._arr,a=this._keyIndices,o=i[e],s=i[r];i[e]=s,i[r]=o,a[s.key]=e,a[o.key]=r},pm}var gm,CC;function kP(){if(CC)return gm;CC=1;var n=Ir(),t=wP();gm=r;var e=n.constant(1);function r(a,o,s,u){return i(a,String(o),s||e,u||function(c){return a.outEdges(c)})}function i(a,o,s,u){var c={},l=new t,d,p,g=function(m){var y=m.v!==d?m.v:m.w,v=c[y],x=s(m),E=p.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+x);E<v.distance&&(v.distance=E,v.predecessor=d,l.decrease(y,E))};for(a.nodes().forEach(function(m){var y=m===o?0:Number.POSITIVE_INFINITY;c[m]={distance:y},l.add(m,y)});l.size()>0&&(d=l.removeMin(),p=c[d],p.distance!==Number.POSITIVE_INFINITY);)u(d).forEach(g);return c}return gm}var vm,NC;function KX(){if(NC)return vm;NC=1;var n=kP(),t=Ir();vm=e;function e(r,i,a){return t.transform(r.nodes(),function(o,s){o[s]=n(r,s,i,a)},{})}return vm}var mm,TC;function AP(){if(TC)return mm;TC=1;var n=Ir();mm=t;function t(e){var r=0,i=[],a={},o=[];function s(u){var c=a[u]={onStack:!0,lowlink:r,index:r++};if(i.push(u),e.successors(u).forEach(function(p){n.has(a,p)?a[p].onStack&&(c.lowlink=Math.min(c.lowlink,a[p].index)):(s(p),c.lowlink=Math.min(c.lowlink,a[p].lowlink))}),c.lowlink===c.index){var l=[],d;do d=i.pop(),a[d].onStack=!1,l.push(d);while(u!==d);o.push(l)}}return e.nodes().forEach(function(u){n.has(a,u)||s(u)}),o}return mm}var ym,MC;function ZX(){if(MC)return ym;MC=1;var n=Ir(),t=AP();ym=e;function e(r){return n.filter(t(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return ym}var bm,_C;function JX(){if(_C)return bm;_C=1;var n=Ir();bm=e;var t=n.constant(1);function e(i,a,o){return r(i,a||t,o||function(s){return i.outEdges(s)})}function r(i,a,o){var s={},u=i.nodes();return u.forEach(function(c){s[c]={},s[c][c]={distance:0},u.forEach(function(l){c!==l&&(s[c][l]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(l){var d=l.v===c?l.w:l.v,p=a(l);s[c][d]={distance:p,predecessor:c}})}),u.forEach(function(c){var l=s[c];u.forEach(function(d){var p=s[d];u.forEach(function(g){var m=p[c],y=l[g],v=p[g],x=m.distance+y.distance;x<v.distance&&(v.distance=x,v.predecessor=y.predecessor)})})}),s}return bm}var xm,OC;function SP(){if(OC)return xm;OC=1;var n=Ir();xm=t,t.CycleException=e;function t(r){var i={},a={},o=[];function s(u){if(n.has(a,u))throw new e;n.has(i,u)||(a[u]=!0,i[u]=!0,n.each(r.predecessors(u),s),delete a[u],o.push(u))}if(n.each(r.sinks(),s),n.size(i)!==r.nodeCount())throw new e;return o}function e(){}return e.prototype=new Error,xm}var Em,PC;function QX(){if(PC)return Em;PC=1;var n=SP();Em=t;function t(e){try{n(e)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return Em}var wm,RC;function CP(){if(RC)return wm;RC=1;var n=Ir();wm=t;function t(r,i,a){n.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),s=[],u={};return n.each(i,function(c){if(!r.hasNode(c))throw new Error("Graph does not have node: "+c);e(r,c,a==="post",u,o,s)}),s}function e(r,i,a,o,s,u){n.has(o,i)||(o[i]=!0,a||u.push(i),n.each(s(i),function(c){e(r,c,a,o,s,u)}),a&&u.push(i))}return wm}var km,DC;function tq(){if(DC)return km;DC=1;var n=CP();km=t;function t(e,r){return n(e,r,"post")}return km}var Am,LC;function eq(){if(LC)return Am;LC=1;var n=CP();Am=t;function t(e,r){return n(e,r,"pre")}return Am}var Sm,IC;function nq(){if(IC)return Sm;IC=1;var n=Ir(),t=ax(),e=wP();Sm=r;function r(i,a){var o=new t,s={},u=new e,c;function l(p){var g=p.v===c?p.w:p.v,m=u.priority(g);if(m!==void 0){var y=a(p);y<m&&(s[g]=c,u.decrease(g,y))}}if(i.nodeCount()===0)return o;n.each(i.nodes(),function(p){u.add(p,Number.POSITIVE_INFINITY),o.setNode(p)}),u.decrease(i.nodes()[0],0);for(var d=!1;u.size()>0;){if(c=u.removeMin(),n.has(s,c))o.setEdge(c,s[c]);else{if(d)throw new Error("Input graph is not connected: "+i);d=!0}i.nodeEdges(c).forEach(l)}return o}return Sm}var jC,BC;function rq(){return BC||(BC=1,jC={components:qX(),dijkstra:kP(),dijkstraAll:KX(),findCycles:ZX(),floydWarshall:JX(),isAcyclic:QX(),postorder:tq(),preorder:eq(),prim:nq(),tarjan:AP(),topsort:SP()}),jC}var Cm,zC;function iq(){if(zC)return Cm;zC=1;var n=HX();return Cm={Graph:n.Graph,json:XX(),alg:rq(),version:n.version},Cm}var Nm,FC;function qr(){if(FC)return Nm;FC=1;var n;if(typeof Ub=="function")try{n=iq()}catch{}return n||(n=window.graphlib),Nm=n,Nm}var Tm,GC;function aq(){if(GC)return Tm;GC=1;var n=ZO(),t=1,e=4;function r(i){return n(i,t|e)}return Tm=r,Tm}var Mm,VC;function bd(){if(VC)return Mm;VC=1;var n=bs(),t=Vi(),e=ld(),r=Lr();function i(a,o,s){if(!r(s))return!1;var u=typeof o;return(u=="number"?t(s)&&e(o,s.length):u=="string"&&o in s)?n(s[o],a):!1}return Mm=i,Mm}var _m,UC;function oq(){if(UC)return _m;UC=1;var n=yd(),t=bs(),e=bd(),r=vo(),i=Object.prototype,a=i.hasOwnProperty,o=n(function(s,u){s=Object(s);var c=-1,l=u.length,d=l>2?u[2]:void 0;for(d&&e(u[0],u[1],d)&&(l=1);++c<l;)for(var p=u[c],g=r(p),m=-1,y=g.length;++m<y;){var v=g[m],x=s[v];(x===void 0||t(x,i[v])&&!a.call(s,v))&&(s[v]=p[v])}return s});return _m=o,_m}var Om,WC;function sq(){if(WC)return Om;WC=1;var n=Ui(),t=Vi(),e=Ca();function r(i){return function(a,o,s){var u=Object(a);if(!t(a)){var c=n(o,3);a=e(a),o=function(d){return c(u[d],d,u)}}var l=i(a,o,s);return l>-1?u[c?a[l]:l]:void 0}}return Om=r,Om}var Pm,YC;function uq(){if(YC)return Pm;YC=1;var n=/\s/;function t(e){for(var r=e.length;r--&&n.test(e.charAt(r)););return r}return Pm=t,Pm}var Rm,$C;function cq(){if($C)return Rm;$C=1;var n=uq(),t=/^\s+/;function e(r){return r&&r.slice(0,n(r)+1).replace(t,"")}return Rm=e,Rm}var Dm,HC;function lq(){if(HC)return Dm;HC=1;var n=cq(),t=Lr(),e=ks(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(c){if(typeof c=="number")return c;if(e(c))return r;if(t(c)){var l=typeof c.valueOf=="function"?c.valueOf():c;c=t(l)?l+"":l}if(typeof c!="string")return c===0?c:+c;c=n(c);var d=a.test(c);return d||o.test(c)?s(c.slice(2),d?2:8):i.test(c)?r:+c}return Dm=u,Dm}var Lm,XC;function NP(){if(XC)return Lm;XC=1;var n=lq(),t=1/0,e=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=n(i),i===t||i===-t){var a=i<0?-1:1;return a*e}return i===i?i:0}return Lm=r,Lm}var Im,qC;function hq(){if(qC)return Im;qC=1;var n=NP();function t(e){var r=n(e),i=r%1;return r===r?i?r-i:r:0}return Im=t,Im}var jm,KC;function dq(){if(KC)return jm;KC=1;var n=bP(),t=Ui(),e=hq(),r=Math.max;function i(a,o,s){var u=a==null?0:a.length;if(!u)return-1;var c=s==null?0:e(s);return c<0&&(c=r(u+c,0)),n(a,t(o,3),c)}return jm=i,jm}var Bm,ZC;function fq(){if(ZC)return Bm;ZC=1;var n=sq(),t=dq(),e=n(t);return Bm=e,Bm}var zm,JC;function TP(){if(JC)return zm;JC=1;var n=ix();function t(e){var r=e==null?0:e.length;return r?n(e,1):[]}return zm=t,zm}var Fm,QC;function pq(){if(QC)return Fm;QC=1;var n=tx(),t=JO(),e=vo();function r(i,a){return i==null?i:n(i,t(a),e)}return Fm=r,Fm}var Gm,tN;function gq(){if(tN)return Gm;tN=1;function n(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}return Gm=n,Gm}var Vm,eN;function vq(){if(eN)return Vm;eN=1;var n=ud(),t=ex(),e=Ui();function r(i,a){var o={};return a=e(a,3),t(i,function(s,u,c){n(o,u,a(s,u,c))}),o}return Vm=r,Vm}var Um,nN;function ox(){if(nN)return Um;nN=1;var n=ks();function t(e,r,i){for(var a=-1,o=e.length;++a<o;){var s=e[a],u=r(s);if(u!=null&&(c===void 0?u===u&&!n(u):i(u,c)))var c=u,l=s}return l}return Um=t,Um}var Wm,rN;function mq(){if(rN)return Wm;rN=1;function n(t,e){return t>e}return Wm=n,Wm}var Ym,iN;function yq(){if(iN)return Ym;iN=1;var n=ox(),t=mq(),e=mo();function r(i){return i&&i.length?n(i,e,t):void 0}return Ym=r,Ym}var $m,aN;function MP(){if(aN)return $m;aN=1;var n=ud(),t=bs();function e(r,i,a){(a!==void 0&&!t(r[i],a)||a===void 0&&!(i in r))&&n(r,i,a)}return $m=e,$m}var Hm,oN;function bq(){if(oN)return Hm;oN=1;var n=po(),t=fd(),e=xi(),r="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,u=o.call(Object);function c(l){if(!e(l)||n(l)!=r)return!1;var d=t(l);if(d===null)return!0;var p=s.call(d,"constructor")&&d.constructor;return typeof p=="function"&&p instanceof p&&o.call(p)==u}return Hm=c,Hm}var Xm,sN;function _P(){if(sN)return Xm;sN=1;function n(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}return Xm=n,Xm}var qm,uN;function xq(){if(uN)return qm;uN=1;var n=Yu(),t=vo();function e(r){return n(r,t(r))}return qm=e,qm}var Km,cN;function Eq(){if(cN)return Km;cN=1;var n=MP(),t=zO(),e=XO(),r=FO(),i=KO(),a=$u(),o=Ze(),s=xP(),u=Es(),c=Wu(),l=Lr(),d=bq(),p=Hu(),g=_P(),m=xq();function y(v,x,E,w,S,k,A){var N=g(v,E),T=g(x,E),O=A.get(T);if(O){n(v,E,O);return}var M=k?k(N,T,E+"",v,x,A):void 0,P=M===void 0;if(P){var L=o(T),j=!L&&u(T),z=!L&&!j&&p(T);M=T,L||j||z?o(N)?M=N:s(N)?M=r(N):j?(P=!1,M=t(T,!0)):z?(P=!1,M=e(T,!0)):M=[]:d(T)||a(T)?(M=N,a(N)?M=m(N):(!l(N)||c(N))&&(M=i(T))):P=!1}P&&(A.set(T,M),S(M,T,w,k,A),A.delete(T)),n(v,E,M)}return Km=y,Km}var Zm,lN;function wq(){if(lN)return Zm;lN=1;var n=sd(),t=MP(),e=tx(),r=Eq(),i=Lr(),a=vo(),o=_P();function s(u,c,l,d,p){u!==c&&e(c,function(g,m){if(p||(p=new n),i(g))r(u,c,m,l,s,d,p);else{var y=d?d(o(u,m),g,m+"",u,c,p):void 0;y===void 0&&(y=g),t(u,m,y)}},a)}return Zm=s,Zm}var Jm,hN;function kq(){if(hN)return Jm;hN=1;var n=yd(),t=bd();function e(r){return n(function(i,a){var o=-1,s=a.length,u=s>1?a[s-1]:void 0,c=s>2?a[2]:void 0;for(u=r.length>3&&typeof u=="function"?(s--,u):void 0,c&&t(a[0],a[1],c)&&(u=s<3?void 0:u,s=1),i=Object(i);++o<s;){var l=a[o];l&&r(i,l,o,u)}return i})}return Jm=e,Jm}var Qm,dN;function Aq(){if(dN)return Qm;dN=1;var n=wq(),t=kq(),e=t(function(r,i,a){n(r,i,a)});return Qm=e,Qm}var ty,fN;function OP(){if(fN)return ty;fN=1;function n(t,e){return t<e}return ty=n,ty}var ey,pN;function Sq(){if(pN)return ey;pN=1;var n=ox(),t=OP(),e=mo();function r(i){return i&&i.length?n(i,e,t):void 0}return ey=r,ey}var ny,gN;function Cq(){if(gN)return ny;gN=1;var n=ox(),t=Ui(),e=OP();function r(i,a){return i&&i.length?n(i,t(a,2),e):void 0}return ny=r,ny}var ry,vN;function Nq(){if(vN)return ry;vN=1;var n=Kr(),t=function(){return n.Date.now()};return ry=t,ry}var iy,mN;function Tq(){if(mN)return iy;mN=1;var n=cd(),t=vd(),e=ld(),r=Lr(),i=Xu();function a(o,s,u,c){if(!r(o))return o;s=t(s,o);for(var l=-1,d=s.length,p=d-1,g=o;g!=null&&++l<d;){var m=i(s[l]),y=u;if(m==="__proto__"||m==="constructor"||m==="prototype")return o;if(l!=p){var v=g[m];y=c?c(v,m,g):void 0,y===void 0&&(y=r(v)?v:e(s[l+1])?[]:{})}n(g,m,y),g=g[m]}return o}return iy=a,iy}var ay,yN;function Mq(){if(yN)return ay;yN=1;var n=md(),t=Tq(),e=vd();function r(i,a,o){for(var s=-1,u=a.length,c={};++s<u;){var l=a[s],d=n(i,l);o(d,l)&&t(c,e(l,i),d)}return c}return ay=r,ay}var oy,bN;function _q(){if(bN)return oy;bN=1;var n=Mq(),t=cP();function e(r,i){return n(r,i,function(a,o){return t(r,o)})}return oy=e,oy}var sy,xN;function Oq(){if(xN)return sy;xN=1;var n=TP(),t=mP(),e=yP();function r(i){return e(t(i,void 0,n),i+"")}return sy=r,sy}var uy,EN;function Pq(){if(EN)return uy;EN=1;var n=_q(),t=Oq(),e=t(function(r,i){return r==null?{}:n(r,i)});return uy=e,uy}var cy,wN;function Rq(){if(wN)return cy;wN=1;var n=Math.ceil,t=Math.max;function e(r,i,a,o){for(var s=-1,u=t(n((i-r)/(a||1)),0),c=Array(u);u--;)c[o?u:++s]=r,r+=a;return c}return cy=e,cy}var ly,kN;function Dq(){if(kN)return ly;kN=1;var n=Rq(),t=bd(),e=NP();function r(i){return function(a,o,s){return s&&typeof s!="number"&&t(a,o,s)&&(o=s=void 0),a=e(a),o===void 0?(o=a,a=0):o=e(o),s=s===void 0?a<o?1:-1:e(s),n(a,o,s,i)}}return ly=r,ly}var hy,AN;function Lq(){if(AN)return hy;AN=1;var n=Dq(),t=n();return hy=t,hy}var dy,SN;function Iq(){if(SN)return dy;SN=1;function n(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}return dy=n,dy}var fy,CN;function jq(){if(CN)return fy;CN=1;var n=ks();function t(e,r){if(e!==r){var i=e!==void 0,a=e===null,o=e===e,s=n(e),u=r!==void 0,c=r===null,l=r===r,d=n(r);if(!c&&!d&&!s&&e>r||s&&u&&l&&!c&&!d||a&&u&&l||!i&&l||!o)return 1;if(!a&&!s&&!d&&e<r||d&&i&&o&&!a&&!s||c&&i&&o||!u&&o||!l)return-1}return 0}return fy=t,fy}var py,NN;function Bq(){if(NN)return py;NN=1;var n=jq();function t(e,r,i){for(var a=-1,o=e.criteria,s=r.criteria,u=o.length,c=i.length;++a<u;){var l=n(o[a],s[a]);if(l){if(a>=c)return l;var d=i[a];return l*(d=="desc"?-1:1)}}return e.index-r.index}return py=t,py}var gy,TN;function zq(){if(TN)return gy;TN=1;var n=gd(),t=md(),e=Ui(),r=pP(),i=Iq(),a=hd(),o=Bq(),s=mo(),u=Ze();function c(l,d,p){d.length?d=n(d,function(y){return u(y)?function(v){return t(v,y.length===1?y[0]:y)}:y}):d=[s];var g=-1;d=n(d,a(e));var m=r(l,function(y,v,x){var E=n(d,function(w){return w(y)});return{criteria:E,index:++g,value:y}});return i(m,function(y,v){return o(y,v,p)})}return gy=c,gy}var vy,MN;function Fq(){if(MN)return vy;MN=1;var n=ix(),t=zq(),e=yd(),r=bd(),i=e(function(a,o){if(a==null)return[];var s=o.length;return s>1&&r(a,o[0],o[1])?o=[]:s>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,n(o,1),[])});return vy=i,vy}var my,_N;function Gq(){if(_N)return my;_N=1;var n=sP(),t=0;function e(r){var i=++t;return n(r)+i}return my=e,my}var yy,ON;function Vq(){if(ON)return yy;ON=1;function n(t,e,r){for(var i=-1,a=t.length,o=e.length,s={};++i<a;){var u=i<o?e[i]:void 0;r(s,t[i],u)}return s}return yy=n,yy}var by,PN;function Uq(){if(PN)return by;PN=1;var n=cd(),t=Vq();function e(r,i){return t(r||[],i||[],n)}return by=e,by}var xy,RN;function Re(){if(RN)return xy;RN=1;var n;if(typeof Ub=="function")try{n={cloneDeep:aq(),constant:Qb(),defaults:oq(),each:tP(),filter:hP(),find:fq(),flatten:TP(),forEach:QO(),forIn:pq(),has:dP(),isUndefined:fP(),last:gq(),map:gP(),mapValues:vq(),max:yq(),merge:Aq(),min:Sq(),minBy:Cq(),now:Nq(),pick:Pq(),range:Lq(),reduce:vP(),sortBy:Fq(),uniqueId:Gq(),values:EP(),zipObject:Uq()}}catch{}return n||(n=window._),xy=n,xy}var Ey,DN;function Wq(){if(DN)return Ey;DN=1,Ey=n;function n(){var r={};r._next=r._prev=r,this._sentinel=r}n.prototype.dequeue=function(){var r=this._sentinel,i=r._prev;if(i!==r)return t(i),i},n.prototype.enqueue=function(r){var i=this._sentinel;r._prev&&r._next&&t(r),r._next=i._next,i._next._prev=r,i._next=r,r._prev=i},n.prototype.toString=function(){for(var r=[],i=this._sentinel,a=i._prev;a!==i;)r.push(JSON.stringify(a,e)),a=a._prev;return"["+r.join(", ")+"]"};function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function e(r,i){if(r!=="_next"&&r!=="_prev")return i}return Ey}var wy,LN;function Yq(){if(LN)return wy;LN=1;var n=Re(),t=qr().Graph,e=Wq();wy=i;var r=n.constant(1);function i(c,l){if(c.nodeCount()<=1)return[];var d=s(c,l||r),p=a(d.graph,d.buckets,d.zeroIdx);return n.flatten(n.map(p,function(g){return c.outEdges(g.v,g.w)}),!0)}function a(c,l,d){for(var p=[],g=l[l.length-1],m=l[0],y;c.nodeCount();){for(;y=m.dequeue();)o(c,l,d,y);for(;y=g.dequeue();)o(c,l,d,y);if(c.nodeCount()){for(var v=l.length-2;v>0;--v)if(y=l[v].dequeue(),y){p=p.concat(o(c,l,d,y,!0));break}}}return p}function o(c,l,d,p,g){var m=g?[]:void 0;return n.forEach(c.inEdges(p.v),function(y){var v=c.edge(y),x=c.node(y.v);g&&m.push({v:y.v,w:y.w}),x.out-=v,u(l,d,x)}),n.forEach(c.outEdges(p.v),function(y){var v=c.edge(y),x=y.w,E=c.node(x);E.in-=v,u(l,d,E)}),c.removeNode(p.v),m}function s(c,l){var d=new t,p=0,g=0;n.forEach(c.nodes(),function(v){d.setNode(v,{v,in:0,out:0})}),n.forEach(c.edges(),function(v){var x=d.edge(v.v,v.w)||0,E=l(v),w=x+E;d.setEdge(v.v,v.w,w),g=Math.max(g,d.node(v.v).out+=E),p=Math.max(p,d.node(v.w).in+=E)});var m=n.range(g+p+3).map(function(){return new e}),y=p+1;return n.forEach(d.nodes(),function(v){u(m,y,d.node(v))}),{graph:d,buckets:m,zeroIdx:y}}function u(c,l,d){d.out?d.in?c[d.out-d.in+l].enqueue(d):c[c.length-1].enqueue(d):c[0].enqueue(d)}return wy}var ky,IN;function $q(){if(IN)return ky;IN=1;var n=Re(),t=Yq();ky={run:e,undo:i};function e(a){var o=a.graph().acyclicer==="greedy"?t(a,s(a)):r(a);n.forEach(o,function(u){var c=a.edge(u);a.removeEdge(u),c.forwardName=u.name,c.reversed=!0,a.setEdge(u.w,u.v,c,n.uniqueId("rev"))});function s(u){return function(c){return u.edge(c).weight}}}function r(a){var o=[],s={},u={};function c(l){n.has(u,l)||(u[l]=!0,s[l]=!0,n.forEach(a.outEdges(l),function(d){n.has(s,d.w)?o.push(d):c(d.w)}),delete s[l])}return n.forEach(a.nodes(),c),o}function i(a){n.forEach(a.edges(),function(o){var s=a.edge(o);if(s.reversed){a.removeEdge(o);var u=s.forwardName;delete s.reversed,delete s.forwardName,a.setEdge(o.w,o.v,s,u)}})}return ky}var Ay,jN;function Qn(){if(jN)return Ay;jN=1;var n=Re(),t=qr().Graph;Ay={addDummyNode:e,simplify:r,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:o,intersectRect:s,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:l,addBorderNode:d,maxRank:p,partition:g,time:m,notime:y};function e(v,x,E,w){var S;do S=n.uniqueId(w);while(v.hasNode(S));return E.dummy=x,v.setNode(S,E),S}function r(v){var x=new t().setGraph(v.graph());return n.forEach(v.nodes(),function(E){x.setNode(E,v.node(E))}),n.forEach(v.edges(),function(E){var w=x.edge(E.v,E.w)||{weight:0,minlen:1},S=v.edge(E);x.setEdge(E.v,E.w,{weight:w.weight+S.weight,minlen:Math.max(w.minlen,S.minlen)})}),x}function i(v){var x=new t({multigraph:v.isMultigraph()}).setGraph(v.graph());return n.forEach(v.nodes(),function(E){v.children(E).length||x.setNode(E,v.node(E))}),n.forEach(v.edges(),function(E){x.setEdge(E,v.edge(E))}),x}function a(v){var x=n.map(v.nodes(),function(E){var w={};return n.forEach(v.outEdges(E),function(S){w[S.w]=(w[S.w]||0)+v.edge(S).weight}),w});return n.zipObject(v.nodes(),x)}function o(v){var x=n.map(v.nodes(),function(E){var w={};return n.forEach(v.inEdges(E),function(S){w[S.v]=(w[S.v]||0)+v.edge(S).weight}),w});return n.zipObject(v.nodes(),x)}function s(v,x){var E=v.x,w=v.y,S=x.x-E,k=x.y-w,A=v.width/2,N=v.height/2;if(!S&&!k)throw new Error("Not possible to find intersection inside of the rectangle");var T,O;return Math.abs(k)*A>Math.abs(S)*N?(k<0&&(N=-N),T=N*S/k,O=N):(S<0&&(A=-A),T=A,O=A*k/S),{x:E+T,y:w+O}}function u(v){var x=n.map(n.range(p(v)+1),function(){return[]});return n.forEach(v.nodes(),function(E){var w=v.node(E),S=w.rank;n.isUndefined(S)||(x[S][w.order]=E)}),x}function c(v){var x=n.min(n.map(v.nodes(),function(E){return v.node(E).rank}));n.forEach(v.nodes(),function(E){var w=v.node(E);n.has(w,"rank")&&(w.rank-=x)})}function l(v){var x=n.min(n.map(v.nodes(),function(k){return v.node(k).rank})),E=[];n.forEach(v.nodes(),function(k){var A=v.node(k).rank-x;E[A]||(E[A]=[]),E[A].push(k)});var w=0,S=v.graph().nodeRankFactor;n.forEach(E,function(k,A){n.isUndefined(k)&&A%S!==0?--w:w&&n.forEach(k,function(N){v.node(N).rank+=w})})}function d(v,x,E,w){var S={width:0,height:0};return arguments.length>=4&&(S.rank=E,S.order=w),e(v,"border",S,x)}function p(v){return n.max(n.map(v.nodes(),function(x){var E=v.node(x).rank;if(!n.isUndefined(E))return E}))}function g(v,x){var E={lhs:[],rhs:[]};return n.forEach(v,function(w){x(w)?E.lhs.push(w):E.rhs.push(w)}),E}function m(v,x){var E=n.now();try{return x()}finally{console.log(v+" time: "+(n.now()-E)+"ms")}}function y(v,x){return x()}return Ay}var Sy,BN;function Hq(){if(BN)return Sy;BN=1;var n=Re(),t=Qn();Sy={run:e,undo:i};function e(a){a.graph().dummyChains=[],n.forEach(a.edges(),function(o){r(a,o)})}function r(a,o){var s=o.v,u=a.node(s).rank,c=o.w,l=a.node(c).rank,d=o.name,p=a.edge(o),g=p.labelRank;if(l!==u+1){a.removeEdge(o);var m,y,v;for(v=0,++u;u<l;++v,++u)p.points=[],y={width:0,height:0,edgeLabel:p,edgeObj:o,rank:u},m=t.addDummyNode(a,"edge",y,"_d"),u===g&&(y.width=p.width,y.height=p.height,y.dummy="edge-label",y.labelpos=p.labelpos),a.setEdge(s,m,{weight:p.weight},d),v===0&&a.graph().dummyChains.push(m),s=m;a.setEdge(s,c,{weight:p.weight},d)}}function i(a){n.forEach(a.graph().dummyChains,function(o){var s=a.node(o),u=s.edgeLabel,c;for(a.setEdge(s.edgeObj,u);s.dummy;)c=a.successors(o)[0],a.removeNode(o),u.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(u.x=s.x,u.y=s.y,u.width=s.width,u.height=s.height),o=c,s=a.node(o)})}return Sy}var Cy,zN;function bh(){if(zN)return Cy;zN=1;var n=Re();Cy={longestPath:t,slack:e};function t(r){var i={};function a(o){var s=r.node(o);if(n.has(i,o))return s.rank;i[o]=!0;var u=n.min(n.map(r.outEdges(o),function(c){return a(c.w)-r.edge(c).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),s.rank=u}n.forEach(r.sources(),a)}function e(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return Cy}var Ny,FN;function PP(){if(FN)return Ny;FN=1;var n=Re(),t=qr().Graph,e=bh().slack;Ny=r;function r(s){var u=new t({directed:!1}),c=s.nodes()[0],l=s.nodeCount();u.setNode(c,{});for(var d,p;i(u,s)<l;)d=a(u,s),p=u.hasNode(d.v)?e(s,d):-e(s,d),o(u,s,p);return u}function i(s,u){function c(l){n.forEach(u.nodeEdges(l),function(d){var p=d.v,g=l===p?d.w:p;!s.hasNode(g)&&!e(u,d)&&(s.setNode(g,{}),s.setEdge(l,g,{}),c(g))})}return n.forEach(s.nodes(),c),s.nodeCount()}function a(s,u){return n.minBy(u.edges(),function(c){if(s.hasNode(c.v)!==s.hasNode(c.w))return e(u,c)})}function o(s,u,c){n.forEach(s.nodes(),function(l){u.node(l).rank+=c})}return Ny}var Ty,GN;function Xq(){if(GN)return Ty;GN=1;var n=Re(),t=PP(),e=bh().slack,r=bh().longestPath,i=qr().alg.preorder,a=qr().alg.postorder,o=Qn().simplify;Ty=s,s.initLowLimValues=d,s.initCutValues=u,s.calcCutValue=l,s.leaveEdge=g,s.enterEdge=m,s.exchangeEdges=y;function s(w){w=o(w),r(w);var S=t(w);d(S),u(S,w);for(var k,A;k=g(S);)A=m(S,w,k),y(S,w,k,A)}function u(w,S){var k=a(w,w.nodes());k=k.slice(0,k.length-1),n.forEach(k,function(A){c(w,S,A)})}function c(w,S,k){var A=w.node(k),N=A.parent;w.edge(k,N).cutvalue=l(w,S,k)}function l(w,S,k){var A=w.node(k),N=A.parent,T=!0,O=S.edge(k,N),M=0;return O||(T=!1,O=S.edge(N,k)),M=O.weight,n.forEach(S.nodeEdges(k),function(P){var L=P.v===k,j=L?P.w:P.v;if(j!==N){var z=L===T,U=S.edge(P).weight;if(M+=z?U:-U,x(w,k,j)){var J=w.edge(k,j).cutvalue;M+=z?-J:J}}}),M}function d(w,S){arguments.length<2&&(S=w.nodes()[0]),p(w,{},1,S)}function p(w,S,k,A,N){var T=k,O=w.node(A);return S[A]=!0,n.forEach(w.neighbors(A),function(M){n.has(S,M)||(k=p(w,S,k,M,A))}),O.low=T,O.lim=k++,N?O.parent=N:delete O.parent,k}function g(w){return n.find(w.edges(),function(S){return w.edge(S).cutvalue<0})}function m(w,S,k){var A=k.v,N=k.w;S.hasEdge(A,N)||(A=k.w,N=k.v);var T=w.node(A),O=w.node(N),M=T,P=!1;T.lim>O.lim&&(M=O,P=!0);var L=n.filter(S.edges(),function(j){return P===E(w,w.node(j.v),M)&&P!==E(w,w.node(j.w),M)});return n.minBy(L,function(j){return e(S,j)})}function y(w,S,k,A){var N=k.v,T=k.w;w.removeEdge(N,T),w.setEdge(A.v,A.w,{}),d(w),u(w,S),v(w,S)}function v(w,S){var k=n.find(w.nodes(),function(N){return!S.node(N).parent}),A=i(w,k);A=A.slice(1),n.forEach(A,function(N){var T=w.node(N).parent,O=S.edge(N,T),M=!1;O||(O=S.edge(T,N),M=!0),S.node(N).rank=S.node(T).rank+(M?O.minlen:-O.minlen)})}function x(w,S,k){return w.hasEdge(S,k)}function E(w,S,k){return k.low<=S.lim&&S.lim<=k.lim}return Ty}var My,VN;function qq(){if(VN)return My;VN=1;var n=bh(),t=n.longestPath,e=PP(),r=Xq();My=i;function i(u){switch(u.graph().ranker){case"network-simplex":s(u);break;case"tight-tree":o(u);break;case"longest-path":a(u);break;default:s(u)}}var a=t;function o(u){t(u),e(u)}function s(u){r(u)}return My}var _y,UN;function Kq(){if(UN)return _y;UN=1;var n=Re();_y=t;function t(i){var a=r(i);n.forEach(i.graph().dummyChains,function(o){for(var s=i.node(o),u=s.edgeObj,c=e(i,a,u.v,u.w),l=c.path,d=c.lca,p=0,g=l[p],m=!0;o!==u.w;){if(s=i.node(o),m){for(;(g=l[p])!==d&&i.node(g).maxRank<s.rank;)p++;g===d&&(m=!1)}if(!m){for(;p<l.length-1&&i.node(g=l[p+1]).minRank<=s.rank;)p++;g=l[p]}i.setParent(o,g),o=i.successors(o)[0]}})}function e(i,a,o,s){var u=[],c=[],l=Math.min(a[o].low,a[s].low),d=Math.max(a[o].lim,a[s].lim),p,g;p=o;do p=i.parent(p),u.push(p);while(p&&(a[p].low>l||d>a[p].lim));for(g=p,p=s;(p=i.parent(p))!==g;)c.push(p);return{path:u.concat(c.reverse()),lca:g}}function r(i){var a={},o=0;function s(u){var c=o;n.forEach(i.children(u),s),a[u]={low:c,lim:o++}}return n.forEach(i.children(),s),a}return _y}var Oy,WN;function Zq(){if(WN)return Oy;WN=1;var n=Re(),t=Qn();Oy={run:e,cleanup:o};function e(s){var u=t.addDummyNode(s,"root",{},"_root"),c=i(s),l=n.max(n.values(c))-1,d=2*l+1;s.graph().nestingRoot=u,n.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var p=a(s)+1;n.forEach(s.children(),function(g){r(s,u,d,p,l,c,g)}),s.graph().nodeRankFactor=d}function r(s,u,c,l,d,p,g){var m=s.children(g);if(!m.length){g!==u&&s.setEdge(u,g,{weight:0,minlen:c});return}var y=t.addBorderNode(s,"_bt"),v=t.addBorderNode(s,"_bb"),x=s.node(g);s.setParent(y,g),x.borderTop=y,s.setParent(v,g),x.borderBottom=v,n.forEach(m,function(E){r(s,u,c,l,d,p,E);var w=s.node(E),S=w.borderTop?w.borderTop:E,k=w.borderBottom?w.borderBottom:E,A=w.borderTop?l:2*l,N=S!==k?1:d-p[g]+1;s.setEdge(y,S,{weight:A,minlen:N,nestingEdge:!0}),s.setEdge(k,v,{weight:A,minlen:N,nestingEdge:!0})}),s.parent(g)||s.setEdge(u,y,{weight:0,minlen:d+p[g]})}function i(s){var u={};function c(l,d){var p=s.children(l);p&&p.length&&n.forEach(p,function(g){c(g,d+1)}),u[l]=d}return n.forEach(s.children(),function(l){c(l,1)}),u}function a(s){return n.reduce(s.edges(),function(u,c){return u+s.edge(c).weight},0)}function o(s){var u=s.graph();s.removeNode(u.nestingRoot),delete u.nestingRoot,n.forEach(s.edges(),function(c){var l=s.edge(c);l.nestingEdge&&s.removeEdge(c)})}return Oy}var Py,YN;function Jq(){if(YN)return Py;YN=1;var n=Re(),t=Qn();Py=e;function e(i){function a(o){var s=i.children(o),u=i.node(o);if(s.length&&n.forEach(s,a),n.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var c=u.minRank,l=u.maxRank+1;c<l;++c)r(i,"borderLeft","_bl",o,u,c),r(i,"borderRight","_br",o,u,c)}}n.forEach(i.children(),a)}function r(i,a,o,s,u,c){var l={width:0,height:0,rank:c,borderType:a},d=u[a][c-1],p=t.addDummyNode(i,"border",l,o);u[a][c]=p,i.setParent(p,s),d&&i.setEdge(d,p,{weight:1})}return Py}var Ry,$N;function Qq(){if($N)return Ry;$N=1;var n=Re();Ry={adjust:t,undo:e};function t(c){var l=c.graph().rankdir.toLowerCase();(l==="lr"||l==="rl")&&r(c)}function e(c){var l=c.graph().rankdir.toLowerCase();(l==="bt"||l==="rl")&&a(c),(l==="lr"||l==="rl")&&(s(c),r(c))}function r(c){n.forEach(c.nodes(),function(l){i(c.node(l))}),n.forEach(c.edges(),function(l){i(c.edge(l))})}function i(c){var l=c.width;c.width=c.height,c.height=l}function a(c){n.forEach(c.nodes(),function(l){o(c.node(l))}),n.forEach(c.edges(),function(l){var d=c.edge(l);n.forEach(d.points,o),n.has(d,"y")&&o(d)})}function o(c){c.y=-c.y}function s(c){n.forEach(c.nodes(),function(l){u(c.node(l))}),n.forEach(c.edges(),function(l){var d=c.edge(l);n.forEach(d.points,u),n.has(d,"x")&&u(d)})}function u(c){var l=c.x;c.x=c.y,c.y=l}return Ry}var Dy,HN;function tK(){if(HN)return Dy;HN=1;var n=Re();Dy=t;function t(e){var r={},i=n.filter(e.nodes(),function(c){return!e.children(c).length}),a=n.max(n.map(i,function(c){return e.node(c).rank})),o=n.map(n.range(a+1),function(){return[]});function s(c){if(!n.has(r,c)){r[c]=!0;var l=e.node(c);o[l.rank].push(c),n.forEach(e.successors(c),s)}}var u=n.sortBy(i,function(c){return e.node(c).rank});return n.forEach(u,s),o}return Dy}var Ly,XN;function eK(){if(XN)return Ly;XN=1;var n=Re();Ly=t;function t(r,i){for(var a=0,o=1;o<i.length;++o)a+=e(r,i[o-1],i[o]);return a}function e(r,i,a){for(var o=n.zipObject(a,n.map(a,function(p,g){return g})),s=n.flatten(n.map(i,function(p){return n.sortBy(n.map(r.outEdges(p),function(g){return{pos:o[g.w],weight:r.edge(g).weight}}),"pos")}),!0),u=1;u<a.length;)u<<=1;var c=2*u-1;u-=1;var l=n.map(new Array(c),function(){return 0}),d=0;return n.forEach(s.forEach(function(p){var g=p.pos+u;l[g]+=p.weight;for(var m=0;g>0;)g%2&&(m+=l[g+1]),g=g-1>>1,l[g]+=p.weight;d+=p.weight*m})),d}return Ly}var Iy,qN;function nK(){if(qN)return Iy;qN=1;var n=Re();Iy=t;function t(e,r){return n.map(r,function(i){var a=e.inEdges(i);if(a.length){var o=n.reduce(a,function(s,u){var c=e.edge(u),l=e.node(u.v);return{sum:s.sum+c.weight*l.order,weight:s.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:i}})}return Iy}var jy,KN;function rK(){if(KN)return jy;KN=1;var n=Re();jy=t;function t(i,a){var o={};n.forEach(i,function(u,c){var l=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:c};n.isUndefined(u.barycenter)||(l.barycenter=u.barycenter,l.weight=u.weight)}),n.forEach(a.edges(),function(u){var c=o[u.v],l=o[u.w];!n.isUndefined(c)&&!n.isUndefined(l)&&(l.indegree++,c.out.push(o[u.w]))});var s=n.filter(o,function(u){return!u.indegree});return e(s)}function e(i){var a=[];function o(c){return function(l){l.merged||(n.isUndefined(l.barycenter)||n.isUndefined(c.barycenter)||l.barycenter>=c.barycenter)&&r(c,l)}}function s(c){return function(l){l.in.push(c),--l.indegree===0&&i.push(l)}}for(;i.length;){var u=i.pop();a.push(u),n.forEach(u.in.reverse(),o(u)),n.forEach(u.out,s(u))}return n.map(n.filter(a,function(c){return!c.merged}),function(c){return n.pick(c,["vs","i","barycenter","weight"])})}function r(i,a){var o=0,s=0;i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=o/s,i.weight=s,i.i=Math.min(a.i,i.i),a.merged=!0}return jy}var By,ZN;function iK(){if(ZN)return By;ZN=1;var n=Re(),t=Qn();By=e;function e(a,o){var s=t.partition(a,function(y){return n.has(y,"barycenter")}),u=s.lhs,c=n.sortBy(s.rhs,function(y){return-y.i}),l=[],d=0,p=0,g=0;u.sort(i(!!o)),g=r(l,c,g),n.forEach(u,function(y){g+=y.vs.length,l.push(y.vs),d+=y.barycenter*y.weight,p+=y.weight,g=r(l,c,g)});var m={vs:n.flatten(l,!0)};return p&&(m.barycenter=d/p,m.weight=p),m}function r(a,o,s){for(var u;o.length&&(u=n.last(o)).i<=s;)o.pop(),a.push(u.vs),s++;return s}function i(a){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:a?s.i-o.i:o.i-s.i}}return By}var zy,JN;function aK(){if(JN)return zy;JN=1;var n=Re(),t=nK(),e=rK(),r=iK();zy=i;function i(s,u,c,l){var d=s.children(u),p=s.node(u),g=p?p.borderLeft:void 0,m=p?p.borderRight:void 0,y={};g&&(d=n.filter(d,function(k){return k!==g&&k!==m}));var v=t(s,d);n.forEach(v,function(k){if(s.children(k.v).length){var A=i(s,k.v,c,l);y[k.v]=A,n.has(A,"barycenter")&&o(k,A)}});var x=e(v,c);a(x,y);var E=r(x,l);if(g&&(E.vs=n.flatten([g,E.vs,m],!0),s.predecessors(g).length)){var w=s.node(s.predecessors(g)[0]),S=s.node(s.predecessors(m)[0]);n.has(E,"barycenter")||(E.barycenter=0,E.weight=0),E.barycenter=(E.barycenter*E.weight+w.order+S.order)/(E.weight+2),E.weight+=2}return E}function a(s,u){n.forEach(s,function(c){c.vs=n.flatten(c.vs.map(function(l){return u[l]?u[l].vs:l}),!0)})}function o(s,u){n.isUndefined(s.barycenter)?(s.barycenter=u.barycenter,s.weight=u.weight):(s.barycenter=(s.barycenter*s.weight+u.barycenter*u.weight)/(s.weight+u.weight),s.weight+=u.weight)}return zy}var Fy,QN;function oK(){if(QN)return Fy;QN=1;var n=Re(),t=qr().Graph;Fy=e;function e(i,a,o){var s=r(i),u=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(c){return i.node(c)});return n.forEach(i.nodes(),function(c){var l=i.node(c),d=i.parent(c);(l.rank===a||l.minRank<=a&&a<=l.maxRank)&&(u.setNode(c),u.setParent(c,d||s),n.forEach(i[o](c),function(p){var g=p.v===c?p.w:p.v,m=u.edge(g,c),y=n.isUndefined(m)?0:m.weight;u.setEdge(g,c,{weight:i.edge(p).weight+y})}),n.has(l,"minRank")&&u.setNode(c,{borderLeft:l.borderLeft[a],borderRight:l.borderRight[a]}))}),u}function r(i){for(var a;i.hasNode(a=n.uniqueId("_root")););return a}return Fy}var Gy,tT;function sK(){if(tT)return Gy;tT=1;var n=Re();Gy=t;function t(e,r,i){var a={},o;n.forEach(i,function(s){for(var u=e.parent(s),c,l;u;){if(c=e.parent(u),c?(l=a[c],a[c]=u):(l=o,o=u),l&&l!==u){r.setEdge(l,u);return}u=c}})}return Gy}var Vy,eT;function uK(){if(eT)return Vy;eT=1;var n=Re(),t=tK(),e=eK(),r=aK(),i=oK(),a=sK(),o=qr().Graph,s=Qn();Vy=u;function u(p){var g=s.maxRank(p),m=c(p,n.range(1,g+1),"inEdges"),y=c(p,n.range(g-1,-1,-1),"outEdges"),v=t(p);d(p,v);for(var x=Number.POSITIVE_INFINITY,E,w=0,S=0;S<4;++w,++S){l(w%2?m:y,w%4>=2),v=s.buildLayerMatrix(p);var k=e(p,v);k<x&&(S=0,E=n.cloneDeep(v),x=k)}d(p,E)}function c(p,g,m){return n.map(g,function(y){return i(p,y,m)})}function l(p,g){var m=new o;n.forEach(p,function(y){var v=y.graph().root,x=r(y,v,m,g);n.forEach(x.vs,function(E,w){y.node(E).order=w}),a(y,m,x.vs)})}function d(p,g){n.forEach(g,function(m){n.forEach(m,function(y,v){p.node(y).order=v})})}return Vy}var Uy,nT;function cK(){if(nT)return Uy;nT=1;var n=Re(),t=qr().Graph,e=Qn();Uy={positionX:m,findType1Conflicts:r,findType2Conflicts:i,addConflict:o,hasConflict:s,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:p,findSmallestWidthAlignment:d,balance:g};function r(x,E){var w={};function S(k,A){var N=0,T=0,O=k.length,M=n.last(A);return n.forEach(A,function(P,L){var j=a(x,P),z=j?x.node(j).order:O;(j||P===M)&&(n.forEach(A.slice(T,L+1),function(U){n.forEach(x.predecessors(U),function(J){var W=x.node(J),at=W.order;(at<N||z<at)&&!(W.dummy&&x.node(U).dummy)&&o(w,J,U)})}),T=L+1,N=z)}),A}return n.reduce(E,S),w}function i(x,E){var w={};function S(A,N,T,O,M){var P;n.forEach(n.range(N,T),function(L){P=A[L],x.node(P).dummy&&n.forEach(x.predecessors(P),function(j){var z=x.node(j);z.dummy&&(z.order<O||z.order>M)&&o(w,j,P)})})}function k(A,N){var T=-1,O,M=0;return n.forEach(N,function(P,L){if(x.node(P).dummy==="border"){var j=x.predecessors(P);j.length&&(O=x.node(j[0]).order,S(N,M,L,T,O),M=L,T=O)}S(N,M,N.length,O,A.length)}),N}return n.reduce(E,k),w}function a(x,E){if(x.node(E).dummy)return n.find(x.predecessors(E),function(w){return x.node(w).dummy})}function o(x,E,w){if(E>w){var S=E;E=w,w=S}var k=x[E];k||(x[E]=k={}),k[w]=!0}function s(x,E,w){if(E>w){var S=E;E=w,w=S}return n.has(x[E],w)}function u(x,E,w,S){var k={},A={},N={};return n.forEach(E,function(T){n.forEach(T,function(O,M){k[O]=O,A[O]=O,N[O]=M})}),n.forEach(E,function(T){var O=-1;n.forEach(T,function(M){var P=S(M);if(P.length){P=n.sortBy(P,function(J){return N[J]});for(var L=(P.length-1)/2,j=Math.floor(L),z=Math.ceil(L);j<=z;++j){var U=P[j];A[M]===M&&O<N[U]&&!s(w,M,U)&&(A[U]=M,A[M]=k[M]=k[U],O=N[U])}}})}),{root:k,align:A}}function c(x,E,w,S,k){var A={},N=l(x,E,w,k),T=k?"borderLeft":"borderRight";function O(L,j){for(var z=N.nodes(),U=z.pop(),J={};U;)J[U]?L(U):(J[U]=!0,z.push(U),z=z.concat(j(U))),U=z.pop()}function M(L){A[L]=N.inEdges(L).reduce(function(j,z){return Math.max(j,A[z.v]+N.edge(z))},0)}function P(L){var j=N.outEdges(L).reduce(function(U,J){return Math.min(U,A[J.w]-N.edge(J))},Number.POSITIVE_INFINITY),z=x.node(L);j!==Number.POSITIVE_INFINITY&&z.borderType!==T&&(A[L]=Math.max(A[L],j))}return O(M,N.predecessors.bind(N)),O(P,N.successors.bind(N)),n.forEach(S,function(L){A[L]=A[w[L]]}),A}function l(x,E,w,S){var k=new t,A=x.graph(),N=y(A.nodesep,A.edgesep,S);return n.forEach(E,function(T){var O;n.forEach(T,function(M){var P=w[M];if(k.setNode(P),O){var L=w[O],j=k.edge(L,P);k.setEdge(L,P,Math.max(N(x,M,O),j||0))}O=M})}),k}function d(x,E){return n.minBy(n.values(E),function(w){var S=Number.NEGATIVE_INFINITY,k=Number.POSITIVE_INFINITY;return n.forIn(w,function(A,N){var T=v(x,N)/2;S=Math.max(A+T,S),k=Math.min(A-T,k)}),S-k})}function p(x,E){var w=n.values(E),S=n.min(w),k=n.max(w);n.forEach(["u","d"],function(A){n.forEach(["l","r"],function(N){var T=A+N,O=x[T],M;if(O!==E){var P=n.values(O);M=N==="l"?S-n.min(P):k-n.max(P),M&&(x[T]=n.mapValues(O,function(L){return L+M}))}})})}function g(x,E){return n.mapValues(x.ul,function(w,S){if(E)return x[E.toLowerCase()][S];var k=n.sortBy(n.map(x,S));return(k[1]+k[2])/2})}function m(x){var E=e.buildLayerMatrix(x),w=n.merge(r(x,E),i(x,E)),S={},k;n.forEach(["u","d"],function(N){k=N==="u"?E:n.values(E).reverse(),n.forEach(["l","r"],function(T){T==="r"&&(k=n.map(k,function(L){return n.values(L).reverse()}));var O=(N==="u"?x.predecessors:x.successors).bind(x),M=u(x,k,w,O),P=c(x,k,M.root,M.align,T==="r");T==="r"&&(P=n.mapValues(P,function(L){return-L})),S[N+T]=P})});var A=d(x,S);return p(S,A),g(S,x.graph().align)}function y(x,E,w){return function(S,k,A){var N=S.node(k),T=S.node(A),O=0,M;if(O+=N.width/2,n.has(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":M=-N.width/2;break;case"r":M=N.width/2;break}if(M&&(O+=w?M:-M),M=0,O+=(N.dummy?E:x)/2,O+=(T.dummy?E:x)/2,O+=T.width/2,n.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":M=T.width/2;break;case"r":M=-T.width/2;break}return M&&(O+=w?M:-M),M=0,O}}function v(x,E){return x.node(E).width}return Uy}var Wy,rT;function lK(){if(rT)return Wy;rT=1;var n=Re(),t=Qn(),e=cK().positionX;Wy=r;function r(a){a=t.asNonCompoundGraph(a),i(a),n.forEach(e(a),function(o,s){a.node(s).x=o})}function i(a){var o=t.buildLayerMatrix(a),s=a.graph().ranksep,u=0;n.forEach(o,function(c){var l=n.max(n.map(c,function(d){return a.node(d).height}));n.forEach(c,function(d){a.node(d).y=u+l/2}),u+=l+s})}return Wy}var Yy,iT;function hK(){if(iT)return Yy;iT=1;var n=Re(),t=$q(),e=Hq(),r=qq(),i=Qn().normalizeRanks,a=Kq(),o=Qn().removeEmptyRanks,s=Zq(),u=Jq(),c=Qq(),l=uK(),d=lK(),p=Qn(),g=qr().Graph;Yy=m;function m($,Y){var F=Y&&Y.debugTiming?p.time:p.notime;F("layout",function(){var K=F(" buildLayoutGraph",function(){return O($)});F(" runLayout",function(){y(K,F)}),F(" updateInputGraph",function(){v($,K)})})}function y($,Y){Y(" makeSpaceForEdgeLabels",function(){M($)}),Y(" removeSelfEdges",function(){ut($)}),Y(" acyclic",function(){t.run($)}),Y(" nestingGraph.run",function(){s.run($)}),Y(" rank",function(){r(p.asNonCompoundGraph($))}),Y(" injectEdgeLabelProxies",function(){P($)}),Y(" removeEmptyRanks",function(){o($)}),Y(" nestingGraph.cleanup",function(){s.cleanup($)}),Y(" normalizeRanks",function(){i($)}),Y(" assignRankMinMax",function(){L($)}),Y(" removeEdgeLabelProxies",function(){j($)}),Y(" normalize.run",function(){e.run($)}),Y(" parentDummyChains",function(){a($)}),Y(" addBorderSegments",function(){u($)}),Y(" order",function(){l($)}),Y(" insertSelfEdges",function(){yt($)}),Y(" adjustCoordinateSystem",function(){c.adjust($)}),Y(" position",function(){d($)}),Y(" positionSelfEdges",function(){kt($)}),Y(" removeBorderNodes",function(){at($)}),Y(" normalize.undo",function(){e.undo($)}),Y(" fixupEdgeLabelCoords",function(){J($)}),Y(" undoCoordinateSystem",function(){c.undo($)}),Y(" translateGraph",function(){z($)}),Y(" assignNodeIntersects",function(){U($)}),Y(" reversePoints",function(){W($)}),Y(" acyclic.undo",function(){t.undo($)})}function v($,Y){n.forEach($.nodes(),function(F){var K=$.node(F),ot=Y.node(F);K&&(K.x=ot.x,K.y=ot.y,Y.children(F).length&&(K.width=ot.width,K.height=ot.height))}),n.forEach($.edges(),function(F){var K=$.edge(F),ot=Y.edge(F);K.points=ot.points,n.has(ot,"x")&&(K.x=ot.x,K.y=ot.y)}),$.graph().width=Y.graph().width,$.graph().height=Y.graph().height}var x=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],S=["width","height"],k={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],N={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function O($){var Y=new g({multigraph:!0,compound:!0}),F=ee($.graph());return Y.setGraph(n.merge({},E,It(F,x),n.pick(F,w))),n.forEach($.nodes(),function(K){var ot=ee($.node(K));Y.setNode(K,n.defaults(It(ot,S),k)),Y.setParent(K,$.parent(K))}),n.forEach($.edges(),function(K){var ot=ee($.edge(K));Y.setEdge(K,n.merge({},N,It(ot,A),n.pick(ot,T)))}),Y}function M($){var Y=$.graph();Y.ranksep/=2,n.forEach($.edges(),function(F){var K=$.edge(F);K.minlen*=2,K.labelpos.toLowerCase()!=="c"&&(Y.rankdir==="TB"||Y.rankdir==="BT"?K.width+=K.labeloffset:K.height+=K.labeloffset)})}function P($){n.forEach($.edges(),function(Y){var F=$.edge(Y);if(F.width&&F.height){var K=$.node(Y.v),ot=$.node(Y.w),dt={rank:(ot.rank-K.rank)/2+K.rank,e:Y};p.addDummyNode($,"edge-proxy",dt,"_ep")}})}function L($){var Y=0;n.forEach($.nodes(),function(F){var K=$.node(F);K.borderTop&&(K.minRank=$.node(K.borderTop).rank,K.maxRank=$.node(K.borderBottom).rank,Y=n.max(Y,K.maxRank))}),$.graph().maxRank=Y}function j($){n.forEach($.nodes(),function(Y){var F=$.node(Y);F.dummy==="edge-proxy"&&($.edge(F.e).labelRank=F.rank,$.removeNode(Y))})}function z($){var Y=Number.POSITIVE_INFINITY,F=0,K=Number.POSITIVE_INFINITY,ot=0,dt=$.graph(),mt=dt.marginx||0,Ot=dt.marginy||0;function ne(Qt){var _t=Qt.x,wt=Qt.y,we=Qt.width,Et=Qt.height;Y=Math.min(Y,_t-we/2),F=Math.max(F,_t+we/2),K=Math.min(K,wt-Et/2),ot=Math.max(ot,wt+Et/2)}n.forEach($.nodes(),function(Qt){ne($.node(Qt))}),n.forEach($.edges(),function(Qt){var _t=$.edge(Qt);n.has(_t,"x")&&ne(_t)}),Y-=mt,K-=Ot,n.forEach($.nodes(),function(Qt){var _t=$.node(Qt);_t.x-=Y,_t.y-=K}),n.forEach($.edges(),function(Qt){var _t=$.edge(Qt);n.forEach(_t.points,function(wt){wt.x-=Y,wt.y-=K}),n.has(_t,"x")&&(_t.x-=Y),n.has(_t,"y")&&(_t.y-=K)}),dt.width=F-Y+mt,dt.height=ot-K+Ot}function U($){n.forEach($.edges(),function(Y){var F=$.edge(Y),K=$.node(Y.v),ot=$.node(Y.w),dt,mt;F.points?(dt=F.points[0],mt=F.points[F.points.length-1]):(F.points=[],dt=ot,mt=K),F.points.unshift(p.intersectRect(K,dt)),F.points.push(p.intersectRect(ot,mt))})}function J($){n.forEach($.edges(),function(Y){var F=$.edge(Y);if(n.has(F,"x"))switch((F.labelpos==="l"||F.labelpos==="r")&&(F.width-=F.labeloffset),F.labelpos){case"l":F.x-=F.width/2+F.labeloffset;break;case"r":F.x+=F.width/2+F.labeloffset;break}})}function W($){n.forEach($.edges(),function(Y){var F=$.edge(Y);F.reversed&&F.points.reverse()})}function at($){n.forEach($.nodes(),function(Y){if($.children(Y).length){var F=$.node(Y),K=$.node(F.borderTop),ot=$.node(F.borderBottom),dt=$.node(n.last(F.borderLeft)),mt=$.node(n.last(F.borderRight));F.width=Math.abs(mt.x-dt.x),F.height=Math.abs(ot.y-K.y),F.x=dt.x+F.width/2,F.y=K.y+F.height/2}}),n.forEach($.nodes(),function(Y){$.node(Y).dummy==="border"&&$.removeNode(Y)})}function ut($){n.forEach($.edges(),function(Y){if(Y.v===Y.w){var F=$.node(Y.v);F.selfEdges||(F.selfEdges=[]),F.selfEdges.push({e:Y,label:$.edge(Y)}),$.removeEdge(Y)}})}function yt($){var Y=p.buildLayerMatrix($);n.forEach(Y,function(F){var K=0;n.forEach(F,function(ot,dt){var mt=$.node(ot);mt.order=dt+K,n.forEach(mt.selfEdges,function(Ot){p.addDummyNode($,"selfedge",{width:Ot.label.width,height:Ot.label.height,rank:mt.rank,order:dt+ ++K,e:Ot.e,label:Ot.label},"_se")}),delete mt.selfEdges})})}function kt($){n.forEach($.nodes(),function(Y){var F=$.node(Y);if(F.dummy==="selfedge"){var K=$.node(F.e.v),ot=K.x+K.width/2,dt=K.y,mt=F.x-ot,Ot=K.height/2;$.setEdge(F.e,F.label),$.removeNode(Y),F.label.points=[{x:ot+2*mt/3,y:dt-Ot},{x:ot+5*mt/6,y:dt-Ot},{x:ot+mt,y:dt},{x:ot+5*mt/6,y:dt+Ot},{x:ot+2*mt/3,y:dt+Ot}],F.label.x=F.x,F.label.y=F.y}})}function It($,Y){return n.mapValues(n.pick($,Y),Number)}function ee($){var Y={};return n.forEach($,function(F,K){Y[K.toLowerCase()]=F}),Y}return Yy}var $y,aT;function dK(){if(aT)return $y;aT=1;var n=Re(),t=Qn(),e=qr().Graph;$y={debugOrdering:r};function r(i){var a=t.buildLayerMatrix(i),o=new e({compound:!0,multigraph:!0}).setGraph({});return n.forEach(i.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+i.node(s).rank)}),n.forEach(i.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),n.forEach(a,function(s,u){var c="layer"+u;o.setNode(c,{rank:"same"}),n.reduce(s,function(l,d){return o.setEdge(l,d,{style:"invis"}),d})}),o}return $y}var oT,sT;function fK(){return sT||(sT=1,oT="0.8.5"),oT}var uT,cT;function pK(){return cT||(cT=1,uT={graphlib:qr(),layout:hK(),debug:dK(),util:{time:Qn().time,notime:Qn().notime},version:fK()}),uT}var RP=pK();const gK=lb(RP);class xd{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,xd.defaultOptions,t)}execute(t,e){return di(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,Object.assign(Object.assign({},this.options),e))})}assign(t,e){return di(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,Object.assign(Object.assign({},this.options),e))})}genericDagreLayout(t,e,r){return di(this,void 0,void 0,function*(){const{nodeSize:i}=r,a=new RP.graphlib.Graph;a.setGraph(r),a.setDefaultEdgeLabel(()=>({}));const o=e.getAllNodes(),s=e.getAllEdges();[...o,...s].some(({id:c})=>Xt(c))&&console.error("Dagre layout only support string id, it will convert number to string."),e.getAllNodes().forEach(c=>{const{id:l}=c,d=Object.assign({},c.data);if(i!==void 0){const[p,g]=SO(St(i)?i(c):i);Object.assign(d,{width:p,height:g})}a.setNode(l.toString(),d)}),e.getAllEdges().forEach(({id:c,source:l,target:d})=>{a.setEdge(l.toString(),d.toString(),{id:c})}),gK.layout(a);const u={nodes:[],edges:[]};return a.nodes().forEach(c=>{const l=a.node(c);u.nodes.push({id:c,data:l}),t&&e.mergeNodeData(c,l)}),a.edges().forEach(c=>{const l=a.edge(c),{id:d}=l,p=dr(l,["id"]),{v:g,w:m}=c;u.edges.push({id:d,source:g,target:m,data:p}),t&&e.mergeEdgeData(d,p)}),u})}}xd.defaultOptions={};/**
91
+ * @license
92
+ * Copyright 2019 Google LLC
93
+ * SPDX-License-Identifier: Apache-2.0
94
+ */const DP=Symbol("Comlink.proxy"),vK=Symbol("Comlink.endpoint"),LP=Symbol("Comlink.releaseProxy"),Hy=Symbol("Comlink.finalizer"),Ll=Symbol("Comlink.thrown"),IP=n=>typeof n=="object"&&n!==null||typeof n=="function",mK={canHandle:n=>IP(n)&&n[DP],serialize(n){const{port1:t,port2:e}=new MessageChannel;return BP(n,t),[e,[e]]},deserialize(n){return n.start(),FP(n)}},yK={canHandle:n=>IP(n)&&Ll in n,serialize({value:n}){let t;return n instanceof Error?t={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:t={isError:!1,value:n},[t,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},jP=new Map([["proxy",mK],["throw",yK]]);function bK(n,t){for(const e of n)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function BP(n,t=globalThis,e=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!bK(e,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:o,path:s}=Object.assign({path:[]},i.data),u=(i.data.argumentList||[]).map(Ya);let c;try{const l=s.slice(0,-1).reduce((p,g)=>p[g],n),d=s.reduce((p,g)=>p[g],n);switch(o){case"GET":c=d;break;case"SET":l[s.slice(-1)[0]]=Ya(i.data.value),c=!0;break;case"APPLY":c=d.apply(l,u);break;case"CONSTRUCT":{const p=new d(...u);c=SK(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;BP(n,g),c=AK(p,[p])}break;case"RELEASE":c=void 0;break;default:return}}catch(l){c={value:l,[Ll]:0}}Promise.resolve(c).catch(l=>({value:l,[Ll]:0})).then(l=>{const[d,p]=wh(l);t.postMessage(Object.assign(Object.assign({},d),{id:a}),p),o==="RELEASE"&&(t.removeEventListener("message",r),zP(t),Hy in n&&typeof n[Hy]=="function"&&n[Hy]())}).catch(l=>{const[d,p]=wh({value:new TypeError("Unserializable return value"),[Ll]:0});t.postMessage(Object.assign(Object.assign({},d),{id:a}),p)})}),t.start&&t.start()}function xK(n){return n.constructor.name==="MessagePort"}function zP(n){xK(n)&&n.close()}function FP(n,t){const e=new Map;return n.addEventListener("message",function(r){const{data:i}=r;if(!i||!i.id)return;const a=e.get(i.id);if(a)try{a(i)}finally{e.delete(i.id)}}),Z1(n,e,[],t)}function El(n){if(n)throw new Error("Proxy has been released and is not useable")}function GP(n){return Yo(n,new Map,{type:"RELEASE"}).then(()=>{zP(n)})}const xh=new WeakMap,Eh="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const t=(xh.get(n)||0)-1;xh.set(n,t),t===0&&GP(n)});function EK(n,t){const e=(xh.get(t)||0)+1;xh.set(t,e),Eh&&Eh.register(n,t,n)}function wK(n){Eh&&Eh.unregister(n)}function Z1(n,t,e=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(o,s){if(El(i),s===LP)return()=>{wK(a),GP(n),t.clear(),i=!0};if(s==="then"){if(e.length===0)return{then:()=>a};const u=Yo(n,t,{type:"GET",path:e.map(c=>c.toString())}).then(Ya);return u.then.bind(u)}return Z1(n,t,[...e,s])},set(o,s,u){El(i);const[c,l]=wh(u);return Yo(n,t,{type:"SET",path:[...e,s].map(d=>d.toString()),value:c},l).then(Ya)},apply(o,s,u){El(i);const c=e[e.length-1];if(c===vK)return Yo(n,t,{type:"ENDPOINT"}).then(Ya);if(c==="bind")return Z1(n,t,e.slice(0,-1));const[l,d]=lT(u);return Yo(n,t,{type:"APPLY",path:e.map(p=>p.toString()),argumentList:l},d).then(Ya)},construct(o,s){El(i);const[u,c]=lT(s);return Yo(n,t,{type:"CONSTRUCT",path:e.map(l=>l.toString()),argumentList:u},c).then(Ya)}});return EK(a,n),a}function kK(n){return Array.prototype.concat.apply([],n)}function lT(n){const t=n.map(wh);return[t.map(e=>e[0]),kK(t.map(e=>e[1]))]}const VP=new WeakMap;function AK(n,t){return VP.set(n,t),n}function SK(n){return Object.assign(n,{[DP]:!0})}function wh(n){for(const[t,e]of jP)if(e.canHandle(n)){const[r,i]=e.serialize(n);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:n},VP.get(n)||[]]}function Ya(n){switch(n.type){case"HANDLER":return jP.get(n.name).deserialize(n.value);case"RAW":return n.value}}function Yo(n,t,e,r){return new Promise(i=>{const a=CK();t.set(a,i),n.start&&n.start(),n.postMessage(Object.assign({id:a},e),r)})}function CK(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class NK extends Fb{constructor(t,e,r){super(),this.graph=t,this.layout=e,this.options=r,this.spawnWorker()}spawnWorker(){this.proxy=FP(new Worker(new URL(""+new URL(""+new URL("worker-BbpylX7l.js",import.meta.url).href,import.meta.url).href,import.meta.url),{type:"module"})),this.running&&(this.running=!1,this.execute())}execute(){var t;return di(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,r=dr(e,["onTick"]),i={};Object.keys(r).forEach(u=>{St(r[u])||(i[u]=r[u])});const a={layout:{id:this.layout.id,options:i,iterations:(t=this.options)===null||t===void 0?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[s]=yield this.proxy.calculateLayout(a,[o]);return s})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[LP]()}isRunning(){return this.running}}class yo extends Lb{}function qu(n,t=!0,e){const r=document.createElement("div");return r.setAttribute("class",`g6-${n}`),Object.assign(r.style,{position:"absolute",display:"block"}),t&&Object.assign(r.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),e&&Object.assign(r.style,e),r}function J1(n,t="div",e={},r="",i=document.body){const a=document.getElementById(n);a&&a.remove();const o=document.createElement(t);return o.innerHTML=r,o.id=n,Object.assign(o.style,e),i.appendChild(o),o}var TK=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Ed extends yo{constructor(t,e){super(t,Object.assign({},Ed.defaultOptions,e)),this.$element=qu("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return TK(this,void 0,void 0,function*(){e.update.call(this,t),Object.assign(this.$element.style,RM(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}Ed.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function MK(n){return`
95
+ <ul class="g6-contextmenu-ul">
96
+ ${n.map(t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`).join("")}
97
+ </ul>
98
+ `}const _K=`
99
+ .g6-contextmenu {
100
+ font-size: 12px;
101
+ background-color: rgba(255, 255, 255, 0.96);
102
+ border-radius: 4px;
103
+ overflow: hidden;
104
+ box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
105
+ transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
106
+ }
107
+
108
+ .g6-contextmenu-ul {
109
+ max-width: 256px;
110
+ min-width: 96px;
111
+ list-style: none;
112
+ padding: 0;
113
+ margin: 0;
114
+ }
115
+
116
+ .g6-contextmenu-li {
117
+ padding: 8px 12px;
118
+ cursor: pointer;
119
+ user-select: none;
120
+ }
121
+
122
+ .g6-contextmenu-li:hover {
123
+ background-color: #f5f5f5;
124
+ cursor: pointer;
125
+ }
126
+ `;var hT=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class wd extends yo{constructor(t,e){super(t,Object.assign({},wd.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=r=>{var i;(i=r.preventDefault)===null||i===void 0||i.call(r),this.show(r)},this.onMenuItemClick=r=>{const{onClick:i,trigger:a}=this.options;if(r.target instanceof HTMLElement&&r.target.className.includes("g6-contextmenu-li")){const o=r.target.getAttribute("value");i==null||i(o,r.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=qu("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t),this.context.canvas.getContainer().appendChild(this.$element),J1("g6-contextmenu-css","style",{},_K,document.head)}show(t){return hT(this,void 0,void 0,function*(){const{enable:e,offset:r}=this.options;if(typeof e=="function"&&!e(t)||!e){this.hide();return}const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-a.left+r[0]}px`,this.$element.style.top=`${t.client.y-a.top+r[1]}px`,this.$element.style.display="block",this.targetElement=t.target})}hide(){this.$element.style.display="none",this.targetElement=null}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(t){return hT(this,void 0,void 0,function*(){const{getContent:e,getItems:r}=this.options;return r?MK(yield r(t)):yield e(t)})}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`canvas:${e}`,this.onTriggerEvent),t.on(`node:${e}`,this.onTriggerEvent),t.on(`edge:${e}`,this.onTriggerEvent),t.on(`combo:${e}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`canvas:${e}`,this.onTriggerEvent),t.off(`node:${e}`,this.onTriggerEvent),t.off(`edge:${e}`,this.onTriggerEvent),t.off(`combo:${e}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}wd.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class kd extends yo{constructor(t,e){super(t,Object.assign({},kd.defaultOptions,e)),this.$element=qu("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=r=>{const{data:{scale:i,origin:a}}=r;if(!i||a===void 0&&this.context.viewport===void 0)return;const o=this.currentScale;this.currentScale=i;const s=i/o,u=us(a||this.context.graph.getCanvasCenter(),1-s),c=this.baseSize*i,l=us(this.offset,s),d=wp(l,c),p=rn(d,u);this.$element.style.backgroundSize=`${c}px ${c}px`,this.$element.style.backgroundPosition=`${p[0]}px ${p[1]}px`,this.offset=wp(p,c)},this.followTranslate=r=>{if(!this.options.follow)return;const{data:{translate:i}}=r;i&&this.updateOffset(i)},this.onTransform=r=>{const i=this.parseFollow(this.options.follow);i.zoom&&this.followZoom(r),i.translate&&this.followTranslate(r)},this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(t){super.update(t),t.size!==void 0&&(this.baseSize=t.size),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(gt.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:t,lineWidth:e,border:r,borderLineWidth:i,borderStroke:a,borderStyle:o}=this.options,s=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:r?`${i}px ${o} ${a}`:"none",backgroundImage:`linear-gradient(${t} ${e}px, transparent ${e}px), linear-gradient(90deg, ${t} ${e}px, transparent ${e}px)`,backgroundSize:`${s}px ${s}px`,backgroundRepeat:"repeat"})}updateOffset(t){const e=this.baseSize*this.currentScale;this.offset=wp(rn(this.offset,t),e),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(t){var e,r;return Eu(t)?{translate:t,zoom:t}:{translate:(e=t==null?void 0:t.translate)!==null&&e!==void 0?e:!1,zoom:(r=t==null?void 0:t.zoom)!==null&&r!==void 0?r:!1}}destroy(){this.context.graph.off(gt.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}kd.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function UP(n){const t={Added:new Map,Updated:new Map,Removed:new Map};return n.forEach(e=>{const{type:r,value:i}=e,a=Z(i);if(r==="NodeAdded"||r==="EdgeAdded"||r==="ComboAdded")t.Added.set(a,e);else if(r==="NodeUpdated"||r==="EdgeUpdated"||r==="ComboUpdated")if(t.Added.has(a))t.Added.set(a,{type:r.replace("Updated","Added"),value:i});else if(t.Updated.has(a)){const{original:o}=t.Updated.get(a);t.Updated.set(a,{type:r,value:i,original:o})}else t.Removed.has(a)||t.Updated.set(a,e);else(r==="NodeRemoved"||r==="EdgeRemoved"||r==="ComboRemoved")&&(t.Added.has(a)?t.Added.delete(a):(t.Updated.has(a)&&t.Updated.delete(a),t.Removed.set(a,e)))}),[...Array.from(t.Added.values()),...Array.from(t.Updated.values()),...Array.from(t.Removed.values())]}function OK(n){const{NodeAdded:t=[],NodeUpdated:e=[],NodeRemoved:r=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:o=[],ComboAdded:s=[],ComboUpdated:u=[],ComboRemoved:c=[]}=Mh(n,l=>l.type);return{add:{nodes:t,edges:i,combos:s},update:{nodes:e,edges:a,combos:u},remove:{nodes:r,edges:o,combos:c}}}function WP(n,t){t(n),n.children&&n.children.forEach(function(e){e&&WP(e,t)})}function PK(n){Ad(n,!0)}function sx(n){Ad(n,!1)}function Ad(n,t){var e=t?"visible":"hidden";WP(n,function(r){r.attr("visibility",e)})}var RK=(function(n){Rr(t,n);function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(this,Sn([],lt(e),!1))||this;return i.isMutationObserved=!0,i.addEventListener(Wt.INSERTED,function(){sx(i)}),i}return t})(vi);function YP(n){var t=n.appendChild(new RK({class:"offscreen"}));return sx(t),t}var $P=(function(n){Rr(t,n);function t(e){e===void 0&&(e={});var r=e.style,i=dr(e,["style"]);return n.call(this,ae({style:ae({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},r)},i))||this}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=YP(this)),this._offscreen},enumerable:!1,configurable:!0}),t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t})(ms),hi=(function(){function n(t,e,r,i){t===void 0&&(t=0),e===void 0&&(e=0),r===void 0&&(r=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=r,this.height=i}return Object.defineProperty(n.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),n.fromRect=function(t){return new n(t.x,t.y,t.width,t.height)},n.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},n.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},n})();function DK(n,t){return St(n)?n.apply(void 0,Sn([],lt(t),!1)):n}var As=function(n,t){var e=function(i){return"".concat(t,"-").concat(i)},r=Object.fromEntries(Object.entries(n).map(function(i){var a=lt(i,2),o=a[0],s=a[1],u=e(s);return[o,{name:u,class:".".concat(u),id:"#".concat(u),toString:function(){return u}}]}));return Object.assign(r,{prefix:e}),r},LK=5,HP=function(n,t,e,r){e===void 0&&(e=0),r===void 0&&(r=LK),Object.entries(t).forEach(function(i){var a=lt(i,2),o=a[0],s=a[1],u=n;Object.prototype.hasOwnProperty.call(t,o)&&(s?is(s)?(is(n[o])||(u[o]={}),e<r?HP(n[o],s,e+1,r):u[o]=t[o]):yi(s)?(u[o]=[],u[o]=u[o].concat(s)):u[o]=s:u[o]=s)})},co=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r+=1)HP(n,t[r]);return n};function IK(n){return n.nodeName==="text"?n:n.nodeName==="g"&&n.children.length===1&&n.children[0].nodeName==="text"?n.children[0]:null}function jK(n,t){var e=IK(n);e&&e.attr(t)}function dT(n,t,e){e===void 0&&(e="..."),jK(n,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:e})}function fT(n){return typeof n=="function"?n():fe(n)||Xt(n)?new $P({style:{text:String(n)}}):n}function BK(n,t){return n.reduce(function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e},{})}function to(n,t,e,r,i){return r===void 0&&(r=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),n?e(t):(r&&i(t),null)}function XP(n,t,e){var r=n.getBBox(),i=r.width,a=r.height,o=t/Math.max(i,a);return n.style.transform="scale(".concat(o,")"),o}function zK(n,t){var e=new Map;return n.forEach(function(r){var i=t(r);e.has(i)||e.set(i,[]),e.get(i).push(r)}),e}function FK(n){throw new Error(n)}var GK=(function(){function n(i,a,o,s,u,c,l){i===void 0&&(i=null),a===void 0&&(a=null),o===void 0&&(o=null),s===void 0&&(s=null),u===void 0&&(u=[null,null,null,null,null]),c===void 0&&(c=[]),l===void 0&&(l=[]),t.add(this),this._elements=Array.from(i),this._data=a,this._parent=o,this._document=s,this._enter=u[0],this._update=u[1],this._exit=u[2],this._merge=u[3],this._split=u[4],this._transitions=c,this._facetElements=l}n.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(a,null,this._elements[0],this._document)},n.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(this._elements,null,this._parent,this._document,void 0,void 0,a)},n.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new e([a],null,a,this._document)},n.prototype.append=function(i){var a=this,o=typeof i=="function"?i:function(){return a.createElement(i)},s=[];if(this._data!==null){for(var u=0;u<this._data.length;u++){var c=this._data[u],l=lt(Array.isArray(c)?c:[c,null],2),d=l[0],p=l[1],g=o(d,u);g.__data__=d,p!==null&&(g.__fromElements__=p),this._parent.appendChild(g),s.push(g)}return new e(s,null,this._parent,this._document)}for(var u=0;u<this._elements.length;u++){var m=this._elements[u],d=m.__data__,g=o(d,u);m.appendChild(g),s.push(g)}return new e(s,null,s[0],this._document)},n.prototype.maybeAppend=function(i,a){var o=ip(this,t,"m",r).call(this,i[0]==="#"?i:"#".concat(i),a);return o.attr("id",i),o},n.prototype.maybeAppendByClassName=function(i,a){var o=i.toString(),s=ip(this,t,"m",r).call(this,o[0]==="."?o:".".concat(o),a);return s.attr("className",o),s},n.prototype.maybeAppendByName=function(i,a){var o=ip(this,t,"m",r).call(this,'[name="'.concat(i,'"]'),a);return o.attr("name",i),o},n.prototype.data=function(i,a,o){var s,u;a===void 0&&(a=function(M){return M}),o===void 0&&(o=function(){return null});for(var c=[],l=[],d=new Set(this._elements),p=[],g=new Set,m=new Map(this._elements.map(function(M,P){return[a(M.__data__,P),M]})),y=new Map(this._facetElements.map(function(M,P){return[a(M.__data__,P),M]})),v=zK(this._elements,function(M){return o(M.__data__)}),x=0;x<i.length;x++){var E=i[x],w=a(E,x),S=o(E,x);if(m.has(w)){var k=m.get(w);k.__data__=E,k.__facet__=!1,l.push(k),d.delete(k),m.delete(w)}else if(y.has(w)){var k=y.get(w);k.__data__=E,k.__facet__=!0,l.push(k),y.delete(w)}else if(v.has(w)){var A=v.get(w);p.push([E,A]);try{for(var N=(s=void 0,DM(A)),T=N.next();!T.done;T=N.next()){var k=T.value;d.delete(k)}}catch(M){s={error:M}}finally{try{T&&!T.done&&(u=N.return)&&u.call(N)}finally{if(s)throw s.error}}v.delete(w)}else if(m.has(S)){var k=m.get(S);k.__toData__?k.__toData__.push(E):k.__toData__=[E],g.add(k),d.delete(k)}else c.push(E)}var O=[new e([],c,this._parent,this._document),new e(l,null,this._parent,this._document),new e(d,null,this._parent,this._document),new e([],p,this._parent,this._document),new e(g,null,this._parent,this._document)];return new e(this._elements,null,this._parent,this._document,O)},n.prototype.merge=function(i){var a=Sn(Sn([],lt(this._elements),!1),lt(i._elements),!1),o=Sn(Sn([],lt(this._transitions),!1),lt(i._transitions),!1);return new e(a,null,this._parent,this._document,void 0,o)},n.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=e.registry[i];return a?new a:FK("Unknown node type: ".concat(i))},n.prototype.join=function(i,a,o,s,u){i===void 0&&(i=function(m){return m}),a===void 0&&(a=function(m){return m}),o===void 0&&(o=function(m){return m.remove()}),s===void 0&&(s=function(m){return m}),u===void 0&&(u=function(m){return m.remove()});var c=i(this._enter),l=a(this._update),d=o(this._exit),p=s(this._merge),g=u(this._split);return l.merge(c).merge(d).merge(p).merge(g)},n.prototype.remove=function(){for(var i=function(s){var u=a._elements[s],c=a._transitions[s];c?c.then(function(){return u.remove()}):u.remove()},a=this,o=0;o<this._elements.length;o++)i(o);return new e([],null,this._parent,this._document,void 0,this._transitions)},n.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var o=this._elements[a],s=o.__data__;i.call(o,s,a)}return this},n.prototype.attr=function(i,a){var o=typeof a!="function"?function(){return a}:a;return this.each(function(s,u){a!==void 0&&(this[i]=o.call(this,s,u))})},n.prototype.style=function(i,a,o){o===void 0&&(o=!0);var s=typeof a!="function"||!o?function(){return a}:a;return this.each(function(u,c){a!==void 0&&(this.style[i]=s.call(this,u,c))})},n.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(o,s){var u=this;Object.entries(i).forEach(function(c){var l=lt(c,2),d=l[0],p=l[1],g=typeof p!="function"||!a?function(){return p}:p;p!==void 0&&u.attr(d,g.call(u,o,s))})})},n.prototype.update=function(i,a){a===void 0&&(a=!0);var o=typeof i!="function"||!a?function(){return i}:i;return this.each(function(s,u){i&&this.update&&this.update(o.call(this,s,u))})},n.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var o=typeof i!="function"||!a?function(){return i}:i;return this.each(function(s,u){i&&this.update&&this.update(o.call(this,s,u))})},n.prototype.transition=function(i){var a=new Array(this._elements.length);return this.each(function(o,s){a[s]=i.call(this,o,s)}),this._transitions=bB(a),this},n.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},n.prototype.call=function(i){for(var a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];return i.call.apply(i,Sn([this._parent,this],lt(a),!1)),this},n.prototype.node=function(){return this._elements[0]},n.prototype.nodes=function(){return this._elements},n.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},n.prototype.parent=function(){return this._parent};var t,e,r;return e=n,t=new WeakSet,r=function(i,a){var o=this._elements[0],s=o.querySelector(i);if(s)return new e([s],null,this._parent,this._document);var u=typeof a=="string"?this.createElement(a):a();return o.appendChild(u),new e([u],null,this._parent,this._document)},n.registry={g:vi,rect:vs,circle:ao,path:Ha,text:$P,ellipse:Sb,image:ju,line:Nb,polygon:Bu,polyline:Tb,html:Cb},n})();function hr(n){return new GK([n],null,n,n.ownerDocument)}function ls(n){if(Xt(n))return[n,n,n,n];if(yi(n)){var t=n.length;if(t===1)return[n[0],n[0],n[0],n[0]];if(t===2)return[n[0],n[1],n[0],n[1]];if(t===3)return[n[0],n[1],n[2],n[1]];if(t===4)return n}return[0,0,0,0]}function VK(n,t){var e,r,i=t.attributes;try{for(var a=DM(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=lt(o.value,2),u=s[0],c=s[1];u!=="id"&&u!=="className"&&n.attr(u,c)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}function ux(n){return n.toString().charAt(0).toUpperCase()+n.toString().slice(1)}function UK(n){return n.toString().charAt(0).toLowerCase()+n.toString().slice(1)}function WK(n,t){return"".concat(t).concat(ux(n))}function pT(n,t,e){var r;e===void 0&&(e=!0);var i=t||((r=n.match(/^([a-z][a-z0-9]+)/))===null||r===void 0?void 0:r[0])||"",a=n.replace(new RegExp("^(".concat(i,")")),"");return e?UK(a):a}function YK(n,t){Object.entries(t).forEach(function(e){var r=lt(e,2),i=r[0],a=r[1];Sn([n],lt(n.querySelectorAll(i)),!1).filter(function(o){return o.matches(i)}).forEach(function(o){if(o){var s=o;s.style.cssText+=Object.entries(a).reduce(function(u,c){return"".concat(u).concat(c.join(":"),";")},"")}})})}var wl=function(n,t){if(!(n!=null&&n.startsWith(t)))return!1;var e=n[t.length];return e>="A"&&e<="Z"};function Or(n,t,e){e===void 0&&(e=!1);var r={};return Object.entries(n).forEach(function(i){var a=lt(i,2),o=a[0],s=a[1];if(!(o==="className"||o==="class")){if(wl(o,"show")&&wl(pT(o,"show"),t)!==e)o===WK(t,"show")?r[o]=s:r[o.replace(new RegExp(ux(t)),"")]=s;else if(!wl(o,"show")&&wl(o,t)!==e){var u=pT(o,t);u==="filter"&&typeof s=="function"||(r[u]=s)}}}),r}function $K(n,t){return Object.entries(n).reduce(function(e,r){var i=lt(r,2),a=i[0],o=i[1];return a.startsWith("show")?e["show".concat(t).concat(a.slice(4))]=o:e["".concat(t).concat(ux(a))]=o,e},{})}function kh(n,t){t===void 0&&(t=["x","y","class","className"]);var e=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(n).forEach(function(a){var o=lt(a,2),s=o[0],u=o[1];t.includes(s)||(e.indexOf(s)!==-1?i[s]=u:r[s]=u)}),[r,i]}function HK(n){var t;return((t=n[0])===null||t===void 0?void 0:t.map(function(e,r){return n.map(function(i){return i[r]})}))||[]}var gT=function(n,t){if(t==null){n.innerHTML="";return}n.replaceChildren?Array.isArray(t)?n.replaceChildren.apply(n,Sn([],lt(t),!1)):n.replaceChildren(t):(n.innerHTML="",Array.isArray(t)?t.forEach(function(e){return n.appendChild(e)}):n.appendChild(t))};function cx(n){return/\S+-\S+/g.test(n)?n.split("-").map(function(t){return t[0]}):n.length>2?[n[0]]:n.split("")}function XK(){Ad(this,this.attributes.visibility!=="hidden")}var Wi=(function(n){Rr(t,n);function t(e,r){r===void 0&&(r={});var i=n.call(this,co({},{style:r},e))||this;return i.initialized=!1,i._defaultOptions=r,i}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=YP(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t.prototype.attributeChangedCallback=function(e){e==="visibility"&&XK.call(this)},t.prototype.update=function(e,r){var i;return this.attr(co({},this.attributes,e||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},t.prototype.clear=function(){this.removeChildren()},t.prototype.bindEvents=function(e,r){},t.prototype.getSubShapeStyle=function(e){var r=dr(e,["x","y","transform","transformOrigin","class","className","zIndex"]);return r},t})(Ab),qP=function(n,t,e){return[["M",n-e,t],["A",e,e,0,1,0,n+e,t],["A",e,e,0,1,0,n-e,t],["Z"]]},qK=qP,KK=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t-e],["L",n+e,t+e],["L",n-e,t+e],["Z"]]},ZK=function(n,t,e){return[["M",n-e,t],["L",n,t-e],["L",n+e,t],["L",n,t+e],["Z"]]},JK=function(n,t,e){var r=e*Math.sin(.3333333333333333*Math.PI);return[["M",n-e,t+r],["L",n,t-r],["L",n+e,t+r],["Z"]]},QK=function(n,t,e){var r=e*Math.sin(.3333333333333333*Math.PI);return[["M",n-e,t-r],["L",n+e,t-r],["L",n,t+r],["Z"]]},tZ=function(n,t,e){var r=e/2*Math.sqrt(3);return[["M",n,t-e],["L",n+r,t-e/2],["L",n+r,t+e/2],["L",n,t+e],["L",n-r,t+e/2],["L",n-r,t-e/2],["Z"]]},eZ=function(n,t,e){var r=e-1.5;return[["M",n-e,t-r],["L",n+e,t+r],["L",n+e,t-r],["L",n-e,t+r],["Z"]]},KP=function(n,t,e){return[["M",n,t+e],["L",n,t-e]]},nZ=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t+e],["M",n+e,t-e],["L",n-e,t+e]]},rZ=function(n,t,e){return[["M",n-e/2,t-e],["L",n+e/2,t-e],["M",n,t-e],["L",n,t+e],["M",n-e/2,t+e],["L",n+e/2,t+e]]},iZ=function(n,t,e){return[["M",n-e,t],["L",n+e,t],["M",n,t-e],["L",n,t+e]]},aZ=function(n,t,e){return[["M",n-e,t],["L",n+e,t]]},ZP=function(n,t,e){return[["M",n-e,t],["L",n+e,t]]},oZ=ZP,sZ=function(n,t,e){return[["M",n-e,t],["A",e/2,e/2,0,1,1,n,t],["A",e/2,e/2,0,1,0,n+e,t]]},uZ=function(n,t,e){return[["M",n-e-1,t-2.5],["L",n,t-2.5],["L",n,t+2.5],["L",n+e+1,t+2.5]]},cZ=function(n,t,e){return[["M",n-e-1,t+2.5],["L",n,t+2.5],["L",n,t-2.5],["L",n+e+1,t-2.5]]},lZ=function(n,t,e){return[["M",n-(e+1),t+2.5],["L",n-e/2,t+2.5],["L",n-e/2,t-2.5],["L",n+e/2,t-2.5],["L",n+e/2,t+2.5],["L",n+e+1,t+2.5]]};function hZ(n,t){return[["M",n-5,t+2.5],["L",n-5,t],["L",n,t],["L",n,t-3],["L",n,t+3],["L",n+6.5,t+3]]}var dZ=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t],["L",n-e,t+e],["Z"]]},fZ=function(n,t,e){var r=e,i=e*.2,a=e*.7;return[["M",n-r,t],["A",r,r,0,1,0,n+r,t],["A",r,r,0,1,0,n-r,t],["Z"],["M",n-a,t],["L",n-i,t],["M",n+i,t],["L",n+a,t],["M",n,t-a],["L",n,t-i],["M",n,t+i],["L",n,t+a]]};function pZ(n){var t="default";if(An(n)&&n instanceof Image)t="image";else if(St(n))t="symbol";else if(fe(n)){var e=new RegExp("data:(image|text)");n.match(e)?t="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(n)?t="url":t="symbol"}return t}function gZ(n){var t=pZ(n);return["base64","url","image"].includes(t)?"image":n&&t==="symbol"?"path":null}var ce=(function(n){Rr(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e,r){var i=e.x,a=i===void 0?0:i,o=e.y,s=o===void 0?0:o,u=this.getSubShapeStyle(e),c=u.symbol,l=u.size,d=l===void 0?16:l,p=dr(u,["symbol","size"]),g=gZ(c);to(!!g,hr(r),function(m){m.maybeAppendByClassName("marker",g).attr("className","marker ".concat(g,"-marker")).call(function(y){if(g==="image"){var v=d*2;y.styles({img:c,width:v,height:v,x:a-d,y:s-d})}else{var v=d/2,x=St(c)?c:t.getSymbol(c);y.styles(ae({d:x==null?void 0:x(a,s,v)},p))}})})},t.MARKER_SYMBOL_MAP=new Map,t.registerSymbol=function(e,r){t.MARKER_SYMBOL_MAP.set(e,r)},t.getSymbol=function(e){return t.MARKER_SYMBOL_MAP.get(e)},t.getSymbols=function(){return Array.from(t.MARKER_SYMBOL_MAP.keys())},t})(Wi);ce.registerSymbol("cross",nZ);ce.registerSymbol("hyphen",aZ);ce.registerSymbol("line",KP);ce.registerSymbol("plus",iZ);ce.registerSymbol("tick",rZ);ce.registerSymbol("circle",qP);ce.registerSymbol("point",qK);ce.registerSymbol("bowtie",eZ);ce.registerSymbol("hexagon",tZ);ce.registerSymbol("square",KK);ce.registerSymbol("diamond",ZK);ce.registerSymbol("triangle",JK);ce.registerSymbol("triangle-down",QK);ce.registerSymbol("line",KP);ce.registerSymbol("dot",ZP);ce.registerSymbol("dash",oZ);ce.registerSymbol("smooth",sZ);ce.registerSymbol("hv",uZ);ce.registerSymbol("vh",cZ);ce.registerSymbol("hvh",lZ);ce.registerSymbol("vhv",hZ);ce.registerSymbol("focus",fZ);function vZ(n,t){n?n.finished.then(t):t()}function mZ(n,t){"update"in n?n.update(t):n.attr(t)}function yZ(n,t,e){if(t.length===0)return null;if(!e){var r=t.slice(-1)[0];return mZ(n,{style:r}),null}return n.animate(t,e)}var vT=As({text:"text"},"title");function bZ(n,t){var e=n.attributes,r=e.position,i=e.spacing,a=e.inset,o=e.text,s=n.getBBox(),u=t.getBBox(),c=cx(r),l=lt(ls(o?i:0),4),d=l[0],p=l[1],g=l[2],m=l[3],y=lt(ls(a),4),v=y[0],x=y[1],E=y[2],w=y[3],S=lt([m+p,d+g],2),k=S[0],A=S[1],N=lt([w+x,v+E],2),T=N[0],O=N[1];if(c[0]==="l")return new hi(s.x,s.y,u.width+s.width+k+T,Math.max(u.height+O,s.height));if(c[0]==="t")return new hi(s.x,s.y,Math.max(u.width+T,s.width),u.height+s.height+A+O);var M=lt([t.attributes.width||u.width,t.attributes.height||u.height],2),P=M[0],L=M[1];return new hi(u.x,u.y,P+s.width+k+T,L+s.height+A+O)}function xZ(n,t){var e=Object.entries(t).reduce(function(r,i){var a=lt(i,2),o=a[0],s=a[1],u=n.node().attr(o);return u||(r[o]=s),r},{});n.styles(e)}function EZ(n){var t,e,r,i,a=n,o=a.width,s=a.height,u=a.position,c=lt([+o/2,+s/2],2),l=c[0],d=c[1],p=lt([+l,+d,"center","middle"],4),g=p[0],m=p[1],y=p[2],v=p[3],x=cx(u);return x.includes("l")&&(t=lt([0,"start"],2),g=t[0],y=t[1]),x.includes("r")&&(e=lt([+o,"end"],2),g=e[0],y=e[1]),x.includes("t")&&(r=lt([0,"top"],2),m=r[0],v=r[1]),x.includes("b")&&(i=lt([+s,"bottom"],2),m=i[0],v=i[1]),{x:g,y:m,textAlign:y,textBaseline:v}}var wZ=(function(n){Rr(t,n);function t(e){return n.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return t.prototype.getAvailableSpace=function(){var e=this,r=this.attributes,i=r.width,a=r.height,o=r.position,s=r.spacing,u=r.inset,c=e.querySelector(vT.text.class);if(!c)return new hi(0,0,+i,+a);var l=c.getBBox(),d=l.width,p=l.height,g=lt(ls(s),4),m=g[0],y=g[1],v=g[2],x=g[3],E=lt([0,0,+i,+a],4),w=E[0],S=E[1],k=E[2],A=E[3],N=cx(o);if(N.includes("i"))return new hi(w,S,k,A);N.forEach(function(J,W){var at,ut,yt,kt;J==="t"&&(at=lt(W===0?[p+v,+a-p-v]:[0,+a],2),S=at[0],A=at[1]),J==="r"&&(ut=lt([+i-d-x],1),k=ut[0]),J==="b"&&(yt=lt([+a-p-m],1),A=yt[0]),J==="l"&&(kt=lt(W===0?[d+y,+i-d-y]:[0,+i],2),w=kt[0],k=kt[1])});var T=lt(ls(u),4),O=T[0],M=T[1],P=T[2],L=T[3],j=lt([L+M,O+P],2),z=j[0],U=j[1];return new hi(w+L,S+O,k-z,A-U)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new hi(0,0,0,0)},t.prototype.render=function(e,r){var i=this,a=dr(e,["width","height","position","spacing"]),o=lt(kh(a),1),s=o[0],u=EZ(e),c=u.x,l=u.y,d=u.textAlign,p=u.textBaseline;to(!!a.text,hr(r),function(g){i.title=g.maybeAppendByClassName(vT.text,"text").styles(s).call(xZ,{x:c,y:l,textAlign:d,textBaseline:p}).node()})},t})(Wi),Cr=As({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),kZ=(function(n){Rr(t,n);function t(e){var r=n.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:dZ(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return r.playState="idle",r.contentGroup=r.appendChild(new vi({class:Cr.contentGroup.name})),r.playWindow=r.contentGroup.appendChild(new vi({class:Cr.playWindow.name})),r.innerCurrPage=r.defaultPage,r}return Object.defineProperty(t.prototype,"defaultPage",{get:function(){var e=this.attributes.defaultPage;return dn(e,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageShape",{get:function(){var e=this.pageViews,r=lt(HK(e.map(function(d){var p=d.getBBox(),g=p.width,m=p.height;return[g,m]})).map(function(d){return Math.max.apply(Math,Sn([],lt(d),!1))}),2),i=r[0],a=r[1],o=this.attributes,s=o.pageWidth,u=s===void 0?i:s,c=o.pageHeight,l=c===void 0?a:c;return{pageWidth:u,pageHeight:l}},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(t.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e=n.prototype.getBBox.call(this),r=e.x,i=e.y,a=this.controllerShape,o=this.pageShape,s=o.pageWidth,u=o.pageHeight;return new hi(r,i,s+a.width,u)},t.prototype.goTo=function(e){var r=this,i=this.attributes.animate,a=this,o=a.currPage,s=a.playState,u=a.playWindow,c=a.pageViews;if(s!=="idle"||e<0||c.length<=0||e>=c.length)return null;c[o].setLocalPosition(0,0),this.prepareFollowingPage(e);var l=lt(this.getFollowingPageDiff(e),2),d=l[0],p=l[1];this.playState="running";var g=yZ(u,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-d,", ").concat(-p,")")}],i);return vZ(g,function(){r.innerCurrPage=e,r.playState="idle",r.setVisiblePages([e]),r.updatePageInfo()}),g},t.prototype.prev=function(){var e=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!e&&i<=0)return null;var a=e?(i-1+r)%r:dn(i-1,0,r);return this.goTo(a)},t.prototype.next=function(){var e=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!e&&i>=r-1)return null;var a=e?(i+1)%r:dn(i+1,0,r);return this.goTo(a)},t.prototype.renderClipPath=function(e){var r=this.pageShape,i=r.pageWidth,a=r.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=e.maybeAppendByClassName(Cr.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},t.prototype.setVisiblePages=function(e){this.playWindow.children.forEach(function(r,i){e.includes(i)?PK(r):sx(r)})},t.prototype.adjustControllerLayout=function(){var e=this,r=e.prevBtnGroup,i=e.nextBtnGroup,a=e.pageInfoGroup,o=this.attributes,s=o.orientation,u=o.controllerPadding,c=a.getBBox(),l=c.width,d=lt(s==="horizontal"?[-180,0]:[-90,90],2),p=d[0],g=d[1];r.setLocalEulerAngles(p),i.setLocalEulerAngles(g);var m=r.getBBox(),y=m.width,v=m.height,x=i.getBBox(),E=x.width,w=x.height,S=Math.max(y,l,E),k=s==="horizontal"?{offset:[[0,0],[y/2+u,0],[y+l+u*2,0]],textAlign:"start"}:{offset:[[S/2,-v-u],[S/2,0],[S/2,w+u]],textAlign:"center"},A=lt(k.offset,3),N=lt(A[0],2),T=N[0],O=N[1],M=lt(A[1],2),P=M[0],L=M[1],j=lt(A[2],2),z=j[0],U=j[1],J=k.textAlign,W=a.querySelector("text");W&&(W.style.textAlign=J),r.setLocalPosition(T,O),a.setLocalPosition(P,L),i.setLocalPosition(z,U)},t.prototype.updatePageInfo=function(){var e,r=this,i=r.currPage,a=r.pageViews,o=r.attributes.formatter;a.length<2||((e=this.pageInfoGroup.querySelector(Cr.pageInfo.class))===null||e===void 0||e.attr("text",o(i+1,a.length)),this.adjustControllerLayout())},t.prototype.getFollowingPageDiff=function(e){var r=this.currPage;if(r===e)return[0,0];var i=this.attributes.orientation,a=this.pageShape,o=a.pageWidth,s=a.pageHeight,u=e<r?-1:1;return i==="horizontal"?[u*o,0]:[0,u*s]},t.prototype.prepareFollowingPage=function(e){var r=this,i=r.currPage,a=r.pageViews;if(this.setVisiblePages([e,i]),e!==i){var o=lt(this.getFollowingPageDiff(e),2),s=o[0],u=o[1];a[e].setLocalPosition(s,u)}},t.prototype.renderController=function(e){var r=this,i=this.attributes.controllerSpacing,a=this.pageShape,o=a.pageWidth,s=a.pageHeight,u=this.pageViews.length>=2,c=e.maybeAppendByClassName(Cr.controller,"g");if(Ad(c.node(),u),!!u){var l=Or(this.attributes,"button"),d=Or(this.attributes,"pageNum"),p=lt(kh(l),2),g=p[0],m=p[1],y=g.size,v=dr(g,["size"]),x=!c.select(Cr.prevBtnGroup.class).node(),E=c.maybeAppendByClassName(Cr.prevBtnGroup,"g").styles(m);this.prevBtnGroup=E.node();var w=E.maybeAppendByClassName(Cr.prevBtn,"path"),S=c.maybeAppendByClassName(Cr.nextBtnGroup,"g").styles(m);this.nextBtnGroup=S.node();var k=S.maybeAppendByClassName(Cr.nextBtn,"path");[w,k].forEach(function(N){N.styles(ae(ae({},v),{transformOrigin:"center"})),XP(N.node(),y)});var A=c.maybeAppendByClassName(Cr.pageInfoGroup,"g");this.pageInfoGroup=A.node(),A.maybeAppendByClassName(Cr.pageInfo,"text").styles(d),this.updatePageInfo(),c.node().setLocalPosition(o+i,s/2),x&&(this.prevBtnGroup.addEventListener("click",function(){r.prev()}),this.nextBtnGroup.addEventListener("click",function(){r.next()}))}},t.prototype.render=function(e,r){var i=e.x,a=i===void 0?0:i,o=e.y,s=o===void 0?0:o;this.attr("transform","translate(".concat(a,", ").concat(s,")"));var u=hr(r);this.renderClipPath(u),this.renderController(u),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},t.prototype.bindEvents=function(){var e=this,r=_h(function(){return e.render(e.attributes,e)},50);this.playWindow.addEventListener(Wt.INSERTED,r),this.playWindow.addEventListener(Wt.REMOVED,r)},t})(Wi);function AZ(n,t,e){var r=1.4,i=r*e;return[["M",n-e,t-i],["L",n+e,t-i],["L",n+e,t+i],["L",n-e,t+i],["Z"]]}var JP=1.4,QP=.4;function SZ(n,t,e){var r=e,i=r*JP,a=r/2,o=r/6,s=n+i*QP;return[["M",n,t],["L",s,t+a],["L",n+i,t+a],["L",n+i,t-a],["L",s,t-a],["Z"],["M",s,t+o],["L",n+i-2,t+o],["M",s,t-o],["L",n+i-2,t-o]]}function CZ(n,t,e){var r=e,i=r*JP,a=r/2,o=r/6,s=t+i*QP;return[["M",n,t],["L",n-a,s],["L",n-a,t+i],["L",n+a,t+i],["L",n+a,s],["Z"],["M",n-o,s],["L",n-o,t+i-2],["M",n+o,s],["L",n+o,t+i-2]]}ce.registerSymbol("hiddenHandle",AZ);ce.registerSymbol("verticalHandle",SZ);ce.registerSymbol("horizontalHandle",CZ);function Q1(n,t,e){return n===void 0&&(n="horizontal"),n==="horizontal"?t:e}var Gt,NZ="component-poptip",Dt={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},mT=(Gt={},Gt[".".concat(Dt.CONTAINER)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},Gt[".".concat(Dt.TEXT)]={"text-align":"center"},Gt[".".concat(Dt.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},Gt[".".concat(Dt.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},Gt[".".concat(Dt.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},Gt[".".concat(Dt.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},Gt[".".concat(Dt.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},Gt[".".concat(Dt.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},Gt["[data-position='top'] .".concat(Dt.ARROW)]={bottom:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},Gt["[data-position='left'] .".concat(Dt.ARROW)]={right:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},Gt["[data-position='right'] .".concat(Dt.ARROW)]={left:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},Gt["[data-position='bottom'] .".concat(Dt.ARROW)]={top:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},Gt["[data-position='top-left'] .".concat(Dt.ARROW)]={left:"10px",bottom:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},Gt["[data-position='top-right'] .".concat(Dt.ARROW)]={right:"10px",bottom:"-2px"},Gt[".".concat(Dt.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},Gt["[data-position='left-top'] .".concat(Dt.ARROW)]={right:"-2px",top:"8px"},Gt[".".concat(Dt.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},Gt["[data-position='left-bottom'] .".concat(Dt.ARROW)]={right:"-2px",bottom:"8px"},Gt[".".concat(Dt.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},Gt["[data-position='right-top'] .".concat(Dt.ARROW)]={left:"-2px",top:"8px"},Gt[".".concat(Dt.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},Gt["[data-position='right-bottom'] .".concat(Dt.ARROW)]={left:"-2px",bottom:"8px"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},Gt["[data-position='bottom-left'] .".concat(Dt.ARROW)]={top:"-2px",left:"8px"},Gt[".".concat(Dt.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},Gt["[data-position='bottom-right'] .".concat(Dt.ARROW)]={top:"-2px",right:"8px"},Gt),TZ=void 0;function MZ(n,t,e,r,i,a){if(i===void 0&&(i=!1),a===void 0&&(a=!1),a)return[n,t];var o=e.getBoundingClientRect(),s=o.x,u=o.y,c=o.width,l=o.height;switch(r){case"top":return i?[s+c/2,u]:[n,u];case"left":return i?[s,u+l/2]:[s,t];case"bottom":return i?[s+c/2,u+l]:[n,u+l];case"right":return i?[s+c,u+l/2]:[s+c,t];case"top-right":case"right-top":return[s+c,u];case"left-bottom":case"bottom-left":return[s,u+l];case"right-bottom":case"bottom-right":return[s+c,u+l];case"top-left":case"left-top":default:return[s,u]}}var _Z=function(n){var t;return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t||(t=n.apply(TZ,e)),t}};function OZ(n){var t=n&&document.getElementById(n);return t||(t=document.createElement("div"),t.setAttribute("id",n),document.body.appendChild(t)),t}function PZ(n){var t=_Z(OZ)(n);return t}var RZ=(function(n){Rr(t,n);function t(e){var r=n.call(this,ma({style:{id:NZ}},t.defaultOptions,e))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return Object.defineProperty(t.prototype,"visible",{get:function(){return this.visibility==="visible"},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){this.visibility=this.style.visibility,this.updatePoptipElement()},t.prototype.update=function(e){this.attr(ma({},this.style,e)),this.render(this.attributes,this)},t.prototype.bind=function(e,r){var i=this;if(e){var a=this.style.text,o=function(u){var c=e,l=i.style,d=a;if(r){var p=typeof r=="function"?r.call(null,u):r,g=p.html,m=p.target,y=dr(p,["html","target"]);l=OB({},i.style,y),(m||m===!1)&&(c=m),typeof g=="string"&&(d=g)}var v=l.position,x=l.arrowPointAtCenter,E=l.follow,w=l.offset;if(c){var S=u,k=S.clientX,A=S.clientY,N=lt(MZ(k,A,c,v,x,E),2),T=N[0],O=N[1];i.showTip(T,O,{text:d,position:v,offset:w})}else i.hideTip()},s=function(){i.hideTip()};e.addEventListener("mousemove",o),e.addEventListener("mouseleave",s),this.map.set(e,[o,s])}},t.prototype.unbind=function(e){if(this.map.has(e)){var r=lt(this.map.get(e)||[],2),i=r[0],a=r[1];i&&e.removeEventListener("mousemove",i),a&&e.removeEventListener("mouseleave",a),this.map.delete(e)}},t.prototype.clear=function(){this.container.innerHTML=""},t.prototype.destroy=function(){var e=this,r;Sn([],lt(this.map.keys()),!1).forEach(function(i){return e.unbind(i)}),(r=this.container)===null||r===void 0||r.remove(),n.prototype.destroy.call(this)},t.prototype.showTip=function(e,r,i){var a=lr(i,"text");if(!(a&&typeof a!="string")&&(this.applyStyles(),e&&r&&i)){var o=i.offset,s=i.position;if(s&&this.container.setAttribute("data-position",s),this.setOffsetPosition(e,r,o),typeof a=="string"){var u=this.container.querySelector(".".concat(Dt.TEXT));u&&(u.innerHTML=a)}this.visibility="visible",this.container.style.visibility="visible"}},t.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},t.prototype.getContainer=function(){return this.container},t.prototype.getClassName=function(){var e=this.style.containerClassName;return"".concat(Dt.CONTAINER).concat(e?" ".concat(e):"")},t.prototype.initShape=function(){var e=this,r=this.style.id;this.container=PZ(r),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return e.showTip()}),this.container.addEventListener("mouseleave",function(){return e.hideTip()})},t.prototype.updatePoptipElement=function(){var e=this.container;this.clear();var r=this.style,i=r.id,a=r.template,o=r.text;this.container.setAttribute("id",i),this.container.className=this.getClassName();var s='<span class="'.concat(Dt.ARROW,'"></span>');e.innerHTML=s,fe(a)?e.innerHTML+=a:a&&_B(a)&&e.appendChild(a),o&&(e.getElementsByClassName(Dt.TEXT)[0].textContent=o),this.applyStyles(),this.container.style.visibility=this.visibility},t.prototype.applyStyles=function(){var e=co({},mT,this.style.domStyles),r=Object.entries(e).reduce(function(a,o){var s=lt(o,2),u=s[0],c=s[1],l=Object.entries(c).reduce(function(d,p){var g=lt(p,2),m=g[0],y=g[1];return"".concat(d).concat(m,": ").concat(y,";")},"");return"".concat(a).concat(u,"{").concat(l,"}")},"");if(this.domStyles!==r){this.domStyles=r;var i=this.container.querySelector("style");i&&this.container.removeChild(i),i=document.createElement("style"),i.innerHTML=r,this.container.appendChild(i)}},t.prototype.setOffsetPosition=function(e,r,i){i===void 0&&(i=this.style.offset);var a=lt(i,2),o=a[0],s=o===void 0?0:o,u=a[1],c=u===void 0?0:u;this.container.style.left="".concat(e+s,"px"),this.container.style.top="".concat(r+c,"px")},t.tag="poptip",t.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:mT,template:'<div class="'.concat(Dt.TEXT,'"></div>')}},t})(Wi),En=As({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),DZ={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};function LZ(n){var t=n.querySelector(En.marker.class);return t?t.style:{}}var IZ=(function(n){Rr(t,n);function t(e){return n.call(this,e,{span:[1,1],marker:function(){return new ao({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(t.prototype,"showValue",{get:function(){var e=this.attributes.valueText;return e?typeof e=="string"||typeof e=="number"?e!=="":typeof e=="function"?!0:e.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualSpace",{get:function(){var e=this.labelGroup,r=this.valueGroup,i=this.attributes,a=i.markerSize,o=i.focus,s=i.focusMarkerSize,u=e.node().getBBox(),c=u.width,l=u.height,d=r.node().getBBox(),p=d.width,g=d.height,m=o?s??12:0;return{markerWidth:a,labelWidth:c,valueWidth:p,focusWidth:m,height:Math.max(a,l,g)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"span",{get:function(){var e=this.attributes.span;if(!e)return[1,1];var r=lt(ls(e),2),i=r[0],a=r[1],o=this.showValue?a:0,s=i+o;return[i/s,o/s]},enumerable:!1,configurable:!0}),t.prototype.setAttribute=function(e,r){n.prototype.setAttribute.call(this,e,r)},Object.defineProperty(t.prototype,"shape",{get:function(){var e,r=this.attributes,i=r.markerSize,a=r.width,o=this.actualSpace,s=o.markerWidth,u=o.focusWidth,c=o.height,l=this.actualSpace,d=l.labelWidth,p=l.valueWidth,g=lt(this.spacing,3),m=g[0],y=g[1],v=g[2];if(a){var x=a-i-m-y-u-v,E=lt(this.span,2),w=E[0],S=E[1];e=lt([w*x,S*x],2),d=e[0],p=e[1]}var k=s+d+p+m+y+u+v;return{width:k,height:c,markerWidth:s,labelWidth:d,valueWidth:p,focusWidth:u}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){var e=this.attributes,r=e.spacing,i=e.focus;if(!r)return[0,0,0];var a=lt(ls(r),3),o=a[0],s=a[1],u=a[2];return[o,this.showValue?s:0,i?u:0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){var e=this.shape,r=e.markerWidth,i=e.labelWidth,a=e.valueWidth,o=e.focusWidth,s=e.width,u=e.height,c=lt(this.spacing,3),l=c[0],d=c[1],p=c[2];return{height:u,width:s,markerWidth:r,labelWidth:i,valueWidth:a,focusWidth:o,position:[r/2,r+l,r+i+l+d,r+i+a+l+d+p+o/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleSize",{get:function(){var e=LZ(this.markerGroup.node()),r=this.attributes,i=r.markerSize,a=r.markerStrokeWidth,o=a===void 0?e.strokeWidth:a,s=r.markerLineWidth,u=s===void 0?e.lineWidth:s,c=r.markerStroke,l=c===void 0?e.stroke:c,d=+(o||u||(l?1:0))*Math.sqrt(2),p=this.markerGroup.node().getBBox(),g=p.width,m=p.height;return(1-d/Math.max(g,m))*i},enumerable:!1,configurable:!0}),t.prototype.renderMarker=function(e){var r=this,i=this.attributes.marker,a=Or(this.attributes,"marker");this.markerGroup=e.maybeAppendByClassName(En.markerGroup,"g").style("zIndex",0),to(!!i,this.markerGroup,function(){var o,s=r.markerGroup.node(),u=(o=s.childNodes)===null||o===void 0?void 0:o[0],c=typeof i=="string"?new ce({style:{symbol:i},className:En.marker.name}):i();u?c.nodeName===u.nodeName?u instanceof ce?u.update(ae(ae({},a),{symbol:i})):(VK(u,c),hr(u).styles(a)):(u.remove(),hr(c).attr("className",En.marker.name).styles(a),s.appendChild(c)):(c instanceof ce||hr(c).attr("className",En.marker.name).styles(a),s.appendChild(c)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]);var l=XP(r.markerGroup.node(),r.scaleSize);r.markerGroup.node().style._transform="scale(".concat(l,")")})},t.prototype.renderLabel=function(e){var r=Or(this.attributes,"label"),i=r.text,a=dr(r,["text"]);this.labelGroup=e.maybeAppendByClassName(En.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(En.label,function(){return fT(i)}).styles(a)},t.prototype.renderValue=function(e){var r=this,i=Or(this.attributes,"value"),a=i.text,o=dr(i,["text"]);this.valueGroup=e.maybeAppendByClassName(En.valueGroup,"g").style("zIndex",0),to(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(En.value,function(){return fT(a)}).styles(o)})},t.prototype.createPoptip=function(){var e=this.attributes.poptip,r=e||{},i=dr(r,["render"]),a=new RZ({style:co(DZ,i)});return this.poptipGroup=a,a},t.prototype.bindPoptip=function(e){var r=this,i=this.attributes.poptip;if(i){var a=this.poptipGroup||this.createPoptip();a.bind(e,function(){var o=r.attributes,s=o.labelText,u=o.valueText,c=o.markerFill,l=typeof s=="string"?s:s==null?void 0:s.attr("text"),d=typeof u=="string"?u:u==null?void 0:u.attr("text");if(typeof i.render=="function")return{html:i.render({label:l,value:d,color:c})};var p="";return(typeof l=="string"||typeof l=="number")&&(p+='<div class="component-poptip-label">'.concat(l,"</div>")),(typeof d=="string"||typeof d=="number")&&(p+='<div class="component-poptip-value">'.concat(d,"</div>")),{html:p}})}},t.prototype.renderFocus=function(e){var r=this,i=this.attributes,a=i.focus,o=i.focusMarkerSize,s={x:0,y:0,size:o,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Ce(a)||(this.focusGroup=e.maybeAppendByClassName(En.focusGroup,"g").style("zIndex",0),to(a,this.focusGroup,function(){var u=new ce({style:ae(ae({},s),{symbol:"focus"})}),c=new ao({style:{r:s.size/2,fill:"transparent"}}),l=r.focusGroup.node();l.appendChild(c),l.appendChild(u),u.update({opacity:0}),e.node().addEventListener("pointerenter",function(){u.update({opacity:1})}),e.node().addEventListener("pointerleave",function(){u.update({opacity:0})})}))},t.prototype.renderPoptip=function(e){var r=this,i=this.attributes.poptip;if(i){var a=e.maybeAppendByClassName(En.value,"g").node(),o=e.maybeAppendByClassName(En.label,"g").node();[a,o].forEach(function(s){s&&r.bindPoptip(s)})}},t.prototype.renderBackground=function(e){var r=this.shape,i=r.width,a=r.height,o=Or(this.attributes,"background");this.background=e.maybeAppendByClassName(En.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(En.background,"rect").styles(ae({width:i,height:a},o))},t.prototype.adjustLayout=function(){var e=this.layout,r=e.labelWidth,i=e.valueWidth,a=e.height,o=lt(e.position,4),s=o[0],u=o[1],c=o[2],l=o[3],d=a/2;this.markerGroup.styles({transform:"translate(".concat(s,", ").concat(d,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(u,", ").concat(d,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(l,", ").concat(d,")")}),dT(this.labelGroup.select(En.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(d,")")}),dT(this.valueGroup.select(En.value.class).node(),Math.ceil(i)))},t.prototype.render=function(e,r){var i=hr(r),a=e.x,o=a===void 0?0:a,s=e.y,u=s===void 0?0:s;i.styles({transform:"translate(".concat(o,", ").concat(u,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.renderPoptip(i),this.renderFocus(i),this.adjustLayout()},t})(Wi),Ga=As({page:"item-page",navigator:"navigator",item:"item"},"items"),yT=function(n,t,e){return e===void 0&&(e=!0),n?t(n):e},jZ=(function(n){Rr(t,n);function t(e){var r=n.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:rp,mouseenter:rp,mouseleave:rp})||this;return r.navigatorShape=[0,0],r}return Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){var e=this.attributes,r=e.gridRow,i=e.gridCol,a=e.data;if(!r&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return r&&i?[r,i]:r?[r,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderData",{get:function(){var e=this.attributes,r=e.data,i=e.layout,a=e.poptip,o=e.focus,s=e.focusMarkerSize,u=Or(this.attributes,"item"),c=r.map(function(l,d){var p=l.id,g=p===void 0?d:p,m=l.label,y=l.value;return{id:"".concat(g),index:d,style:ae({layout:i,labelText:m,valueText:y,poptip:a,focus:o,focusMarkerSize:s},Object.fromEntries(Object.entries(u).map(function(v){var x=lt(v,2),E=x[0],w=x[1];return[E,DK(w,[l,d,r])]})))}});return c},enumerable:!1,configurable:!0}),t.prototype.getGridLayout=function(){var e=this,r=this.attributes,i=r.orientation,a=r.width,o=r.rowPadding,s=r.colPadding,u=lt(this.navigatorShape,1),c=u[0],l=lt(this.grid,2),d=l[0],p=l[1],g=p*d,m=0;return this.pageViews.children.map(function(y,v){var x,E,w=Math.floor(v/g),S=v%g,k=e.ifHorizontal(p,d),A=[Math.floor(S/k),S%k];i==="vertical"&&A.reverse();var N=lt(A,2),T=N[0],O=N[1],M=(a-c-(p-1)*s)/p,P=y.getBBox().height,L=lt([0,0],2),j=L[0],z=L[1];return i==="horizontal"?(x=lt([m,T*(P+o)],2),j=x[0],z=x[1],m=O===p-1?0:m+M+s):(E=lt([O*(M+s),m],2),j=E[0],z=E[1],m=T===d-1?0:m+P+o),{page:w,index:v,row:T,col:O,pageIndex:S,width:M,height:P,x:j,y:z}})},t.prototype.getFlexLayout=function(){var e=this.attributes,r=e.width,i=e.height,a=e.rowPadding,o=e.colPadding,s=lt(this.navigatorShape,1),u=s[0],c=lt(this.grid,2),l=c[0],d=c[1],p=lt([r-u,i],2),g=p[0],m=p[1],y=lt([0,0,0,0,0,0,0,0],8),v=y[0],x=y[1],E=y[2],w=y[3],S=y[4],k=y[5],A=y[6],N=y[7];return this.pageViews.children.map(function(T,O){var M,P,L,j,z=T.getBBox(),U=z.width,J=z.height,W=A===0?0:o,at=A+W+U;if(at<=g&&yT(S,function(yt){return yt<d}))return M=lt([A+W,N,at],3),v=M[0],x=M[1],A=M[2],{width:U,height:J,x:v,y:x,page:E,index:O,pageIndex:w++,row:k,col:S++};P=lt([k+1,0,0,N+J+a],4),k=P[0],S=P[1],A=P[2],N=P[3];var ut=N+J;return ut<=m&&yT(k,function(yt){return yt<l})?(L=lt([A,N,U],3),v=L[0],x=L[1],A=L[2],{width:U,height:J,x:v,y:x,page:E,index:O,pageIndex:w++,row:k,col:S++}):(j=lt([0,0,U,0,E+1,0,0,0],8),v=j[0],x=j[1],A=j[2],N=j[3],E=j[4],w=j[5],k=j[6],S=j[7],{width:U,height:J,x:v,y:x,page:E,index:O,pageIndex:w++,row:k,col:S++})})},Object.defineProperty(t.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var e=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,r=e.call(this);return r.slice(-1)[0].page>0?(this.navigatorShape=[55,0],e.call(this)):r},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(e,r){var i=this.attributes.orientation;return Q1(i,e,r)},t.prototype.flattenPage=function(e){e.querySelectorAll(Ga.item.class).forEach(function(r){e.appendChild(r)}),e.querySelectorAll(Ga.page.class).forEach(function(r){var i=e.removeChild(r);i.destroy()})},t.prototype.renderItems=function(e){var r=this.attributes,i=r.click,a=r.mouseenter,o=r.mouseleave;this.flattenPage(e);var s=this.dispatchCustomEvent.bind(this);hr(e).selectAll(Ga.item.class).data(this.renderData,function(u){return u.id}).join(function(u){return u.append(function(c){var l=c.style;return new IZ({style:l})}).attr("className",Ga.item.name).on("click",function(){i==null||i(this),s("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),s("itemMouseenter",{item:this})}).on("pointerleave",function(){o==null||o(this),s("itemMouseleave",{item:this})})},function(u){return u.each(function(c){var l=c.style;this.update(l)})},function(u){return u.remove()})},t.prototype.relayoutNavigator=function(){var e,r=this.attributes,i=r.layout,a=r.width,o=((e=this.pageViews.children[0])===null||e===void 0?void 0:e.getBBox().height)||0,s=lt(this.navigatorShape,2),u=s[0],c=s[1];this.navigator.update(i==="grid"?{pageWidth:a-u,pageHeight:o-c}:{})},t.prototype.adjustLayout=function(){var e=this,r=Object.entries(BK(this.itemsLayout,"page")).map(function(a){var o=lt(a,2),s=o[0],u=o[1];return{page:s,layouts:u}}),i=Sn([],lt(this.navigator.getContainer().children),!1);r.forEach(function(a){var o=a.layouts,s=e.pageViews.appendChild(new vi({className:Ga.page.name}));o.forEach(function(u){var c=u.x,l=u.y,d=u.index,p=u.width,g=u.height,m=i[d];s.appendChild(m),Xl(m,"__layout__",u),m.update({x:c,y:l,width:p,height:g})})}),this.relayoutNavigator()},t.prototype.renderNavigator=function(e){var r=this.attributes.orientation,i=Or(this.attributes,"nav"),a=co({orientation:r},i),o=this;return e.selectAll(Ga.navigator.class).data(["nav"]).join(function(s){return s.append(function(){return new kZ({style:a})}).attr("className",Ga.navigator.name).each(function(){o.navigator=this})},function(s){return s.each(function(){this.update(a)})},function(s){return s.remove()}),this.navigator},t.prototype.getBBox=function(){return this.navigator.getBBox()},t.prototype.render=function(e,r){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(hr(r));this.renderItems(a.getContainer()),this.adjustLayout()}},t.prototype.dispatchCustomEvent=function(e,r){var i=new vn(e,{detail:r});this.dispatchEvent(i)},t})(Wi),eu=As({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),t6={showLabel:!0,formatter:function(n){return n.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0};(function(n){Rr(t,n);function t(e){return n.call(this,e,t6)||this}return t.prototype.render=function(e,r){var i=hr(r).maybeAppendByClassName(eu.markerGroup,"g");this.renderMarker(i);var a=hr(r).maybeAppendByClassName(eu.labelGroup,"g");this.renderLabel(a)},t.prototype.renderMarker=function(e){var r=this,i=this.attributes,a=i.orientation,o=i.markerSymbol,s=o===void 0?Q1(a,"horizontalHandle","verticalHandle"):o;to(!!s,e,function(u){var c=Or(r.attributes,"marker"),l=ae({symbol:s},c);r.marker=u.maybeAppendByClassName(eu.marker,function(){return new ce({style:l})}).update(l)})},t.prototype.renderLabel=function(e){var r=this,i=this.attributes,a=i.showLabel,o=i.orientation,s=i.spacing,u=s===void 0?0:s,c=i.formatter;to(a,e,function(l){var d,p=Or(r.attributes,"label"),g=p.text,m=dr(p,["text"]),y=((d=l.select(eu.marker.class))===null||d===void 0?void 0:d.node().getBBox())||{},v=y.width,x=v===void 0?0:v,E=y.height,w=E===void 0?0:E,S=lt(Q1(o,[0,w+u,"center","top"],[x+u,0,"start","middle"]),4),k=S[0],A=S[1],N=S[2],T=S[3];l.maybeAppendByClassName(eu.label,"text").styles(ae(ae({},m),{x:k,y:A,text:c(g).toString(),textAlign:N,textBaseline:T}))})},t})(Wi);var e6={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},BZ=co({},e6,{});co({},e6,$K(t6,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"});var nu=As({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),zZ=(function(n){Rr(t,n);function t(e){return n.call(this,e,BZ)||this}return t.prototype.renderTitle=function(e,r,i){var a=this.attributes,o=a.showTitle,s=a.titleText,u=Or(this.attributes,"title"),c=lt(kh(u),2),l=c[0],d=c[1];this.titleGroup=e.maybeAppendByClassName(nu.titleGroup,"g").styles(d);var p=ae(ae({width:r,height:i},l),{text:o?s:""});this.title=this.titleGroup.maybeAppendByClassName(nu.title,function(){return new wZ({style:p})}).update(p)},t.prototype.renderItems=function(e,r){var i=r.x,a=r.y,o=r.width,s=r.height,u=Or(this.attributes,"title",!0),c=lt(kh(u),2),l=c[0],d=c[1],p=ae(ae({},l),{width:o,height:s,x:0,y:0});this.itemsGroup=e.maybeAppendByClassName(nu.itemsGroup,"g").styles(ae(ae({},d),{transform:"translate(".concat(i,", ").concat(a,")")}));var g=this;this.itemsGroup.selectAll(nu.items.class).data(["items"]).join(function(m){return m.append(function(){return new jZ({style:p})}).attr("className",nu.items.name).each(function(){g.items=hr(this)})},function(m){return m.update(p)},function(m){return m.remove()})},t.prototype.adjustLayout=function(){var e=this.attributes.showTitle;if(e){var r=this.title.node().getAvailableSpace(),i=r.x,a=r.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,r=e.showTitle,i=e.width,a=e.height;return r?this.title.node().getAvailableSpace():new hi(0,0,i,a)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e,r,i=(e=this.title)===null||e===void 0?void 0:e.node(),a=(r=this.items)===null||r===void 0?void 0:r.node();return!i||!a?n.prototype.getBBox.call(this):bZ(i,a)},t.prototype.render=function(e,r){var i=this.attributes,a=i.width,o=i.height,s=i.x,u=s===void 0?0:s,c=i.y,l=c===void 0?0:c,d=hr(r);r.style.transform="translate(".concat(u,", ").concat(l,")"),this.renderTitle(d,a,o),this.renderItems(d,this.availableSpace),this.adjustLayout()},t})(Wi);function tb(n){return n===void 0&&(n=""),{CONTAINER:"".concat(n,"tooltip"),TITLE:"".concat(n,"tooltip-title"),LIST:"".concat(n,"tooltip-list"),LIST_ITEM:"".concat(n,"tooltip-list-item"),NAME:"".concat(n,"tooltip-list-item-name"),MARKER:"".concat(n,"tooltip-list-item-marker"),NAME_LABEL:"".concat(n,"tooltip-list-item-name-label"),VALUE:"".concat(n,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(n,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(n,"tooltip-crosshair-y")}}var bT={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function FZ(n){var t;n===void 0&&(n="");var e=tb(n);return t={},t[".".concat(e.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},t[".".concat(e.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},t[".".concat(e.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},t[".".concat(e.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},t[".".concat(e.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},t[".".concat(e.NAME)]={display:"flex","align-items":"center","max-width":"216px"},t[".".concat(e.NAME_LABEL)]=ae({flex:1},bT),t[".".concat(e.VALUE)]=ae({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},bT),t[".".concat(e.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t[".".concat(e.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t}var GZ=(function(n){Rr(t,n);function t(e){var r=this,i,a,o=(a=(i=e.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,s=tb(o);return r=n.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(s.CONTAINER,'"></div>'),title:'<div class="'.concat(s.TITLE,'"></div>'),item:'<li class="'.concat(s.LIST_ITEM,`" data-index={index}>
127
+ <span class="`).concat(s.NAME,`">
128
+ <span class="`).concat(s.MARKER,`" style="background:{color}"></span>
129
+ <span class="`).concat(s.NAME_LABEL,`" title="{name}">{name}</span>
130
+ </span>
131
+ <span class="`).concat(s.VALUE,`" title="{value}">{value}</span>
132
+ </li>`)},style:FZ(o)})||this,r.timestamp=-1,r.prevCustomContentKey=r.attributes.contentKey,r.initShape(),r.render(r.attributes,r),r}return Object.defineProperty(t.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.element},Object.defineProperty(t.prototype,"elementSize",{get:function(){var e=this.element.offsetWidth,r=this.element.offsetHeight;return{width:e,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HTMLTooltipItemsElements",{get:function(){var e=this.attributes,r=e.data,i=e.template;return r.map(function(a,o){var s=a.name,u=s===void 0?"":s,c=a.color,l=c===void 0?"black":c,d=a.index,p=dr(a,["name","color","index"]),g=ae({name:u,color:l,index:d??o},p);return b1(SB(i.item,g))})},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){this.renderHTMLTooltipElement(),this.updatePosition()},t.prototype.destroy=function(){var e;(e=this.element)===null||e===void 0||e.remove(),n.prototype.destroy.call(this)},t.prototype.show=function(e,r){var i=this;if(e!==void 0&&r!==void 0){var a=this.element.style.visibility==="hidden",o=function(){i.attributes.x=e??i.attributes.x,i.attributes.y=r??i.attributes.y,i.updatePosition()};a?this.closeTransition(o):o()}this.element.style.visibility="visible"},t.prototype.hide=function(e,r){e===void 0&&(e=0),r===void 0&&(r=0);var i=this.attributes.enterable;i&&this.isCursorEntered(e,r)||(this.element.style.visibility="hidden")},t.prototype.initShape=function(){var e=this.attributes.template;this.element=b1(e.container),this.id&&this.element.setAttribute("id",this.id)},t.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var e=this.attributes.content;e&&(typeof e=="string"?this.element.innerHTML=e:gT(this.element,e))}},t.prototype.renderHTMLTooltipElement=function(){var e,r,i=this.attributes,a=i.template,o=i.title,s=i.enterable,u=i.style,c=i.content,l=tb(a.prefixCls),d=this.element;if(this.element.style.pointerEvents=s?"auto":"none",c)this.renderCustomContent();else{o?(d.innerHTML=a.title,d.getElementsByClassName(l.TITLE)[0].innerHTML=o):(r=(e=d.getElementsByClassName(l.TITLE))===null||e===void 0?void 0:e[0])===null||r===void 0||r.remove();var p=this.HTMLTooltipItemsElements,g=document.createElement("ul");g.className=l.LIST,gT(g,p);var m=this.element.querySelector(".".concat(l.LIST));m?m.replaceWith(g):d.appendChild(g)}YK(d,u)},t.prototype.getRelativeOffsetFromCursor=function(e){var r=this.attributes,i=r.position,a=r.offset,o=e||i,s=o.split("-"),u={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},c=this.elementSize,l=c.width,d=c.height,p=[-l/2,-d/2];return s.forEach(function(g){var m=lt(p,2),y=m[0],v=m[1],x=lt(u[g],2),E=x[0],w=x[1];p=[y+(l/2+a[0])*E,v+(d/2+a[1])*w]}),p},t.prototype.setOffsetPosition=function(e){var r=lt(e,2),i=r[0],a=r[1],o=this.attributes,s=o.x,u=s===void 0?0:s,c=o.y,l=c===void 0?0:c,d=o.container,p=d.x,g=d.y;this.element.style.left="".concat(+u+p+i,"px"),this.element.style.top="".concat(+l+g+a,"px")},t.prototype.updatePosition=function(){var e=this.attributes.showDelay,r=e===void 0?60:e,i=Date.now();this.timestamp>0&&i-this.timestamp<r||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},t.prototype.autoPosition=function(e){var r=lt(e,2),i=r[0],a=r[1],o=this.attributes,s=o.x,u=o.y,c=o.bounding,l=o.position;if(!c)return[i,a];var d=this.element,p=d.offsetWidth,g=d.offsetHeight,m=lt([+s+i,+u+a],2),y=m[0],v=m[1],x={left:"right",right:"left",top:"bottom",bottom:"top"},E=c.x,w=c.y,S=c.width,k=c.height,A={left:y<E,right:y+p>E+S,top:v<w,bottom:v+g>w+k},N=[];l.split("-").forEach(function(O){A[O]?N.push(x[O]):N.push(O)});var T=N.join("-");return this.getRelativeOffsetFromCursor(T)},t.prototype.isCursorEntered=function(e,r){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,o=i.y,s=i.width,u=i.height;return new hi(a,o,s,u).isPointIn(e,r)}return!1},t.prototype.closeTransition=function(e){var r=this,i=this.element.style.transition;this.element.style.transition="none",e(),setTimeout(function(){r.element.style.transition=i},10)},t.tag="tooltip",t})(Wi);function n6(n){const{width:t,height:e,renderer:r}=n,i=VZ(n),a=new I1({width:t,height:e,container:i,renderer:r||new gh});return[i,a]}function VZ(n){var t;const{container:e,className:r,graphCanvas:i}=n;if(e)return typeof e=="string"?document.getElementById(e):e;const a=qu(r,!1),{width:o,height:s,containerStyle:u}=n,[c,l]=UZ(n);return Object.assign(a.style,Object.assign({position:"absolute",left:c+"px",top:l+"px",width:o+"px",height:s+"px"},u)),(t=i.getContainer())===null||t===void 0||t.appendChild(a),a}function UZ(n){const{width:t,height:e,placement:r,graphCanvas:i}=n,[a,o]=i.getSize(),[s,u]=q_(r);return[s*(a-t),u*(o-e)]}var WZ=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Sd extends yo{constructor(t,e){super(t,Object.assign({},Sd.defaultOptions,e)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:r}=this.context;r.on(gt.AFTER_DRAW,this.createElement)},this.changeState=(r,i)=>{const{graph:a}=this.context,{typePrefix:o}=this,s=lr(r,[o,"id"]),u=lr(r,[o,"style","labelText"]),[c]=s.split("__"),l=this.fieldMap[c].get(u)||[];a.setElementState(Object.fromEntries(l==null?void 0:l.map(d=>[d,i])))},this.click=r=>{if(this.options.trigger==="hover")return;const i=lr(r,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(r,[])):(this.selectedItems.push(i),this.changeState(r,"selected"))},this.mouseleave=r=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(r,[]))},this.mouseenter=r=>{if(this.options.trigger==="click")return;const i=lr(r,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(r,"active"))},this.setFieldMap=(r,i,a)=>{if(!r)return;const o=this.fieldMap[a];if(o)if(!o.has(r))o.set(r,[i]);else{const s=o.get(r);s&&(s.push(i),o.set(r,s))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(r,i)=>{if(!r)return[];const{model:a,element:o}=this.context,{nodes:s,edges:u,combos:c}=a.getData(),l={},d=v=>St(r)?r(v):r,p={node:"circle",edge:"line",combo:"rect"},g={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},m=(v,x)=>o==null?void 0:o.getElementComputedStyle(v,x),y=(v,x)=>{v.forEach(E=>{const{id:w}=E,S=lr(E,["data",d(E)]),k=(o==null?void 0:o.getElementType(x,E))||"circle",A=m(x,E),N=(x==="edge"?A==null?void 0:A.stroke:A==null?void 0:A.fill)||"#1783ff";w&&S&&S.replace(/\s+/g,"")&&(this.setFieldMap(S,w,x),l[S]||(l[S]={id:`${x}__${w}`,label:S,marker:g[k]||p[x],elementType:x,lineWidth:1,stroke:N,fill:N}))})};switch(i){case"node":y(s,"node");break;case"edge":y(u,"edge");break;case"combo":y(c,"combo");break;default:return[]}return Object.values(l)},this.createElement=()=>{if(this.draw){this.updateElement();return}const r=this.options,{width:i,height:a,nodeField:o,edgeField:s,comboField:u}=r,c=WZ(r,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),l=this.getMarkerData(o,"node"),d=this.getMarkerData(s,"edge"),p=this.getMarkerData(u,"combo"),g=[...l,...p,...d],m=Object.assign({width:i,height:a,data:g,itemMarkerLineWidth:({lineWidth:v})=>v,itemMarker:({marker:v})=>v,itemMarkerStroke:({stroke:v})=>v,itemMarkerFill:({fill:v})=>v,gridCol:l.length},c,this.getEvents()),y=new zZ({className:"legend",style:m});this.category=y,this.upsertCanvas().appendChild(y),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5,itemLabelOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const t=this.context.canvas,[e,r]=t.getSize(),{width:i=e,height:a=r,position:o,container:s,containerStyle:u,className:c}=this.options,[l,d]=n6({width:i,height:a,graphCanvas:t,container:s,containerStyle:u,placement:o,className:"legend"});return this.container=l,c&&l.classList.add(c),this.canvas=d,this.canvas}destroy(){this.clear(),this.context.graph.off(gt.AFTER_DRAW,this.createElement),super.destroy()}}Sd.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};var YZ=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const r6={fill:"#1D2129",wordWrap:!0,maxLines:1,textOverflow:"ellipsis",textBaseline:"top",textAlign:"start",x:0},$Z=Object.assign(Object.assign({},r6),{fillOpacity:.9,fontSize:16,fontWeight:"bold"}),HZ=Object.assign(Object.assign({},r6),{fillOpacity:.65,fontSize:12,fontWeight:"normal"}),XZ={align:"left",spacing:8,size:44,padding:[16,24,0,24]},Xy="title",xT="subtitle";class qZ extends yo{get padding(){return zi(this.options.padding)}constructor(t,e){const r=Object.assign({},XZ,e);super(t,r),this.onRender=()=>{const i=this.updateCanvas();this.renderTitle(i)},this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(gt.AFTER_RENDER,this.onRender),t.on(gt.AFTER_ANIMATE,this.onRender)}unbindEvents(){const{graph:t}=this.context;t.off(gt.AFTER_RENDER,this.onRender),t.off(gt.AFTER_ANIMATE,this.onRender)}destroy(){var t,e;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),super.destroy()}updateCanvas(){const{size:t,className:e,align:r}=this.options,[i]=this.context.canvas.getSize(),[a=0,,o=0]=this.padding,s=t+a+o;if(this.canvas){const{width:u,height:c}=this.canvas.getConfig();(i!==u||s!==c)&&this.canvas.resize(i,s)}else{const u={left:"left-top",center:"top",right:"right-top"},[c,l]=n6({width:i,height:s,placement:u[r]||u.left,className:"title-canvas",graphCanvas:this.context.canvas});e&&c.classList.add(e),this.container=c,this.canvas=l}return this.canvas}renderTitle(t){const e=new KZ({options:this.options,ctx:this.context});t.removeChildren(),e.getTitle().forEach(r=>{r&&t.appendChild(r)})}}class KZ{get padding(){return zi(this.options.padding)}constructor(t){const{options:e,ctx:r}=t;this.options=e,this.context=r}getTitle(){const t=this.options,e=Xy,r=t[e],i=xT,a=t[i],{spacing:o=44,align:s}=t,u=YZ(t,[e+"",i+"","spacing","padding","align"]),c=r,l=a,d=Cn(u,Xy),p=Cn(u,xT),[g]=this.context.graph.getSize(),[m=0,y=0,,v=0]=this.padding,x=g,E=x-v-y;let w=null,S=v,k="left";switch(s){case"left":S=v,k="left";break;case"center":S=x/2,k="center";break;case"right":S=x-y,k="right";break;default:S=v,k="left"}const A=new xa({className:Xy,style:Object.assign(Object.assign(Object.assign(Object.assign({},$Z),{wordWrapWidth:E-5,x:S,y:m,textAlign:k}),d),{text:c})}),N=A.getBBox();return l&&(w=new xa({className:"subTitle",style:Object.assign(Object.assign(Object.assign(Object.assign({},HZ),{wordWrapWidth:E-5,x:S,y:N.height+o+m,textAlign:k}),p),{text:l})})),[A,w]}}function ZZ(n){const t={top:"unset",right:"unset",bottom:"unset",left:"unset"};return n.split("-").forEach(e=>{t[e]="8px"}),t.flexDirection=n.startsWith("top")||n.startsWith("bottom")?"row":"column",t}const JZ=`
133
+ .g6-toolbar {
134
+ position: absolute;
135
+ z-index: 100;
136
+ display: flex;
137
+ flex-direction: row;
138
+ align-items: center;
139
+ justify-content: center;
140
+ border-radius: 4px;
141
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
142
+ opacity: 0.65;
143
+ }
144
+ .g6-toolbar .g6-toolbar-item {
145
+ display: inline-block;
146
+ width: 16px;
147
+ height: 16px;
148
+ padding: 4px;
149
+ cursor: pointer;
150
+ box-sizing: content-box;
151
+ }
152
+
153
+ .g6-toolbar .g6-toolbar-item:hover {
154
+ background-color: #f0f0f0;
155
+ }
156
+
157
+ .g6-toolbar .g6-toolbar-item svg {
158
+ display: inline-block;
159
+ width: 100%;
160
+ height: 100%;
161
+ pointer-events: none;
162
+ }
163
+ `,QZ=`
164
+ <svg>
165
+ <symbol id="zoom-in" viewBox="64 64 896 896">
166
+ <path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
167
+ </symbol>
168
+ <symbol id="zoom-out" viewBox="64 64 896 896">
169
+ <path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
170
+ </symbol>
171
+ <symbol id="edit" viewBox="64 64 896 896">
172
+ <path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>
173
+ </symbol>
174
+ <symbol id="delete" viewBox="64 64 896 896">
175
+ <path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>
176
+ </symbol>
177
+ <symbol id="redo" viewBox="64 64 896 896">
178
+ <path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>
179
+ </symbol>
180
+ <symbol id="undo" viewBox="64 64 896 896">
181
+ <path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>
182
+ </symbol>
183
+ <symbol id="export" viewBox="64 64 896 896">
184
+ <path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>
185
+ </symbol>
186
+ <symbol id="auto-fit" viewBox="64 64 896 896">
187
+ <path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>
188
+ <path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>
189
+ </symbol>
190
+ <symbol id="reset" viewBox="64 64 896 896">
191
+ <path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>
192
+ </symbol>
193
+ <symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
194
+ <path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>
195
+ <symbol id="request-fullscreen" viewBox="0 0 1024 1024">
196
+ <path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>
197
+ </svg>
198
+ `;var ET=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Cd extends yo{constructor(t,e){super(t,Object.assign({},Cd.defaultOptions,e)),this.$element=qu("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const o=i.target.getAttribute("value");a==null||a(o,i.target)}};const r=this.context.canvas.getContainer();this.$element.style.display="flex",r.appendChild(this.$element),J1("g6-toolbar-css","style",{},JZ,document.head),J1("g6-toolbar-svgicon","div",{display:"none"},QZ),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return ET(this,void 0,void 0,function*(){e.update.call(this,t);const{className:r,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${r||""}`,Object.assign(this.$element.style,a,ZZ(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return ET(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(t=>{var e;return`
199
+ <div class="g6-toolbar-item" value="${t.value}" title="${(e=t.title)!==null&&e!==void 0?e:""}">
200
+ <svg aria-hidden="true" focusable="false">
201
+ <use xlink:href="#${t.id}"></use>
202
+ </svg>
203
+ </div>`}).join("")})}}Cd.defaultOptions={position:"top-left"};var wT=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,[])).next())})};class Nd extends yo{constructor(t,e){super(t,Object.assign({},Nd.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(r,i)=>{const{enable:a}=this.options;return typeof a=="function"?a(r,i):a},this.onClick=r=>{const{target:{id:i}}=r;this.currentTarget===i?this.hide(r):this.show(r)},this.onPointerMove=r=>{const{target:i}=r;!this.currentTarget||i.id===this.currentTarget||this.show(r)},this.onPointerLeave=r=>{this.hide(r)},this.onCanvasMove=r=>{this.hide(r)},this.onPointerOver=r=>{this.show(r)},this.showById=r=>wT(this,void 0,void 0,function*(){const i={target:{id:r}};yield this.show(i)}),this.getElementData=(r,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([r]);case"edge":return a.getEdgeData([r]);case"combo":return a.getComboData([r]);default:return[]}},this.show=r=>wT(this,void 0,void 0,function*(){var i,a;const{client:o,target:{id:s}}=r;if(Uu(r.target))return;const u=this.context.graph.getElementType(s),{getContent:c,title:l}=this.options,d=this.getElementData(s,u);if(!this.tooltipElement||!this.isEnable(r,d))return;let p={};if(c){if(p.content=yield c(r,d),!p.content)return}else{const y=this.context.graph.getElementRenderStyle(s),v=u==="node"?y.fill:y.stroke;p={title:l||u,data:d.map(x=>({name:"ID",value:x.id||`${x.source} -> ${x.target}`,color:v}))}}this.currentTarget=s;let g,m;if(o)g=o.x,m=o.y;else{const y=lr(d,"0.style",{x:0,y:0});g=y.x,m=y.y}(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:g,y:m,style:{".tooltip":{visibility:"visible"}}}),p))}),this.hide=r=>{var i,a,o,s,u;if(!r){(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!1),(o=this.tooltipElement)===null||o===void 0||o.hide(),this.currentTarget=null;return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:c,y:l}}=r;(u=(s=this.options).onOpenChange)===null||u===void 0||u.call(s,!1),this.tooltipElement.hide(c,l),this.currentTarget=null},this.initTooltip=()=>{var r;const i=new GZ({className:"tooltip",style:this.tooltipStyleProps});return(r=this.container)===null||r===void 0||r.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerover":this.onPointerOver,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerover":this.onPointerOver,"edge:pointermove":this.onPointerMove,"combo:pointerover":this.onPointerOver,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&((e=this.container)===null||e===void 0||e.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:t}=this.context,e=t.getContainer();e&&(this.container=e,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(r=>{t.off(r,e[r])})}bindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(r=>{t.on(r,e[r])})}get tooltipStyleProps(){const{canvas:t}=this.context,{center:e}=t.getBounds(),r=t.getContainer(),{top:i,left:a}=r.getBoundingClientRect(),{style:o,position:s,enterable:u,container:c={x:-a,y:-i},title:l,offset:d}=this.options,[p,g]=e,[m,y]=t.getSize();return{x:p,y:g,container:c,title:l,bounding:{x:0,y:0,width:m,height:y},position:s,enterable:u,offset:d,style:o}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}Nd.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};class i6 extends Lb{beforeDraw(t,e){return t}afterLayout(t,e){}}function lu(n,t,e,r,i){const a=Z(r),o=`${e}s`,s=i?r:n.add[o].get(a)||n.update[o].get(a)||n.remove[o].get(a)||r;Object.entries(n).forEach(([u,c])=>{t===u?c[o].set(a,s):c[o].delete(a)})}function Il(n,t){return Object.keys(n).every(e=>n[e]===t[e])}function re(n,t,e){B1[n][t]&&ka.warn(`The extension ${t} of ${n} has been registered before, and will be overridden.`),Object.assign(B1[n],{[t]:e})}/*!
204
+ * @antv/g-plugin-dragndrop
205
+ * @description A G plugin for Drag n Drop implemented with PointerEvents
206
+ * @version 2.0.38
207
+ * @date 7/30/2025, 1:35:41 PM
208
+ * @author AntVis
209
+ * @docs https://g.antv.antgroup.com/
210
+ */var a6=(function(){function n(t){et(this,n),this.dragndropPluginOptions=t}return nt(n,[{key:"apply",value:function(t){var e=this,r=t.renderingService,i=t.renderingContext,a=i.root.ownerDocument,o=a.defaultView,s=function(u){var c=u.target,l=c===a,d=l&&e.dragndropPluginOptions.isDocumentDraggable?a:c.closest&&c.closest("[draggable=true]");if(d){var p=!1,g=u.timeStamp,m=[u.clientX,u.clientY],y=null,v=[u.clientX,u.clientY],x=(function(){var w=ya(fn().mark(function S(k){var A,N,T,O,M,P;return fn().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(p){L.next=2;break}if(A=k.timeStamp-g,N=Hn([k.clientX,k.clientY],m),!(A<=e.dragndropPluginOptions.dragstartTimeThreshold||N<=e.dragndropPluginOptions.dragstartDistanceThreshold)){L.next=1;break}return L.abrupt("return");case 1:k.type="dragstart",d.dispatchEvent(k),p=!0;case 2:if(k.type="drag",k.dx=k.clientX-v[0],k.dy=k.clientY-v[1],d.dispatchEvent(k),v=[k.clientX,k.clientY],l){L.next=4;break}return T=e.dragndropPluginOptions.overlap==="pointer"?[k.canvasX,k.canvasY]:c.getBounds().center,L.next=3,a.elementsFromPoint(T[0],T[1]);case 3:O=L.sent,M=O[O.indexOf(c)+1],P=(M==null?void 0:M.closest("[droppable=true]"))||(e.dragndropPluginOptions.isDocumentDroppable?a:null),y!==P&&(y&&(k.type="dragleave",k.target=y,y.dispatchEvent(k)),P&&(k.type="dragenter",k.target=P,P.dispatchEvent(k)),y=P,y&&(k.type="dragover",k.target=y,y.dispatchEvent(k)));case 4:case"end":return L.stop()}},S)}));return function(S){return w.apply(this,arguments)}})();o.addEventListener("pointermove",x);var E=function(w){if(p){w.detail={preventClick:!0};var S=w.clone();y&&(S.type="drop",S.target=y,y.dispatchEvent(S)),S.type="dragend",d.dispatchEvent(S),p=!1}o.removeEventListener("pointermove",x)};c.addEventListener("pointerup",E,{once:!0}),c.addEventListener("pointerupoutside",E,{once:!0})}};r.hooks.init.tap(n.tag,function(){o.addEventListener("pointerdown",s)}),r.hooks.destroy.tap(n.tag,function(){o.removeEventListener("pointerdown",s)})}}])})();a6.tag="Dragndrop";var tJ=(function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return et(this,t),e=Bt(this,t),e.name="dragndrop",e.options=r,e}return zt(t,n),nt(t,[{key:"init",value:function(){this.addRenderingPlugin(new a6(Lt({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(e){Object.assign(this.plugins[0].dragndropPluginOptions,e)}}])})(wa),kT=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})},AT=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const ST=["main"],CT=["background","main","label","transient"];function eJ(n){return n.main}class NT{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||eJ(this.getLayers())}getLayers(){return this.extends.layers}getRenderer(t){return this.extends.renderers[t]}getCamera(t="main"){return this.getLayer(t).getCamera()}getRoot(t="main"){return this.getLayer(t).getRoot()}getContextService(t="main"){return this.getLayer(t).getContextService()}setCursor(t){this.config.cursor=t,this.getLayer().setCursor(t)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(t){this.config={enableMultiLayer:!0},Object.assign(this.config,t);const e=this.config,{renderer:r,background:i,enableMultiLayer:a}=e,o=AT(e,["renderer","background","cursor","enableMultiLayer"]),s=a?CT:ST,u=TT(r,s),c=Object.fromEntries(s.map(l=>{const d=new I1(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:a,renderer:u[l],background:a?l==="background"?i:void 0:i}));return[l,d]}));MT(c),this.extends={config:this.config,renderer:r,renderers:u,layers:c}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,t])=>t.ready))}resize(t,e){Object.assign(this.extends.config,{width:t,height:e}),Object.values(this.getLayers()).forEach(r=>{const i=r.getCamera(),a=i.getPosition(),o=i.getFocalPoint();r.resize(t,e),i.setPosition(a),i.setFocalPoint(o)})}getBounds(t){return Fu(Object.values(this.getLayers()).map(e=>t?e.getRoot().childNodes.find(r=>r.classList.includes(t)):e.getRoot()).filter(e=>(e==null?void 0:e.childNodes.length)>0).map(e=>e.getBounds()))}getContainer(){const t=this.extends.config.container;return typeof t=="string"?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var r;const i=((r=t.style)===null||r===void 0?void 0:r.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=TT(t,this.config.enableMultiLayer?CT:ST);this.extends.renderers=e,Object.entries(e).forEach(([r,i])=>this.getLayer(r).setRenderer(i)),MT(this.getLayers())}getCanvasByViewport(t){return oi(this.getLayer().viewport2Canvas(Js(t)))}getViewportByCanvas(t){return oi(this.getLayer().canvas2Viewport(Js(t)))}getViewportByClient(t){return oi(this.getLayer().client2Viewport(Js(t)))}getClientByViewport(t){return oi(this.getLayer().viewport2Client(Js(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),r=e.client2Viewport(Js(t));return oi(e.viewport2Canvas(r))}toDataURL(){return kT(this,arguments,void 0,function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:r="viewport"}=t,i=AT(t,["mode"]);let[a,o,s,u]=[0,0,0,0];if(r==="viewport")[s,u]=this.getSize();else if(r==="overall"){const x=this.getBounds(),E=zu(x);[a,o]=x.min,[s,u]=E}const c=b1('<div id="virtual-image"></div>'),l=new I1({width:s,height:u,renderer:new gh,devicePixelRatio:e,container:c,background:this.extends.config.background});yield l.ready,l.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),l.appendChild(this.getRoot().cloneNode(!0));const d=this.getLayer("label").getRoot().cloneNode(!0),p=l.viewport2Canvas({x:0,y:0}),g=this.getCanvasByViewport([0,0]);d.translate([g[0]-p.x,g[1]-p.y]),d.scale(1/this.getCamera().getZoom()),l.appendChild(d),l.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const m=this.getCamera(),y=l.getCamera();if(r==="viewport")y.setZoom(m.getZoom()),y.setPosition(m.getPosition()),y.setFocalPoint(m.getFocalPoint());else if(r==="overall"){const[x,E,w]=y.getPosition(),[S,k,A]=y.getFocalPoint();y.setPosition([x+a,E+o,w]),y.setFocalPoint([S+a,k+o,A])}const v=l.getContextService();return new Promise(x=>{l.addEventListener(cr.RERENDER,()=>kT(this,void 0,void 0,function*(){yield new Promise(w=>setTimeout(w,300));const E=yield v.toDataURL(i);x(E)}))})})}destroy(){Object.values(this.getLayers()).forEach(t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()})}}function TT(n,t){return Object.fromEntries(t.map(e=>{const r=(n==null?void 0:n(e))||new gh;return r instanceof gh&&r.setConfig({enableDirtyRectangleRendering:!1}),e==="main"?r.registerPlugin(new tJ({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):r.unregisterPlugin(r.getPlugin("dom-interaction")),[e,r]}))}function MT(n){Object.entries(n).forEach(([t,e])=>{const r=e.getContextService().getDomElement();r!=null&&r.style&&(r.style.gridArea="1 / 1 / 2 / 2",r.style.outline="none",r.tabIndex=1,t!=="main"&&(r.style.pointerEvents="none")),r!=null&&r.parentElement&&(r.parentElement.style.display="grid",r.parentElement.style.isolation="isolate")})}const zo=n=>n?parseInt(n):0;function nJ(n){const t=getComputedStyle(n),e=n.clientWidth||zo(t.width),r=n.clientHeight||zo(t.height),i=zo(t.paddingLeft)+zo(t.paddingRight),a=zo(t.paddingTop)+zo(t.paddingBottom);return[e-i,r-a]}function _T(n){if(!n)return[0,0];let t=640,e=480;const[r,i]=nJ(n);t=r||t,e=i||e;const a=1,o=1;return[Math.max(Xt(t)?t:a,a),Math.max(Xt(e)?e:o,o)]}class Td{constructor(t){this.type=t}}class Xe extends Td{constructor(t,e){super(t),this.data=e}}class Tr extends Td{constructor(t,e,r,i){super(t),this.animationType=e,this.animation=r,this.data=i}}class Fo extends Td{constructor(t,e,r){super(t),this.elementType=e,this.data=r}}class kl extends Td{constructor(t,e){super(t),this.data=e}}function an(n,t){n.emit(t.type,t)}function rJ(n){if(!n)return null;if(n instanceof S_)return{type:"canvas",element:n};let t=n;for(;t;){if(Vu(t))return{type:"node",element:t};if(EO(t))return{type:"edge",element:t};if(Bb(t))return{type:"combo",element:t};t=t.parentElement}return null}function OT(n){var t;return((t=n==null?void 0:n.style)===null||t===void 0?void 0:t.zIndex)||0}const yu="cachedStyle",lx=n=>`__${n}__`;function iJ(n,t){const e=Array.isArray(t)?t:[t];lr(n,yu)||Xl(n,yu,{}),e.forEach(r=>{Xl(lr(n,yu),lx(r),n.attributes[r])})}function PT(n,t){return lr(n,[yu,lx(t)])}function aJ(n,t){return lx(t)in(lr(n,yu)||{})}class oJ{constructor(t){this.tasks=[],this.animations=new Set,this.context=t}getTasks(){const t=[...this.tasks];return this.tasks=[],t}add(t,e){this.tasks.push([t,e])}animate(t,e,r){var i,a,o;(i=e==null?void 0:e.before)===null||i===void 0||i.call(e);const s=this.getTasks().map(([c,l])=>{var d,p,g;const{element:m,elementType:y,stage:v}=c,x=eU(this.context.options,y,v,t);(d=l==null?void 0:l.before)===null||d===void 0||d.call(l);const E=x.length?rU(m,this.inferStyle(c,r),x):null;return E?((p=l==null?void 0:l.beforeAnimate)===null||p===void 0||p.call(l,E),E.finished.then(()=>{var w,S;(w=l==null?void 0:l.afterAnimate)===null||w===void 0||w.call(l,E),(S=l==null?void 0:l.after)===null||S===void 0||S.call(l),this.animations.delete(E)})):(g=l==null?void 0:l.after)===null||g===void 0||g.call(l),E}).filter(Boolean);s.forEach(c=>this.animations.add(c));const u=Pb(s);return u?((a=e==null?void 0:e.beforeAnimate)===null||a===void 0||a.call(e,u),u.finished.then(()=>{var c,l;(c=e==null?void 0:e.afterAnimate)===null||c===void 0||c.call(e,u),(l=e==null?void 0:e.after)===null||l===void 0||l.call(e),this.release()})):(o=e==null?void 0:e.after)===null||o===void 0||o.call(e),u}inferStyle(t,e){var r,i;const{element:a,elementType:o,stage:s,originalStyle:u,updatedStyle:c={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},u),c));const{modifiedStyle:l}=t,d={},p={};if(s==="enter")Object.assign(d,{opacity:0});else if(s==="exit")Object.assign(p,{opacity:0});else if(s==="show")Object.assign(d,{opacity:0}),Object.assign(p,{opacity:(r=PT(a,"opacity"))!==null&&r!==void 0?r:ah("opacity")});else if(s==="hide")Object.assign(d,{opacity:(i=PT(a,"opacity"))!==null&&i!==void 0?i:ah("opacity")}),Object.assign(p,{opacity:0});else if(s==="collapse"){const{collapse:g}=e||{},{target:m,descendants:y,position:v}=g;if(o==="node"){if(y.includes(a.id)){const[x,E,w]=v;Object.assign(p,{x,y:E,z:w})}}else if(o==="combo"){if(a.id===m||y.includes(a.id)){const[x,E]=v;Object.assign(p,{x,y:E,childrenNode:u.childrenNode})}}else o==="edge"&&Object.assign(p,{sourceNode:l.sourceNode,targetNode:l.targetNode})}else if(s==="expand"){const{expand:g}=e||{},{target:m,descendants:y,position:v}=g;if(o==="node"){if(a.id===m||y.includes(a.id)){const[x,E,w]=v;Object.assign(d,{x,y:E,z:w})}}else if(o==="combo"){if(a.id===m||y.includes(a.id)){const[x,E,w]=v;Object.assign(d,{x,y:E,z:w,childrenNode:l.childrenNode})}}else o==="edge"&&Object.assign(d,{sourceNode:l.sourceNode,targetNode:l.targetNode})}return[Object.keys(d).length>0?Object.assign({},u,d):u,Object.keys(p).length>0?Object.assign({},l,p):l]}stop(){this.animations.forEach(t=>t.cancel())}clear(){this.tasks=[]}release(){var t,e;const{canvas:r}=this.context,i=(e=(t=r.document)===null||t===void 0?void 0:t.timeline)===null||e===void 0?void 0:e.animationsWithPromises;i&&(r.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class sJ{constructor(t){this.batchCount=0,this.context=t}emit(t){const{graph:e}=this.context;e.emit(t.type,t)}startBatch(t=!0){this.batchCount++,this.batchCount===1&&this.emit(new Xe(gt.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new Xe(gt.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class uJ extends Db{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=e=>{const{target:r}=e,i=rJ(r);if(!i)return;const{graph:a,canvas:o}=this.context,{type:s,element:u}=i;if("destroyed"in u&&(Uu(u)||u.destroyed))return;const{type:c,detail:l,button:d}=e,p=Object.assign(Object.assign({},e),{target:u,targetType:s,originalTarget:r});c===st.POINTER_MOVE&&(this.currentTarget!==u&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${st.POINTER_LEAVE}`,Object.assign(Object.assign({},p),{type:st.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),u&&(Object.assign(p,{type:st.POINTER_ENTER}),a.emit(`${s}:${st.POINTER_ENTER}`,p))),this.currentTarget=u,this.currentTargetType=s),c===st.CLICK&&d===2||(a.emit(`${s}:${c}`,p),a.emit(c,p)),c===st.CLICK&&l===2&&(Object.assign(p,{type:st.DBLCLICK}),a.emit(`${s}:${st.DBLCLICK}`,p),a.emit(st.DBLCLICK,p)),c===st.POINTER_DOWN&&d===2&&(Object.assign(p,{type:st.CONTEXT_MENU,preventDefault:()=>{var g;(g=o.getContainer())===null||g===void 0||g.addEventListener(st.CONTEXT_MENU,m=>m.preventDefault(),{once:!0})}}),a.emit(`${s}:${st.CONTEXT_MENU}`,p),a.emit(st.CONTEXT_MENU,p))},this.forwardContainerEvents=e=>{this.context.graph.emit(e.type,e)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[$o.KEY_DOWN,$o.KEY_UP].forEach(r=>{t.addEventListener(r,this.forwardContainerEvents)});const e=this.context.canvas.document;e&&[st.CLICK,st.DBLCLICK,st.POINTER_OVER,st.POINTER_LEAVE,st.POINTER_ENTER,st.POINTER_MOVE,st.POINTER_OUT,st.POINTER_DOWN,st.POINTER_UP,st.CONTEXT_MENU,st.DRAG_START,st.DRAG,st.DRAG_END,st.DRAG_ENTER,st.DRAG_OVER,st.DRAG_LEAVE,st.DROP,st.WHEEL].forEach(r=>{e.addEventListener(r,this.forwardCanvasEvents)})}destroy(){const t=this.context.canvas.getContainer();t&&[$o.KEY_DOWN,$o.KEY_UP].forEach(e=>{t.removeEventListener(e,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var Pu=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function ea(n,t){const{data:e,style:r}=n,i=Pu(n,["data","style"]),{data:a,style:o}=t,s=Pu(t,["data","style"]),u=Object.assign(Object.assign({},i),s);return(e||a)&&Object.assign(u,{data:Object.assign(Object.assign({},e),a)}),(r||o)&&Object.assign(u,{style:Object.assign(Object.assign({},r),o)}),u}function qy(n){const{data:t,style:e}=n,r=Pu(n,["data","style"]);return t&&(r.data=Object.assign({},t)),e&&(r.style=Object.assign({},e)),r}function Go(n={},t={}){const{states:e=[],data:r={},style:i={},children:a=[]}=n,o=Pu(n,["states","data","style","children"]),{states:s=[],data:u={},style:c={},children:l=[]}=t,d=Pu(t,["states","data","style","children"]),p=(m,y)=>m.length!==y.length?!1:m.every((v,x)=>v===y[x]),g=(m,y)=>{const v=Object.keys(m),x=Object.keys(y);return v.length!==x.length?!1:v.every(E=>m[E]===y[E])};return!(!g(o,d)||!p(a,l)||!p(e,s)||!g(r,u)||!g(i,c))}var cJ=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function Ky(n){const{id:t=Z(n),style:e,data:r}=n,i=cJ(n,["id","style","data"]),a=Object.assign(Object.assign({},n),{style:Object.assign({},e),data:Object.assign({},r)});return iU(n)?Object.assign({id:t,data:a},i):{id:t,data:a}}function cn(n){return n.data}function lJ(n){if(n.hasTreeStructure(Yr))return;n.attachTreeStructure(Yr);const t=n.getAllEdges();for(const e of t){const{source:r,target:i}=e;n.setParent(i,r,Yr)}}class hJ{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new qh}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===Se.NodeUpdated||e===Se.EdgeUpdated||e===Se.ComboUpdated){const{value:r,original:i}=t;this.changes.push({value:qy(r),original:qy(i),type:e})}else this.changes.push({value:qy(t.value),type:e})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(t){this.batchCount++,this.model.batch(t),this.batchCount--}isBatching(){return this.batchCount>0}silence(t){this.isTraceless=!0,t(),this.isTraceless=!1}isCombo(t){return this.comboIds.has(t)||this.latestRemovedComboIds.has(t)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=cn(r);return this.isCombo(Z(i))||(t===void 0||t.includes(Z(i)))&&e.push(i),e},[])}getEdgeDatum(t){return cn(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce((e,r)=>{const i=cn(r);return(t===void 0||t.includes(Z(i)))&&e.push(i),e},[])}getComboData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=cn(r);return this.isCombo(Z(i))&&(t===void 0||t.includes(Z(i)))&&e.push(i),e},[])}getRootsData(t=Yr){return this.model.getRoots(t).map(cn)}getAncestorsData(t,e){const{model:r}=this;return!r.hasNode(t)||!r.hasTreeStructure(e)?[]:r.getAncestors(t,e).map(cn)}getDescendantsData(t){const e=this.getElementDataById(t),r=[];return Qo(e,i=>{i!==e&&r.push(i)},i=>this.getChildrenData(Z(i)),"TB"),r}getParentData(t,e){const{model:r}=this;if(!e){ka.warn("The hierarchy structure key is not specified");return}if(!r.hasNode(t)||!r.hasTreeStructure(e))return;const i=r.getParent(t,e);return i?cn(i):void 0}getChildrenData(t){const e=this.getElementType(t)==="node"?Yr:me,{model:r}=this;return!r.hasNode(t)||!r.hasTreeStructure(e)?[]:r.getChildren(t,e).map(cn)}getElementsDataByType(t){return t==="node"?this.getNodeData():t==="edge"?this.getEdgeData():t==="combo"?this.getComboData():[]}getElementDataById(t){return this.getElementType(t)==="edge"?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){const e=this.model.getNode(t);return cn(e)}getNodeLikeData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=cn(r);return t?t.includes(Z(i))&&e.push(i):e.push(i),e},[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter(r=>{var i;return(i=r.states)===null||i===void 0?void 0:i.includes(e)})}getElementState(t){var e;return((e=this.getElementDataById(t))===null||e===void 0?void 0:e.states)||[]}hasNode(t){return this.model.hasNode(t)&&!this.isCombo(t)}hasEdge(t){return this.model.hasEdge(t)}hasCombo(t){return this.model.hasNode(t)&&this.isCombo(t)}getRelatedEdgesData(t,e="both"){return this.model.getRelatedEdges(t,e).map(cn)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(cn)}setData(t){const{nodes:e=[],edges:r=[],combos:i=[]}=t,{nodes:a,edges:o,combos:s}=this.getData(),u=mu(a,e,d=>Z(d),Go),c=mu(o,r,d=>Z(d),Go),l=mu(s,i,d=>Z(d),Go);this.batch(()=>{const d={nodes:u.enter,edges:c.enter,combos:l.enter};this.addData(d),this.computeZIndex(d,"add",!0);const p={nodes:u.update,edges:c.update,combos:l.update};this.updateData(p),this.computeZIndex(p,"update",!0);const g={nodes:u.exit.map(Z),edges:c.exit.map(Z),combos:l.exit.map(Z)};this.removeData(g)})}addData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.addComboData(i),this.addNodeData(e),this.addEdgeData(r)}),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map(e=>(this.pushChange({value:e,type:Se.NodeAdded}),Ky(e)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map(e=>(this.pushChange({value:e,type:Se.EdgeAdded}),Ky(e)))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(me)||e.attachTreeStructure(me),e.addNodes(t.map(r=>(this.comboIds.add(Z(r)),this.pushChange({value:r,type:Se.ComboAdded}),Ky(r)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const r=this.getNodeLikeDatum(t),i=e.map(Z);this.addNodeData(e),this.updateNodeData([{id:t,children:[...r.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:t,target:a})))}computeZIndex(t,e,r=!1){!r&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:o=[]}=t;o.forEach(s=>{var u,c,l;const d=Z(s);if(e==="add"&&Xt((u=s.style)===null||u===void 0?void 0:u.zIndex)||e==="update"&&!("combo"in s))return;const p=this.getParentData(d,me),g=p?((l=(c=p.style)===null||c===void 0?void 0:c.zIndex)!==null&&l!==void 0?l:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:d,style:{zIndex:g}}])})}),i.forEach(s=>{var u,c,l;const d=Z(s);if(e==="add"&&Xt((u=s.style)===null||u===void 0?void 0:u.zIndex)||e==="update"&&!("combo"in s)&&!("children"in s))return;let p=0;const g=this.getParentData(d,me);if(g)p=(((c=g.style)===null||c===void 0?void 0:c.zIndex)||0)+1;else{const m=this.getParentData(d,Yr);m&&(p=((l=m==null?void 0:m.style)===null||l===void 0?void 0:l.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:d,style:{zIndex:p}}])})}),a.forEach(s=>{var u,c,l,d,p;if(Xt((u=s.style)===null||u===void 0?void 0:u.zIndex))return;let{id:g,source:m,target:y}=s;if(!g)g=Z(s);else{const E=this.getEdgeDatum(g);m=E.source,y=E.target}if(!m||!y)return;const v=((l=(c=this.getNodeLikeDatum(m))===null||c===void 0?void 0:c.style)===null||l===void 0?void 0:l.zIndex)||0,x=((p=(d=this.getNodeLikeDatum(y))===null||d===void 0?void 0:d.style)===null||p===void 0?void 0:p.zIndex)||0;this.updateEdgeData([{id:Z(s),style:{zIndex:Math.max(v,x)-1}}])})})}getFrontZIndex(t){var e;const r=this.getElementType(t),i=this.getElementDataById(t),a=this.getData();if(Object.assign(a,{[`${r}s`]:a[`${r}s`].filter(o=>Z(o)!==t)}),r==="combo"&&!ba(i)){const o=new Set(this.getAncestorsData(t,me).map(Z));a.nodes=a.nodes.filter(s=>!o.has(Z(s))),a.combos=a.combos.filter(s=>!o.has(Z(s))),a.edges=a.edges.filter(({source:s,target:u})=>!o.has(s)&&!o.has(u))}return Math.max(((e=i.style)===null||e===void 0?void 0:e.zIndex)||0,0,...Object.values(a).flat().map(o=>{var s;return(((s=o==null?void 0:o.style)===null||s===void 0?void 0:s.zIndex)||0)+1}))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach(r=>{const i=Z(r),a=fl(r);a!==void 0&&(e.hasTreeStructure(me)||e.attachTreeStructure(me),a===null&&this.refreshComboData(i),this.setParent(i,fl(r),me));const o=r.children||[];if(o.length){e.hasTreeStructure(Yr)||e.attachTreeStructure(Yr);const s=o.filter(u=>e.hasNode(u));s.forEach(u=>this.setParent(u,i,Yr)),s.length!==o.length&&this.updateNodeData([{id:i,children:s}])}})}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.updateNodeData(e),this.updateComboData(i),this.updateEdgeData(r)}),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{const r=[];t.forEach(i=>{const a=Z(i),o=cn(e.getNode(a));if(Go(o,i))return;const s=ea(o,i);this.pushChange({value:s,original:o,type:Se.NodeUpdated}),e.mergeNodeData(a,s),r.push(s)}),this.updateNodeLikeHierarchy(r)}),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:r}=this.getData();t.forEach(i=>{this.pushChange({value:i,original:i,type:Se.NodeUpdated})}),e.forEach(i=>{this.pushChange({value:i,original:i,type:Se.EdgeUpdated})}),r.forEach(i=>{this.pushChange({value:i,original:i,type:Se.ComboUpdated})})}syncNodeLikeDatum(t){const{model:e}=this,r=Z(t);if(!e.hasNode(r))return;const i=cn(e.getNode(r)),a=ea(i,t);e.mergeNodeData(r,a)}syncEdgeDatum(t){const{model:e}=this,r=Z(t);if(!e.hasEdge(r))return;const i=cn(e.getEdge(r)),a=ea(i,t);e.mergeEdgeData(r,a)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{t.forEach(r=>{const i=Z(r),a=cn(e.getEdge(i));if(Go(a,r))return;r.source&&a.source!==r.source&&e.updateEdgeSource(i,r.source),r.target&&a.target!==r.target&&e.updateEdgeTarget(i,r.target);const o=ea(a,r);this.pushChange({value:o,original:a,type:Se.EdgeUpdated}),e.mergeEdgeData(i,o)})}),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch(()=>{const r=[];t.forEach(i=>{const a=Z(i),o=cn(e.getNode(a));if(Go(o,i))return;const s=ea(o,i);this.pushChange({value:s,original:o,type:Se.ComboUpdated}),e.mergeNodeData(a,s),r.push(s)}),this.updateNodeLikeHierarchy(r)}),this.computeZIndex({combos:t},"update")}setParent(t,e,r,i=!0){if(t===e)return;const a=this.getNodeLikeDatum(t),o=fl(a);if(o!==e&&r===me){const s={id:t,combo:e};this.isCombo(t)?this.syncNodeLikeDatum(s):this.syncNodeLikeDatum(s)}this.model.setParent(t,e,r),i&&r===me&&EB([o,e]).forEach(s=>{s!==void 0&&this.refreshComboData(s)})}refreshComboData(t){const e=this.getComboData([t])[0],r=this.getAncestorsData(t,me);e&&this.pushChange({value:e,original:e,type:Se.ComboUpdated}),r.forEach(i=>{this.pushChange({value:i,original:i,type:Se.ComboUpdated})})}getElementPosition(t){const e=this.getElementDataById(t);return _r(e)}translateNodeLikeBy(t,e){this.isCombo(t)?this.translateComboBy(t,e):this.translateNodeBy(t,e)}translateNodeLikeTo(t,e){this.isCombo(t)?this.translateComboTo(t,e):this.translateNodeTo(t,e)}translateNodeBy(t,e){const r=this.getElementPosition(t),i=rn(r,[...e,0].slice(0,3));this.translateNodeTo(t,i)}translateNodeTo(t,e){const[r=0,i=0,a=0]=e;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:t,style:{x:r,y:i,z:a}}])})}translateComboBy(t,e){const[r=0,i=0,a=0]=e;if([r,i,a].some(isNaN)||[r,i,a].every(u=>u===0))return;const o=this.getComboData([t])[0];if(!o)return;const s=new Set;Qo(o,u=>{const c=Z(u);if(s.has(c))return;s.add(c);const[l,d,p]=_r(u),g=ea(u,{style:{x:l+r,y:d+i,z:p+a}});this.pushChange({value:g,original:u,type:this.isCombo(c)?Se.ComboUpdated:Se.NodeUpdated}),this.model.mergeNodeData(c,g)},u=>this.getChildrenData(Z(u)),"BT")}translateComboTo(t,e){var r;if(e.some(isNaN))return;const[i=0,a=0,o=0]=e,s=(r=this.getComboData([t]))===null||r===void 0?void 0:r[0];if(!s)return;const[u,c,l]=_r(s),d=i-u,p=a-c,g=o-l;Qo(s,m=>{const y=Z(m),[v,x,E]=_r(m),w=ea(m,{style:{x:v+d,y:x+p,z:E+g}});this.pushChange({value:w,original:m,type:this.isCombo(y)?Se.ComboUpdated:Se.NodeUpdated}),this.model.mergeNodeData(y,w)},m=>this.getChildrenData(Z(m)),"BT")}removeData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.removeEdgeData(r),this.removeNodeData(e),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.removeEdgeData(this.getRelatedEdgesData(e).map(Z)),this.pushChange({value:this.getNodeData([e])[0],type:Se.NodeRemoved}),this.removeNodeLikeHierarchy(e)}),this.model.removeNodes(t)})}removeEdgeData(t=[]){t.length&&(t.forEach(e=>this.pushChange({value:this.getEdgeData([e])[0],type:Se.EdgeRemoved})),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.pushChange({value:this.getComboData([e])[0],type:Se.ComboRemoved}),this.removeNodeLikeHierarchy(e),this.comboIds.delete(e)}),this.model.removeNodes(t)})}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(me)){const e=fl(this.getNodeLikeDatum(t));this.setParent(t,void 0,me,!1),this.model.getChildren(t,me).forEach(r=>{const i=cn(r),a=Z(i);this.setParent(Z(i),e,me,!1);const o=ea(i,{id:Z(i),combo:e});this.pushChange({value:o,original:i,type:this.isCombo(a)?Se.ComboUpdated:Se.NodeUpdated}),this.model.mergeNodeData(Z(i),o)}),Tt(e)||this.refreshComboData(e)}}getElementType(t){if(this.model.hasNode(t))return this.isCombo(t)?"combo":"node";if(this.model.hasEdge(t))return"edge";throw new Error(Li(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),r=t.getAllEdges();t.removeEdges(r.map(i=>i.id)),t.removeNodes(e.map(i=>i.id)),this.context={}}}var ru=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})};class dJ{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){this.initContainer()}initContainer(){if(!this.container||this.container.destroyed){const{canvas:t}=this.context;this.container=t.appendChild(new vi({className:"elements"}))}}emit(t,e){e.silence||an(this.context.graph,t)}forEachElementData(t){so.forEach(e=>{const r=this.context.model.getElementsDataByType(e);t(e,r)})}getElementType(t,e){var r;const{options:i,graph:a}=this.context,o=((r=i[t])===null||r===void 0?void 0:r.type)||e.type;return o?typeof o=="string"?o:o.call(a,e):t==="edge"?"line":"circle"}getTheme(t){return j_(this.context.options)[t]||{}}getThemeStyle(t){return this.getTheme(t).style||{}}getThemeStateStyle(t,e){const{state:r={}}=this.getTheme(t);return Object.assign({},...e.map(i=>r[i]||{}))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData((e,r)=>{var i,a;const o=Object.assign({},ok((i=this.getTheme(e))===null||i===void 0?void 0:i.palette),ok((a=t[e])===null||a===void 0?void 0:a.palette));o!=null&&o.field&&Object.assign(this.paletteStyle,HU(r,o))})}getPaletteStyle(t,e){const r=this.paletteStyle[e];return r?t==="edge"?{stroke:r}:{fill:r}:{}}computeElementDefaultStyle(t,e){var r;const{options:i}=this.context,a=((r=i[t])===null||r===void 0?void 0:r.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[Z(e.datum)]=ak(a,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData((r,i)=>{const a=i.length;for(let o=0;o<a;o++){const s=i[o];(t===void 0||t.includes(Z(s)))&&this.computeElementDefaultStyle(r,{datum:s,graph:e})}})}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch{return[]}}getElementStateStyle(t,e,r){var i,a;const{options:o}=this.context,s=((a=(i=o[t])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[e])||{};return ak(s,r)}computeElementStatesStyle(t,e,r){this.stateStyle[Z(r.datum)]=Object.assign({},...e.map(i=>this.getElementStateStyle(t,i,r)))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData((r,i)=>{const a=i.length;for(let o=0;o<a;o++){const s=i[o];if(t===void 0||t.includes(Z(s))){const u=this.getElementState(Z(s));this.computeElementStatesStyle(r,u,{datum:s,graph:e})}}})}getStateStyle(t){return this.stateStyle[t]||{}}computeStyle(t,e){t&&["translate","zIndex"].includes(t)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(e),this.computeElementsStatesStyle(e))}getElement(t){return this.elementMap[t]}getNodes(){return this.context.model.getNodeData().map(({id:t})=>this.elementMap[t])}getEdges(){return this.context.model.getEdgeData().map(t=>this.elementMap[Z(t)])}getCombos(){return this.context.model.getComboData().map(({id:t})=>this.elementMap[t])}getElementComputedStyle(t,e){const r=Z(e),i=this.getThemeStyle(t),a=this.getPaletteStyle(t,r),o=e.style||{},s=this.getDefaultStyle(r),u=this.getThemeStateStyle(t,this.getElementState(r)),c=this.getStateStyle(r),l=Object.assign({},i,a,o,s,u,c);if(t==="combo"){const d=this.context.model.getChildrenData(r),p=l.collapsed?[]:d.map(Z).filter(g=>this.getElement(g));Object.assign(l,{childrenNode:p,childrenData:d})}return l}getDrawData(t){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:r="draw",stage:i=r}=t;return this.markDestroyElement(e.drawData),this.computeStyle(i),{type:r,stage:i,data:e}}draw(t={animation:!0}){const e=this.getDrawData(t);if(!e)return;const{data:{drawData:{add:r,update:i,remove:a}}}=e;return this.destroyElements(a,t),this.createElements(r,t),this.updateElements(i,t),this.setAnimationTask(t,e)}preLayoutDraw(){return ru(this,arguments,void 0,function*(t={animation:!0}){var e,r;const i=this.getDrawData(t);if(!i)return;const{data:{drawData:a}}=i;yield(r=(e=this.context.layout)===null||e===void 0?void 0:e.preLayout)===null||r===void 0?void 0:r.call(e,a);const{add:o,update:s,remove:u}=a;return this.destroyElements(u,t),this.createElements(o,t),this.updateElements(s,t),this.setAnimationTask(t,i)})}setAnimationTask(t,e){const{animation:r,silence:i}=t,{data:{dataChanges:a,drawData:o},stage:s,type:u}=e;return this.context.animation.animate(r,i?{}:{before:()=>this.emit(new Xe(gt.BEFORE_DRAW,{dataChanges:a,animation:r,stage:s,render:u==="render"}),t),beforeAnimate:c=>this.emit(new Tr(gt.BEFORE_ANIMATE,$n.DRAW,c,o),t),afterAnimate:c=>this.emit(new Tr(gt.AFTER_ANIMATE,$n.DRAW,c,o),t),after:()=>this.emit(new Xe(gt.AFTER_DRAW,{dataChanges:a,animation:r,stage:s,render:u==="render",firstRender:this.context.graph.rendered===!1}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,r=e.getChanges(),i=UP(r);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:o=[],NodeRemoved:s=[],EdgeAdded:u=[],EdgeUpdated:c=[],EdgeRemoved:l=[],ComboAdded:d=[],ComboUpdated:p=[],ComboRemoved:g=[]}=Mh(i,x=>x.type),m=x=>new Map(x.map(E=>{const w=E.value;return[Z(w),w]})),y={add:{nodes:m(a),edges:m(u),combos:m(d)},update:{nodes:m(o),edges:m(c),combos:m(p)},remove:{nodes:m(s),edges:m(l),combos:m(g)}},v=this.transformData(y,t);return e.clearChanges(),{dataChanges:r,drawData:v}}transformData(t,e){const r=this.context.transform.getTransformInstance();return Object.values(r).reduce((i,a)=>a.beforeDraw(i,e),t)}createElement(t,e,r){var i;const a=Z(e);if(this.getElement(a))return;const o=this.getElementType(t,e),s=this.getElementComputedStyle(t,e),u=ji(t,o);if(!u)return ka.warn(`The element ${o} of ${t} is not registered.`);this.emit(new Fo(gt.BEFORE_ELEMENT_CREATE,t,e),r);const c=this.container.appendChild(new u({id:a,context:this.context,style:s}));this.shapeTypeMap[a]=o,this.elementMap[a]=c;const{stage:l="enter"}=r;(i=this.context.animation)===null||i===void 0||i.add({element:c,elementType:t,stage:l,originalStyle:Object.assign({},c.attributes),updatedStyle:s},{after:()=>{var d;this.emit(new Fo(gt.AFTER_ELEMENT_CREATE,t,e),r),(d=c.onCreate)===null||d===void 0||d.call(c)}})}createElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["node",r],["combo",a],["edge",i]].forEach(([o,s])=>{s.forEach(u=>this.createElement(o,u,e))})}getUpdateStageStyle(t,e,r){const{stage:i="update"}=r;if(i==="translate")if(t==="node"||t==="combo"){const{style:{x:a=0,y:o=0,z:s=0}={}}=e;return{x:a,y:o,z:s}}else return{};return this.getElementComputedStyle(t,e)}updateElement(t,e,r){var i;const a=Z(e),{stage:o="update"}=r,s=this.getElement(a);if(!s)return()=>null;this.emit(new Fo(gt.BEFORE_ELEMENT_UPDATE,t,e),r);const u=this.getElementType(t,e),c=this.getUpdateStageStyle(t,e,r);this.shapeTypeMap[a]!==u&&(s.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(t,e,{animation:!1,silence:!0}));const l=o!=="visibility"?o:c.visibility==="hidden"?"hide":"show";l==="hide"&&delete c.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:s,elementType:t,stage:l,originalStyle:Object.assign({},s.attributes),updatedStyle:c},{before:()=>{const d=this.elementMap[a];o!=="collapse"&&H1(d,c),o==="visibility"&&(aJ(d,"opacity")||iJ(d,"opacity"),this.visibilityCache.set(d,l==="show"?"visible":"hidden"),l==="show"&&oo(d,"visible"))},after:()=>{var d;const p=this.elementMap[a];o==="collapse"&&H1(p,c),l==="hide"&&oo(p,this.visibilityCache.get(p)),this.emit(new Fo(gt.AFTER_ELEMENT_UPDATE,t,e),r),(d=p.onUpdate)===null||d===void 0||d.call(p)}})}updateElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["node",r],["combo",a],["edge",i]].forEach(([o,s])=>{s.forEach(u=>this.updateElement(o,u,e))})}markDestroyElement(t){Object.values(t.remove).forEach(e=>{e.forEach(r=>{const i=Z(r),a=this.getElement(i);a&&CY(a)})})}destroyElement(t,e,r){var i;const{stage:a="exit"}=r,o=Z(e),s=this.elementMap[o];if(!s)return()=>null;this.emit(new Fo(gt.BEFORE_ELEMENT_DESTROY,t,e),r),(i=this.context.animation)===null||i===void 0||i.add({element:s,elementType:t,stage:a,originalStyle:Object.assign({},s.attributes),updatedStyle:{}},{after:()=>{var u;this.clearElement(o),s.destroy(),(u=s.onDestroy)===null||u===void 0||u.call(s),this.emit(new Fo(gt.AFTER_ELEMENT_DESTROY,t,e),r)}})}destroyElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["combo",a],["edge",i],["node",r]].forEach(([o,s])=>{s.forEach(u=>this.destroyElement(o,u,e))})}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}alignLayoutResultToElement(t,e){var r,i;const a=(r=t.nodes)===null||r===void 0?void 0:r.find(o=>Z(o)===e);if(a){const o=_r(this.context.model.getNodeLikeDatum(e)),s=_r(a),u=Mn(o,s);(i=t.nodes)===null||i===void 0||i.forEach(c=>{var l,d,p;!((l=c.style)===null||l===void 0)&&l.x&&(c.style.x+=u[0]),!((d=c.style)===null||d===void 0)&&d.y&&(c.style.y+=u[1]),!((p=c.style)===null||p===void 0)&&p.z&&(c.style.z+=u[2]||0)})}}collapseNode(t,e){return ru(this,void 0,void 0,function*(){var r;const{animation:i}=e,a=this.computeChangesAndDrawData({stage:"collapse",animation:i});if(!a)return;const{drawData:o}=a,{add:s,remove:u,update:c}=o;this.markDestroyElement(o);const l={animation:i,stage:"collapse",data:o};this.destroyElements(u,l),this.createElements(s,l),this.updateElements(c,l),yield(r=this.context.animation.animate(i,{beforeAnimate:d=>this.emit(new Tr(gt.BEFORE_ANIMATE,$n.COLLAPSE,d,o),l),afterAnimate:d=>this.emit(new Tr(gt.AFTER_ANIMATE,$n.COLLAPSE,d,o),l)},{collapse:{target:t,descendants:Array.from(u.nodes).map(([,d])=>Z(d)),position:_r(c.nodes.get(t))}}))===null||r===void 0?void 0:r.finished})}expandNode(t,e){return ru(this,void 0,void 0,function*(){var r;const{model:i}=this.context,{animation:a}=e,o=_r(i.getNodeData([t])[0]),s=this.computeChangesAndDrawData({stage:"expand",animation:a});if(this.createElements(s.drawData.add,{animation:!1,stage:"expand",target:t}),this.context.animation.clear(),this.computeStyle("expand"),!s)return;const{drawData:u}=s,{update:c,add:l}=u,d={animation:a,stage:"expand",data:u};l.edges.forEach(p=>c.edges.set(Z(p),p)),l.nodes.forEach(p=>c.nodes.set(Z(p),p)),this.updateElements(c,d),yield(r=this.context.animation.animate(a,{beforeAnimate:p=>this.emit(new Tr(gt.BEFORE_ANIMATE,$n.EXPAND,p,u),d),afterAnimate:p=>this.emit(new Tr(gt.AFTER_ANIMATE,$n.EXPAND,p,u),d)},{expand:{target:t,descendants:Array.from(l.nodes).map(([,p])=>Z(p)),position:o}}))===null||r===void 0?void 0:r.finished})}collapseCombo(t,e){return ru(this,void 0,void 0,function*(){var r;const{model:i,element:a}=this.context;if(i.getAncestorsData(t,me).some(y=>ba(y)))return;const o=a.getElement(t),s=o.getComboPosition(Object.assign(Object.assign({},o.attributes),{collapsed:!0})),u=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!u)return;const{dataChanges:c,drawData:l}=u;this.markDestroyElement(l);const{update:d,remove:p}=l,g={animation:e,stage:"collapse",data:l};this.destroyElements(p,g),this.updateElements(d,g);const m=y=>Array.from(y).map(([,v])=>Z(v));yield(r=this.context.animation.animate(e,{before:()=>this.emit(new Xe(gt.BEFORE_DRAW,{dataChanges:c,animation:e}),g),beforeAnimate:y=>this.emit(new Tr(gt.BEFORE_ANIMATE,$n.COLLAPSE,y,l),g),afterAnimate:y=>this.emit(new Tr(gt.AFTER_ANIMATE,$n.COLLAPSE,y,l),g),after:()=>this.emit(new Xe(gt.AFTER_DRAW,{dataChanges:c,animation:e}),g)},{collapse:{target:t,descendants:[...m(p.nodes),...m(p.combos)],position:s}}))===null||r===void 0?void 0:r.finished})}expandCombo(t,e){return ru(this,void 0,void 0,function*(){var r;const{model:i}=this.context,a=_r(i.getComboData([t])[0]);this.computeStyle("expand");const o=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!o)return;const{dataChanges:s,drawData:u}=o,{add:c,update:l}=u,d={animation:e,stage:"expand",data:u,target:t};this.createElements(c,d),this.updateElements(l,d);const p=g=>Array.from(g).map(([,m])=>Z(m));yield(r=this.context.animation.animate(e,{before:()=>this.emit(new Xe(gt.BEFORE_DRAW,{dataChanges:s,animation:e}),d),beforeAnimate:g=>this.emit(new Tr(gt.BEFORE_ANIMATE,$n.EXPAND,g,u),d),afterAnimate:g=>this.emit(new Tr(gt.AFTER_ANIMATE,$n.EXPAND,g,u),d),after:()=>this.emit(new Xe(gt.AFTER_DRAW,{dataChanges:s,animation:e}),d)},{expand:{target:t,descendants:[...p(c.nodes),...p(c.combos)],position:a}}))===null||r===void 0?void 0:r.finished})}clear(){this.container.destroy(),this.initContainer(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={}}destroy(){this.clear(),this.container.destroy(),this.context={}}}var Vo=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})},fJ=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class pJ{get presetOptions(){return{animation:!!B_(this.context.options,!0)}}get options(){const{options:t}=this.context;return t.layout}constructor(t){this.instances=[],this.context=t}getLayoutInstance(){return this.instances}preLayout(t){return Vo(this,void 0,void 0,function*(){var e,r,i,a;const{graph:o,model:s}=this.context,{add:u}=t;an(o,new Xe(gt.BEFORE_LAYOUT,{type:"pre"}));const c=yield(e=this.context.layout)===null||e===void 0?void 0:e.simulate();(r=c==null?void 0:c.nodes)===null||r===void 0||r.forEach(l=>{const d=Z(l),p=u.nodes.get(d);s.syncNodeLikeDatum(l),p&&Object.assign(p.style,l.style)}),(i=c==null?void 0:c.edges)===null||i===void 0||i.forEach(l=>{const d=Z(l),p=u.edges.get(d);s.syncEdgeDatum(l),p&&Object.assign(p.style,l.style)}),(a=c==null?void 0:c.combos)===null||a===void 0||a.forEach(l=>{const d=Z(l),p=u.combos.get(d);s.syncNodeLikeDatum(l),p&&Object.assign(p.style,l.style)}),an(o,new Xe(gt.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)})}postLayout(){return Vo(this,arguments,void 0,function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:r}=this.context;an(r,new Xe(gt.BEFORE_LAYOUT,{type:"post"}));for(let i=0;i<e.length;i++){const a=e[i],o=this.getLayoutData(a),s=Object.assign(Object.assign({},this.presetOptions),a);an(r,new Xe(gt.BEFORE_STAGE_LAYOUT,{options:s,index:i}));const u=yield this.stepLayout(o,s,i);an(r,new Xe(gt.AFTER_STAGE_LAYOUT,{options:s,index:i})),a.animation||this.updateElementPosition(u,!1)}an(r,new Xe(gt.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")})}transformDataAfterLayout(t,e){const r=this.context.transform.getTransformInstance();Object.values(r).forEach(i=>i.afterLayout(t,e))}simulate(){return Vo(this,void 0,void 0,function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(let r=0;r<t.length;r++){const i=t[r],a=this.getLayoutData(i);e=yield this.stepLayout(a,Object.assign(Object.assign(Object.assign({},this.presetOptions),i),{animation:!1}),r)}return e})}stepLayout(t,e,r){return Vo(this,void 0,void 0,function*(){return PY(e)?yield this.treeLayout(t,e,r):yield this.graphLayout(t,e,r)})}graphLayout(t,e,r){return Vo(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:o=300}=e,s=this.initGraphLayout(e);if(!s)return{};if(this.instances[r]=s,this.instance=s,a){const c=s;return this.supervisor=new NK(c.graphData2LayoutModel(t),c.instance,{iterations:o}),Rl(yield this.supervisor.execute())}if(Pk(s))return i?yield s.execute(t,{onTick:c=>{this.updateElementPosition(c,!1)}}):(s.execute(t),s.stop(),s.tick(o));const u=yield s.execute(t);if(i){const c=this.updateElementPosition(u,i);yield c==null?void 0:c.finished}return u})}treeLayout(t,e,r){return Vo(this,void 0,void 0,function*(){const{type:i,animation:a}=e,o=ji("layout",i);if(!o)return{};const{nodes:s=[],edges:u=[]}=t,c=new qh({nodes:s.map(g=>({id:Z(g),data:g.data||{}})),edges:u.map(g=>({id:Z(g),source:g.source,target:g.target,data:g.data||{}}))});lJ(c);const l={nodes:[],edges:[]},d={nodes:[],edges:[]};c.getRoots(Yr).forEach(g=>{Qo(g,E=>{E.children=c.getSuccessors(E.id)},E=>c.getSuccessors(E.id),"TB");const m=o(g,e),{x:y,y:v,z:x=0}=m;Qo(m,E=>{const{id:w,x:S,y:k,z:A=0}=E;l.nodes.push({id:w,style:{x:y,y:v,z:x}}),d.nodes.push({id:w,style:{x:S,y:k,z:A}})},E=>E.children,"TB")});const p=this.inferTreeLayoutOffset(d);if(RT(d,p),a){RT(l,p),this.updateElementPosition(l,!1);const g=this.updateElementPosition(d,a);yield g==null?void 0:g.finished}return d})}inferTreeLayoutOffset(t){var e;let[r,i]=[1/0,-1/0],[a,o]=[1/0,-1/0];(e=t.nodes)===null||e===void 0||e.forEach(y=>{const{x:v=0,y:x=0}=y.style||{};r=Math.min(r,v),i=Math.max(i,v),a=Math.min(a,x),o=Math.max(o,x)});const{canvas:s}=this.context,u=s.getSize(),[c,l]=s.getCanvasByViewport([0,0]),[d,p]=s.getCanvasByViewport(u);if(r>=c&&i<=d&&a>=l&&o<=p)return[0,0];const g=(c+d)/2,m=(l+p)/2;return[g-(r+i)/2,m-(a+o)/2]}stopLayout(){this.instance&&Pk(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(t){const{nodeFilter:e=()=>!0,comboFilter:r=()=>!0,preLayout:i=!1,isLayoutInvisibleNodes:a=!1}=t,{nodes:o,edges:s,combos:u}=this.context.model.getData(),{element:c,model:l}=this.context,d=x=>c.getElement(x),p=i?x=>{var E;return!a&&(((E=x.style)===null||E===void 0?void 0:E.visibility)==="hidden"||l.getAncestorsData(x.id,Yr).some(ba)||l.getAncestorsData(x.id,me).some(ba))?!1:e(x)}:x=>{const E=Z(x),w=d(E);return!w||Uu(w)?!1:e(x)},g=o.filter(p),m=u.filter(r),y=new Map(g.map(x=>[Z(x),x]));m.forEach(x=>y.set(Z(x),x));const v=s.filter(({source:x,target:E})=>y.has(x)&&y.has(E));return{nodes:g,edges:v,combos:m}}initGraphLayout(t){var e;const{element:r,viewport:i}=this.context,{type:a}=t,o=fJ(t,["type","enableWorker","animation","iterations"]),[s,u]=i.getCanvasSize(),c=[s/2,u/2],l=(e=t==null?void 0:t.nodeSize)!==null&&e!==void 0?e:(y=>{const v=r==null?void 0:r.getElement(y.id);return v?v.attributes.size:r==null?void 0:r.getElementComputedStyle("node",y).size}),d=ji("layout",a);if(!d)return ka.warn(`The layout of ${a} is not registered.`);const p=Object.getPrototypeOf(d.prototype)===AO.prototype?d:DY(d,this.context),g=new p(this.context),m={nodeSize:l,width:s,height:u,center:c};switch(g.id){case"d3-force":case"d3-force-3d":Object.assign(m,{center:{x:s/2,y:u/2,z:0}});break}return ma(g.options,m,o),g}updateElementPosition(t,e){const{model:r,element:i}=this.context;return i?(r.updateData(t),i.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},(t=this.supervisor)===null||t===void 0||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const RT=(n,t)=>{var e;const[r,i]=t;(e=n.nodes)===null||e===void 0||e.forEach(a=>{if(a.style){const{x:o=0,y:s=0}=a.style;a.style.x=o+r,a.style.y=s+i}else a.style={x:r,y:i}})};function gJ(n){return[vJ].reduce((t,e)=>e(t),n)}function vJ(n){return!n.layout||Array.isArray(n.layout)||"preLayout"in n.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(n.layout.type)&&(n.layout.preLayout=!0),n}class mJ extends Db{constructor(t){super(t),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(t){this.setExtensions(t)}getPluginInstance(t){const e=this.extensionMap[t];if(e)return e;ka.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const r=this.extensions.find(i=>i.type===t);if(r)return this.extensionMap[r.key]}}const Al=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class yJ extends Db{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...Al.slice(0,Al.length-1),...t,Al[Al.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var iu=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})};class bJ{get padding(){return zi(this.context.options.padding)}get paddingOffset(){const[t,e,r,i]=this.padding,[a,o,s]=[(i-e)/2,(t-r)/2,0];return[a,o,s]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,r]=this.paddingOffset,{zoom:i,rotation:a,x:o=e,y:s=r}=t.options;this.transform({mode:"absolute",scale:i,translate:[o,s],rotate:a},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,r)=>{const i=Object.entries(t.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),a=e[r];if(typeof a=="function")return(...o)=>{const s=a.apply(e,o);return i.forEach(u=>{u[r].apply(u,o)}),s}}})}createLandmark(t){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,t)}getAnimation(t){const e=B_(this.context.options,t);return e?wu(Object.assign({},e),["easing","duration"]):!1}getCanvasSize(){const{canvas:t}=this.context,{width:e=0,height:r=0}=t.getConfig();return[e,r]}getCanvasCenter(){const{canvas:t}=this.context,{width:e=0,height:r=0}=t.getConfig();return[e/2,r/2,0]}getViewportCenter(){const[t,e]=this.camera.getPosition();return[t,e,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(t){const{camera:e}=this,{mode:r,translate:i=[]}=t,a=this.getZoom(),o=e.getPosition(),s=e.getFocalPoint(),[u,c]=this.getCanvasCenter(),[l=0,d=0,p=0]=i,g=sh([-l,-d,-p],a);return r==="relative"?{position:rn(o,g),focalPoint:rn(s,g)}:{position:rn([u,c,o[2]],g),focalPoint:rn([u,c,s[2]],g)}}getRotateOptions(t){const{mode:e,rotate:r=0}=t;return{roll:e==="relative"?this.camera.getRoll()+r:r}}getZoomOptions(t){const{zoomRange:e}=this.context.options,r=this.camera.getZoom(),{mode:i,scale:a=1}=t;return dn(i==="relative"?r*a:a,...e)}transform(t,e){return iu(this,void 0,void 0,function*(){const{graph:r}=this.context,{translate:i,rotate:a,scale:o,origin:s}=t;this.cancelAnimation();const u=this.getAnimation(e);if(an(r,new kl(gt.BEFORE_TRANSFORM,t)),!a&&o&&!i&&s&&!u){this.camera.setZoomByViewportPoint(this.getZoomOptions(t),s),an(r,new kl(gt.AFTER_TRANSFORM,t));return}const c={};if(i&&Object.assign(c,this.getTranslateOptions(t)),Xt(a)&&Object.assign(c,this.getRotateOptions(t)),Xt(o)&&Object.assign(c,{zoom:this.getZoomOptions(t)}),u)return an(r,new Tr(gt.BEFORE_ANIMATE,$n.TRANSFORM,null,t)),new Promise(l=>{this.transformResolver=l,this.camera.gotoLandmark(this.createLandmark(c),Object.assign(Object.assign({},u),{onfinish:()=>{an(r,new Tr(gt.AFTER_ANIMATE,$n.TRANSFORM,null,t)),an(r,new kl(gt.AFTER_TRANSFORM,t)),this.transformResolver=void 0,l()}}))});this.camera.gotoLandmark(this.createLandmark(c),{duration:0}),an(r,new kl(gt.AFTER_TRANSFORM,t))})}fitView(t,e){return iu(this,void 0,void 0,function*(){const[r,i,a,o]=this.padding,{when:s="always",direction:u="both"}=t||{},[c,l]=this.context.canvas.getSize(),d=c-o-i,p=l-r-a,g=this.context.canvas.getBounds(),m=this.getBBoxInViewport(g),[y,v]=zu(m),x=u==="x"&&y>=d||u==="y"&&v>=p||u==="both"&&y>=d&&v>=p;if(s==="overflow"&&!x)return yield this.fitCenter({animation:e});const E=d/y,w=p/v,S=u==="x"?E:u==="y"?w:Math.min(E,w),k=this.getAnimation(e);Number.isFinite(S)&&(yield this.transform({mode:"relative",scale:S,translate:rn(Mn(this.getCanvasCenter(),this.getBBoxInViewport(g).center),sh(this.paddingOffset,S))},k))})}fitCenter(t){return iu(this,void 0,void 0,function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)})}focusElements(t){return iu(this,arguments,void 0,function*(e,r={}){const{element:i}=this.context;if(!i)return;const a=s=>r.shapes?s.getShape(r.shapes).getRenderBounds():s.getRenderBounds(),o=Fu(e.map(s=>a(i.getElement(s))));yield this.focus(o,r)})}focus(t,e){return iu(this,void 0,void 0,function*(){const r=this.context.graph.getViewportByCanvas(t.center),i=e.position||this.getCanvasCenter(),a=Mn(i,r);yield this.transform({mode:"relative",translate:rn(a,this.paddingOffset)},e.animation)})}getBBoxInViewport(t){const{min:e,max:r}=t,{graph:i}=this.context,[a,o]=i.getViewportByCanvas(e),[s,u]=i.getViewportByCanvas(r),c=new ye;return c.setMinMax([a,o,0],[s,u,0]),c}isInViewport(t,e=!1,r=0){const{graph:i}=this.context,a=this.getCanvasSize(),[o,s]=i.getCanvasByViewport([0,0]),[u,c]=i.getCanvasByViewport(a);let l=new ye;return l.setMinMax([o,s,0],[u,c,0]),r&&(l=Aa(l,r)),ss(t)?Xr(t,l):e?sU(t,l):l.intersects(t)}cancelAnimation(){var t,e;!((t=this.camera.landmarks)===null||t===void 0)&&t.length&&this.camera.cancelLandmarkAnimation(),(e=this.transformResolver)===null||e===void 0||e.call(this)}}var ve=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{c(r.next(l))}catch(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((r=r.apply(n,t||[])).next())})};class Md extends Fb{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new hJ},this.isCollapsingExpanding=!1,this.onResize=_h(()=>{this.resize()},300),this._setOptions(Object.assign({},Md.defaultOptions,t),!0),this.context.graph=this,this.options.autoResize&&((e=globalThis.addEventListener)===null||e===void 0||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),Object.assign(this.options,gJ(t)),e){const{data:p}=t;p&&this.addData(p);return}const{behaviors:r,combo:i,data:a,edge:o,layout:s,node:u,plugins:c,theme:l,transforms:d}=t;r&&this.setBehaviors(r),a&&this.setData(a),u&&this.setNode(u),o&&this.setEdge(o),i&&this.setCombo(i),s&&this.setLayout(s),l&&this.setTheme(l),c&&this.setPlugins(c),d&&this.setTransforms(d)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(t,e){t&&(this.options.width=t),e&&(this.options.height=e),this.resize(t,e)}setZoomRange(t){this.options.zoomRange=t}getZoomRange(){return this.options.zoomRange}setNode(t){this.options.node=t,this.context.model.refreshData()}setEdge(t){this.options.edge=t,this.context.model.refreshData()}setCombo(t){this.options.combo=t,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(t){this.options.theme=St(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=St(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=St(t)?t(this.getBehaviors()):t,(e=this.context.behavior)===null||e===void 0||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=St(t)?t(this.getPlugins()):t,(e=this.context.plugin)===null||e===void 0||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=St(t)?t(this.getTransforms()):t,(e=this.context.transform)===null||e===void 0||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r)),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}hasNode(t){return this.context.model.hasNode(t)}hasEdge(t){return this.context.model.hasEdge(t)}hasCombo(t){return this.context.model.hasCombo(t)}getElementData(t){return Array.isArray(t)?t.map(e=>this.context.model.getElementDataById(e)):this.context.model.getElementDataById(t)}getNodeData(t){return t===void 0?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):this.context.model.getNodeLikeDatum(t)}getEdgeData(t){return t===void 0?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):this.context.model.getEdgeDatum(t)}getComboData(t){return t===void 0?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):this.context.model.getNodeLikeDatum(t)}setData(t){this.context.model.setData(St(t)?t(this.getData()):t)}addData(t){this.context.model.addData(St(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData(St(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData(St(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData(St(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData(St(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData(St(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData(St(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData(St(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData(St(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData(St(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData(St(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData(St(t)?t(this.getComboData()):t)}getElementType(t){return this.context.model.getElementType(t)}getRelatedEdgesData(t,e="both"){return this.context.model.getRelatedEdgesData(t,e)}getNeighborNodesData(t){return this.context.model.getNeighborNodesData(t)}getAncestorsData(t,e){return this.context.model.getAncestorsData(t,e)}getParentData(t,e){return this.context.model.getParentData(t,e)}getChildrenData(t){return this.context.model.getChildrenData(t)}getDescendantsData(t){return this.context.model.getDescendantsData(t)}getElementDataByState(t,e){return this.context.model.getElementDataByState(t,e)}initCanvas(){return ve(this,void 0,void 0,function*(){var t;if(this.context.canvas)return yield this.context.canvas.ready;const{container:e="container",width:r,height:i,renderer:a,cursor:o,background:s,canvas:u,devicePixelRatio:c=(t=globalThis.devicePixelRatio)!==null&&t!==void 0?t:1}=this.options;if(e instanceof NT)this.context.canvas=e,o&&e.setCursor(o),a&&e.setRenderer(a),yield e.ready;else{const l=fe(e)?document.getElementById(e):e,d=_T(l);this.emit(gt.BEFORE_CANVAS_INIT,{container:l,width:r,height:i});const p=Object.assign(Object.assign({},u),{container:l,width:r||d[0],height:i||d[1],background:s,renderer:a,cursor:o,devicePixelRatio:c}),g=new NT(p);this.context.canvas=g,yield g.ready,this.emit(gt.AFTER_CANVAS_INIT,{canvas:g})}})}updateCanvas(t){var e,r;const{renderer:i,cursor:a,height:o,width:s}=t,u=this.context.canvas;u&&(i&&(this.emit(gt.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),u.setRenderer(i),this.emit(gt.AFTER_RENDERER_CHANGE,{renderer:i})),a&&u.setCursor(a),(Xt(s)||Xt(o))&&this.setSize((e=s??this.options.width)!==null&&e!==void 0?e:0,(r=o??this.options.height)!==null&&r!==void 0?r:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new sJ(this.context)),this.context.plugin||(this.context.plugin=new mJ(this.context)),this.context.viewport||(this.context.viewport=new bJ(this.context)),this.context.transform||(this.context.transform=new yJ(this.context)),this.context.element||(this.context.element=new dJ(this.context)),this.context.animation||(this.context.animation=new oJ(this.context)),this.context.layout||(this.context.layout=new pJ(this.context)),this.context.behavior||(this.context.behavior=new uJ(this.context))}prepare(){return ve(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(Li("The graph instance has been destroyed"));return}yield this.initCanvas(),this.initRuntime()})}render(){return ve(this,void 0,void 0,function*(){if(yield this.prepare(),an(this,new Xe(gt.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&RY(this.options.layout)){const t=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}this.rendered=!0,an(this,new Xe(gt.AFTER_RENDER))})}draw(){return ve(this,void 0,void 0,function*(){var t;yield this.prepare(),yield(t=this.context.element.draw())===null||t===void 0?void 0:t.finished})}layout(t){return ve(this,void 0,void 0,function*(){yield this.context.layout.postLayout(t)})}stopLayout(){this.context.layout.stopLayout()}clear(){return ve(this,void 0,void 0,function*(){const{model:t,element:e}=this.context;t.setData({}),t.clearChanges(),e==null||e.clear()})}destroy(){var t;an(this,new Xe(gt.BEFORE_DESTROY));const{layout:e,animation:r,element:i,model:a,canvas:o,behavior:s,plugin:u}=this.context;u==null||u.destroy(),s==null||s.destroy(),e==null||e.destroy(),r==null||r.destroy(),i==null||i.destroy(),a.destroy(),o==null||o.destroy(),this.options={},this.context={},this.off(),(t=globalThis.removeEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,an(this,new Xe(gt.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var r;const i=_T((r=this.context.canvas)===null||r===void 0?void 0:r.getContainer()),a=[t||i[0],e||i[1]];if(!this.context.canvas)return;const o=this.context.canvas.getSize();Jn(a,o)||(an(this,new Xe(gt.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),an(this,new Xe(gt.AFTER_SIZE_CHANGE,{size:a})))}fitView(t,e){return ve(this,void 0,void 0,function*(){var r;yield(r=this.context.viewport)===null||r===void 0?void 0:r.fitView(t,e)})}fitCenter(t){return ve(this,void 0,void 0,function*(){var e;yield(e=this.context.viewport)===null||e===void 0?void 0:e.fitCenter({animation:t})})}autoFit(){return ve(this,void 0,void 0,function*(){const{autoFit:t}=this.context.options;if(t)if(fe(t))t==="view"?yield this.fitView():t==="center"&&(yield this.fitCenter());else{const{type:e,animation:r}=t;e==="view"?yield this.fitView(t.options,r):e==="center"&&(yield this.fitCenter(r))}})}focusElement(t,e){return ve(this,void 0,void 0,function*(){var r;yield(r=this.context.viewport)===null||r===void 0?void 0:r.focusElements(Array.isArray(t)?t:[t],{animation:e})})}zoomBy(t,e,r){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:r},e)})}zoomTo(t,e,r){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",scale:t,origin:r},e)})}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,r){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:r},e)})}rotateTo(t,e,r){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",rotate:t,origin:r},e)})}getRotation(){return this.context.viewport.getRotation()}translateBy(t,e){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)})}translateTo(t,e){return ve(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)})}getPosition(){return Mn([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return ve(this,arguments,void 0,function*(r,i,a=!0){var o,s;const[u,c]=An(r)?[r,(o=i)!==null&&o!==void 0?o:!0]:[{[r]:i},a];Object.entries(u).forEach(([l,d])=>this.context.model.translateNodeLikeBy(l,d)),yield(s=this.context.element.draw({animation:c,stage:"translate"}))===null||s===void 0?void 0:s.finished})}translateElementTo(t,e){return ve(this,arguments,void 0,function*(r,i,a=!0){var o,s;const[u,c]=An(r)?[r,(o=i)!==null&&o!==void 0?o:!0]:[{[r]:i},a];Object.entries(u).forEach(([l,d])=>this.context.model.translateNodeLikeTo(l,d)),yield(s=this.context.element.draw({animation:c,stage:"translate"}))===null||s===void 0?void 0:s.finished})}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return RM(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return ve(this,arguments,void 0,function*(r,i,a=!0){var o,s;const[u,c]=An(r)?[r,(o=i)!==null&&o!==void 0?o:!0]:[{[r]:i},a],l={nodes:[],edges:[],combos:[]};Object.entries(u).forEach(([g,m])=>{const y=this.getElementType(g);l[`${y}s`].push({id:g,style:{visibility:m}})});const{model:d,element:p}=this.context;d.preventUpdateNodeLikeHierarchy(()=>{d.updateData(l)}),yield(s=p.draw({animation:c,stage:"visibility"}))===null||s===void 0?void 0:s.finished})}showElement(t,e){return ve(this,void 0,void 0,function*(){const r=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(r.map(i=>[i,"visible"])),e)})}hideElement(t,e){return ve(this,void 0,void 0,function*(){const r=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(r.map(i=>[i,"hidden"])),e)})}getElementVisibility(t){var e,r;const i=this.context.element.getElement(t);return(r=(e=i==null?void 0:i.style)===null||e===void 0?void 0:e.visibility)!==null&&r!==void 0?r:"visible"}setElementZIndex(t,e){return ve(this,void 0,void 0,function*(){var r;const i={nodes:[],edges:[],combos:[]},a=An(t)?t:{[t]:e};Object.entries(a).forEach(([u,c])=>{const l=this.getElementType(u);i[`${l}s`].push({id:u,style:{zIndex:c}})});const{model:o,element:s}=this.context;o.preventUpdateNodeLikeHierarchy(()=>o.updateData(i)),yield(r=s.draw({animation:!1,stage:"zIndex"}))===null||r===void 0?void 0:r.finished})}frontElement(t){return ve(this,void 0,void 0,function*(){const e=Array.isArray(t)?t:[t],{model:r}=this.context,i={};e.map(a=>{const o=r.getFrontZIndex(a);if(r.getElementType(a)==="combo"){const s=r.getAncestorsData(a,me).at(-1)||this.getComboData(a),u=[s,...r.getDescendantsData(Z(s))],c=o-OT(s);u.forEach(d=>{i[Z(d)]=this.getElementZIndex(Z(d))+c});const{internal:l}=nY(u.map(Z),d=>r.getRelatedEdgesData(d));l.forEach(d=>{const p=Z(d);i[p]=this.getElementZIndex(p)+c})}else i[a]=o}),yield this.setElementZIndex(i)})}getElementZIndex(t){return OT(this.context.model.getElementDataById(t))}setElementState(t,e){return ve(this,arguments,void 0,function*(r,i,a=!0){var o,s;const[u,c]=An(r)?[r,(o=i)!==null&&o!==void 0?o:!0]:[{[r]:i},a],l=p=>p?Array.isArray(p)?p:[p]:[],d={nodes:[],edges:[],combos:[]};Object.entries(u).forEach(([p,g])=>{const m=this.getElementType(p);d[`${m}s`].push({id:p,states:l(g)})}),this.updateData(d),yield(s=this.context.element.draw({animation:c,stage:"state"}))===null||s===void 0?void 0:s.finished})}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return ve(this,arguments,void 0,function*(e,r=!0){const{model:i,element:a}=this.context;if(ba(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof r=="boolean"&&(r={animation:r,align:!0});const o=i.getElementType(e);yield this.frontElement(e),this.isCollapsingExpanding=!0,i.updateData(o==="node"?{nodes:[{id:e,style:{collapsed:!0}}]}:{combos:[{id:e,style:{collapsed:!0}}]}),o==="node"?yield a.collapseNode(e,r):o==="combo"&&(yield a.collapseCombo(e,!!r.animation)),this.isCollapsingExpanding=!1})}expandElement(t){return ve(this,arguments,void 0,function*(e,r=!0){const{model:i,element:a}=this.context;if(!ba(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof r=="boolean"&&(r={animation:r,align:!0});const o=i.getElementType(e);this.isCollapsingExpanding=!0,i.updateData(o==="node"?{nodes:[{id:e,style:{collapsed:!1}}]}:{combos:[{id:e,style:{collapsed:!1}}]}),o==="node"?yield a.expandNode(e,r):o==="combo"&&(yield a.expandCombo(e,!!r.animation)),this.isCollapsingExpanding=!1})}setElementCollapsibility(t,e){const r=this.getElementType(t);r==="node"?this.updateNodeData([{id:t,style:{collapsed:e}}]):r==="combo"&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return ve(this,arguments,void 0,function*(t={}){return this.context.canvas.toDataURL(t)})}getCanvasByViewport(t){return this.context.canvas.getCanvasByViewport(t)}getViewportByCanvas(t){return this.context.canvas.getViewportByCanvas(t)}getClientByCanvas(t){return this.context.canvas.getClientByCanvas(t)}getCanvasByClient(t){return this.context.canvas.getCanvasByClient(t)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(t,e,r){return super.on(t,e,r)}once(t,e){return super.once(t,e)}off(t,e){return super.off(t,e)}}Md.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};const xJ=(n,t)=>{const{source:e,target:r}=t,i=n.getElementDataById(e),a=n.getElementDataById(r),o=vk(i,d=>n.getParentData(d,me)),s=vk(a,d=>n.getParentData(d,me)),u=Z(o),c=Z(s),l={sourceNode:u,targetNode:c};return t.style?Object.assign(t.style,l):t.style=l,t},EJ=(n,t,e)=>{const[r,i]=t,[a,o]=e;if(i===r)return a;const s=(n-r)/(i-r);return a+s*(o-a)},wJ=(n,t,e)=>{const[r,i]=t,[a,o]=e,s=Math.log(n-r+1)/Math.log(i-r+1);return a+s*(o-a)},kJ=(n,t,e,r=2)=>{const[i,a]=t,[o,s]=e,u=Math.pow((n-i)/(a-i),r);return o+u*(s-o)},AJ=(n,t,e)=>{const[r,i]=t,[a,o]=e,s=Math.sqrt((n-r)/(i-r));return a+s*(o-a)};class _d extends i6{constructor(t,e){super(t,ma({},_d.defaultOptions,e)),this.assignSizeByCentrality=(r,i,a,o,s,u)=>{const c=[i,a],l=[o[0],s[0]],d=[o[1],s[1]],p=[o[2],s[2]],g=(m,y)=>{if(typeof u=="function")return u(m,c,y);switch(u){case"linear":return EJ(m,c,y);case"log":return wJ(m,c,y);case"pow":return kJ(m,c,y,2);case"sqrt":return AJ(m,c,y);default:return y[0]}};return[g(r,l),g(r,d),g(r,p)]}}beforeDraw(t){const{model:e}=this.context,r=e.getNodeData(),i=ga(this.options.maxSize),a=ga(this.options.minSize),o=this.getCentralities(this.options.centrality),s=o.size>0?Math.max(...o.values()):0,u=o.size>0?Math.min(...o.values()):0;return r.forEach(c=>{var l;const d=this.assignSizeByCentrality(o.get(Z(c))||0,u,s,a,i,this.options.scale),p=(l=this.context.element)===null||l===void 0?void 0:l.getElement(Z(c)),g={size:d};this.assignLabelStyle(g,d,c,p),(!p||!Il(g,p.attributes))&&lu(t,p?"update":"add","node",ma(c,{style:g}),!0)}),t}assignLabelStyle(t,e,r,i){var a;const o=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",r);if(Object.assign(t,wu(o,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const s=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:s,labelLineHeight:s+oU(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,r){const i=Math.min(...t)/2,[a,o]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[r,e];return Math.min(o,Math.max(i,a))}getCentralities(t){const{model:e}=this.context,r=e.getData();if(typeof t=="function")return t(r);const i=e.getRelatedEdgesData.bind(e);return U_(r,i,t)}}_d.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};const SJ="quadratic",DT=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class Ru extends i6{constructor(t,e){super(t,Object.assign({},Ru.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=r=>{const{add:{edges:i},update:{nodes:a,edges:o,combos:s},remove:{edges:u}}=r,{model:c}=this.context,l=new Map,d=(m,y)=>{c.getRelatedEdgesData(y).forEach(v=>!l.has(Z(v))&&l.set(Z(v),v))};a.forEach(d),s.forEach(d);const p=m=>{const y=new Set(r.remove.edges.keys()),v=c.getEdgeData().filter(x=>!y.has(Z(x))).map(x=>xJ(c,x));CJ(m,v).forEach(x=>{const E=Z(x);l.has(E)||l.set(E,x)})};if(u.size&&u.forEach(p),i.size&&i.forEach(p),o.size){const m=OK(UP(c.getChanges())).update.edges;o.forEach(y=>{var v;p(y);const x=(v=m.find(E=>Z(E.value)===Z(y)))===null||v===void 0?void 0:v.original;x&&!hx(y,x)&&p(x)})}PM(this.options.edges)||l.forEach((m,y)=>!this.options.edges.includes(y)&&l.delete(y));const g=c.getEdgeData().map(Z);return new Map([...l].sort((m,y)=>g.indexOf(m[0])-g.indexOf(y[0])))},this.applyBundlingStyle=(r,i,a)=>{const{edgeMap:o,reverses:s}=LT(i);o.forEach(u=>{u.forEach((c,l,d)=>{var p;const g=d.length,m=c.style||{};if(c.source===c.target){const x=DT.length;m.loopPlacement=DT[l%x],m.loopDist=Math.floor(l/x)*a+50}else if(g===1)m.curveOffset=0;else{const x=(l%2===0?1:-1)*(s[`${c.source}|${c.target}|${l}`]?-1:1);m.curveOffset=g%2===1?x*Math.ceil(l/2)*a*2:x*(Math.floor(l/2)*a*2+a)}const y=Object.assign(c,{type:SJ,style:m}),v=(p=this.context.element)===null||p===void 0?void 0:p.getElement(Z(c));(!v||!Il(y.style,v.attributes))&&lu(r,v?"update":"add","edge",y,!0)})})},this.resetEdgeStyle=r=>{const i=r.style||{},a=this.cacheMergeStyle.get(Z(r))||{};return Object.keys(a).forEach(o=>{Jn(i[o],a[o])&&(r[o]?i[o]=r[o]:delete i[o])}),Object.assign(r,{style:i})},this.applyMergingStyle=(r,i)=>{const{edgeMap:a,reverses:o}=LT(i);a.forEach(s=>{var u;if(s.length===1){const l=s[0],d=(u=this.context.element)===null||u===void 0?void 0:u.getElement(Z(l)),p=this.resetEdgeStyle(l);(!d||!Il(p,d.attributes))&&lu(r,d?"update":"add","edge",p);return}const c=s.map(({source:l,target:d,style:p={}},g)=>{const{startArrow:m,endArrow:y}=p,v={},[x,E]=o[`${l}|${d}|${g}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return Eu(m)&&(v[x]=m),Eu(y)&&(v[E]=y),v}).reduce((l,d)=>Object.assign(Object.assign({},l),d),{});s.forEach((l,d,p)=>{var g;if(d!==0){lu(r,"remove","edge",l);return}const m=Object.assign({},St(this.options.style)?this.options.style(p):this.options.style,{childrenData:p});this.cacheMergeStyle.set(Z(l),m);const y=Object.assign(Object.assign({},l),{type:"line",style:Object.assign(Object.assign(Object.assign({},l.style),c),m)}),v=(g=this.context.element)===null||g===void 0?void 0:g.getElement(Z(l));(!v||!Il(y.style,v.attributes))&&lu(r,v?"update":"add","edge",y,!0)})})}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return e.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}Ru.defaultOptions={mode:"bundle",distance:15};const LT=n=>{const t=new Map,e=new Set,r={},i=new Map;for(const[a,o]of n){if(e.has(a))continue;const{source:s,target:u}=o,c=`${s}-${u}`;t.has(c)||(t.set(c,[]),i.set(c,new Set));const l=t.get(c),d=i.get(c);l&&d&&!d.has(a)&&(l.push(o),d.add(a),e.add(a));for(const[p,g]of n)if(!(e.has(p)||p===a)&&hx(o,g)){const m=t.get(c),y=i.get(c);m&&y&&!y.has(p)&&(m.push(g),y.add(p),s===g.target&&u===g.source&&(r[`${g.source}|${g.target}|${m.length-1}`]=!0),e.add(p))}}return{edgeMap:t,reverses:r}},CJ=(n,t,e)=>t.filter(r=>hx(r,n)),hx=(n,t)=>{const{sourceNode:e,targetNode:r}=n.style||{},{sourceNode:i,targetNode:a}=t.style||{};return e===i&&r===a||e===a&&r===i},NJ={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css"},TJ={dragCanvas:!0,zoomCanvas:!0,scrollCanvas:!0,clickSelect:!0,focusElement:!0,hoverActivate:!0,autoAdaptLabel:!0};class MJ{constructor(t={}){Te(this,"options"),this.options={...TJ,...t}}generate(){const t=[];return this.options.dragCanvas&&t.push(this.createDragCanvasConfig()),this.options.zoomCanvas&&t.push(this.createZoomCanvasConfig()),this.options.scrollCanvas&&t.push(this.createScrollCanvasConfig()),this.options.optimizeViewportTransform&&t.push(this.createOptimizeViewportTransformConfig()),this.options.clickSelect&&t.push(this.createClickSelectConfig()),this.options.brushSelect&&t.push(this.createBrushSelectConfig()),this.options.lassoSelect&&t.push(this.createLassoSelectConfig()),this.options.createEdge&&t.push(this.createCreateEdgeConfig()),this.options.dragElement&&t.push(this.createDragElementConfig()),this.options.dragElementForce&&t.push(this.createDragElementForceConfig()),this.options.collapseExpand&&t.push(this.createCollapseExpandConfig()),this.options.focusElement&&t.push(this.createFocusElementConfig()),this.options.hoverActivate&&t.push(this.createHoverActivateConfig()),this.options.fixElementSize&&t.push(this.createFixElementSizeConfig()),this.options.autoAdaptLabel&&t.push(this.createAutoAdaptLabelConfig()),t}createDragCanvasConfig(){const t=this.options.dragCanvas;return typeof t=="boolean"?{type:"drag-canvas"}:{type:"drag-canvas",key:"drag-canvas",direction:"both",...t}}createZoomCanvasConfig(){const t=this.options.zoomCanvas;return typeof t=="boolean"?{type:"zoom-canvas"}:{type:"zoom-canvas",key:"zoom-canvas",sensitivity:1,...t}}createScrollCanvasConfig(){const t=this.options.scrollCanvas;return typeof t=="boolean"?{type:"scroll-canvas"}:{type:"scroll-canvas",key:"scroll-canvas",sensitivity:1,...t}}createOptimizeViewportTransformConfig(){const t=this.options.optimizeViewportTransform;return typeof t=="boolean"?{type:"optimize-viewport-transform"}:{type:"optimize-viewport-transform",key:"optimize-viewport-transform",debounce:200,...t}}createClickSelectConfig(){const t=this.options.clickSelect;return typeof t=="boolean"?{type:"click-select"}:{type:"click-select",key:"click-select",multiple:!1,...t}}createBrushSelectConfig(){const t=this.options.brushSelect;return typeof t=="boolean"?{type:"brush-select"}:{type:"brush-select",key:"brush-select",...t}}createLassoSelectConfig(){const t=this.options.lassoSelect;return typeof t=="boolean"?{type:"lasso-select"}:{type:"lasso-select",key:"lasso-select",...t}}createCreateEdgeConfig(){const t=this.options.createEdge;return typeof t=="boolean"?{type:"create-edge"}:{type:"create-edge",key:"create-edge",...t}}createDragElementConfig(){const t=this.options.dragElement;return typeof t=="boolean"?{type:"drag-element"}:{type:"drag-element",key:"drag-element",...t}}createDragElementForceConfig(){const t=this.options.dragElementForce;return typeof t=="boolean"?{type:"drag-element-force"}:{type:"drag-element-force",key:"drag-element-force",...t}}createCollapseExpandConfig(){const t=this.options.collapseExpand;return typeof t=="boolean"?{type:"collapse-expand"}:{type:"collapse-expand",key:"collapse-expand",...t}}createFocusElementConfig(){const t=this.options.focusElement;return typeof t=="boolean"?{type:"focus-element"}:{type:"focus-element",key:"focus-element",animation:{duration:500,easing:"ease-in"},...t}}createHoverActivateConfig(){const t=this.options.hoverActivate;return typeof t=="boolean"?{type:"hover-activate"}:{type:"hover-activate",key:"hover-activate",animation:!0,degree:0,direction:"both",state:"active",...t}}createFixElementSizeConfig(){const t=this.options.fixElementSize;return typeof t=="boolean"?{type:"fix-element-size"}:{type:"fix-element-size",key:"fix-element-size",...t}}createAutoAdaptLabelConfig(){const t=this.options.autoAdaptLabel;return typeof t=="boolean"?{type:"auto-adapt-label"}:{type:"auto-adapt-label",key:"auto-adapt-label",enable:!0,...t}}}function eb(n={}){return new MJ(n).generate()}function _J(n){const t={minimal:{dragCanvas:!0,zoomCanvas:!0},standard:{dragCanvas:!0,zoomCanvas:!0,scrollCanvas:!0,clickSelect:!0,focusElement:!0,hoverActivate:!0},advanced:{dragCanvas:!0,zoomCanvas:!0,scrollCanvas:!0,optimizeViewportTransform:!0,clickSelect:!0,brushSelect:!0,dragElement:!0,focusElement:!0,hoverActivate:!0,autoAdaptLabel:!0},full:{dragCanvas:!0,zoomCanvas:!0,scrollCanvas:!0,optimizeViewportTransform:!0,clickSelect:!0,brushSelect:!0,lassoSelect:!0,createEdge:!0,dragElement:!0,dragElementForce:!0,collapseExpand:!0,focusElement:!0,hoverActivate:!0,fixElementSize:!0,autoAdaptLabel:!0},preview:{dragCanvas:{direction:"both",sensitivity:1},zoomCanvas:{sensitivity:.8,trigger:["Control"]},scrollCanvas:{sensitivity:1.2},optimizeViewportTransform:{debounce:200},focusElement:{animation:{duration:600,easing:"ease-in-out"}},hoverActivate:{animation:!0,degree:1,direction:"both",state:"highlight"},autoAdaptLabel:!0,clickSelect:!1,brushSelect:!1,lassoSelect:!1,createEdge:!1,dragElement:!1,dragElementForce:!1,collapseExpand:!1}};return eb(t[n]||t.standard)}class OJ{constructor(t={}){Te(this,"options"),this.options=t}generate(){const t=[];return this.options.background&&(this.options.background===!0?t.push({type:"background"}):t.push({type:"background",...this.options.background})),this.options.bubbleSets&&(this.options.bubbleSets===!0?t.push({type:"bubble-sets",members:[]}):t.push({type:"bubble-sets",members:[],...this.options.bubbleSets})),this.options.fullscreen&&(this.options.fullscreen===!0?t.push({type:"fullscreen"}):t.push({type:"fullscreen",...this.options.fullscreen})),this.options.gridLine&&(this.options.gridLine===!0?t.push({type:"grid-line"}):t.push({type:"grid-line",...this.options.gridLine})),this.options.history&&(this.options.history===!0?t.push({type:"history"}):t.push({type:"history",...this.options.history})),this.options.legend&&(this.options.legend===!0?t.push({type:"legend",key:"legend",nodeField:"nodeType",edgeField:"edgeType"}):t.push({type:"legend",key:"legend",...this.options.legend})),this.options.contextmenu&&(this.options.contextmenu===!0?t.push({type:"contextmenu"}):t.push({type:"contextmenu",...this.options.contextmenu})),this.options.snapline&&(this.options.snapline===!0?t.push({type:"snapline"}):t.push({type:"snapline",...this.options.snapline})),this.options.timebar&&(this.options.timebar===!0?t.push({type:"timebar",data:[]}):t.push({type:"timebar",data:[],...this.options.timebar})),this.options.title&&(this.options.title===!0?t.push({type:"title",key:"title"}):t.push({type:"title",key:"title",...this.options.title})),this.options.toolbar&&(this.options.toolbar===!0?t.push({type:"toolbar",getItems:()=>[],onClick:()=>{}}):t.push({type:"toolbar",getItems:()=>[],onClick:()=>{},...this.options.toolbar})),this.options.tooltip&&(this.options.tooltip===!0?t.push({type:"tooltip"}):t.push({type:"tooltip",...this.options.tooltip})),this.options.watermark&&(this.options.watermark===!0?t.push({type:"watermark"}):t.push({type:"watermark",...this.options.watermark})),t}}const PJ={minimal:{},standard:{tooltip:!0,legend:!0},advanced:{tooltip:!0,legend:!0,minimap:!0,toolbar:!0,history:!0},full:{background:!0,bubbleSets:!0,fullscreen:!0,gridLine:!0,history:!0,legend:!0,contextmenu:!0,minimap:!0,snapline:!0,timebar:!0,title:!0,toolbar:!0,tooltip:!0,watermark:!0},preview:{background:{backgroundColor:"#f8f9fa",opacity:"0.8"},fullscreen:{autoFit:!0,trigger:{request:"F",exit:"Esc"}},gridLine:{size:20,stroke:"#e8e8e8",follow:!0},legend:{type:"legend",key:"legend",position:"bottom-right",trigger:"hover",nodeField:"nodeType",edgeField:"edgeType"},title:{type:"title",key:"title",title:"\u77E5\u8BC6\u56FE\u8C31\u9884\u89C8",align:"center"},tooltip:{position:"top-right",trigger:"hover",getContent:async(n,t)=>{var r;const e=t[0];return n.targetType==="node"?`
211
+ <div style="padding: 8px; background: #fff; border: 1px solid #d9d9d9; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);">
212
+ <div style="font-weight: bold; margin-bottom: 4px;">${((r=e.data)==null?void 0:r.label)||e.id}</div>
213
+ <div style="color: #666; font-size: 12px;">\u8282\u70B9ID: ${e.id}</div>
214
+ </div>
215
+ `:""}}}};function Ah(n={}){return new OJ(n).generate()}function RJ(n,t={}){const e=PJ[n];if(!e)return console.warn(`Unknown plugin preset: ${n}. Using empty configuration.`),Ah(t);const r={...e,...t};return Ah(r)}function Zy(n){return n===void 0?!1:Array.isArray(n)?n.length>0:typeof n=="function"}async function Jy(n,t){return n?typeof n=="function"?n(t):n:[]}function DJ(n,t,e){if(!t)return n;const r=t,i={type:"contextmenu",key:"nodegraph-contextmenu",className:r.className??"nodegraph-contextmenu",trigger:r.trigger??"contextmenu",offset:r.offset??[4,4],enable:o=>{const s=o==null?void 0:o.targetType;return!!(s==="node"&&Zy(r.node)||s==="edge"&&Zy(r.edge)||s==="canvas"&&Zy(r.canvas))},getItems:async o=>{e.lastEventRef.current=o;const s=o==null?void 0:o.targetType;let u=[];s==="node"?u=await Jy(r.node,o):s==="edge"?u=await Jy(r.edge,o):s==="canvas"&&(u=await Jy(r.canvas,o));try{o.__resolvedItems=u}catch{}return u},onClick:(o,s,u)=>{var w,S,k;const c=e.lastEventRef.current,l=c==null?void 0:c.targetType;if(!l||l!=="node"&&l!=="edge"&&l!=="canvas")return;const d=(u==null?void 0:u.id)??((w=c==null?void 0:c.target)==null?void 0:w.id)??(c==null?void 0:c.itemId)??((S=c==null?void 0:c.element)==null?void 0:S.id)??(c==null?void 0:c.elementId)??(c==null?void 0:c.id)??void 0,p=d!=null?String(d):void 0,g=e.getGraph();let m,y;try{l==="node"&&p&&(g!=null&&g.getNodeData)&&(m=g.getNodeData(p)),l==="edge"&&p&&(g!=null&&g.getEdgeData)&&(y=g.getEdgeData(p))}catch{}const v=c==null?void 0:c.__resolvedItems;let x=String(o);if(Array.isArray(v)){const A=v.find(N=>N.value===o);A!=null&&A.name&&(x=A.name)}const E={targetType:l,value:o,name:x,elementId:p,nodeData:m,edgeData:y,graphEvent:c};try{(k=r.onItemClick)==null||k.call(r,E)}catch{}try{e.emit("nodegraph_contextmenu_item",E)}catch{}}},a=n.findIndex(o=>o.type==="contextmenu");if(a>=0){const o=n.slice();return o[a]=i,o}return[...n,i]}const o6=document.createElement("style");o6.innerHTML=`@import url('${NJ.css}');`;document.head.appendChild(o6);const IT="node-graph-fullscreen-host-style";if(typeof document<"u"&&!document.getElementById(IT)){const n=document.createElement("style");n.id=IT,n.textContent=`
216
+ .node-graph-canvas-host:fullscreen,
217
+ .node-graph-canvas-host:-webkit-full-screen,
218
+ .node-graph-canvas-host:-moz-full-screen {
219
+ width: 100vw !important;
220
+ height: 100vh !important;
221
+ max-width: 100vw;
222
+ max-height: 100vh;
223
+ box-sizing: border-box;
224
+ }
225
+ `,document.head.appendChild(n)}const LJ=n=>{const t=Va(null),[e,r]=lj({width:0,height:0}),i=Va(null),a=Va(n.onReady),o=Va(n.onDestroy);a.current=n.onReady,o.current=n.onDestroy;const s=Va(n.eventEmit);s.current=n.eventEmit;const u=Va(null),c=ii(()=>typeof n.behaviors=="string"?_J(n.behaviors):n.behaviors?eb(n.behaviors):eb(),[n.behaviors]),l=ii(()=>typeof n.plugins=="string"?RJ(n.plugins):n.plugins?Ah(n.plugins):Ah(),[n.plugins]),d=ii(()=>{let v=n.layout;return typeof v=="string"&&(v={type:v}),v},[n.layout]),p=()=>({width:n.width??e.width,height:n.height??e.height}),g=()=>{var x;const v=i.current;i.current=null,v&&((x=o.current)==null||x.call(o,v),v.destroy())},m=()=>{if(!t.current)return null;const{width:v,height:x}=p();if(v<=0||x<=0)return null;const E=(k,A)=>{var N;try{(N=s.current)==null||N.call(s,k,A,()=>{})}catch{}};let w=l;w=DJ(w,n.contextMenu,{lastEventRef:u,emit:E,getGraph:()=>i.current});const S=new Md({container:t.current,width:v,height:x,data:n.data,layout:d,theme:n.theme,behaviors:c,plugins:w,...n.node?{node:n.node}:{},...n.edge?{edge:n.edge}:{}});return S.render(),S},y=v=>{var A,N,T,O;const x=(M,P)=>{var L;try{(L=s.current)==null||L.call(s,M,P,()=>{})}catch{}},E=M=>{var P;try{return(P=v.getNodeData)==null?void 0:P.call(v,M)}catch{return}},w=M=>{var P;try{return(P=v.getEdgeData)==null?void 0:P.call(v,M)}catch{return}},S=async(M,P)=>{var L,j,z;try{const U=((L=v.getElementDataByState)==null?void 0:L.call(v,M,P))??[];if(!Array.isArray(U)||U.length===0)return;const J={};for(const W of U){const at=W==null?void 0:W.id;if(!at)continue;const ut=((j=v.getElementState)==null?void 0:j.call(v,at))??[];J[at]=ut.filter(yt=>yt!==P)}await((z=v.setElementState)==null?void 0:z.call(v,J,!1))}catch{}},k=async(M,P)=>{var L,j;if(P)try{await S(M,"selected");const z=((L=v.getElementState)==null?void 0:L.call(v,P))??[];z.includes("selected")||await((j=v.setElementState)==null?void 0:j.call(v,{[P]:[...z,"selected"]},!1))}catch{}};(A=v.on)==null||A.call(v,"node:click",M=>{var j,z,U;const P=((j=M==null?void 0:M.target)==null?void 0:j.id)??(M==null?void 0:M.itemId)??((z=M==null?void 0:M.element)==null?void 0:z.id)??(M==null?void 0:M.id),L=P?E(String(P)):void 0;(U=n.selectEnable)!=null&&U.node&&k("node",P?String(P):void 0),x("nodegraph_node_selected",{id:P,data:L,event:M})}),(N=v.on)==null||N.call(v,"edge:click",M=>{var j,z,U;const P=((j=M==null?void 0:M.target)==null?void 0:j.id)??(M==null?void 0:M.itemId)??((z=M==null?void 0:M.element)==null?void 0:z.id)??(M==null?void 0:M.id),L=P?w(String(P)):void 0;(U=n.selectEnable)!=null&&U.edge&&k("edge",P?String(P):void 0),x("nodegraph_edge_selected",{id:P,data:L,event:M})}),(T=v.on)==null||T.call(v,"canvas:click",async M=>{await S("node","selected"),await S("edge","selected"),x("nodegraph_selection_cleared",{event:M})}),(O=v.on)==null||O.call(v,"canvas:pointermove",async()=>{await S("node","active"),await S("edge","active")})};return Us(()=>{const v=()=>{if(t.current){const{offsetWidth:E,offsetHeight:w}=t.current;r({width:E,height:w})}};v(),window.addEventListener("resize",v);let x=null;return t.current&&window.ResizeObserver&&(x=new ResizeObserver(v),x.observe(t.current)),()=>{window.removeEventListener("resize",v),x&&x.disconnect()}},[]),Us(()=>{var x;if(i.current||e.width<=0||e.height<=0)return;const v=m();v&&(i.current=v,y(v),(x=a.current)==null||x.call(a,v))},[e.width,e.height]),Us(()=>{var x;if(!i.current)return;g();const v=m();if(v)return i.current=v,y(v),(x=a.current)==null||x.call(a,v),()=>{}},[n.data,n.theme,n.width,n.height,d,c,l,n.contextMenu,n.node,n.edge]),Us(()=>{var w;const v=i.current;if(!v||n.width!=null||n.height!=null||e.width<=0||e.height<=0)return;const{width:x,height:E}=p();try{typeof v.changeSize=="function"?v.changeSize(x,E):typeof v.resize=="function"?v.resize(x,E):typeof v.setSize=="function"?v.setSize(x,E):v.render()}catch{try{(w=v.render)==null||w.call(v)}catch{}}},[e.width,e.height,n.width,n.height]),Us(()=>()=>{g()},[]),nn.jsx("div",{ref:t,className:"node-graph-canvas-host",onContextMenu:v=>v.preventDefault(),style:{width:"100%",height:"100%",minHeight:0}})},bt=new Set,m4=()=>{console.log("\u5F00\u59CB\u6CE8\u518C G6 \u6269\u5C55..."),bt.has("plugin-background")||(re(Kt.PLUGIN,"background",Ed),bt.add("plugin-background")),bt.has("plugin-grid-line")||(re(Kt.PLUGIN,"grid-line",kd),bt.add("plugin-grid-line")),bt.has("plugin-legend")||(re(Kt.PLUGIN,"legend",Sd),bt.add("plugin-legend")),bt.has("plugin-title")||(re(Kt.PLUGIN,"title",qZ),bt.add("plugin-title")),bt.has("plugin-toolbar")||(re(Kt.PLUGIN,"toolbar",Cd),bt.add("plugin-toolbar")),bt.has("plugin-tooltip")||(re(Kt.PLUGIN,"tooltip",Nd),bt.add("plugin-tooltip")),bt.has("plugin-contextmenu")||(re(Kt.PLUGIN,"contextmenu",wd),bt.add("plugin-contextmenu")),bt.has("transform-update-related-edges")||(re(Kt.TRANSFORM,"update-related-edges",Ru),bt.add("transform-update-related-edges")),bt.has("transform-get-edge-actual-ends")||(re(Kt.TRANSFORM,"get-edge-actual-ends",Ru),bt.add("transform-get-edge-actual-ends")),bt.has("transform-arrange-draw-order")||(re(Kt.TRANSFORM,"arrange-draw-order",_d),bt.add("transform-arrange-draw-order")),bt.has("behavior-drag-canvas")||(re(Kt.BEHAVIOR,"drag-canvas",Hh),bt.add("behavior-drag-canvas")),bt.has("behavior-zoom-canvas")||(re(Kt.BEHAVIOR,"zoom-canvas",td),bt.add("behavior-zoom-canvas")),bt.has("behavior-scroll-canvas")||(re(Kt.BEHAVIOR,"scroll-canvas",Qh),bt.add("behavior-scroll-canvas")),bt.has("behavior-optimize-viewport-transform")||(re(Kt.BEHAVIOR,"optimize-viewport-transform",Jh),bt.add("behavior-optimize-viewport-transform")),bt.has("behavior-click-select")||(re(Kt.BEHAVIOR,"click-select",jh),bt.add("behavior-click-select")),bt.has("behavior-drag-element")||(re(Kt.BEHAVIOR,"drag-element",Xh),bt.add("behavior-drag-element")),bt.has("behavior-focus-element")||(re(Kt.BEHAVIOR,"focus-element",Kh),bt.add("behavior-focus-element")),bt.has("behavior-hover-activate")||(re(Kt.BEHAVIOR,"hover-activate",Zh),bt.add("behavior-hover-activate")),bt.has("behavior-auto-adapt-label")||(re(Kt.BEHAVIOR,"auto-adapt-label",Lh),bt.add("behavior-auto-adapt-label")),bt.has("behavior-collapse-expand-node")||(re(Kt.BEHAVIOR,"collapse-expand-node",_u),bt.add("behavior-collapse-expand-node")),bt.has("behavior-collapse-expand-combo")||(re(Kt.BEHAVIOR,"collapse-expand-combo",_u),bt.add("behavior-collapse-expand-combo")),bt.has("node-circle")||(re(Kt.NODE,"circle",zh),bt.add("node-circle")),bt.has("edge-line")||(re(Kt.EDGE,"line",Wh),bt.add("edge-line")),bt.has("edge-quadratic")||(re(Kt.EDGE,"quadratic",$h),bt.add("edge-quadratic")),bt.has("edge-cubic")||(re(Kt.EDGE,"cubic",fo),bt.add("edge-cubic")),bt.has("edge-cubic-horizontal")||(re(Kt.EDGE,"cubic-horizontal",Gh),bt.add("edge-cubic-horizontal")),bt.has("edge-cubic-vertical")||(re(Kt.EDGE,"cubic-vertical",Uh),bt.add("edge-cubic-vertical")),bt.has("edge-cubic-radial")||(re(Kt.EDGE,"cubic-radial",Vh),bt.add("edge-cubic-radial")),bt.has("edge-polyline")||(re(Kt.EDGE,"polyline",Yh),bt.add("edge-polyline")),bt.has("layout-force")||(re(Kt.LAYOUT,"force",S$),bt.add("layout-force")),bt.has("layout-d3-force")||(re(Kt.LAYOUT,"d3-force",Q$),bt.add("layout-d3-force")),bt.has("layout-dagre")||(re(Kt.LAYOUT,"dagre",xd),bt.add("layout-dagre")),console.log("G6 \u6269\u5C55\u6CE8\u518C\u5B8C\u6210\uFF01")};var jl={exports:{}};/**
226
+ * @license
227
+ * Lodash <https://lodash.com/>
228
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
229
+ * Released under MIT license <https://lodash.com/license>
230
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
231
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
232
+ */var IJ=jl.exports,jT;function jJ(){return jT||(jT=1,(function(n,t){(function(){var e,r="4.17.23",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,l="__lodash_placeholder__",d=1,p=2,g=4,m=1,y=2,v=1,x=2,E=4,w=8,S=16,k=32,A=64,N=128,T=256,O=512,M=30,P="...",L=800,j=16,z=1,U=2,J=3,W=1/0,at=9007199254740991,ut=17976931348623157e292,yt=NaN,kt=4294967295,It=kt-1,ee=kt>>>1,$=[["ary",N],["bind",v],["bindKey",x],["curry",w],["curryRight",S],["flip",O],["partial",k],["partialRight",A],["rearg",T]],Y="[object Arguments]",F="[object Array]",K="[object AsyncFunction]",ot="[object Boolean]",dt="[object Date]",mt="[object DOMException]",Ot="[object Error]",ne="[object Function]",Qt="[object GeneratorFunction]",_t="[object Map]",wt="[object Number]",we="[object Null]",Et="[object Object]",ze="[object Promise]",_n="[object Proxy]",zn="[object RegExp]",Je="[object Set]",Qe="[object String]",je="[object Symbol]",Fn="[object Undefined]",sn="[object WeakMap]",Cs="[object WeakSet]",Zr="[object ArrayBuffer]",On="[object DataView]",Yi="[object Float32Array]",bo="[object Float64Array]",Ns="[object Int8Array]",xo="[object Int16Array]",pr="[object Int32Array]",jr="[object Uint8Array]",Bd="[object Uint8ClampedArray]",zd="[object Uint16Array]",Fd="[object Uint32Array]",O6=/\b__p \+= '';/g,P6=/\b(__p \+=) '' \+/g,R6=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mx=/&(?:amp|lt|gt|quot|#39);/g,yx=/[&<>"']/g,D6=RegExp(mx.source),L6=RegExp(yx.source),I6=/<%-([\s\S]+?)%>/g,j6=/<%([\s\S]+?)%>/g,bx=/<%=([\s\S]+?)%>/g,B6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z6=/^\w*$/,F6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gd=/[\\^$.*+?()[\]{}|]/g,G6=RegExp(Gd.source),Vd=/^\s+/,V6=/\s/,U6=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W6=/\{\n\/\* \[wrapped with (.+)\] \*/,Y6=/,? & /,$6=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,H6=/[()=,{}\[\]\/\s]/,X6=/\\(\\)?/g,q6=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xx=/\w*$/,K6=/^[-+]0x[0-9a-f]+$/i,Z6=/^0b[01]+$/i,J6=/^\[object .+?Constructor\]$/,Q6=/^0o[0-7]+$/i,tR=/^(?:0|[1-9]\d*)$/,eR=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zu=/($^)/,nR=/['\n\r\u2028\u2029\\]/g,Ju="\\ud800-\\udfff",rR="\\u0300-\\u036f",iR="\\ufe20-\\ufe2f",aR="\\u20d0-\\u20ff",Ex=rR+iR+aR,wx="\\u2700-\\u27bf",kx="a-z\\xdf-\\xf6\\xf8-\\xff",oR="\\xac\\xb1\\xd7\\xf7",sR="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uR="\\u2000-\\u206f",cR=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ax="A-Z\\xc0-\\xd6\\xd8-\\xde",Sx="\\ufe0e\\ufe0f",Cx=oR+sR+uR+cR,Ud="['\u2019]",lR="["+Ju+"]",Nx="["+Cx+"]",Qu="["+Ex+"]",Tx="\\d+",hR="["+wx+"]",Mx="["+kx+"]",_x="[^"+Ju+Cx+Tx+wx+kx+Ax+"]",Wd="\\ud83c[\\udffb-\\udfff]",dR="(?:"+Qu+"|"+Wd+")",Ox="[^"+Ju+"]",Yd="(?:\\ud83c[\\udde6-\\uddff]){2}",$d="[\\ud800-\\udbff][\\udc00-\\udfff]",Eo="["+Ax+"]",Px="\\u200d",Rx="(?:"+Mx+"|"+_x+")",fR="(?:"+Eo+"|"+_x+")",Dx="(?:"+Ud+"(?:d|ll|m|re|s|t|ve))?",Lx="(?:"+Ud+"(?:D|LL|M|RE|S|T|VE))?",Ix=dR+"?",jx="["+Sx+"]?",pR="(?:"+Px+"(?:"+[Ox,Yd,$d].join("|")+")"+jx+Ix+")*",gR="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vR="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bx=jx+Ix+pR,mR="(?:"+[hR,Yd,$d].join("|")+")"+Bx,yR="(?:"+[Ox+Qu+"?",Qu,Yd,$d,lR].join("|")+")",bR=RegExp(Ud,"g"),xR=RegExp(Qu,"g"),Hd=RegExp(Wd+"(?="+Wd+")|"+yR+Bx,"g"),ER=RegExp([Eo+"?"+Mx+"+"+Dx+"(?="+[Nx,Eo,"$"].join("|")+")",fR+"+"+Lx+"(?="+[Nx,Eo+Rx,"$"].join("|")+")",Eo+"?"+Rx+"+"+Dx,Eo+"+"+Lx,vR,gR,Tx,mR].join("|"),"g"),wR=RegExp("["+Px+Ju+Ex+Sx+"]"),kR=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,AR=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],SR=-1,ke={};ke[Yi]=ke[bo]=ke[Ns]=ke[xo]=ke[pr]=ke[jr]=ke[Bd]=ke[zd]=ke[Fd]=!0,ke[Y]=ke[F]=ke[Zr]=ke[ot]=ke[On]=ke[dt]=ke[Ot]=ke[ne]=ke[_t]=ke[wt]=ke[Et]=ke[zn]=ke[Je]=ke[Qe]=ke[sn]=!1;var xe={};xe[Y]=xe[F]=xe[Zr]=xe[On]=xe[ot]=xe[dt]=xe[Yi]=xe[bo]=xe[Ns]=xe[xo]=xe[pr]=xe[_t]=xe[wt]=xe[Et]=xe[zn]=xe[Je]=xe[Qe]=xe[je]=xe[jr]=xe[Bd]=xe[zd]=xe[Fd]=!0,xe[Ot]=xe[ne]=xe[sn]=!1;var CR={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},NR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},TR={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},MR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_R=parseFloat,OR=parseInt,zx=typeof oa=="object"&&oa&&oa.Object===Object&&oa,PR=typeof self=="object"&&self&&self.Object===Object&&self,pn=zx||PR||Function("return this")(),Xd=t&&!t.nodeType&&t,Na=Xd&&!0&&n&&!n.nodeType&&n,Fx=Na&&Na.exports===Xd,qd=Fx&&zx.process,gr=(function(){try{var G=Na&&Na.require&&Na.require("util").types;return G||qd&&qd.binding&&qd.binding("util")}catch{}})(),Gx=gr&&gr.isArrayBuffer,Vx=gr&&gr.isDate,Ux=gr&&gr.isMap,Wx=gr&&gr.isRegExp,Yx=gr&&gr.isSet,$x=gr&&gr.isTypedArray;function tr(G,q,H){switch(H.length){case 0:return G.call(q);case 1:return G.call(q,H[0]);case 2:return G.call(q,H[0],H[1]);case 3:return G.call(q,H[0],H[1],H[2])}return G.apply(q,H)}function RR(G,q,H,vt){for(var Rt=-1,ie=G==null?0:G.length;++Rt<ie;){var tn=G[Rt];q(vt,tn,H(tn),G)}return vt}function vr(G,q){for(var H=-1,vt=G==null?0:G.length;++H<vt&&q(G[H],H,G)!==!1;);return G}function DR(G,q){for(var H=G==null?0:G.length;H--&&q(G[H],H,G)!==!1;);return G}function Hx(G,q){for(var H=-1,vt=G==null?0:G.length;++H<vt;)if(!q(G[H],H,G))return!1;return!0}function $i(G,q){for(var H=-1,vt=G==null?0:G.length,Rt=0,ie=[];++H<vt;){var tn=G[H];q(tn,H,G)&&(ie[Rt++]=tn)}return ie}function tc(G,q){var H=G==null?0:G.length;return!!H&&wo(G,q,0)>-1}function Kd(G,q,H){for(var vt=-1,Rt=G==null?0:G.length;++vt<Rt;)if(H(q,G[vt]))return!0;return!1}function _e(G,q){for(var H=-1,vt=G==null?0:G.length,Rt=Array(vt);++H<vt;)Rt[H]=q(G[H],H,G);return Rt}function Hi(G,q){for(var H=-1,vt=q.length,Rt=G.length;++H<vt;)G[Rt+H]=q[H];return G}function Zd(G,q,H,vt){var Rt=-1,ie=G==null?0:G.length;for(vt&&ie&&(H=G[++Rt]);++Rt<ie;)H=q(H,G[Rt],Rt,G);return H}function LR(G,q,H,vt){var Rt=G==null?0:G.length;for(vt&&Rt&&(H=G[--Rt]);Rt--;)H=q(H,G[Rt],Rt,G);return H}function Jd(G,q){for(var H=-1,vt=G==null?0:G.length;++H<vt;)if(q(G[H],H,G))return!0;return!1}var IR=Qd("length");function jR(G){return G.split("")}function BR(G){return G.match($6)||[]}function Xx(G,q,H){var vt;return H(G,function(Rt,ie,tn){if(q(Rt,ie,tn))return vt=ie,!1}),vt}function ec(G,q,H,vt){for(var Rt=G.length,ie=H+(vt?1:-1);vt?ie--:++ie<Rt;)if(q(G[ie],ie,G))return ie;return-1}function wo(G,q,H){return q===q?KR(G,q,H):ec(G,qx,H)}function zR(G,q,H,vt){for(var Rt=H-1,ie=G.length;++Rt<ie;)if(vt(G[Rt],q))return Rt;return-1}function qx(G){return G!==G}function Kx(G,q){var H=G==null?0:G.length;return H?ef(G,q)/H:yt}function Qd(G){return function(q){return q==null?e:q[G]}}function tf(G){return function(q){return G==null?e:G[q]}}function Zx(G,q,H,vt,Rt){return Rt(G,function(ie,tn,ge){H=vt?(vt=!1,ie):q(H,ie,tn,ge)}),H}function FR(G,q){var H=G.length;for(G.sort(q);H--;)G[H]=G[H].value;return G}function ef(G,q){for(var H,vt=-1,Rt=G.length;++vt<Rt;){var ie=q(G[vt]);ie!==e&&(H=H===e?ie:H+ie)}return H}function nf(G,q){for(var H=-1,vt=Array(G);++H<G;)vt[H]=q(H);return vt}function GR(G,q){return _e(q,function(H){return[H,G[H]]})}function Jx(G){return G&&G.slice(0,nE(G)+1).replace(Vd,"")}function er(G){return function(q){return G(q)}}function rf(G,q){return _e(q,function(H){return G[H]})}function Ts(G,q){return G.has(q)}function Qx(G,q){for(var H=-1,vt=G.length;++H<vt&&wo(q,G[H],0)>-1;);return H}function tE(G,q){for(var H=G.length;H--&&wo(q,G[H],0)>-1;);return H}function VR(G,q){for(var H=G.length,vt=0;H--;)G[H]===q&&++vt;return vt}var UR=tf(CR),WR=tf(NR);function YR(G){return"\\"+MR[G]}function $R(G,q){return G==null?e:G[q]}function ko(G){return wR.test(G)}function HR(G){return kR.test(G)}function XR(G){for(var q,H=[];!(q=G.next()).done;)H.push(q.value);return H}function af(G){var q=-1,H=Array(G.size);return G.forEach(function(vt,Rt){H[++q]=[Rt,vt]}),H}function eE(G,q){return function(H){return G(q(H))}}function Xi(G,q){for(var H=-1,vt=G.length,Rt=0,ie=[];++H<vt;){var tn=G[H];(tn===q||tn===l)&&(G[H]=l,ie[Rt++]=H)}return ie}function nc(G){var q=-1,H=Array(G.size);return G.forEach(function(vt){H[++q]=vt}),H}function qR(G){var q=-1,H=Array(G.size);return G.forEach(function(vt){H[++q]=[vt,vt]}),H}function KR(G,q,H){for(var vt=H-1,Rt=G.length;++vt<Rt;)if(G[vt]===q)return vt;return-1}function ZR(G,q,H){for(var vt=H+1;vt--;)if(G[vt]===q)return vt;return vt}function Ao(G){return ko(G)?QR(G):IR(G)}function Br(G){return ko(G)?tD(G):jR(G)}function nE(G){for(var q=G.length;q--&&V6.test(G.charAt(q)););return q}var JR=tf(TR);function QR(G){for(var q=Hd.lastIndex=0;Hd.test(G);)++q;return q}function tD(G){return G.match(Hd)||[]}function eD(G){return G.match(ER)||[]}var nD=(function G(q){q=q==null?pn:So.defaults(pn.Object(),q,So.pick(pn,AR));var H=q.Array,vt=q.Date,Rt=q.Error,ie=q.Function,tn=q.Math,ge=q.Object,of=q.RegExp,rD=q.String,mr=q.TypeError,rc=H.prototype,iD=ie.prototype,Co=ge.prototype,ic=q["__core-js_shared__"],ac=iD.toString,oe=Co.hasOwnProperty,aD=0,rE=(function(){var h=/[^.]+$/.exec(ic&&ic.keys&&ic.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""})(),oc=Co.toString,oD=ac.call(ge),sD=pn._,uD=of("^"+ac.call(oe).replace(Gd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sc=Fx?q.Buffer:e,qi=q.Symbol,uc=q.Uint8Array,iE=sc?sc.allocUnsafe:e,cc=eE(ge.getPrototypeOf,ge),aE=ge.create,oE=Co.propertyIsEnumerable,lc=rc.splice,sE=qi?qi.isConcatSpreadable:e,Ms=qi?qi.iterator:e,Ta=qi?qi.toStringTag:e,hc=(function(){try{var h=Ra(ge,"defineProperty");return h({},"",{}),h}catch{}})(),cD=q.clearTimeout!==pn.clearTimeout&&q.clearTimeout,lD=vt&&vt.now!==pn.Date.now&&vt.now,hD=q.setTimeout!==pn.setTimeout&&q.setTimeout,dc=tn.ceil,fc=tn.floor,sf=ge.getOwnPropertySymbols,dD=sc?sc.isBuffer:e,uE=q.isFinite,fD=rc.join,pD=eE(ge.keys,ge),en=tn.max,bn=tn.min,gD=vt.now,vD=q.parseInt,cE=tn.random,mD=rc.reverse,uf=Ra(q,"DataView"),_s=Ra(q,"Map"),cf=Ra(q,"Promise"),No=Ra(q,"Set"),Os=Ra(q,"WeakMap"),Ps=Ra(ge,"create"),pc=Os&&new Os,To={},yD=Da(uf),bD=Da(_s),xD=Da(cf),ED=Da(No),wD=Da(Os),gc=qi?qi.prototype:e,Rs=gc?gc.valueOf:e,lE=gc?gc.toString:e;function R(h){if(Be(h)&&!jt(h)&&!(h instanceof Zt)){if(h instanceof yr)return h;if(oe.call(h,"__wrapped__"))return hw(h)}return new yr(h)}var Mo=(function(){function h(){}return function(f){if(!De(f))return{};if(aE)return aE(f);h.prototype=f;var b=new h;return h.prototype=e,b}})();function vc(){}function yr(h,f){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=e}R.templateSettings={escape:I6,evaluate:j6,interpolate:bx,variable:"",imports:{_:R}},R.prototype=vc.prototype,R.prototype.constructor=R,yr.prototype=Mo(vc.prototype),yr.prototype.constructor=yr;function Zt(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=kt,this.__views__=[]}function kD(){var h=new Zt(this.__wrapped__);return h.__actions__=Gn(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=Gn(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=Gn(this.__views__),h}function AD(){if(this.__filtered__){var h=new Zt(this);h.__dir__=-1,h.__filtered__=!0}else h=this.clone(),h.__dir__*=-1;return h}function SD(){var h=this.__wrapped__.value(),f=this.__dir__,b=jt(h),C=f<0,_=b?h.length:0,D=jL(0,_,this.__views__),I=D.start,B=D.end,V=B-I,Q=C?B:I-1,tt=this.__iteratees__,it=tt.length,pt=0,xt=bn(V,this.__takeCount__);if(!b||!C&&_==V&&xt==V)return DE(h,this.__actions__);var Ct=[];t:for(;V--&&pt<xt;){Q+=f;for(var Vt=-1,Nt=h[Q];++Vt<it;){var qt=tt[Vt],Jt=qt.iteratee,ir=qt.type,Dn=Jt(Nt);if(ir==U)Nt=Dn;else if(!Dn){if(ir==z)continue t;break t}}Ct[pt++]=Nt}return Ct}Zt.prototype=Mo(vc.prototype),Zt.prototype.constructor=Zt;function Ma(h){var f=-1,b=h==null?0:h.length;for(this.clear();++f<b;){var C=h[f];this.set(C[0],C[1])}}function CD(){this.__data__=Ps?Ps(null):{},this.size=0}function ND(h){var f=this.has(h)&&delete this.__data__[h];return this.size-=f?1:0,f}function TD(h){var f=this.__data__;if(Ps){var b=f[h];return b===u?e:b}return oe.call(f,h)?f[h]:e}function MD(h){var f=this.__data__;return Ps?f[h]!==e:oe.call(f,h)}function _D(h,f){var b=this.__data__;return this.size+=this.has(h)?0:1,b[h]=Ps&&f===e?u:f,this}Ma.prototype.clear=CD,Ma.prototype.delete=ND,Ma.prototype.get=TD,Ma.prototype.has=MD,Ma.prototype.set=_D;function Ei(h){var f=-1,b=h==null?0:h.length;for(this.clear();++f<b;){var C=h[f];this.set(C[0],C[1])}}function OD(){this.__data__=[],this.size=0}function PD(h){var f=this.__data__,b=mc(f,h);if(b<0)return!1;var C=f.length-1;return b==C?f.pop():lc.call(f,b,1),--this.size,!0}function RD(h){var f=this.__data__,b=mc(f,h);return b<0?e:f[b][1]}function DD(h){return mc(this.__data__,h)>-1}function LD(h,f){var b=this.__data__,C=mc(b,h);return C<0?(++this.size,b.push([h,f])):b[C][1]=f,this}Ei.prototype.clear=OD,Ei.prototype.delete=PD,Ei.prototype.get=RD,Ei.prototype.has=DD,Ei.prototype.set=LD;function wi(h){var f=-1,b=h==null?0:h.length;for(this.clear();++f<b;){var C=h[f];this.set(C[0],C[1])}}function ID(){this.size=0,this.__data__={hash:new Ma,map:new(_s||Ei),string:new Ma}}function jD(h){var f=Mc(this,h).delete(h);return this.size-=f?1:0,f}function BD(h){return Mc(this,h).get(h)}function zD(h){return Mc(this,h).has(h)}function FD(h,f){var b=Mc(this,h),C=b.size;return b.set(h,f),this.size+=b.size==C?0:1,this}wi.prototype.clear=ID,wi.prototype.delete=jD,wi.prototype.get=BD,wi.prototype.has=zD,wi.prototype.set=FD;function _a(h){var f=-1,b=h==null?0:h.length;for(this.__data__=new wi;++f<b;)this.add(h[f])}function GD(h){return this.__data__.set(h,u),this}function VD(h){return this.__data__.has(h)}_a.prototype.add=_a.prototype.push=GD,_a.prototype.has=VD;function zr(h){var f=this.__data__=new Ei(h);this.size=f.size}function UD(){this.__data__=new Ei,this.size=0}function WD(h){var f=this.__data__,b=f.delete(h);return this.size=f.size,b}function YD(h){return this.__data__.get(h)}function $D(h){return this.__data__.has(h)}function HD(h,f){var b=this.__data__;if(b instanceof Ei){var C=b.__data__;if(!_s||C.length<i-1)return C.push([h,f]),this.size=++b.size,this;b=this.__data__=new wi(C)}return b.set(h,f),this.size=b.size,this}zr.prototype.clear=UD,zr.prototype.delete=WD,zr.prototype.get=YD,zr.prototype.has=$D,zr.prototype.set=HD;function hE(h,f){var b=jt(h),C=!b&&La(h),_=!b&&!C&&ta(h),D=!b&&!C&&!_&&Ro(h),I=b||C||_||D,B=I?nf(h.length,rD):[],V=B.length;for(var Q in h)(f||oe.call(h,Q))&&!(I&&(Q=="length"||_&&(Q=="offset"||Q=="parent")||D&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Ci(Q,V)))&&B.push(Q);return B}function dE(h){var f=h.length;return f?h[xf(0,f-1)]:e}function XD(h,f){return _c(Gn(h),Oa(f,0,h.length))}function qD(h){return _c(Gn(h))}function lf(h,f,b){(b!==e&&!Fr(h[f],b)||b===e&&!(f in h))&&ki(h,f,b)}function Ds(h,f,b){var C=h[f];(!(oe.call(h,f)&&Fr(C,b))||b===e&&!(f in h))&&ki(h,f,b)}function mc(h,f){for(var b=h.length;b--;)if(Fr(h[b][0],f))return b;return-1}function KD(h,f,b,C){return Ki(h,function(_,D,I){f(C,_,b(_),I)}),C}function fE(h,f){return h&&Qr(f,un(f),h)}function ZD(h,f){return h&&Qr(f,Un(f),h)}function ki(h,f,b){f=="__proto__"&&hc?hc(h,f,{configurable:!0,enumerable:!0,value:b,writable:!0}):h[f]=b}function hf(h,f){for(var b=-1,C=f.length,_=H(C),D=h==null;++b<C;)_[b]=D?e:Yf(h,f[b]);return _}function Oa(h,f,b){return h===h&&(b!==e&&(h=h<=b?h:b),f!==e&&(h=h>=f?h:f)),h}function br(h,f,b,C,_,D){var I,B=f&d,V=f&p,Q=f&g;if(b&&(I=_?b(h,C,_,D):b(h)),I!==e)return I;if(!De(h))return h;var tt=jt(h);if(tt){if(I=zL(h),!B)return Gn(h,I)}else{var it=xn(h),pt=it==ne||it==Qt;if(ta(h))return jE(h,B);if(it==Et||it==Y||pt&&!_){if(I=V||pt?{}:nw(h),!B)return V?TL(h,ZD(I,h)):NL(h,fE(I,h))}else{if(!xe[it])return _?h:{};I=FL(h,it,B)}}D||(D=new zr);var xt=D.get(h);if(xt)return xt;D.set(h,I),Ow(h)?h.forEach(function(Nt){I.add(br(Nt,f,b,Nt,h,D))}):Mw(h)&&h.forEach(function(Nt,qt){I.set(qt,br(Nt,f,b,qt,h,D))});var Ct=Q?V?Of:_f:V?Un:un,Vt=tt?e:Ct(h);return vr(Vt||h,function(Nt,qt){Vt&&(qt=Nt,Nt=h[qt]),Ds(I,qt,br(Nt,f,b,qt,h,D))}),I}function JD(h){var f=un(h);return function(b){return pE(b,h,f)}}function pE(h,f,b){var C=b.length;if(h==null)return!C;for(h=ge(h);C--;){var _=b[C],D=f[_],I=h[_];if(I===e&&!(_ in h)||!D(I))return!1}return!0}function gE(h,f,b){if(typeof h!="function")throw new mr(o);return Gs(function(){h.apply(e,b)},f)}function Ls(h,f,b,C){var _=-1,D=tc,I=!0,B=h.length,V=[],Q=f.length;if(!B)return V;b&&(f=_e(f,er(b))),C?(D=Kd,I=!1):f.length>=i&&(D=Ts,I=!1,f=new _a(f));t:for(;++_<B;){var tt=h[_],it=b==null?tt:b(tt);if(tt=C||tt!==0?tt:0,I&&it===it){for(var pt=Q;pt--;)if(f[pt]===it)continue t;V.push(tt)}else D(f,it,C)||V.push(tt)}return V}var Ki=VE(Jr),vE=VE(ff,!0);function QD(h,f){var b=!0;return Ki(h,function(C,_,D){return b=!!f(C,_,D),b}),b}function yc(h,f,b){for(var C=-1,_=h.length;++C<_;){var D=h[C],I=f(D);if(I!=null&&(B===e?I===I&&!rr(I):b(I,B)))var B=I,V=D}return V}function tL(h,f,b,C){var _=h.length;for(b=Ft(b),b<0&&(b=-b>_?0:_+b),C=C===e||C>_?_:Ft(C),C<0&&(C+=_),C=b>C?0:Rw(C);b<C;)h[b++]=f;return h}function mE(h,f){var b=[];return Ki(h,function(C,_,D){f(C,_,D)&&b.push(C)}),b}function gn(h,f,b,C,_){var D=-1,I=h.length;for(b||(b=VL),_||(_=[]);++D<I;){var B=h[D];f>0&&b(B)?f>1?gn(B,f-1,b,C,_):Hi(_,B):C||(_[_.length]=B)}return _}var df=UE(),yE=UE(!0);function Jr(h,f){return h&&df(h,f,un)}function ff(h,f){return h&&yE(h,f,un)}function bc(h,f){return $i(f,function(b){return Ni(h[b])})}function Pa(h,f){f=Ji(f,h);for(var b=0,C=f.length;h!=null&&b<C;)h=h[ti(f[b++])];return b&&b==C?h:e}function bE(h,f,b){var C=f(h);return jt(h)?C:Hi(C,b(h))}function Pn(h){return h==null?h===e?Fn:we:Ta&&Ta in ge(h)?IL(h):qL(h)}function pf(h,f){return h>f}function eL(h,f){return h!=null&&oe.call(h,f)}function nL(h,f){return h!=null&&f in ge(h)}function rL(h,f,b){return h>=bn(f,b)&&h<en(f,b)}function gf(h,f,b){for(var C=b?Kd:tc,_=h[0].length,D=h.length,I=D,B=H(D),V=1/0,Q=[];I--;){var tt=h[I];I&&f&&(tt=_e(tt,er(f))),V=bn(tt.length,V),B[I]=!b&&(f||_>=120&&tt.length>=120)?new _a(I&&tt):e}tt=h[0];var it=-1,pt=B[0];t:for(;++it<_&&Q.length<V;){var xt=tt[it],Ct=f?f(xt):xt;if(xt=b||xt!==0?xt:0,!(pt?Ts(pt,Ct):C(Q,Ct,b))){for(I=D;--I;){var Vt=B[I];if(!(Vt?Ts(Vt,Ct):C(h[I],Ct,b)))continue t}pt&&pt.push(Ct),Q.push(xt)}}return Q}function iL(h,f,b,C){return Jr(h,function(_,D,I){f(C,b(_),D,I)}),C}function Is(h,f,b){f=Ji(f,h),h=ow(h,f);var C=h==null?h:h[ti(Er(f))];return C==null?e:tr(C,h,b)}function xE(h){return Be(h)&&Pn(h)==Y}function aL(h){return Be(h)&&Pn(h)==Zr}function oL(h){return Be(h)&&Pn(h)==dt}function js(h,f,b,C,_){return h===f?!0:h==null||f==null||!Be(h)&&!Be(f)?h!==h&&f!==f:sL(h,f,b,C,js,_)}function sL(h,f,b,C,_,D){var I=jt(h),B=jt(f),V=I?F:xn(h),Q=B?F:xn(f);V=V==Y?Et:V,Q=Q==Y?Et:Q;var tt=V==Et,it=Q==Et,pt=V==Q;if(pt&&ta(h)){if(!ta(f))return!1;I=!0,tt=!1}if(pt&&!tt)return D||(D=new zr),I||Ro(h)?QE(h,f,b,C,_,D):DL(h,f,V,b,C,_,D);if(!(b&m)){var xt=tt&&oe.call(h,"__wrapped__"),Ct=it&&oe.call(f,"__wrapped__");if(xt||Ct){var Vt=xt?h.value():h,Nt=Ct?f.value():f;return D||(D=new zr),_(Vt,Nt,b,C,D)}}return pt?(D||(D=new zr),LL(h,f,b,C,_,D)):!1}function uL(h){return Be(h)&&xn(h)==_t}function vf(h,f,b,C){var _=b.length,D=_,I=!C;if(h==null)return!D;for(h=ge(h);_--;){var B=b[_];if(I&&B[2]?B[1]!==h[B[0]]:!(B[0]in h))return!1}for(;++_<D;){B=b[_];var V=B[0],Q=h[V],tt=B[1];if(I&&B[2]){if(Q===e&&!(V in h))return!1}else{var it=new zr;if(C)var pt=C(Q,tt,V,h,f,it);if(!(pt===e?js(tt,Q,m|y,C,it):pt))return!1}}return!0}function EE(h){if(!De(h)||WL(h))return!1;var f=Ni(h)?uD:J6;return f.test(Da(h))}function cL(h){return Be(h)&&Pn(h)==zn}function lL(h){return Be(h)&&xn(h)==Je}function hL(h){return Be(h)&&Ic(h.length)&&!!ke[Pn(h)]}function wE(h){return typeof h=="function"?h:h==null?Wn:typeof h=="object"?jt(h)?SE(h[0],h[1]):AE(h):Ww(h)}function mf(h){if(!Fs(h))return pD(h);var f=[];for(var b in ge(h))oe.call(h,b)&&b!="constructor"&&f.push(b);return f}function dL(h){if(!De(h))return XL(h);var f=Fs(h),b=[];for(var C in h)C=="constructor"&&(f||!oe.call(h,C))||b.push(C);return b}function yf(h,f){return h<f}function kE(h,f){var b=-1,C=Vn(h)?H(h.length):[];return Ki(h,function(_,D,I){C[++b]=f(_,D,I)}),C}function AE(h){var f=Rf(h);return f.length==1&&f[0][2]?iw(f[0][0],f[0][1]):function(b){return b===h||vf(b,h,f)}}function SE(h,f){return Lf(h)&&rw(f)?iw(ti(h),f):function(b){var C=Yf(b,h);return C===e&&C===f?$f(b,h):js(f,C,m|y)}}function xc(h,f,b,C,_){h!==f&&df(f,function(D,I){if(_||(_=new zr),De(D))fL(h,f,I,b,xc,C,_);else{var B=C?C(jf(h,I),D,I+"",h,f,_):e;B===e&&(B=D),lf(h,I,B)}},Un)}function fL(h,f,b,C,_,D,I){var B=jf(h,b),V=jf(f,b),Q=I.get(V);if(Q){lf(h,b,Q);return}var tt=D?D(B,V,b+"",h,f,I):e,it=tt===e;if(it){var pt=jt(V),xt=!pt&&ta(V),Ct=!pt&&!xt&&Ro(V);tt=V,pt||xt||Ct?jt(B)?tt=B:Fe(B)?tt=Gn(B):xt?(it=!1,tt=jE(V,!0)):Ct?(it=!1,tt=BE(V,!0)):tt=[]:Vs(V)||La(V)?(tt=B,La(B)?tt=Dw(B):(!De(B)||Ni(B))&&(tt=nw(V))):it=!1}it&&(I.set(V,tt),_(tt,V,C,D,I),I.delete(V)),lf(h,b,tt)}function CE(h,f){var b=h.length;if(b)return f+=f<0?b:0,Ci(f,b)?h[f]:e}function NE(h,f,b){f.length?f=_e(f,function(D){return jt(D)?function(I){return Pa(I,D.length===1?D[0]:D)}:D}):f=[Wn];var C=-1;f=_e(f,er(At()));var _=kE(h,function(D,I,B){var V=_e(f,function(Q){return Q(D)});return{criteria:V,index:++C,value:D}});return FR(_,function(D,I){return CL(D,I,b)})}function pL(h,f){return TE(h,f,function(b,C){return $f(h,C)})}function TE(h,f,b){for(var C=-1,_=f.length,D={};++C<_;){var I=f[C],B=Pa(h,I);b(B,I)&&Bs(D,Ji(I,h),B)}return D}function gL(h){return function(f){return Pa(f,h)}}function bf(h,f,b,C){var _=C?zR:wo,D=-1,I=f.length,B=h;for(h===f&&(f=Gn(f)),b&&(B=_e(h,er(b)));++D<I;)for(var V=0,Q=f[D],tt=b?b(Q):Q;(V=_(B,tt,V,C))>-1;)B!==h&&lc.call(B,V,1),lc.call(h,V,1);return h}function ME(h,f){for(var b=h?f.length:0,C=b-1;b--;){var _=f[b];if(b==C||_!==D){var D=_;Ci(_)?lc.call(h,_,1):kf(h,_)}}return h}function xf(h,f){return h+fc(cE()*(f-h+1))}function vL(h,f,b,C){for(var _=-1,D=en(dc((f-h)/(b||1)),0),I=H(D);D--;)I[C?D:++_]=h,h+=b;return I}function Ef(h,f){var b="";if(!h||f<1||f>at)return b;do f%2&&(b+=h),f=fc(f/2),f&&(h+=h);while(f);return b}function $t(h,f){return Bf(aw(h,f,Wn),h+"")}function mL(h){return dE(Do(h))}function yL(h,f){var b=Do(h);return _c(b,Oa(f,0,b.length))}function Bs(h,f,b,C){if(!De(h))return h;f=Ji(f,h);for(var _=-1,D=f.length,I=D-1,B=h;B!=null&&++_<D;){var V=ti(f[_]),Q=b;if(V==="__proto__"||V==="constructor"||V==="prototype")return h;if(_!=I){var tt=B[V];Q=C?C(tt,V,B):e,Q===e&&(Q=De(tt)?tt:Ci(f[_+1])?[]:{})}Ds(B,V,Q),B=B[V]}return h}var _E=pc?function(h,f){return pc.set(h,f),h}:Wn,bL=hc?function(h,f){return hc(h,"toString",{configurable:!0,enumerable:!1,value:Xf(f),writable:!0})}:Wn;function xL(h){return _c(Do(h))}function xr(h,f,b){var C=-1,_=h.length;f<0&&(f=-f>_?0:_+f),b=b>_?_:b,b<0&&(b+=_),_=f>b?0:b-f>>>0,f>>>=0;for(var D=H(_);++C<_;)D[C]=h[C+f];return D}function EL(h,f){var b;return Ki(h,function(C,_,D){return b=f(C,_,D),!b}),!!b}function Ec(h,f,b){var C=0,_=h==null?C:h.length;if(typeof f=="number"&&f===f&&_<=ee){for(;C<_;){var D=C+_>>>1,I=h[D];I!==null&&!rr(I)&&(b?I<=f:I<f)?C=D+1:_=D}return _}return wf(h,f,Wn,b)}function wf(h,f,b,C){var _=0,D=h==null?0:h.length;if(D===0)return 0;f=b(f);for(var I=f!==f,B=f===null,V=rr(f),Q=f===e;_<D;){var tt=fc((_+D)/2),it=b(h[tt]),pt=it!==e,xt=it===null,Ct=it===it,Vt=rr(it);if(I)var Nt=C||Ct;else Q?Nt=Ct&&(C||pt):B?Nt=Ct&&pt&&(C||!xt):V?Nt=Ct&&pt&&!xt&&(C||!Vt):xt||Vt?Nt=!1:Nt=C?it<=f:it<f;Nt?_=tt+1:D=tt}return bn(D,It)}function OE(h,f){for(var b=-1,C=h.length,_=0,D=[];++b<C;){var I=h[b],B=f?f(I):I;if(!b||!Fr(B,V)){var V=B;D[_++]=I===0?0:I}}return D}function PE(h){return typeof h=="number"?h:rr(h)?yt:+h}function nr(h){if(typeof h=="string")return h;if(jt(h))return _e(h,nr)+"";if(rr(h))return lE?lE.call(h):"";var f=h+"";return f=="0"&&1/h==-W?"-0":f}function Zi(h,f,b){var C=-1,_=tc,D=h.length,I=!0,B=[],V=B;if(b)I=!1,_=Kd;else if(D>=i){var Q=f?null:PL(h);if(Q)return nc(Q);I=!1,_=Ts,V=new _a}else V=f?[]:B;t:for(;++C<D;){var tt=h[C],it=f?f(tt):tt;if(tt=b||tt!==0?tt:0,I&&it===it){for(var pt=V.length;pt--;)if(V[pt]===it)continue t;f&&V.push(it),B.push(tt)}else _(V,it,b)||(V!==B&&V.push(it),B.push(tt))}return B}function kf(h,f){f=Ji(f,h);var b=-1,C=f.length;if(!C)return!0;for(var _=h==null||typeof h!="object"&&typeof h!="function";++b<C;){var D=f[b];if(typeof D=="string"){if(D==="__proto__"&&!oe.call(h,"__proto__"))return!1;if(D==="constructor"&&b+1<C&&typeof f[b+1]=="string"&&f[b+1]==="prototype"){if(_&&b===0)continue;return!1}}}var I=ow(h,f);return I==null||delete I[ti(Er(f))]}function RE(h,f,b,C){return Bs(h,f,b(Pa(h,f)),C)}function wc(h,f,b,C){for(var _=h.length,D=C?_:-1;(C?D--:++D<_)&&f(h[D],D,h););return b?xr(h,C?0:D,C?D+1:_):xr(h,C?D+1:0,C?_:D)}function DE(h,f){var b=h;return b instanceof Zt&&(b=b.value()),Zd(f,function(C,_){return _.func.apply(_.thisArg,Hi([C],_.args))},b)}function Af(h,f,b){var C=h.length;if(C<2)return C?Zi(h[0]):[];for(var _=-1,D=H(C);++_<C;)for(var I=h[_],B=-1;++B<C;)B!=_&&(D[_]=Ls(D[_]||I,h[B],f,b));return Zi(gn(D,1),f,b)}function LE(h,f,b){for(var C=-1,_=h.length,D=f.length,I={};++C<_;){var B=C<D?f[C]:e;b(I,h[C],B)}return I}function Sf(h){return Fe(h)?h:[]}function Cf(h){return typeof h=="function"?h:Wn}function Ji(h,f){return jt(h)?h:Lf(h,f)?[h]:lw(se(h))}var wL=$t;function Qi(h,f,b){var C=h.length;return b=b===e?C:b,!f&&b>=C?h:xr(h,f,b)}var IE=cD||function(h){return pn.clearTimeout(h)};function jE(h,f){if(f)return h.slice();var b=h.length,C=iE?iE(b):new h.constructor(b);return h.copy(C),C}function Nf(h){var f=new h.constructor(h.byteLength);return new uc(f).set(new uc(h)),f}function kL(h,f){var b=f?Nf(h.buffer):h.buffer;return new h.constructor(b,h.byteOffset,h.byteLength)}function AL(h){var f=new h.constructor(h.source,xx.exec(h));return f.lastIndex=h.lastIndex,f}function SL(h){return Rs?ge(Rs.call(h)):{}}function BE(h,f){var b=f?Nf(h.buffer):h.buffer;return new h.constructor(b,h.byteOffset,h.length)}function zE(h,f){if(h!==f){var b=h!==e,C=h===null,_=h===h,D=rr(h),I=f!==e,B=f===null,V=f===f,Q=rr(f);if(!B&&!Q&&!D&&h>f||D&&I&&V&&!B&&!Q||C&&I&&V||!b&&V||!_)return 1;if(!C&&!D&&!Q&&h<f||Q&&b&&_&&!C&&!D||B&&b&&_||!I&&_||!V)return-1}return 0}function CL(h,f,b){for(var C=-1,_=h.criteria,D=f.criteria,I=_.length,B=b.length;++C<I;){var V=zE(_[C],D[C]);if(V){if(C>=B)return V;var Q=b[C];return V*(Q=="desc"?-1:1)}}return h.index-f.index}function FE(h,f,b,C){for(var _=-1,D=h.length,I=b.length,B=-1,V=f.length,Q=en(D-I,0),tt=H(V+Q),it=!C;++B<V;)tt[B]=f[B];for(;++_<I;)(it||_<D)&&(tt[b[_]]=h[_]);for(;Q--;)tt[B++]=h[_++];return tt}function GE(h,f,b,C){for(var _=-1,D=h.length,I=-1,B=b.length,V=-1,Q=f.length,tt=en(D-B,0),it=H(tt+Q),pt=!C;++_<tt;)it[_]=h[_];for(var xt=_;++V<Q;)it[xt+V]=f[V];for(;++I<B;)(pt||_<D)&&(it[xt+b[I]]=h[_++]);return it}function Gn(h,f){var b=-1,C=h.length;for(f||(f=H(C));++b<C;)f[b]=h[b];return f}function Qr(h,f,b,C){var _=!b;b||(b={});for(var D=-1,I=f.length;++D<I;){var B=f[D],V=C?C(b[B],h[B],B,b,h):e;V===e&&(V=h[B]),_?ki(b,B,V):Ds(b,B,V)}return b}function NL(h,f){return Qr(h,Df(h),f)}function TL(h,f){return Qr(h,tw(h),f)}function kc(h,f){return function(b,C){var _=jt(b)?RR:KD,D=f?f():{};return _(b,h,At(C,2),D)}}function _o(h){return $t(function(f,b){var C=-1,_=b.length,D=_>1?b[_-1]:e,I=_>2?b[2]:e;for(D=h.length>3&&typeof D=="function"?(_--,D):e,I&&Rn(b[0],b[1],I)&&(D=_<3?e:D,_=1),f=ge(f);++C<_;){var B=b[C];B&&h(f,B,C,D)}return f})}function VE(h,f){return function(b,C){if(b==null)return b;if(!Vn(b))return h(b,C);for(var _=b.length,D=f?_:-1,I=ge(b);(f?D--:++D<_)&&C(I[D],D,I)!==!1;);return b}}function UE(h){return function(f,b,C){for(var _=-1,D=ge(f),I=C(f),B=I.length;B--;){var V=I[h?B:++_];if(b(D[V],V,D)===!1)break}return f}}function ML(h,f,b){var C=f&v,_=zs(h);function D(){var I=this&&this!==pn&&this instanceof D?_:h;return I.apply(C?b:this,arguments)}return D}function WE(h){return function(f){f=se(f);var b=ko(f)?Br(f):e,C=b?b[0]:f.charAt(0),_=b?Qi(b,1).join(""):f.slice(1);return C[h]()+_}}function Oo(h){return function(f){return Zd(Vw(Gw(f).replace(bR,"")),h,"")}}function zs(h){return function(){var f=arguments;switch(f.length){case 0:return new h;case 1:return new h(f[0]);case 2:return new h(f[0],f[1]);case 3:return new h(f[0],f[1],f[2]);case 4:return new h(f[0],f[1],f[2],f[3]);case 5:return new h(f[0],f[1],f[2],f[3],f[4]);case 6:return new h(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new h(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var b=Mo(h.prototype),C=h.apply(b,f);return De(C)?C:b}}function _L(h,f,b){var C=zs(h);function _(){for(var D=arguments.length,I=H(D),B=D,V=Po(_);B--;)I[B]=arguments[B];var Q=D<3&&I[0]!==V&&I[D-1]!==V?[]:Xi(I,V);if(D-=Q.length,D<b)return qE(h,f,Ac,_.placeholder,e,I,Q,e,e,b-D);var tt=this&&this!==pn&&this instanceof _?C:h;return tr(tt,this,I)}return _}function YE(h){return function(f,b,C){var _=ge(f);if(!Vn(f)){var D=At(b,3);f=un(f),b=function(B){return D(_[B],B,_)}}var I=h(f,b,C);return I>-1?_[D?f[I]:I]:e}}function $E(h){return Si(function(f){var b=f.length,C=b,_=yr.prototype.thru;for(h&&f.reverse();C--;){var D=f[C];if(typeof D!="function")throw new mr(o);if(_&&!I&&Tc(D)=="wrapper")var I=new yr([],!0)}for(C=I?C:b;++C<b;){D=f[C];var B=Tc(D),V=B=="wrapper"?Pf(D):e;V&&If(V[0])&&V[1]==(N|w|k|T)&&!V[4].length&&V[9]==1?I=I[Tc(V[0])].apply(I,V[3]):I=D.length==1&&If(D)?I[B]():I.thru(D)}return function(){var Q=arguments,tt=Q[0];if(I&&Q.length==1&&jt(tt))return I.plant(tt).value();for(var it=0,pt=b?f[it].apply(this,Q):tt;++it<b;)pt=f[it].call(this,pt);return pt}})}function Ac(h,f,b,C,_,D,I,B,V,Q){var tt=f&N,it=f&v,pt=f&x,xt=f&(w|S),Ct=f&O,Vt=pt?e:zs(h);function Nt(){for(var qt=arguments.length,Jt=H(qt),ir=qt;ir--;)Jt[ir]=arguments[ir];if(xt)var Dn=Po(Nt),ar=VR(Jt,Dn);if(C&&(Jt=FE(Jt,C,_,xt)),D&&(Jt=GE(Jt,D,I,xt)),qt-=ar,xt&&qt<Q){var Ge=Xi(Jt,Dn);return qE(h,f,Ac,Nt.placeholder,b,Jt,Ge,B,V,Q-qt)}var Gr=it?b:this,Mi=pt?Gr[h]:h;return qt=Jt.length,B?Jt=KL(Jt,B):Ct&&qt>1&&Jt.reverse(),tt&&V<qt&&(Jt.length=V),this&&this!==pn&&this instanceof Nt&&(Mi=Vt||zs(Mi)),Mi.apply(Gr,Jt)}return Nt}function HE(h,f){return function(b,C){return iL(b,h,f(C),{})}}function Sc(h,f){return function(b,C){var _;if(b===e&&C===e)return f;if(b!==e&&(_=b),C!==e){if(_===e)return C;typeof b=="string"||typeof C=="string"?(b=nr(b),C=nr(C)):(b=PE(b),C=PE(C)),_=h(b,C)}return _}}function Tf(h){return Si(function(f){return f=_e(f,er(At())),$t(function(b){var C=this;return h(f,function(_){return tr(_,C,b)})})})}function Cc(h,f){f=f===e?" ":nr(f);var b=f.length;if(b<2)return b?Ef(f,h):f;var C=Ef(f,dc(h/Ao(f)));return ko(f)?Qi(Br(C),0,h).join(""):C.slice(0,h)}function OL(h,f,b,C){var _=f&v,D=zs(h);function I(){for(var B=-1,V=arguments.length,Q=-1,tt=C.length,it=H(tt+V),pt=this&&this!==pn&&this instanceof I?D:h;++Q<tt;)it[Q]=C[Q];for(;V--;)it[Q++]=arguments[++B];return tr(pt,_?b:this,it)}return I}function XE(h){return function(f,b,C){return C&&typeof C!="number"&&Rn(f,b,C)&&(b=C=e),f=Ti(f),b===e?(b=f,f=0):b=Ti(b),C=C===e?f<b?1:-1:Ti(C),vL(f,b,C,h)}}function Nc(h){return function(f,b){return typeof f=="string"&&typeof b=="string"||(f=wr(f),b=wr(b)),h(f,b)}}function qE(h,f,b,C,_,D,I,B,V,Q){var tt=f&w,it=tt?I:e,pt=tt?e:I,xt=tt?D:e,Ct=tt?e:D;f|=tt?k:A,f&=~(tt?A:k),f&E||(f&=-4);var Vt=[h,f,_,xt,it,Ct,pt,B,V,Q],Nt=b.apply(e,Vt);return If(h)&&sw(Nt,Vt),Nt.placeholder=C,uw(Nt,h,f)}function Mf(h){var f=tn[h];return function(b,C){if(b=wr(b),C=C==null?0:bn(Ft(C),292),C&&uE(b)){var _=(se(b)+"e").split("e"),D=f(_[0]+"e"+(+_[1]+C));return _=(se(D)+"e").split("e"),+(_[0]+"e"+(+_[1]-C))}return f(b)}}var PL=No&&1/nc(new No([,-0]))[1]==W?function(h){return new No(h)}:Zf;function KE(h){return function(f){var b=xn(f);return b==_t?af(f):b==Je?qR(f):GR(f,h(f))}}function Ai(h,f,b,C,_,D,I,B){var V=f&x;if(!V&&typeof h!="function")throw new mr(o);var Q=C?C.length:0;if(Q||(f&=-97,C=_=e),I=I===e?I:en(Ft(I),0),B=B===e?B:Ft(B),Q-=_?_.length:0,f&A){var tt=C,it=_;C=_=e}var pt=V?e:Pf(h),xt=[h,f,b,C,_,tt,it,D,I,B];if(pt&&HL(xt,pt),h=xt[0],f=xt[1],b=xt[2],C=xt[3],_=xt[4],B=xt[9]=xt[9]===e?V?0:h.length:en(xt[9]-Q,0),!B&&f&(w|S)&&(f&=-25),!f||f==v)var Ct=ML(h,f,b);else f==w||f==S?Ct=_L(h,f,B):(f==k||f==(v|k))&&!_.length?Ct=OL(h,f,b,C):Ct=Ac.apply(e,xt);var Vt=pt?_E:sw;return uw(Vt(Ct,xt),h,f)}function ZE(h,f,b,C){return h===e||Fr(h,Co[b])&&!oe.call(C,b)?f:h}function JE(h,f,b,C,_,D){return De(h)&&De(f)&&(D.set(f,h),xc(h,f,e,JE,D),D.delete(f)),h}function RL(h){return Vs(h)?e:h}function QE(h,f,b,C,_,D){var I=b&m,B=h.length,V=f.length;if(B!=V&&!(I&&V>B))return!1;var Q=D.get(h),tt=D.get(f);if(Q&&tt)return Q==f&&tt==h;var it=-1,pt=!0,xt=b&y?new _a:e;for(D.set(h,f),D.set(f,h);++it<B;){var Ct=h[it],Vt=f[it];if(C)var Nt=I?C(Vt,Ct,it,f,h,D):C(Ct,Vt,it,h,f,D);if(Nt!==e){if(Nt)continue;pt=!1;break}if(xt){if(!Jd(f,function(qt,Jt){if(!Ts(xt,Jt)&&(Ct===qt||_(Ct,qt,b,C,D)))return xt.push(Jt)})){pt=!1;break}}else if(!(Ct===Vt||_(Ct,Vt,b,C,D))){pt=!1;break}}return D.delete(h),D.delete(f),pt}function DL(h,f,b,C,_,D,I){switch(b){case On:if(h.byteLength!=f.byteLength||h.byteOffset!=f.byteOffset)return!1;h=h.buffer,f=f.buffer;case Zr:return!(h.byteLength!=f.byteLength||!D(new uc(h),new uc(f)));case ot:case dt:case wt:return Fr(+h,+f);case Ot:return h.name==f.name&&h.message==f.message;case zn:case Qe:return h==f+"";case _t:var B=af;case Je:var V=C&m;if(B||(B=nc),h.size!=f.size&&!V)return!1;var Q=I.get(h);if(Q)return Q==f;C|=y,I.set(h,f);var tt=QE(B(h),B(f),C,_,D,I);return I.delete(h),tt;case je:if(Rs)return Rs.call(h)==Rs.call(f)}return!1}function LL(h,f,b,C,_,D){var I=b&m,B=_f(h),V=B.length,Q=_f(f),tt=Q.length;if(V!=tt&&!I)return!1;for(var it=V;it--;){var pt=B[it];if(!(I?pt in f:oe.call(f,pt)))return!1}var xt=D.get(h),Ct=D.get(f);if(xt&&Ct)return xt==f&&Ct==h;var Vt=!0;D.set(h,f),D.set(f,h);for(var Nt=I;++it<V;){pt=B[it];var qt=h[pt],Jt=f[pt];if(C)var ir=I?C(Jt,qt,pt,f,h,D):C(qt,Jt,pt,h,f,D);if(!(ir===e?qt===Jt||_(qt,Jt,b,C,D):ir)){Vt=!1;break}Nt||(Nt=pt=="constructor")}if(Vt&&!Nt){var Dn=h.constructor,ar=f.constructor;Dn!=ar&&"constructor"in h&&"constructor"in f&&!(typeof Dn=="function"&&Dn instanceof Dn&&typeof ar=="function"&&ar instanceof ar)&&(Vt=!1)}return D.delete(h),D.delete(f),Vt}function Si(h){return Bf(aw(h,e,pw),h+"")}function _f(h){return bE(h,un,Df)}function Of(h){return bE(h,Un,tw)}var Pf=pc?function(h){return pc.get(h)}:Zf;function Tc(h){for(var f=h.name+"",b=To[f],C=oe.call(To,f)?b.length:0;C--;){var _=b[C],D=_.func;if(D==null||D==h)return _.name}return f}function Po(h){var f=oe.call(R,"placeholder")?R:h;return f.placeholder}function At(){var h=R.iteratee||qf;return h=h===qf?wE:h,arguments.length?h(arguments[0],arguments[1]):h}function Mc(h,f){var b=h.__data__;return UL(f)?b[typeof f=="string"?"string":"hash"]:b.map}function Rf(h){for(var f=un(h),b=f.length;b--;){var C=f[b],_=h[C];f[b]=[C,_,rw(_)]}return f}function Ra(h,f){var b=$R(h,f);return EE(b)?b:e}function IL(h){var f=oe.call(h,Ta),b=h[Ta];try{h[Ta]=e;var C=!0}catch{}var _=oc.call(h);return C&&(f?h[Ta]=b:delete h[Ta]),_}var Df=sf?function(h){return h==null?[]:(h=ge(h),$i(sf(h),function(f){return oE.call(h,f)}))}:Jf,tw=sf?function(h){for(var f=[];h;)Hi(f,Df(h)),h=cc(h);return f}:Jf,xn=Pn;(uf&&xn(new uf(new ArrayBuffer(1)))!=On||_s&&xn(new _s)!=_t||cf&&xn(cf.resolve())!=ze||No&&xn(new No)!=Je||Os&&xn(new Os)!=sn)&&(xn=function(h){var f=Pn(h),b=f==Et?h.constructor:e,C=b?Da(b):"";if(C)switch(C){case yD:return On;case bD:return _t;case xD:return ze;case ED:return Je;case wD:return sn}return f});function jL(h,f,b){for(var C=-1,_=b.length;++C<_;){var D=b[C],I=D.size;switch(D.type){case"drop":h+=I;break;case"dropRight":f-=I;break;case"take":f=bn(f,h+I);break;case"takeRight":h=en(h,f-I);break}}return{start:h,end:f}}function BL(h){var f=h.match(W6);return f?f[1].split(Y6):[]}function ew(h,f,b){f=Ji(f,h);for(var C=-1,_=f.length,D=!1;++C<_;){var I=ti(f[C]);if(!(D=h!=null&&b(h,I)))break;h=h[I]}return D||++C!=_?D:(_=h==null?0:h.length,!!_&&Ic(_)&&Ci(I,_)&&(jt(h)||La(h)))}function zL(h){var f=h.length,b=new h.constructor(f);return f&&typeof h[0]=="string"&&oe.call(h,"index")&&(b.index=h.index,b.input=h.input),b}function nw(h){return typeof h.constructor=="function"&&!Fs(h)?Mo(cc(h)):{}}function FL(h,f,b){var C=h.constructor;switch(f){case Zr:return Nf(h);case ot:case dt:return new C(+h);case On:return kL(h,b);case Yi:case bo:case Ns:case xo:case pr:case jr:case Bd:case zd:case Fd:return BE(h,b);case _t:return new C;case wt:case Qe:return new C(h);case zn:return AL(h);case Je:return new C;case je:return SL(h)}}function GL(h,f){var b=f.length;if(!b)return h;var C=b-1;return f[C]=(b>1?"& ":"")+f[C],f=f.join(b>2?", ":" "),h.replace(U6,`{
233
+ /* [wrapped with `+f+`] */
234
+ `)}function VL(h){return jt(h)||La(h)||!!(sE&&h&&h[sE])}function Ci(h,f){var b=typeof h;return f=f??at,!!f&&(b=="number"||b!="symbol"&&tR.test(h))&&h>-1&&h%1==0&&h<f}function Rn(h,f,b){if(!De(b))return!1;var C=typeof f;return(C=="number"?Vn(b)&&Ci(f,b.length):C=="string"&&f in b)?Fr(b[f],h):!1}function Lf(h,f){if(jt(h))return!1;var b=typeof h;return b=="number"||b=="symbol"||b=="boolean"||h==null||rr(h)?!0:z6.test(h)||!B6.test(h)||f!=null&&h in ge(f)}function UL(h){var f=typeof h;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?h!=="__proto__":h===null}function If(h){var f=Tc(h),b=R[f];if(typeof b!="function"||!(f in Zt.prototype))return!1;if(h===b)return!0;var C=Pf(b);return!!C&&h===C[0]}function WL(h){return!!rE&&rE in h}var YL=ic?Ni:Qf;function Fs(h){var f=h&&h.constructor,b=typeof f=="function"&&f.prototype||Co;return h===b}function rw(h){return h===h&&!De(h)}function iw(h,f){return function(b){return b==null?!1:b[h]===f&&(f!==e||h in ge(b))}}function $L(h){var f=Dc(h,function(C){return b.size===c&&b.clear(),C}),b=f.cache;return f}function HL(h,f){var b=h[1],C=f[1],_=b|C,D=_<(v|x|N),I=C==N&&b==w||C==N&&b==T&&h[7].length<=f[8]||C==(N|T)&&f[7].length<=f[8]&&b==w;if(!(D||I))return h;C&v&&(h[2]=f[2],_|=b&v?0:E);var B=f[3];if(B){var V=h[3];h[3]=V?FE(V,B,f[4]):B,h[4]=V?Xi(h[3],l):f[4]}return B=f[5],B&&(V=h[5],h[5]=V?GE(V,B,f[6]):B,h[6]=V?Xi(h[5],l):f[6]),B=f[7],B&&(h[7]=B),C&N&&(h[8]=h[8]==null?f[8]:bn(h[8],f[8])),h[9]==null&&(h[9]=f[9]),h[0]=f[0],h[1]=_,h}function XL(h){var f=[];if(h!=null)for(var b in ge(h))f.push(b);return f}function qL(h){return oc.call(h)}function aw(h,f,b){return f=en(f===e?h.length-1:f,0),function(){for(var C=arguments,_=-1,D=en(C.length-f,0),I=H(D);++_<D;)I[_]=C[f+_];_=-1;for(var B=H(f+1);++_<f;)B[_]=C[_];return B[f]=b(I),tr(h,this,B)}}function ow(h,f){return f.length<2?h:Pa(h,xr(f,0,-1))}function KL(h,f){for(var b=h.length,C=bn(f.length,b),_=Gn(h);C--;){var D=f[C];h[C]=Ci(D,b)?_[D]:e}return h}function jf(h,f){if(!(f==="constructor"&&typeof h[f]=="function")&&f!="__proto__")return h[f]}var sw=cw(_E),Gs=hD||function(h,f){return pn.setTimeout(h,f)},Bf=cw(bL);function uw(h,f,b){var C=f+"";return Bf(h,GL(C,ZL(BL(C),b)))}function cw(h){var f=0,b=0;return function(){var C=gD(),_=j-(C-b);if(b=C,_>0){if(++f>=L)return arguments[0]}else f=0;return h.apply(e,arguments)}}function _c(h,f){var b=-1,C=h.length,_=C-1;for(f=f===e?C:f;++b<f;){var D=xf(b,_),I=h[D];h[D]=h[b],h[b]=I}return h.length=f,h}var lw=$L(function(h){var f=[];return h.charCodeAt(0)===46&&f.push(""),h.replace(F6,function(b,C,_,D){f.push(_?D.replace(X6,"$1"):C||b)}),f});function ti(h){if(typeof h=="string"||rr(h))return h;var f=h+"";return f=="0"&&1/h==-W?"-0":f}function Da(h){if(h!=null){try{return ac.call(h)}catch{}try{return h+""}catch{}}return""}function ZL(h,f){return vr($,function(b){var C="_."+b[0];f&b[1]&&!tc(h,C)&&h.push(C)}),h.sort()}function hw(h){if(h instanceof Zt)return h.clone();var f=new yr(h.__wrapped__,h.__chain__);return f.__actions__=Gn(h.__actions__),f.__index__=h.__index__,f.__values__=h.__values__,f}function JL(h,f,b){(b?Rn(h,f,b):f===e)?f=1:f=en(Ft(f),0);var C=h==null?0:h.length;if(!C||f<1)return[];for(var _=0,D=0,I=H(dc(C/f));_<C;)I[D++]=xr(h,_,_+=f);return I}function QL(h){for(var f=-1,b=h==null?0:h.length,C=0,_=[];++f<b;){var D=h[f];D&&(_[C++]=D)}return _}function t5(){var h=arguments.length;if(!h)return[];for(var f=H(h-1),b=arguments[0],C=h;C--;)f[C-1]=arguments[C];return Hi(jt(b)?Gn(b):[b],gn(f,1))}var e5=$t(function(h,f){return Fe(h)?Ls(h,gn(f,1,Fe,!0)):[]}),n5=$t(function(h,f){var b=Er(f);return Fe(b)&&(b=e),Fe(h)?Ls(h,gn(f,1,Fe,!0),At(b,2)):[]}),r5=$t(function(h,f){var b=Er(f);return Fe(b)&&(b=e),Fe(h)?Ls(h,gn(f,1,Fe,!0),e,b):[]});function i5(h,f,b){var C=h==null?0:h.length;return C?(f=b||f===e?1:Ft(f),xr(h,f<0?0:f,C)):[]}function a5(h,f,b){var C=h==null?0:h.length;return C?(f=b||f===e?1:Ft(f),f=C-f,xr(h,0,f<0?0:f)):[]}function o5(h,f){return h&&h.length?wc(h,At(f,3),!0,!0):[]}function s5(h,f){return h&&h.length?wc(h,At(f,3),!0):[]}function u5(h,f,b,C){var _=h==null?0:h.length;return _?(b&&typeof b!="number"&&Rn(h,f,b)&&(b=0,C=_),tL(h,f,b,C)):[]}function dw(h,f,b){var C=h==null?0:h.length;if(!C)return-1;var _=b==null?0:Ft(b);return _<0&&(_=en(C+_,0)),ec(h,At(f,3),_)}function fw(h,f,b){var C=h==null?0:h.length;if(!C)return-1;var _=C-1;return b!==e&&(_=Ft(b),_=b<0?en(C+_,0):bn(_,C-1)),ec(h,At(f,3),_,!0)}function pw(h){var f=h==null?0:h.length;return f?gn(h,1):[]}function c5(h){var f=h==null?0:h.length;return f?gn(h,W):[]}function l5(h,f){var b=h==null?0:h.length;return b?(f=f===e?1:Ft(f),gn(h,f)):[]}function h5(h){for(var f=-1,b=h==null?0:h.length,C={};++f<b;){var _=h[f];C[_[0]]=_[1]}return C}function gw(h){return h&&h.length?h[0]:e}function d5(h,f,b){var C=h==null?0:h.length;if(!C)return-1;var _=b==null?0:Ft(b);return _<0&&(_=en(C+_,0)),wo(h,f,_)}function f5(h){var f=h==null?0:h.length;return f?xr(h,0,-1):[]}var p5=$t(function(h){var f=_e(h,Sf);return f.length&&f[0]===h[0]?gf(f):[]}),g5=$t(function(h){var f=Er(h),b=_e(h,Sf);return f===Er(b)?f=e:b.pop(),b.length&&b[0]===h[0]?gf(b,At(f,2)):[]}),v5=$t(function(h){var f=Er(h),b=_e(h,Sf);return f=typeof f=="function"?f:e,f&&b.pop(),b.length&&b[0]===h[0]?gf(b,e,f):[]});function m5(h,f){return h==null?"":fD.call(h,f)}function Er(h){var f=h==null?0:h.length;return f?h[f-1]:e}function y5(h,f,b){var C=h==null?0:h.length;if(!C)return-1;var _=C;return b!==e&&(_=Ft(b),_=_<0?en(C+_,0):bn(_,C-1)),f===f?ZR(h,f,_):ec(h,qx,_,!0)}function b5(h,f){return h&&h.length?CE(h,Ft(f)):e}var x5=$t(vw);function vw(h,f){return h&&h.length&&f&&f.length?bf(h,f):h}function E5(h,f,b){return h&&h.length&&f&&f.length?bf(h,f,At(b,2)):h}function w5(h,f,b){return h&&h.length&&f&&f.length?bf(h,f,e,b):h}var k5=Si(function(h,f){var b=h==null?0:h.length,C=hf(h,f);return ME(h,_e(f,function(_){return Ci(_,b)?+_:_}).sort(zE)),C});function A5(h,f){var b=[];if(!(h&&h.length))return b;var C=-1,_=[],D=h.length;for(f=At(f,3);++C<D;){var I=h[C];f(I,C,h)&&(b.push(I),_.push(C))}return ME(h,_),b}function zf(h){return h==null?h:mD.call(h)}function S5(h,f,b){var C=h==null?0:h.length;return C?(b&&typeof b!="number"&&Rn(h,f,b)?(f=0,b=C):(f=f==null?0:Ft(f),b=b===e?C:Ft(b)),xr(h,f,b)):[]}function C5(h,f){return Ec(h,f)}function N5(h,f,b){return wf(h,f,At(b,2))}function T5(h,f){var b=h==null?0:h.length;if(b){var C=Ec(h,f);if(C<b&&Fr(h[C],f))return C}return-1}function M5(h,f){return Ec(h,f,!0)}function _5(h,f,b){return wf(h,f,At(b,2),!0)}function O5(h,f){var b=h==null?0:h.length;if(b){var C=Ec(h,f,!0)-1;if(Fr(h[C],f))return C}return-1}function P5(h){return h&&h.length?OE(h):[]}function R5(h,f){return h&&h.length?OE(h,At(f,2)):[]}function D5(h){var f=h==null?0:h.length;return f?xr(h,1,f):[]}function L5(h,f,b){return h&&h.length?(f=b||f===e?1:Ft(f),xr(h,0,f<0?0:f)):[]}function I5(h,f,b){var C=h==null?0:h.length;return C?(f=b||f===e?1:Ft(f),f=C-f,xr(h,f<0?0:f,C)):[]}function j5(h,f){return h&&h.length?wc(h,At(f,3),!1,!0):[]}function B5(h,f){return h&&h.length?wc(h,At(f,3)):[]}var z5=$t(function(h){return Zi(gn(h,1,Fe,!0))}),F5=$t(function(h){var f=Er(h);return Fe(f)&&(f=e),Zi(gn(h,1,Fe,!0),At(f,2))}),G5=$t(function(h){var f=Er(h);return f=typeof f=="function"?f:e,Zi(gn(h,1,Fe,!0),e,f)});function V5(h){return h&&h.length?Zi(h):[]}function U5(h,f){return h&&h.length?Zi(h,At(f,2)):[]}function W5(h,f){return f=typeof f=="function"?f:e,h&&h.length?Zi(h,e,f):[]}function Ff(h){if(!(h&&h.length))return[];var f=0;return h=$i(h,function(b){if(Fe(b))return f=en(b.length,f),!0}),nf(f,function(b){return _e(h,Qd(b))})}function mw(h,f){if(!(h&&h.length))return[];var b=Ff(h);return f==null?b:_e(b,function(C){return tr(f,e,C)})}var Y5=$t(function(h,f){return Fe(h)?Ls(h,f):[]}),$5=$t(function(h){return Af($i(h,Fe))}),H5=$t(function(h){var f=Er(h);return Fe(f)&&(f=e),Af($i(h,Fe),At(f,2))}),X5=$t(function(h){var f=Er(h);return f=typeof f=="function"?f:e,Af($i(h,Fe),e,f)}),q5=$t(Ff);function K5(h,f){return LE(h||[],f||[],Ds)}function Z5(h,f){return LE(h||[],f||[],Bs)}var J5=$t(function(h){var f=h.length,b=f>1?h[f-1]:e;return b=typeof b=="function"?(h.pop(),b):e,mw(h,b)});function yw(h){var f=R(h);return f.__chain__=!0,f}function Q5(h,f){return f(h),h}function Oc(h,f){return f(h)}var tI=Si(function(h){var f=h.length,b=f?h[0]:0,C=this.__wrapped__,_=function(D){return hf(D,h)};return f>1||this.__actions__.length||!(C instanceof Zt)||!Ci(b)?this.thru(_):(C=C.slice(b,+b+(f?1:0)),C.__actions__.push({func:Oc,args:[_],thisArg:e}),new yr(C,this.__chain__).thru(function(D){return f&&!D.length&&D.push(e),D}))});function eI(){return yw(this)}function nI(){return new yr(this.value(),this.__chain__)}function rI(){this.__values__===e&&(this.__values__=Pw(this.value()));var h=this.__index__>=this.__values__.length,f=h?e:this.__values__[this.__index__++];return{done:h,value:f}}function iI(){return this}function aI(h){for(var f,b=this;b instanceof vc;){var C=hw(b);C.__index__=0,C.__values__=e,f?_.__wrapped__=C:f=C;var _=C;b=b.__wrapped__}return _.__wrapped__=h,f}function oI(){var h=this.__wrapped__;if(h instanceof Zt){var f=h;return this.__actions__.length&&(f=new Zt(this)),f=f.reverse(),f.__actions__.push({func:Oc,args:[zf],thisArg:e}),new yr(f,this.__chain__)}return this.thru(zf)}function sI(){return DE(this.__wrapped__,this.__actions__)}var uI=kc(function(h,f,b){oe.call(h,b)?++h[b]:ki(h,b,1)});function cI(h,f,b){var C=jt(h)?Hx:QD;return b&&Rn(h,f,b)&&(f=e),C(h,At(f,3))}function lI(h,f){var b=jt(h)?$i:mE;return b(h,At(f,3))}var hI=YE(dw),dI=YE(fw);function fI(h,f){return gn(Pc(h,f),1)}function pI(h,f){return gn(Pc(h,f),W)}function gI(h,f,b){return b=b===e?1:Ft(b),gn(Pc(h,f),b)}function bw(h,f){var b=jt(h)?vr:Ki;return b(h,At(f,3))}function xw(h,f){var b=jt(h)?DR:vE;return b(h,At(f,3))}var vI=kc(function(h,f,b){oe.call(h,b)?h[b].push(f):ki(h,b,[f])});function mI(h,f,b,C){h=Vn(h)?h:Do(h),b=b&&!C?Ft(b):0;var _=h.length;return b<0&&(b=en(_+b,0)),jc(h)?b<=_&&h.indexOf(f,b)>-1:!!_&&wo(h,f,b)>-1}var yI=$t(function(h,f,b){var C=-1,_=typeof f=="function",D=Vn(h)?H(h.length):[];return Ki(h,function(I){D[++C]=_?tr(f,I,b):Is(I,f,b)}),D}),bI=kc(function(h,f,b){ki(h,b,f)});function Pc(h,f){var b=jt(h)?_e:kE;return b(h,At(f,3))}function xI(h,f,b,C){return h==null?[]:(jt(f)||(f=f==null?[]:[f]),b=C?e:b,jt(b)||(b=b==null?[]:[b]),NE(h,f,b))}var EI=kc(function(h,f,b){h[b?0:1].push(f)},function(){return[[],[]]});function wI(h,f,b){var C=jt(h)?Zd:Zx,_=arguments.length<3;return C(h,At(f,4),b,_,Ki)}function kI(h,f,b){var C=jt(h)?LR:Zx,_=arguments.length<3;return C(h,At(f,4),b,_,vE)}function AI(h,f){var b=jt(h)?$i:mE;return b(h,Lc(At(f,3)))}function SI(h){var f=jt(h)?dE:mL;return f(h)}function CI(h,f,b){(b?Rn(h,f,b):f===e)?f=1:f=Ft(f);var C=jt(h)?XD:yL;return C(h,f)}function NI(h){var f=jt(h)?qD:xL;return f(h)}function TI(h){if(h==null)return 0;if(Vn(h))return jc(h)?Ao(h):h.length;var f=xn(h);return f==_t||f==Je?h.size:mf(h).length}function MI(h,f,b){var C=jt(h)?Jd:EL;return b&&Rn(h,f,b)&&(f=e),C(h,At(f,3))}var _I=$t(function(h,f){if(h==null)return[];var b=f.length;return b>1&&Rn(h,f[0],f[1])?f=[]:b>2&&Rn(f[0],f[1],f[2])&&(f=[f[0]]),NE(h,gn(f,1),[])}),Rc=lD||function(){return pn.Date.now()};function OI(h,f){if(typeof f!="function")throw new mr(o);return h=Ft(h),function(){if(--h<1)return f.apply(this,arguments)}}function Ew(h,f,b){return f=b?e:f,f=h&&f==null?h.length:f,Ai(h,N,e,e,e,e,f)}function ww(h,f){var b;if(typeof f!="function")throw new mr(o);return h=Ft(h),function(){return--h>0&&(b=f.apply(this,arguments)),h<=1&&(f=e),b}}var Gf=$t(function(h,f,b){var C=v;if(b.length){var _=Xi(b,Po(Gf));C|=k}return Ai(h,C,f,b,_)}),kw=$t(function(h,f,b){var C=v|x;if(b.length){var _=Xi(b,Po(kw));C|=k}return Ai(f,C,h,b,_)});function Aw(h,f,b){f=b?e:f;var C=Ai(h,w,e,e,e,e,e,f);return C.placeholder=Aw.placeholder,C}function Sw(h,f,b){f=b?e:f;var C=Ai(h,S,e,e,e,e,e,f);return C.placeholder=Sw.placeholder,C}function Cw(h,f,b){var C,_,D,I,B,V,Q=0,tt=!1,it=!1,pt=!0;if(typeof h!="function")throw new mr(o);f=wr(f)||0,De(b)&&(tt=!!b.leading,it="maxWait"in b,D=it?en(wr(b.maxWait)||0,f):D,pt="trailing"in b?!!b.trailing:pt);function xt(Ge){var Gr=C,Mi=_;return C=_=e,Q=Ge,I=h.apply(Mi,Gr),I}function Ct(Ge){return Q=Ge,B=Gs(qt,f),tt?xt(Ge):I}function Vt(Ge){var Gr=Ge-V,Mi=Ge-Q,Yw=f-Gr;return it?bn(Yw,D-Mi):Yw}function Nt(Ge){var Gr=Ge-V,Mi=Ge-Q;return V===e||Gr>=f||Gr<0||it&&Mi>=D}function qt(){var Ge=Rc();if(Nt(Ge))return Jt(Ge);B=Gs(qt,Vt(Ge))}function Jt(Ge){return B=e,pt&&C?xt(Ge):(C=_=e,I)}function ir(){B!==e&&IE(B),Q=0,C=V=_=B=e}function Dn(){return B===e?I:Jt(Rc())}function ar(){var Ge=Rc(),Gr=Nt(Ge);if(C=arguments,_=this,V=Ge,Gr){if(B===e)return Ct(V);if(it)return IE(B),B=Gs(qt,f),xt(V)}return B===e&&(B=Gs(qt,f)),I}return ar.cancel=ir,ar.flush=Dn,ar}var PI=$t(function(h,f){return gE(h,1,f)}),RI=$t(function(h,f,b){return gE(h,wr(f)||0,b)});function DI(h){return Ai(h,O)}function Dc(h,f){if(typeof h!="function"||f!=null&&typeof f!="function")throw new mr(o);var b=function(){var C=arguments,_=f?f.apply(this,C):C[0],D=b.cache;if(D.has(_))return D.get(_);var I=h.apply(this,C);return b.cache=D.set(_,I)||D,I};return b.cache=new(Dc.Cache||wi),b}Dc.Cache=wi;function Lc(h){if(typeof h!="function")throw new mr(o);return function(){var f=arguments;switch(f.length){case 0:return!h.call(this);case 1:return!h.call(this,f[0]);case 2:return!h.call(this,f[0],f[1]);case 3:return!h.call(this,f[0],f[1],f[2])}return!h.apply(this,f)}}function LI(h){return ww(2,h)}var II=wL(function(h,f){f=f.length==1&&jt(f[0])?_e(f[0],er(At())):_e(gn(f,1),er(At()));var b=f.length;return $t(function(C){for(var _=-1,D=bn(C.length,b);++_<D;)C[_]=f[_].call(this,C[_]);return tr(h,this,C)})}),Vf=$t(function(h,f){var b=Xi(f,Po(Vf));return Ai(h,k,e,f,b)}),Nw=$t(function(h,f){var b=Xi(f,Po(Nw));return Ai(h,A,e,f,b)}),jI=Si(function(h,f){return Ai(h,T,e,e,e,f)});function BI(h,f){if(typeof h!="function")throw new mr(o);return f=f===e?f:Ft(f),$t(h,f)}function zI(h,f){if(typeof h!="function")throw new mr(o);return f=f==null?0:en(Ft(f),0),$t(function(b){var C=b[f],_=Qi(b,0,f);return C&&Hi(_,C),tr(h,this,_)})}function FI(h,f,b){var C=!0,_=!0;if(typeof h!="function")throw new mr(o);return De(b)&&(C="leading"in b?!!b.leading:C,_="trailing"in b?!!b.trailing:_),Cw(h,f,{leading:C,maxWait:f,trailing:_})}function GI(h){return Ew(h,1)}function VI(h,f){return Vf(Cf(f),h)}function UI(){if(!arguments.length)return[];var h=arguments[0];return jt(h)?h:[h]}function WI(h){return br(h,g)}function YI(h,f){return f=typeof f=="function"?f:e,br(h,g,f)}function $I(h){return br(h,d|g)}function HI(h,f){return f=typeof f=="function"?f:e,br(h,d|g,f)}function XI(h,f){return f==null||pE(h,f,un(f))}function Fr(h,f){return h===f||h!==h&&f!==f}var qI=Nc(pf),KI=Nc(function(h,f){return h>=f}),La=xE((function(){return arguments})())?xE:function(h){return Be(h)&&oe.call(h,"callee")&&!oE.call(h,"callee")},jt=H.isArray,ZI=Gx?er(Gx):aL;function Vn(h){return h!=null&&Ic(h.length)&&!Ni(h)}function Fe(h){return Be(h)&&Vn(h)}function JI(h){return h===!0||h===!1||Be(h)&&Pn(h)==ot}var ta=dD||Qf,QI=Vx?er(Vx):oL;function t8(h){return Be(h)&&h.nodeType===1&&!Vs(h)}function e8(h){if(h==null)return!0;if(Vn(h)&&(jt(h)||typeof h=="string"||typeof h.splice=="function"||ta(h)||Ro(h)||La(h)))return!h.length;var f=xn(h);if(f==_t||f==Je)return!h.size;if(Fs(h))return!mf(h).length;for(var b in h)if(oe.call(h,b))return!1;return!0}function n8(h,f){return js(h,f)}function r8(h,f,b){b=typeof b=="function"?b:e;var C=b?b(h,f):e;return C===e?js(h,f,e,b):!!C}function Uf(h){if(!Be(h))return!1;var f=Pn(h);return f==Ot||f==mt||typeof h.message=="string"&&typeof h.name=="string"&&!Vs(h)}function i8(h){return typeof h=="number"&&uE(h)}function Ni(h){if(!De(h))return!1;var f=Pn(h);return f==ne||f==Qt||f==K||f==_n}function Tw(h){return typeof h=="number"&&h==Ft(h)}function Ic(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=at}function De(h){var f=typeof h;return h!=null&&(f=="object"||f=="function")}function Be(h){return h!=null&&typeof h=="object"}var Mw=Ux?er(Ux):uL;function a8(h,f){return h===f||vf(h,f,Rf(f))}function o8(h,f,b){return b=typeof b=="function"?b:e,vf(h,f,Rf(f),b)}function s8(h){return _w(h)&&h!=+h}function u8(h){if(YL(h))throw new Rt(a);return EE(h)}function c8(h){return h===null}function l8(h){return h==null}function _w(h){return typeof h=="number"||Be(h)&&Pn(h)==wt}function Vs(h){if(!Be(h)||Pn(h)!=Et)return!1;var f=cc(h);if(f===null)return!0;var b=oe.call(f,"constructor")&&f.constructor;return typeof b=="function"&&b instanceof b&&ac.call(b)==oD}var Wf=Wx?er(Wx):cL;function h8(h){return Tw(h)&&h>=-at&&h<=at}var Ow=Yx?er(Yx):lL;function jc(h){return typeof h=="string"||!jt(h)&&Be(h)&&Pn(h)==Qe}function rr(h){return typeof h=="symbol"||Be(h)&&Pn(h)==je}var Ro=$x?er($x):hL;function d8(h){return h===e}function f8(h){return Be(h)&&xn(h)==sn}function p8(h){return Be(h)&&Pn(h)==Cs}var g8=Nc(yf),v8=Nc(function(h,f){return h<=f});function Pw(h){if(!h)return[];if(Vn(h))return jc(h)?Br(h):Gn(h);if(Ms&&h[Ms])return XR(h[Ms]());var f=xn(h),b=f==_t?af:f==Je?nc:Do;return b(h)}function Ti(h){if(!h)return h===0?h:0;if(h=wr(h),h===W||h===-W){var f=h<0?-1:1;return f*ut}return h===h?h:0}function Ft(h){var f=Ti(h),b=f%1;return f===f?b?f-b:f:0}function Rw(h){return h?Oa(Ft(h),0,kt):0}function wr(h){if(typeof h=="number")return h;if(rr(h))return yt;if(De(h)){var f=typeof h.valueOf=="function"?h.valueOf():h;h=De(f)?f+"":f}if(typeof h!="string")return h===0?h:+h;h=Jx(h);var b=Z6.test(h);return b||Q6.test(h)?OR(h.slice(2),b?2:8):K6.test(h)?yt:+h}function Dw(h){return Qr(h,Un(h))}function m8(h){return h?Oa(Ft(h),-at,at):h===0?h:0}function se(h){return h==null?"":nr(h)}var y8=_o(function(h,f){if(Fs(f)||Vn(f)){Qr(f,un(f),h);return}for(var b in f)oe.call(f,b)&&Ds(h,b,f[b])}),Lw=_o(function(h,f){Qr(f,Un(f),h)}),Bc=_o(function(h,f,b,C){Qr(f,Un(f),h,C)}),b8=_o(function(h,f,b,C){Qr(f,un(f),h,C)}),x8=Si(hf);function E8(h,f){var b=Mo(h);return f==null?b:fE(b,f)}var w8=$t(function(h,f){h=ge(h);var b=-1,C=f.length,_=C>2?f[2]:e;for(_&&Rn(f[0],f[1],_)&&(C=1);++b<C;)for(var D=f[b],I=Un(D),B=-1,V=I.length;++B<V;){var Q=I[B],tt=h[Q];(tt===e||Fr(tt,Co[Q])&&!oe.call(h,Q))&&(h[Q]=D[Q])}return h}),k8=$t(function(h){return h.push(e,JE),tr(Iw,e,h)});function A8(h,f){return Xx(h,At(f,3),Jr)}function S8(h,f){return Xx(h,At(f,3),ff)}function C8(h,f){return h==null?h:df(h,At(f,3),Un)}function N8(h,f){return h==null?h:yE(h,At(f,3),Un)}function T8(h,f){return h&&Jr(h,At(f,3))}function M8(h,f){return h&&ff(h,At(f,3))}function _8(h){return h==null?[]:bc(h,un(h))}function O8(h){return h==null?[]:bc(h,Un(h))}function Yf(h,f,b){var C=h==null?e:Pa(h,f);return C===e?b:C}function P8(h,f){return h!=null&&ew(h,f,eL)}function $f(h,f){return h!=null&&ew(h,f,nL)}var R8=HE(function(h,f,b){f!=null&&typeof f.toString!="function"&&(f=oc.call(f)),h[f]=b},Xf(Wn)),D8=HE(function(h,f,b){f!=null&&typeof f.toString!="function"&&(f=oc.call(f)),oe.call(h,f)?h[f].push(b):h[f]=[b]},At),L8=$t(Is);function un(h){return Vn(h)?hE(h):mf(h)}function Un(h){return Vn(h)?hE(h,!0):dL(h)}function I8(h,f){var b={};return f=At(f,3),Jr(h,function(C,_,D){ki(b,f(C,_,D),C)}),b}function j8(h,f){var b={};return f=At(f,3),Jr(h,function(C,_,D){ki(b,_,f(C,_,D))}),b}var B8=_o(function(h,f,b){xc(h,f,b)}),Iw=_o(function(h,f,b,C){xc(h,f,b,C)}),z8=Si(function(h,f){var b={};if(h==null)return b;var C=!1;f=_e(f,function(D){return D=Ji(D,h),C||(C=D.length>1),D}),Qr(h,Of(h),b),C&&(b=br(b,d|p|g,RL));for(var _=f.length;_--;)kf(b,f[_]);return b});function F8(h,f){return jw(h,Lc(At(f)))}var G8=Si(function(h,f){return h==null?{}:pL(h,f)});function jw(h,f){if(h==null)return{};var b=_e(Of(h),function(C){return[C]});return f=At(f),TE(h,b,function(C,_){return f(C,_[0])})}function V8(h,f,b){f=Ji(f,h);var C=-1,_=f.length;for(_||(_=1,h=e);++C<_;){var D=h==null?e:h[ti(f[C])];D===e&&(C=_,D=b),h=Ni(D)?D.call(h):D}return h}function U8(h,f,b){return h==null?h:Bs(h,f,b)}function W8(h,f,b,C){return C=typeof C=="function"?C:e,h==null?h:Bs(h,f,b,C)}var Bw=KE(un),zw=KE(Un);function Y8(h,f,b){var C=jt(h),_=C||ta(h)||Ro(h);if(f=At(f,4),b==null){var D=h&&h.constructor;_?b=C?new D:[]:De(h)?b=Ni(D)?Mo(cc(h)):{}:b={}}return(_?vr:Jr)(h,function(I,B,V){return f(b,I,B,V)}),b}function $8(h,f){return h==null?!0:kf(h,f)}function H8(h,f,b){return h==null?h:RE(h,f,Cf(b))}function X8(h,f,b,C){return C=typeof C=="function"?C:e,h==null?h:RE(h,f,Cf(b),C)}function Do(h){return h==null?[]:rf(h,un(h))}function q8(h){return h==null?[]:rf(h,Un(h))}function K8(h,f,b){return b===e&&(b=f,f=e),b!==e&&(b=wr(b),b=b===b?b:0),f!==e&&(f=wr(f),f=f===f?f:0),Oa(wr(h),f,b)}function Z8(h,f,b){return f=Ti(f),b===e?(b=f,f=0):b=Ti(b),h=wr(h),rL(h,f,b)}function J8(h,f,b){if(b&&typeof b!="boolean"&&Rn(h,f,b)&&(f=b=e),b===e&&(typeof f=="boolean"?(b=f,f=e):typeof h=="boolean"&&(b=h,h=e)),h===e&&f===e?(h=0,f=1):(h=Ti(h),f===e?(f=h,h=0):f=Ti(f)),h>f){var C=h;h=f,f=C}if(b||h%1||f%1){var _=cE();return bn(h+_*(f-h+_R("1e-"+((_+"").length-1))),f)}return xf(h,f)}var Q8=Oo(function(h,f,b){return f=f.toLowerCase(),h+(b?Fw(f):f)});function Fw(h){return Hf(se(h).toLowerCase())}function Gw(h){return h=se(h),h&&h.replace(eR,UR).replace(xR,"")}function t9(h,f,b){h=se(h),f=nr(f);var C=h.length;b=b===e?C:Oa(Ft(b),0,C);var _=b;return b-=f.length,b>=0&&h.slice(b,_)==f}function e9(h){return h=se(h),h&&L6.test(h)?h.replace(yx,WR):h}function n9(h){return h=se(h),h&&G6.test(h)?h.replace(Gd,"\\$&"):h}var r9=Oo(function(h,f,b){return h+(b?"-":"")+f.toLowerCase()}),i9=Oo(function(h,f,b){return h+(b?" ":"")+f.toLowerCase()}),a9=WE("toLowerCase");function o9(h,f,b){h=se(h),f=Ft(f);var C=f?Ao(h):0;if(!f||C>=f)return h;var _=(f-C)/2;return Cc(fc(_),b)+h+Cc(dc(_),b)}function s9(h,f,b){h=se(h),f=Ft(f);var C=f?Ao(h):0;return f&&C<f?h+Cc(f-C,b):h}function u9(h,f,b){h=se(h),f=Ft(f);var C=f?Ao(h):0;return f&&C<f?Cc(f-C,b)+h:h}function c9(h,f,b){return b||f==null?f=0:f&&(f=+f),vD(se(h).replace(Vd,""),f||0)}function l9(h,f,b){return(b?Rn(h,f,b):f===e)?f=1:f=Ft(f),Ef(se(h),f)}function h9(){var h=arguments,f=se(h[0]);return h.length<3?f:f.replace(h[1],h[2])}var d9=Oo(function(h,f,b){return h+(b?"_":"")+f.toLowerCase()});function f9(h,f,b){return b&&typeof b!="number"&&Rn(h,f,b)&&(f=b=e),b=b===e?kt:b>>>0,b?(h=se(h),h&&(typeof f=="string"||f!=null&&!Wf(f))&&(f=nr(f),!f&&ko(h))?Qi(Br(h),0,b):h.split(f,b)):[]}var p9=Oo(function(h,f,b){return h+(b?" ":"")+Hf(f)});function g9(h,f,b){return h=se(h),b=b==null?0:Oa(Ft(b),0,h.length),f=nr(f),h.slice(b,b+f.length)==f}function v9(h,f,b){var C=R.templateSettings;b&&Rn(h,f,b)&&(f=e),h=se(h),f=Bc({},f,C,ZE);var _=Bc({},f.imports,C.imports,ZE),D=un(_),I=rf(_,D),B,V,Q=0,tt=f.interpolate||Zu,it="__p += '",pt=of((f.escape||Zu).source+"|"+tt.source+"|"+(tt===bx?q6:Zu).source+"|"+(f.evaluate||Zu).source+"|$","g"),xt="//# sourceURL="+(oe.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++SR+"]")+`
235
+ `;h.replace(pt,function(Nt,qt,Jt,ir,Dn,ar){return Jt||(Jt=ir),it+=h.slice(Q,ar).replace(nR,YR),qt&&(B=!0,it+=`' +
236
+ __e(`+qt+`) +
237
+ '`),Dn&&(V=!0,it+=`';
238
+ `+Dn+`;
239
+ __p += '`),Jt&&(it+=`' +
240
+ ((__t = (`+Jt+`)) == null ? '' : __t) +
241
+ '`),Q=ar+Nt.length,Nt}),it+=`';
242
+ `;var Ct=oe.call(f,"variable")&&f.variable;if(!Ct)it=`with (obj) {
243
+ `+it+`
244
+ }
245
+ `;else if(H6.test(Ct))throw new Rt(s);it=(V?it.replace(O6,""):it).replace(P6,"$1").replace(R6,"$1;"),it="function("+(Ct||"obj")+`) {
246
+ `+(Ct?"":`obj || (obj = {});
247
+ `)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(V?`, __j = Array.prototype.join;
248
+ function print() { __p += __j.call(arguments, '') }
249
+ `:`;
250
+ `)+it+`return __p
251
+ }`;var Vt=Uw(function(){return ie(D,xt+"return "+it).apply(e,I)});if(Vt.source=it,Uf(Vt))throw Vt;return Vt}function m9(h){return se(h).toLowerCase()}function y9(h){return se(h).toUpperCase()}function b9(h,f,b){if(h=se(h),h&&(b||f===e))return Jx(h);if(!h||!(f=nr(f)))return h;var C=Br(h),_=Br(f),D=Qx(C,_),I=tE(C,_)+1;return Qi(C,D,I).join("")}function x9(h,f,b){if(h=se(h),h&&(b||f===e))return h.slice(0,nE(h)+1);if(!h||!(f=nr(f)))return h;var C=Br(h),_=tE(C,Br(f))+1;return Qi(C,0,_).join("")}function E9(h,f,b){if(h=se(h),h&&(b||f===e))return h.replace(Vd,"");if(!h||!(f=nr(f)))return h;var C=Br(h),_=Qx(C,Br(f));return Qi(C,_).join("")}function w9(h,f){var b=M,C=P;if(De(f)){var _="separator"in f?f.separator:_;b="length"in f?Ft(f.length):b,C="omission"in f?nr(f.omission):C}h=se(h);var D=h.length;if(ko(h)){var I=Br(h);D=I.length}if(b>=D)return h;var B=b-Ao(C);if(B<1)return C;var V=I?Qi(I,0,B).join(""):h.slice(0,B);if(_===e)return V+C;if(I&&(B+=V.length-B),Wf(_)){if(h.slice(B).search(_)){var Q,tt=V;for(_.global||(_=of(_.source,se(xx.exec(_))+"g")),_.lastIndex=0;Q=_.exec(tt);)var it=Q.index;V=V.slice(0,it===e?B:it)}}else if(h.indexOf(nr(_),B)!=B){var pt=V.lastIndexOf(_);pt>-1&&(V=V.slice(0,pt))}return V+C}function k9(h){return h=se(h),h&&D6.test(h)?h.replace(mx,JR):h}var A9=Oo(function(h,f,b){return h+(b?" ":"")+f.toUpperCase()}),Hf=WE("toUpperCase");function Vw(h,f,b){return h=se(h),f=b?e:f,f===e?HR(h)?eD(h):BR(h):h.match(f)||[]}var Uw=$t(function(h,f){try{return tr(h,e,f)}catch(b){return Uf(b)?b:new Rt(b)}}),S9=Si(function(h,f){return vr(f,function(b){b=ti(b),ki(h,b,Gf(h[b],h))}),h});function C9(h){var f=h==null?0:h.length,b=At();return h=f?_e(h,function(C){if(typeof C[1]!="function")throw new mr(o);return[b(C[0]),C[1]]}):[],$t(function(C){for(var _=-1;++_<f;){var D=h[_];if(tr(D[0],this,C))return tr(D[1],this,C)}})}function N9(h){return JD(br(h,d))}function Xf(h){return function(){return h}}function T9(h,f){return h==null||h!==h?f:h}var M9=$E(),_9=$E(!0);function Wn(h){return h}function qf(h){return wE(typeof h=="function"?h:br(h,d))}function O9(h){return AE(br(h,d))}function P9(h,f){return SE(h,br(f,d))}var R9=$t(function(h,f){return function(b){return Is(b,h,f)}}),D9=$t(function(h,f){return function(b){return Is(h,b,f)}});function Kf(h,f,b){var C=un(f),_=bc(f,C);b==null&&!(De(f)&&(_.length||!C.length))&&(b=f,f=h,h=this,_=bc(f,un(f)));var D=!(De(b)&&"chain"in b)||!!b.chain,I=Ni(h);return vr(_,function(B){var V=f[B];h[B]=V,I&&(h.prototype[B]=function(){var Q=this.__chain__;if(D||Q){var tt=h(this.__wrapped__),it=tt.__actions__=Gn(this.__actions__);return it.push({func:V,args:arguments,thisArg:h}),tt.__chain__=Q,tt}return V.apply(h,Hi([this.value()],arguments))})}),h}function L9(){return pn._===this&&(pn._=sD),this}function Zf(){}function I9(h){return h=Ft(h),$t(function(f){return CE(f,h)})}var j9=Tf(_e),B9=Tf(Hx),z9=Tf(Jd);function Ww(h){return Lf(h)?Qd(ti(h)):gL(h)}function F9(h){return function(f){return h==null?e:Pa(h,f)}}var G9=XE(),V9=XE(!0);function Jf(){return[]}function Qf(){return!1}function U9(){return{}}function W9(){return""}function Y9(){return!0}function $9(h,f){if(h=Ft(h),h<1||h>at)return[];var b=kt,C=bn(h,kt);f=At(f),h-=kt;for(var _=nf(C,f);++b<h;)f(b);return _}function H9(h){return jt(h)?_e(h,ti):rr(h)?[h]:Gn(lw(se(h)))}function X9(h){var f=++aD;return se(h)+f}var q9=Sc(function(h,f){return h+f},0),K9=Mf("ceil"),Z9=Sc(function(h,f){return h/f},1),J9=Mf("floor");function Q9(h){return h&&h.length?yc(h,Wn,pf):e}function tj(h,f){return h&&h.length?yc(h,At(f,2),pf):e}function ej(h){return Kx(h,Wn)}function nj(h,f){return Kx(h,At(f,2))}function rj(h){return h&&h.length?yc(h,Wn,yf):e}function ij(h,f){return h&&h.length?yc(h,At(f,2),yf):e}var aj=Sc(function(h,f){return h*f},1),oj=Mf("round"),sj=Sc(function(h,f){return h-f},0);function uj(h){return h&&h.length?ef(h,Wn):0}function cj(h,f){return h&&h.length?ef(h,At(f,2)):0}return R.after=OI,R.ary=Ew,R.assign=y8,R.assignIn=Lw,R.assignInWith=Bc,R.assignWith=b8,R.at=x8,R.before=ww,R.bind=Gf,R.bindAll=S9,R.bindKey=kw,R.castArray=UI,R.chain=yw,R.chunk=JL,R.compact=QL,R.concat=t5,R.cond=C9,R.conforms=N9,R.constant=Xf,R.countBy=uI,R.create=E8,R.curry=Aw,R.curryRight=Sw,R.debounce=Cw,R.defaults=w8,R.defaultsDeep=k8,R.defer=PI,R.delay=RI,R.difference=e5,R.differenceBy=n5,R.differenceWith=r5,R.drop=i5,R.dropRight=a5,R.dropRightWhile=o5,R.dropWhile=s5,R.fill=u5,R.filter=lI,R.flatMap=fI,R.flatMapDeep=pI,R.flatMapDepth=gI,R.flatten=pw,R.flattenDeep=c5,R.flattenDepth=l5,R.flip=DI,R.flow=M9,R.flowRight=_9,R.fromPairs=h5,R.functions=_8,R.functionsIn=O8,R.groupBy=vI,R.initial=f5,R.intersection=p5,R.intersectionBy=g5,R.intersectionWith=v5,R.invert=R8,R.invertBy=D8,R.invokeMap=yI,R.iteratee=qf,R.keyBy=bI,R.keys=un,R.keysIn=Un,R.map=Pc,R.mapKeys=I8,R.mapValues=j8,R.matches=O9,R.matchesProperty=P9,R.memoize=Dc,R.merge=B8,R.mergeWith=Iw,R.method=R9,R.methodOf=D9,R.mixin=Kf,R.negate=Lc,R.nthArg=I9,R.omit=z8,R.omitBy=F8,R.once=LI,R.orderBy=xI,R.over=j9,R.overArgs=II,R.overEvery=B9,R.overSome=z9,R.partial=Vf,R.partialRight=Nw,R.partition=EI,R.pick=G8,R.pickBy=jw,R.property=Ww,R.propertyOf=F9,R.pull=x5,R.pullAll=vw,R.pullAllBy=E5,R.pullAllWith=w5,R.pullAt=k5,R.range=G9,R.rangeRight=V9,R.rearg=jI,R.reject=AI,R.remove=A5,R.rest=BI,R.reverse=zf,R.sampleSize=CI,R.set=U8,R.setWith=W8,R.shuffle=NI,R.slice=S5,R.sortBy=_I,R.sortedUniq=P5,R.sortedUniqBy=R5,R.split=f9,R.spread=zI,R.tail=D5,R.take=L5,R.takeRight=I5,R.takeRightWhile=j5,R.takeWhile=B5,R.tap=Q5,R.throttle=FI,R.thru=Oc,R.toArray=Pw,R.toPairs=Bw,R.toPairsIn=zw,R.toPath=H9,R.toPlainObject=Dw,R.transform=Y8,R.unary=GI,R.union=z5,R.unionBy=F5,R.unionWith=G5,R.uniq=V5,R.uniqBy=U5,R.uniqWith=W5,R.unset=$8,R.unzip=Ff,R.unzipWith=mw,R.update=H8,R.updateWith=X8,R.values=Do,R.valuesIn=q8,R.without=Y5,R.words=Vw,R.wrap=VI,R.xor=$5,R.xorBy=H5,R.xorWith=X5,R.zip=q5,R.zipObject=K5,R.zipObjectDeep=Z5,R.zipWith=J5,R.entries=Bw,R.entriesIn=zw,R.extend=Lw,R.extendWith=Bc,Kf(R,R),R.add=q9,R.attempt=Uw,R.camelCase=Q8,R.capitalize=Fw,R.ceil=K9,R.clamp=K8,R.clone=WI,R.cloneDeep=$I,R.cloneDeepWith=HI,R.cloneWith=YI,R.conformsTo=XI,R.deburr=Gw,R.defaultTo=T9,R.divide=Z9,R.endsWith=t9,R.eq=Fr,R.escape=e9,R.escapeRegExp=n9,R.every=cI,R.find=hI,R.findIndex=dw,R.findKey=A8,R.findLast=dI,R.findLastIndex=fw,R.findLastKey=S8,R.floor=J9,R.forEach=bw,R.forEachRight=xw,R.forIn=C8,R.forInRight=N8,R.forOwn=T8,R.forOwnRight=M8,R.get=Yf,R.gt=qI,R.gte=KI,R.has=P8,R.hasIn=$f,R.head=gw,R.identity=Wn,R.includes=mI,R.indexOf=d5,R.inRange=Z8,R.invoke=L8,R.isArguments=La,R.isArray=jt,R.isArrayBuffer=ZI,R.isArrayLike=Vn,R.isArrayLikeObject=Fe,R.isBoolean=JI,R.isBuffer=ta,R.isDate=QI,R.isElement=t8,R.isEmpty=e8,R.isEqual=n8,R.isEqualWith=r8,R.isError=Uf,R.isFinite=i8,R.isFunction=Ni,R.isInteger=Tw,R.isLength=Ic,R.isMap=Mw,R.isMatch=a8,R.isMatchWith=o8,R.isNaN=s8,R.isNative=u8,R.isNil=l8,R.isNull=c8,R.isNumber=_w,R.isObject=De,R.isObjectLike=Be,R.isPlainObject=Vs,R.isRegExp=Wf,R.isSafeInteger=h8,R.isSet=Ow,R.isString=jc,R.isSymbol=rr,R.isTypedArray=Ro,R.isUndefined=d8,R.isWeakMap=f8,R.isWeakSet=p8,R.join=m5,R.kebabCase=r9,R.last=Er,R.lastIndexOf=y5,R.lowerCase=i9,R.lowerFirst=a9,R.lt=g8,R.lte=v8,R.max=Q9,R.maxBy=tj,R.mean=ej,R.meanBy=nj,R.min=rj,R.minBy=ij,R.stubArray=Jf,R.stubFalse=Qf,R.stubObject=U9,R.stubString=W9,R.stubTrue=Y9,R.multiply=aj,R.nth=b5,R.noConflict=L9,R.noop=Zf,R.now=Rc,R.pad=o9,R.padEnd=s9,R.padStart=u9,R.parseInt=c9,R.random=J8,R.reduce=wI,R.reduceRight=kI,R.repeat=l9,R.replace=h9,R.result=V8,R.round=oj,R.runInContext=G,R.sample=SI,R.size=TI,R.snakeCase=d9,R.some=MI,R.sortedIndex=C5,R.sortedIndexBy=N5,R.sortedIndexOf=T5,R.sortedLastIndex=M5,R.sortedLastIndexBy=_5,R.sortedLastIndexOf=O5,R.startCase=p9,R.startsWith=g9,R.subtract=sj,R.sum=uj,R.sumBy=cj,R.template=v9,R.times=$9,R.toFinite=Ti,R.toInteger=Ft,R.toLength=Rw,R.toLower=m9,R.toNumber=wr,R.toSafeInteger=m8,R.toString=se,R.toUpper=y9,R.trim=b9,R.trimEnd=x9,R.trimStart=E9,R.truncate=w9,R.unescape=k9,R.uniqueId=X9,R.upperCase=A9,R.upperFirst=Hf,R.each=bw,R.eachRight=xw,R.first=gw,Kf(R,(function(){var h={};return Jr(R,function(f,b){oe.call(R.prototype,b)||(h[b]=f)}),h})(),{chain:!1}),R.VERSION=r,vr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){R[h].placeholder=R}),vr(["drop","take"],function(h,f){Zt.prototype[h]=function(b){b=b===e?1:en(Ft(b),0);var C=this.__filtered__&&!f?new Zt(this):this.clone();return C.__filtered__?C.__takeCount__=bn(b,C.__takeCount__):C.__views__.push({size:bn(b,kt),type:h+(C.__dir__<0?"Right":"")}),C},Zt.prototype[h+"Right"]=function(b){return this.reverse()[h](b).reverse()}}),vr(["filter","map","takeWhile"],function(h,f){var b=f+1,C=b==z||b==J;Zt.prototype[h]=function(_){var D=this.clone();return D.__iteratees__.push({iteratee:At(_,3),type:b}),D.__filtered__=D.__filtered__||C,D}}),vr(["head","last"],function(h,f){var b="take"+(f?"Right":"");Zt.prototype[h]=function(){return this[b](1).value()[0]}}),vr(["initial","tail"],function(h,f){var b="drop"+(f?"":"Right");Zt.prototype[h]=function(){return this.__filtered__?new Zt(this):this[b](1)}}),Zt.prototype.compact=function(){return this.filter(Wn)},Zt.prototype.find=function(h){return this.filter(h).head()},Zt.prototype.findLast=function(h){return this.reverse().find(h)},Zt.prototype.invokeMap=$t(function(h,f){return typeof h=="function"?new Zt(this):this.map(function(b){return Is(b,h,f)})}),Zt.prototype.reject=function(h){return this.filter(Lc(At(h)))},Zt.prototype.slice=function(h,f){h=Ft(h);var b=this;return b.__filtered__&&(h>0||f<0)?new Zt(b):(h<0?b=b.takeRight(-h):h&&(b=b.drop(h)),f!==e&&(f=Ft(f),b=f<0?b.dropRight(-f):b.take(f-h)),b)},Zt.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},Zt.prototype.toArray=function(){return this.take(kt)},Jr(Zt.prototype,function(h,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),C=/^(?:head|last)$/.test(f),_=R[C?"take"+(f=="last"?"Right":""):f],D=C||/^find/.test(f);_&&(R.prototype[f]=function(){var I=this.__wrapped__,B=C?[1]:arguments,V=I instanceof Zt,Q=B[0],tt=V||jt(I),it=function(qt){var Jt=_.apply(R,Hi([qt],B));return C&&pt?Jt[0]:Jt};tt&&b&&typeof Q=="function"&&Q.length!=1&&(V=tt=!1);var pt=this.__chain__,xt=!!this.__actions__.length,Ct=D&&!pt,Vt=V&&!xt;if(!D&&tt){I=Vt?I:new Zt(this);var Nt=h.apply(I,B);return Nt.__actions__.push({func:Oc,args:[it],thisArg:e}),new yr(Nt,pt)}return Ct&&Vt?h.apply(this,B):(Nt=this.thru(it),Ct?C?Nt.value()[0]:Nt.value():Nt)})}),vr(["pop","push","shift","sort","splice","unshift"],function(h){var f=rc[h],b=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",C=/^(?:pop|shift)$/.test(h);R.prototype[h]=function(){var _=arguments;if(C&&!this.__chain__){var D=this.value();return f.apply(jt(D)?D:[],_)}return this[b](function(I){return f.apply(jt(I)?I:[],_)})}}),Jr(Zt.prototype,function(h,f){var b=R[f];if(b){var C=b.name+"";oe.call(To,C)||(To[C]=[]),To[C].push({name:f,func:b})}}),To[Ac(e,x).name]=[{name:"wrapper",func:e}],Zt.prototype.clone=kD,Zt.prototype.reverse=AD,Zt.prototype.value=SD,R.prototype.at=tI,R.prototype.chain=eI,R.prototype.commit=nI,R.prototype.next=rI,R.prototype.plant=aI,R.prototype.reverse=oI,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=sI,R.prototype.first=R.prototype.head,Ms&&(R.prototype[Ms]=iI),R}),So=nD();Na?((Na.exports=So)._=So,Xd._=So):pn._=So}).call(IJ)})(jl,jl.exports)),jl.exports}var BJ=jJ();const BT=lb(BJ);function s6(n){const t={};return n.forEach(e=>{t[e.name]=e.value}),t}function zJ(n){return n.name}function FJ(n){return(n||"").replace(/&#x([0-9a-fA-F]+);/g,(t,e)=>"\\u"+e)}function GJ(n,t=20){return((n==null?void 0:n.length)||0)>t?{text:n,maxWidth:150,wordWrap:!0,maxLines:3,offsetY:15}:{text:n,maxWidth:100,wordWrap:!1,maxLines:1,offsetY:10}}function VJ(n){var c,l,d;const t=s6(n.properties),e=((c=n==null?void 0:n.style)==null?void 0:c.keyshape)||{},r=((l=n==null?void 0:n.style)==null?void 0:l.icon)||{},i=((d=n==null?void 0:n.style)==null?void 0:d.label)||{},{style:a,...o}=n,s=zJ(n),u=GJ(s);return{id:n.vid,style:{x:n.x,y:n.y,size:e.size,fill:e.fill,stroke:"#000",lineWidth:1,radius:e.r,opacity:e.fillOpacity,shadowBlur:e.shadowBlur,shadowColor:"rgba(0, 0, 0, 0.25)",shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,cursor:e.cursor,label:i.visible,labelText:u.text,labelFill:i.fill,labelFontSize:i.fontSize,labelTextAlign:"center",labelTextBaseline:"top",labelOffsetX:0,labelOffsetY:u.offsetY,labelPlacement:"bottom",labelMaxWidth:u.maxWidth,labelWordWrap:u.wordWrap,labelMaxLines:u.maxLines,labelTextOverflow:"ellipsis",iconFontFamily:"iconfont",iconText:FJ(r.value||r.text),iconFontSize:r.fontSize,iconFill:r.fill},data:{...o,...t,nodeType:n.nodeType,name:n.name,hit:n.hit},states:n.hit?["highlight"]:[]}}function UJ(n){var u,c;const t=s6(n.properties),e=((u=n==null?void 0:n.style)==null?void 0:u.keyshape)||{},r=((c=n==null?void 0:n.style)==null?void 0:c.label)||{value:(n==null?void 0:n.name)||(n==null?void 0:n.edgeType),fill:"#000",fontSize:10},{style:i,src:a,dst:o,...s}=n;return{id:n.id,source:n.src.vid,target:n.dst.vid,style:{stroke:e.stroke||"#ccc",lineWidth:e.lineWidth||1,opacity:e.opacity||.85,cursor:e.cursor,label:!0,labelText:r.value,labelFill:r.fill,labelFontSize:r.fontSize,labelOffsetX:0,labelOffsetY:-15,labelPlacement:"center",endArrow:!0,startArrow:!1,endArrowSize:6,endArrowFill:e.stroke},data:{...s,...t,edgeType:n.edgeType,rank:n.rank}}}function WJ(n){if(!n||!n.nodeList||!n.edgeList)return console.error("\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E:",n),{nodes:[],edges:[]};const t=n.nodeList.map(VJ).filter(r=>r&&r.id),e=n.edgeList.map(UJ).filter(r=>r&&r.id&&r.source&&r.target);return console.log("sdglaksdjgklag",{nodes:t,edges:e}),{nodes:BT.uniqBy(t,"id"),edges:BT.uniqBy(e,"id")}}const YJ={halo:!0,haloStroke:"#1783FF",haloLineWidth:12,haloStrokeOpacity:.18},$J={lineWidth:2,stroke:"#1783FF"};function Qy(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function HJ(n,t,e){const r=n??{},i=Qy(r.state)?r.state:{},a=i.active,o=i.selected;let s;if(typeof a=="function")s=a;else{const c=Qy(a)?a:{};s={...YJ,...c,...t??{}}}let u;if(typeof o=="function")u=o;else{const c=Qy(o)?o:{};u={...$J,...c,...e??{}}}return{...r,state:{...i,active:s,selected:u}}}const XJ={lineWidth:2,opacity:1},qJ={lineWidth:3,stroke:"#1783FF",opacity:1};function t1(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function KJ(n,t,e){const r=n??{},i=t1(r.state)?r.state:{},a=i.active,o=i.selected;let s;if(typeof a=="function")s=a;else{const c=t1(a)?a:{};s={...XJ,...c,...t??{}}}let u;if(typeof o=="function")u=o;else{const c=t1(o)?o:{};u={...qJ,...c,...e??{}}}return{...r,state:{...i,active:s,selected:u}}}var Sl={},zT;function ZJ(){if(zT)return Sl;zT=1;var n=fj;return Sl.createRoot=n.createRoot,Sl.hydrateRoot=n.hydrateRoot,Sl}var JJ=ZJ();const nb=new WeakMap;function e1(n){const t=nb.get(n);t&&(t.unmount(),nb.delete(n))}function QJ(n){const{render:t,containerClassName:e="g6-react-tooltip-container"}=n;return async(r,i)=>{const a=document.createElement("div");a.className=e;const o=JJ.createRoot(a);o.render(t({event:r,items:Array.isArray(i)?i:[i]})),nb.set(a,o);let s=0;const u=()=>{if(s+=1,!a.isConnected){e1(a);return}const c=a.parentElement;if(c){const l=new MutationObserver(()=>{a.isConnected||(l.disconnect(),e1(a))});l.observe(c,{childList:!0}),window.setTimeout(()=>{try{l.disconnect()}catch{}a.isConnected||e1(a)},3e4);return}s<10&&requestAnimationFrame(u)};return requestAnimationFrame(u),a}}var Zn=function(){return Zn=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Zn.apply(this,arguments)};function Sh(n,t,e){if(e||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return n.concat(a||Array.prototype.slice.call(t))}var Ae="-ms-",bu="-moz-",ue="-webkit-",u6="comm",Od="rule",dx="decl",tQ="@import",c6="@keyframes",eQ="@layer",l6=Math.abs,fx=String.fromCharCode,rb=Object.assign;function nQ(n,t){return hn(n,0)^45?(((t<<2^hn(n,0))<<2^hn(n,1))<<2^hn(n,2))<<2^hn(n,3):0}function h6(n){return n.trim()}function Oi(n,t){return(n=t.exec(n))?n[0]:n}function Ut(n,t,e){return n.replace(t,e)}function Bl(n,t,e){return n.indexOf(t,e)}function hn(n,t){return n.charCodeAt(t)|0}function hs(n,t,e){return n.slice(t,e)}function ai(n){return n.length}function d6(n){return n.length}function hu(n,t){return t.push(n),n}function rQ(n,t){return n.map(t).join("")}function FT(n,t){return n.filter(function(e){return!Oi(e,t)})}var Pd=1,ds=1,f6=0,Pr=0,qe=0,Ss="";function Rd(n,t,e,r,i,a,o,s){return{value:n,root:t,parent:e,type:r,props:i,children:a,line:Pd,column:ds,length:o,return:"",siblings:s}}function na(n,t){return rb(Rd("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},t)}function Uo(n){for(;n.root;)n=na(n.root,{children:[n]});hu(n,n.siblings)}function iQ(){return qe}function aQ(){return qe=Pr>0?hn(Ss,--Pr):0,ds--,qe===10&&(ds=1,Pd--),qe}function Hr(){return qe=Pr<f6?hn(Ss,Pr++):0,ds++,qe===10&&(ds=1,Pd++),qe}function eo(){return hn(Ss,Pr)}function zl(){return Pr}function Dd(n,t){return hs(Ss,n,t)}function ib(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function oQ(n){return Pd=ds=1,f6=ai(Ss=n),Pr=0,[]}function sQ(n){return Ss="",n}function n1(n){return h6(Dd(Pr-1,ab(n===91?n+2:n===40?n+1:n)))}function uQ(n){for(;(qe=eo())&&qe<33;)Hr();return ib(n)>2||ib(qe)>3?"":" "}function cQ(n,t){for(;--t&&Hr()&&!(qe<48||qe>102||qe>57&&qe<65||qe>70&&qe<97););return Dd(n,zl()+(t<6&&eo()==32&&Hr()==32))}function ab(n){for(;Hr();)switch(qe){case n:return Pr;case 34:case 39:n!==34&&n!==39&&ab(qe);break;case 40:n===41&&ab(n);break;case 92:Hr();break}return Pr}function lQ(n,t){for(;Hr()&&n+qe!==57&&!(n+qe===84&&eo()===47););return"/*"+Dd(t,Pr-1)+"*"+fx(n===47?n:Hr())}function hQ(n){for(;!ib(eo());)Hr();return Dd(n,Pr)}function dQ(n){return sQ(Fl("",null,null,null,[""],n=oQ(n),0,[0],n))}function Fl(n,t,e,r,i,a,o,s,u){for(var c=0,l=0,d=o,p=0,g=0,m=0,y=1,v=1,x=1,E=0,w="",S=i,k=a,A=r,N=w;v;)switch(m=E,E=Hr()){case 40:if(m!=108&&hn(N,d-1)==58){Bl(N+=Ut(n1(E),"&","&\f"),"&\f",l6(c?s[c-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:N+=n1(E);break;case 9:case 10:case 13:case 32:N+=uQ(m);break;case 92:N+=cQ(zl()-1,7);continue;case 47:switch(eo()){case 42:case 47:hu(fQ(lQ(Hr(),zl()),t,e,u),u);break;default:N+="/"}break;case 123*y:s[c++]=ai(N)*x;case 125*y:case 59:case 0:switch(E){case 0:case 125:v=0;case 59+l:x==-1&&(N=Ut(N,/\f/g,"")),g>0&&ai(N)-d&&hu(g>32?VT(N+";",r,e,d-1,u):VT(Ut(N," ","")+";",r,e,d-2,u),u);break;case 59:N+=";";default:if(hu(A=GT(N,t,e,c,l,i,s,w,S=[],k=[],d,a),a),E===123)if(l===0)Fl(N,t,A,A,S,a,d,s,k);else switch(p===99&&hn(N,3)===110?100:p){case 100:case 108:case 109:case 115:Fl(n,A,A,r&&hu(GT(n,A,A,0,0,i,s,w,i,S=[],d,k),k),i,k,d,s,r?S:k);break;default:Fl(N,A,A,A,[""],k,0,s,k)}}c=l=g=0,y=x=1,w=N="",d=o;break;case 58:d=1+ai(N),g=m;default:if(y<1){if(E==123)--y;else if(E==125&&y++==0&&aQ()==125)continue}switch(N+=fx(E),E*y){case 38:x=l>0?1:(N+="\f",-1);break;case 44:s[c++]=(ai(N)-1)*x,x=1;break;case 64:eo()===45&&(N+=n1(Hr())),p=eo(),l=d=ai(w=N+=hQ(zl())),E++;break;case 45:m===45&&ai(N)==2&&(y=0)}}return a}function GT(n,t,e,r,i,a,o,s,u,c,l,d){for(var p=i-1,g=i===0?a:[""],m=d6(g),y=0,v=0,x=0;y<r;++y)for(var E=0,w=hs(n,p+1,p=l6(v=o[y])),S=n;E<m;++E)(S=h6(v>0?g[E]+" "+w:Ut(w,/&\f/g,g[E])))&&(u[x++]=S);return Rd(n,t,e,i===0?Od:s,u,c,l,d)}function fQ(n,t,e,r){return Rd(n,t,e,u6,fx(iQ()),hs(n,2,-2),0,r)}function VT(n,t,e,r,i){return Rd(n,t,e,dx,hs(n,0,r),hs(n,r+1,-1),r,i)}function p6(n,t,e){switch(nQ(n,t)){case 5103:return ue+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ue+n+n;case 4789:return bu+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return ue+n+bu+n+Ae+n+n;case 5936:switch(hn(n,t+11)){case 114:return ue+n+Ae+Ut(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return ue+n+Ae+Ut(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return ue+n+Ae+Ut(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return ue+n+Ae+n+n;case 6165:return ue+n+Ae+"flex-"+n+n;case 5187:return ue+n+Ut(n,/(\w+).+(:[^]+)/,ue+"box-$1$2"+Ae+"flex-$1$2")+n;case 5443:return ue+n+Ae+"flex-item-"+Ut(n,/flex-|-self/g,"")+(Oi(n,/flex-|baseline/)?"":Ae+"grid-row-"+Ut(n,/flex-|-self/g,""))+n;case 4675:return ue+n+Ae+"flex-line-pack"+Ut(n,/align-content|flex-|-self/g,"")+n;case 5548:return ue+n+Ae+Ut(n,"shrink","negative")+n;case 5292:return ue+n+Ae+Ut(n,"basis","preferred-size")+n;case 6060:return ue+"box-"+Ut(n,"-grow","")+ue+n+Ae+Ut(n,"grow","positive")+n;case 4554:return ue+Ut(n,/([^-])(transform)/g,"$1"+ue+"$2")+n;case 6187:return Ut(Ut(Ut(n,/(zoom-|grab)/,ue+"$1"),/(image-set)/,ue+"$1"),n,"")+n;case 5495:case 3959:return Ut(n,/(image-set\([^]*)/,ue+"$1$`$1");case 4968:return Ut(Ut(n,/(.+:)(flex-)?(.*)/,ue+"box-pack:$3"+Ae+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ue+n+n;case 4200:if(!Oi(n,/flex-|baseline/))return Ae+"grid-column-align"+hs(n,t)+n;break;case 2592:case 3360:return Ae+Ut(n,"template-","")+n;case 4384:case 3616:return e&&e.some(function(r,i){return t=i,Oi(r.props,/grid-\w+-end/)})?~Bl(n+(e=e[t].value),"span",0)?n:Ae+Ut(n,"-start","")+n+Ae+"grid-row-span:"+(~Bl(e,"span",0)?Oi(e,/\d+/):+Oi(e,/\d+/)-+Oi(n,/\d+/))+";":Ae+Ut(n,"-start","")+n;case 4896:case 4128:return e&&e.some(function(r){return Oi(r.props,/grid-\w+-start/)})?n:Ae+Ut(Ut(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return Ut(n,/(.+)-inline(.+)/,ue+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ai(n)-1-t>6)switch(hn(n,t+1)){case 109:if(hn(n,t+4)!==45)break;case 102:return Ut(n,/(.+:)(.+)-([^]+)/,"$1"+ue+"$2-$3$1"+bu+(hn(n,t+3)==108?"$3":"$2-$3"))+n;case 115:return~Bl(n,"stretch",0)?p6(Ut(n,"stretch","fill-available"),t,e)+n:n}break;case 5152:case 5920:return Ut(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,o,s,u,c){return Ae+i+":"+a+c+(o?Ae+i+"-span:"+(s?u:+u-+a)+c:"")+n});case 4949:if(hn(n,t+6)===121)return Ut(n,":",":"+ue)+n;break;case 6444:switch(hn(n,hn(n,14)===45?18:11)){case 120:return Ut(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ue+(hn(n,14)===45?"inline-":"")+"box$3$1"+ue+"$2$3$1"+Ae+"$2box$3")+n;case 100:return Ut(n,":",":"+Ae)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ut(n,"scroll-","scroll-snap-")+n}return n}function Ch(n,t){for(var e="",r=0;r<n.length;r++)e+=t(n[r],r,n,t)||"";return e}function pQ(n,t,e,r){switch(n.type){case eQ:if(n.children.length)break;case tQ:case dx:return n.return=n.return||n.value;case u6:return"";case c6:return n.return=n.value+"{"+Ch(n.children,r)+"}";case Od:if(!ai(n.value=n.props.join(",")))return""}return ai(e=Ch(n.children,r))?n.return=n.value+"{"+e+"}":""}function gQ(n){var t=d6(n);return function(e,r,i,a){for(var o="",s=0;s<t;s++)o+=n[s](e,r,i,a)||"";return o}}function vQ(n){return function(t){t.root||(t=t.return)&&n(t)}}function mQ(n,t,e,r){if(n.length>-1&&!n.return)switch(n.type){case dx:n.return=p6(n.value,n.length,e);return;case c6:return Ch([na(n,{value:Ut(n.value,"@","@"+ue)})],r);case Od:if(n.length)return rQ(e=n.props,function(i){switch(Oi(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Uo(na(n,{props:[Ut(i,/:(read-\w+)/,":"+bu+"$1")]})),Uo(na(n,{props:[i]})),rb(n,{props:FT(e,r)});break;case"::placeholder":Uo(na(n,{props:[Ut(i,/:(plac\w+)/,":"+ue+"input-$1")]})),Uo(na(n,{props:[Ut(i,/:(plac\w+)/,":"+bu+"$1")]})),Uo(na(n,{props:[Ut(i,/:(plac\w+)/,Ae+"input-$1")]})),Uo(na(n,{props:[i]})),rb(n,{props:FT(e,r)});break}return""})}}var yQ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fs=typeof process<"u"&&sr!==void 0&&(sr.REACT_APP_SC_ATTR||sr.SC_ATTR)||"data-styled",g6="active",v6="data-styled-version",Ld="6.1.19",px=`/*!sc*/
252
+ `,Nh=typeof window<"u"&&typeof document<"u",bQ=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&sr!==void 0&&sr.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&sr.REACT_APP_SC_DISABLE_SPEEDY!==""?sr.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&sr.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&sr!==void 0&&sr.SC_DISABLE_SPEEDY!==void 0&&sr.SC_DISABLE_SPEEDY!==""&&sr.SC_DISABLE_SPEEDY!=="false"&&sr.SC_DISABLE_SPEEDY),Id=Object.freeze([]),ps=Object.freeze({});function xQ(n,t,e){return e===void 0&&(e=ps),n.theme!==e.theme&&n.theme||t||e.theme}var m6=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),EQ=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wQ=/(^-|-$)/g;function UT(n){return n.replace(EQ,"-").replace(wQ,"")}var kQ=/(a)(d)/gi,Cl=52,WT=function(n){return String.fromCharCode(n+(n>25?39:97))};function ob(n){var t,e="";for(t=Math.abs(n);t>Cl;t=t/Cl|0)e=WT(t%Cl)+e;return(WT(t%Cl)+e).replace(kQ,"$1-$2")}var r1,y6=5381,Ho=function(n,t){for(var e=t.length;e;)n=33*n^t.charCodeAt(--e);return n},b6=function(n){return Ho(y6,n)};function AQ(n){return ob(b6(n)>>>0)}function SQ(n){return n.displayName||n.name||"Component"}function i1(n){return typeof n=="string"&&!0}var x6=typeof Symbol=="function"&&Symbol.for,E6=x6?Symbol.for("react.memo"):60115,CQ=x6?Symbol.for("react.forward_ref"):60112,NQ={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},TQ={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w6={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},MQ=((r1={})[CQ]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r1[E6]=w6,r1);function YT(n){return("type"in(t=n)&&t.type.$$typeof)===E6?w6:"$$typeof"in n?MQ[n.$$typeof]:NQ;var t}var _Q=Object.defineProperty,OQ=Object.getOwnPropertyNames,$T=Object.getOwnPropertySymbols,PQ=Object.getOwnPropertyDescriptor,RQ=Object.getPrototypeOf,HT=Object.prototype;function k6(n,t,e){if(typeof t!="string"){if(HT){var r=RQ(t);r&&r!==HT&&k6(n,r,e)}var i=OQ(t);$T&&(i=i.concat($T(t)));for(var a=YT(n),o=YT(t),s=0;s<i.length;++s){var u=i[s];if(!(u in TQ||e&&e[u]||o&&u in o||a&&u in a)){var c=PQ(t,u);try{_Q(n,u,c)}catch{}}}}return n}function gs(n){return typeof n=="function"}function gx(n){return typeof n=="object"&&"styledComponentId"in n}function Ka(n,t){return n&&t?"".concat(n," ").concat(t):n||t||""}function XT(n,t){if(n.length===0)return"";for(var e=n[0],r=1;r<n.length;r++)e+=n[r];return e}function Du(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function sb(n,t,e){if(e===void 0&&(e=!1),!e&&!Du(n)&&!Array.isArray(n))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)n[r]=sb(n[r],t[r]);else if(Du(t))for(var r in t)n[r]=sb(n[r],t[r]);return n}function vx(n,t){Object.defineProperty(n,"toString",{value:t})}function Ku(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(n," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var DQ=(function(){function n(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return n.prototype.indexOfGroup=function(t){for(var e=0,r=0;r<t;r++)e+=this.groupSizes[r];return e},n.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;t>=a;)if((a<<=1)<0)throw Ku(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var o=i;o<a;o++)this.groupSizes[o]=0}for(var s=this.indexOfGroup(t+1),u=(o=0,e.length);o<u;o++)this.tag.insertRule(s,e[o])&&(this.groupSizes[t]++,s++)},n.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],r=this.indexOfGroup(t),i=r+e;this.groupSizes[t]=0;for(var a=r;a<i;a++)this.tag.deleteRule(r)}},n.prototype.getGroup=function(t){var e="";if(t>=this.length||this.groupSizes[t]===0)return e;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),a=i+r,o=i;o<a;o++)e+="".concat(this.tag.getRule(o)).concat(px);return e},n})(),Gl=new Map,Th=new Map,Vl=1,Nl=function(n){if(Gl.has(n))return Gl.get(n);for(;Th.has(Vl);)Vl++;var t=Vl++;return Gl.set(n,t),Th.set(t,n),t},LQ=function(n,t){Vl=t+1,Gl.set(n,t),Th.set(t,n)},IQ="style[".concat(fs,"][").concat(v6,'="').concat(Ld,'"]'),jQ=new RegExp("^".concat(fs,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),BQ=function(n,t,e){for(var r,i=e.split(","),a=0,o=i.length;a<o;a++)(r=i[a])&&n.registerName(t,r)},zQ=function(n,t){for(var e,r=((e=t.textContent)!==null&&e!==void 0?e:"").split(px),i=[],a=0,o=r.length;a<o;a++){var s=r[a].trim();if(s){var u=s.match(jQ);if(u){var c=0|parseInt(u[1],10),l=u[2];c!==0&&(LQ(l,c),BQ(n,l,u[3]),n.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}},qT=function(n){for(var t=document.querySelectorAll(IQ),e=0,r=t.length;e<r;e++){var i=t[e];i&&i.getAttribute(fs)!==g6&&(zQ(n,i),i.parentNode&&i.parentNode.removeChild(i))}};function FQ(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var A6=function(n){var t=document.head,e=n||t,r=document.createElement("style"),i=(function(s){var u=Array.from(s.querySelectorAll("style[".concat(fs,"]")));return u[u.length-1]})(e),a=i!==void 0?i.nextSibling:null;r.setAttribute(fs,g6),r.setAttribute(v6,Ld);var o=FQ();return o&&r.setAttribute("nonce",o),e.insertBefore(r,a),r},GQ=(function(){function n(t){this.element=A6(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(e){if(e.sheet)return e.sheet;for(var r=document.styleSheets,i=0,a=r.length;i<a;i++){var o=r[i];if(o.ownerNode===e)return o}throw Ku(17)})(this.element),this.length=0}return n.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch{return!1}},n.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},n.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},n})(),VQ=(function(){function n(t){this.element=A6(t),this.nodes=this.element.childNodes,this.length=0}return n.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var r=document.createTextNode(e);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},n.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},n})(),UQ=(function(){function n(t){this.rules=[],this.length=0}return n.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},n.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},n.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},n})(),KT=Nh,WQ={isServer:!Nh,useCSSOMInjection:!bQ},S6=(function(){function n(t,e,r){t===void 0&&(t=ps),e===void 0&&(e={});var i=this;this.options=Zn(Zn({},WQ),t),this.gs=e,this.names=new Map(r),this.server=!!t.isServer,!this.server&&Nh&&KT&&(KT=!1,qT(this)),vx(this,function(){return(function(a){for(var o=a.getTag(),s=o.length,u="",c=function(d){var p=(function(x){return Th.get(x)})(d);if(p===void 0)return"continue";var g=a.names.get(p),m=o.getGroup(d);if(g===void 0||!g.size||m.length===0)return"continue";var y="".concat(fs,".g").concat(d,'[id="').concat(p,'"]'),v="";g!==void 0&&g.forEach(function(x){x.length>0&&(v+="".concat(x,","))}),u+="".concat(m).concat(y,'{content:"').concat(v,'"}').concat(px)},l=0;l<s;l++)c(l);return u})(i)})}return n.registerId=function(t){return Nl(t)},n.prototype.rehydrate=function(){!this.server&&Nh&&qT(this)},n.prototype.reconstructWithOptions=function(t,e){return e===void 0&&(e=!0),new n(Zn(Zn({},this.options),t),this.gs,e&&this.names||void 0)},n.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},n.prototype.getTag=function(){return this.tag||(this.tag=(t=(function(e){var r=e.useCSSOMInjection,i=e.target;return e.isServer?new UQ(i):r?new GQ(i):new VQ(i)})(this.options),new DQ(t)));var t},n.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},n.prototype.registerName=function(t,e){if(Nl(t),this.names.has(t))this.names.get(t).add(e);else{var r=new Set;r.add(e),this.names.set(t,r)}},n.prototype.insertRules=function(t,e,r){this.registerName(t,e),this.getTag().insertRules(Nl(t),r)},n.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},n.prototype.clearRules=function(t){this.getTag().clearGroup(Nl(t)),this.clearNames(t)},n.prototype.clearTag=function(){this.tag=void 0},n})(),YQ=/&/g,$Q=/^\s*\/\/.*$/gm;function C6(n,t){return n.map(function(e){return e.type==="rule"&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(e.children)&&e.type!=="@keyframes"&&(e.children=C6(e.children,t)),e})}function HQ(n){var t,e,r,i=ps,a=i.options,o=a===void 0?ps:a,s=i.plugins,u=s===void 0?Id:s,c=function(p,g,m){return m.startsWith(e)&&m.endsWith(e)&&m.replaceAll(e,"").length>0?".".concat(t):p},l=u.slice();l.push(function(p){p.type===Od&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(YQ,e).replace(r,c))}),o.prefix&&l.push(mQ),l.push(pQ);var d=function(p,g,m,y){g===void 0&&(g=""),m===void 0&&(m=""),y===void 0&&(y="&"),t=y,e=g,r=new RegExp("\\".concat(e,"\\b"),"g");var v=p.replace($Q,""),x=dQ(m||g?"".concat(m," ").concat(g," { ").concat(v," }"):v);o.namespace&&(x=C6(x,o.namespace));var E=[];return Ch(x,gQ(l.concat(vQ(function(w){return E.push(w)})))),E};return d.hash=u.length?u.reduce(function(p,g){return g.name||Ku(15),Ho(p,g.name)},y6).toString():"",d}var XQ=new S6,ub=HQ(),qQ=ts.createContext({shouldForwardProp:void 0,styleSheet:XQ,stylis:ub});ts.createContext(void 0);function ZT(){return dj(qQ)}var KQ=(function(){function n(t,e){var r=this;this.inject=function(i,a){a===void 0&&(a=ub);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,vx(this,function(){throw Ku(12,String(r.name))})}return n.prototype.getName=function(t){return t===void 0&&(t=ub),this.name+t.hash},n})(),ZQ=function(n){return n>="A"&&n<="Z"};function JT(n){for(var t="",e=0;e<n.length;e++){var r=n[e];if(e===1&&r==="-"&&n[0]==="-")return n;ZQ(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var N6=function(n){return n==null||n===!1||n===""},T6=function(n){var t,e,r=[];for(var i in n){var a=n[i];n.hasOwnProperty(i)&&!N6(a)&&(Array.isArray(a)&&a.isCss||gs(a)?r.push("".concat(JT(i),":"),a,";"):Du(a)?r.push.apply(r,Sh(Sh(["".concat(i," {")],T6(a),!1),["}"],!1)):r.push("".concat(JT(i),": ").concat((t=i,(e=a)==null||typeof e=="boolean"||e===""?"":typeof e!="number"||e===0||t in yQ||t.startsWith("--")?String(e).trim():"".concat(e,"px")),";")))}return r};function no(n,t,e,r){if(N6(n))return[];if(gx(n))return[".".concat(n.styledComponentId)];if(gs(n)){if(!gs(a=n)||a.prototype&&a.prototype.isReactComponent||!t)return[n];var i=n(t);return no(i,t,e,r)}var a;return n instanceof KQ?e?(n.inject(e,r),[n.getName(r)]):[n]:Du(n)?T6(n):Array.isArray(n)?Array.prototype.concat.apply(Id,n.map(function(o){return no(o,t,e,r)})):[n.toString()]}function JQ(n){for(var t=0;t<n.length;t+=1){var e=n[t];if(gs(e)&&!gx(e))return!1}return!0}var QQ=b6(Ld),t4=(function(){function n(t,e,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&JQ(t),this.componentId=e,this.baseHash=Ho(QQ,e),this.baseStyle=r,S6.registerId(e)}return n.prototype.generateAndInjectStyles=function(t,e,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))i=Ka(i,this.staticRulesId);else{var a=XT(no(this.rules,t,e,r)),o=ob(Ho(this.baseHash,a)>>>0);if(!e.hasNameForId(this.componentId,o)){var s=r(a,".".concat(o),void 0,this.componentId);e.insertRules(this.componentId,o,s)}i=Ka(i,o),this.staticRulesId=o}else{for(var u=Ho(this.baseHash,r.hash),c="",l=0;l<this.rules.length;l++){var d=this.rules[l];if(typeof d=="string")c+=d;else if(d){var p=XT(no(d,t,e,r));u=Ho(u,p+l),c+=p}}if(c){var g=ob(u>>>0);e.hasNameForId(this.componentId,g)||e.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=Ka(i,g)}}return i},n})(),e4=ts.createContext(void 0),a1={};function n4(n,t,e){var r=gx(n),i=n,a=!i1(n),o=t.attrs,s=o===void 0?Id:o,u=t.componentId,c=u===void 0?(function(S,k){var A=typeof S!="string"?"sc":UT(S);a1[A]=(a1[A]||0)+1;var N="".concat(A,"-").concat(AQ(Ld+A+a1[A]));return k?"".concat(k,"-").concat(N):N})(t.displayName,t.parentComponentId):u,l=t.displayName,d=l===void 0?(function(S){return i1(S)?"styled.".concat(S):"Styled(".concat(SQ(S),")")})(n):l,p=t.displayName&&t.componentId?"".concat(UT(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,m=t.shouldForwardProp;if(r&&i.shouldForwardProp){var y=i.shouldForwardProp;if(t.shouldForwardProp){var v=t.shouldForwardProp;m=function(S,k){return y(S,k)&&v(S,k)}}else m=y}var x=new t4(e,p,r?i.componentStyle:void 0);function E(S,k){return(function(A,N,T){var O=A.attrs,M=A.componentStyle,P=A.defaultProps,L=A.foldedComponentIds,j=A.styledComponentId,z=A.target,U=ts.useContext(e4),J=ZT(),W=A.shouldForwardProp||J.shouldForwardProp,at=xQ(N,U,P)||ps,ut=(function(Y,F,K){for(var ot,dt=Zn(Zn({},F),{className:void 0,theme:K}),mt=0;mt<Y.length;mt+=1){var Ot=gs(ot=Y[mt])?ot(dt):ot;for(var ne in Ot)dt[ne]=ne==="className"?Ka(dt[ne],Ot[ne]):ne==="style"?Zn(Zn({},dt[ne]),Ot[ne]):Ot[ne]}return F.className&&(dt.className=Ka(dt.className,F.className)),dt})(O,N,at),yt=ut.as||z,kt={};for(var It in ut)ut[It]===void 0||It[0]==="$"||It==="as"||It==="theme"&&ut.theme===at||(It==="forwardedAs"?kt.as=ut.forwardedAs:W&&!W(It,yt)||(kt[It]=ut[It]));var ee=(function(Y,F){var K=ZT(),ot=Y.generateAndInjectStyles(F,K.styleSheet,K.stylis);return ot})(M,ut),$=Ka(L,j);return ee&&($+=" "+ee),ut.className&&($+=" "+ut.className),kt[i1(yt)&&!m6.has(yt)?"class":"className"]=$,T&&(kt.ref=T),hj(yt,kt)})(w,S,k)}E.displayName=d;var w=ts.forwardRef(E);return w.attrs=g,w.componentStyle=x,w.displayName=d,w.shouldForwardProp=m,w.foldedComponentIds=r?Ka(i.foldedComponentIds,i.styledComponentId):"",w.styledComponentId=p,w.target=r?i.target:n,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(S){this._foldedDefaultProps=r?(function(k){for(var A=[],N=1;N<arguments.length;N++)A[N-1]=arguments[N];for(var T=0,O=A;T<O.length;T++)sb(k,O[T],!0);return k})({},i.defaultProps,S):S}}),vx(w,function(){return".".concat(w.styledComponentId)}),a&&k6(w,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function QT(n,t){for(var e=[n[0]],r=0,i=t.length;r<i;r+=1)e.push(t[r],n[r+1]);return e}var tM=function(n){return Object.assign(n,{isCss:!0})};function r4(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(gs(n)||Du(n))return tM(no(QT(Id,Sh([n],t,!0))));var r=n;return t.length===0&&r.length===1&&typeof r[0]=="string"?no(r):tM(no(QT(r,t)))}function cb(n,t,e){if(e===void 0&&(e=ps),!t)throw Ku(1,t);var r=function(i){for(var a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];return n(t,e,r4.apply(void 0,Sh([i],a,!1)))};return r.attrs=function(i){return cb(n,t,Zn(Zn({},e),{attrs:Array.prototype.concat(e.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return cb(n,t,Zn(Zn({},e),i))},r}var M6=function(n){return cb(n4,n)},jd=M6;m6.forEach(function(n){jd[n]=M6(n)});const i4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAASJJREFUeAHtVO1twkAMPZ8yAJ2gdJOOECkff0k36Aalk0D/RomUjtBJChukC+T6HuQiA3fwD4GEJcuW/fx8d7FjzK2LeCfLspWIzJ1zG9ht0zTLWFGaprMkSd6BfbbWzoZh6Nu2fWPOTswiT9BXACqoOSdd1/XEEEt+2Bef05W9d9jZXBCNwQl/Q4S86if0C35VFMUqRjbmKmLHmu0JiO/i/bIs1yhyIVLGmCMm1Gw6Id/F+3Vd++4nnRljjhjzkOsKv2ae5x/HccbOjZSNkcFUegOmgn3sYE71yInqvIRx3GczDm1sNDiD2JQFXNoNefzuJwo3B8li1+XCnDEHUq4fG3P11tMNFC64mzHRGP5YQoR/0G905S6LfpeIyIj9MXcl/wXdf/S0Z6m/AAAAAElFTkSuQmCC",a4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAXhJREFUeAHVU0tSg0AQHTA5h2SbLExWbuEGsRKq2EVvEE9gcgL1BGZJ8ZMbBE9g3FDsxBvgzip+vo7EQhiS4EpfVdcb6J7H66GHsb8OYV9SVdVhnucyQtoWC0KYJIkLhK0EC6FbCMi8PHIehK94wmL1xWQymYHWEBsilnEc90zTFCjwfoS4F0VR6na7r0Vts0NyBnpGhBBSmlrTNE3KsmxNR4FQLMvyuA7h6PGQGEHX9RAuFSwj7HlgvJZhf0xfTNN0uU+sLAq6RkjT6VSuCeJLY2LHcVbsSKATl1zCyKwmCJwinlgLoJMIRO33eIK/AtxF5eey4Dv7ctkKNEJNghtWOeBDKC4AjY5bE8Tk3xHj59wcqUftzou934Inu0UQBB/9fh96wiWY+b7P/UE0XsifDwaDMWrndJts2647JGDiFyCPRFkDcGYyYoUaqt0YhrH4ka9uwJ1VMF8j1tzm2W6NuotqvsPbVMxXk+AL6G27udORQCH7V/gEb9CzzMvMKcQAAAAASUVORK5CYII=",o4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAeBJREFUeAHVVEtSwkAQDUlYG5fusqZYxBuEExiKT7FDTiA3MJwAOYFxh0BhbiA5gSyArXHpDpcWn/geTqhhjJQLF9pVUz3d0/36Mz2jaX+dcllKz/Ms0zSvsHVzuZwDbmEtkySZbrfbu/F4HPwYsFarOQB5gLMNMQLAFDLBLMMwLoQ+Xq1WpTAM46OABAN7FNm0RqPRJCPgJQJc41zLAtUP0JEZwWiYgrF8LDu1GQ6Hga7rJbYhn8/fqgF1OTLLUaPCycN6lkH7/X4M2x62brVadTMBYdAEi7L6kkXr9fpG+2yNJ+tNqVwXh51UrlQqHkqzoONNa7h1D1UQIGY7EHgJeQobJxNQJYCkY5PKXVFJADYR+zfore8Ad6MhlVQG4zx6BMNZCbqYdpLPiZqIDMj0L8DbFFgSnVmmCBDL/W00GvZmszloE2l/KRhg3prN3skG0BPwRc0EAZqCB7JeHWwOtYPROT922wjaRDUBWtEZDAZ+ZoYkPK0Wnxnm7gnz1VaBOOT1er1LMJF9otp8ecvsDcrwAcySdh8CR4WfhPgoSD3xvvkEfYzRvo+GCjibzZaLxSIsFAoRjN+RzRmcT7Fese7RjjJ+m3A+n0+KxSIT8mGrwSfSfoPQAh8r0P4NfQBAUxDH+xYbsQAAAABJRU5ErkJggg==",s4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAcJJREFUeAHVVDtywjAQlT8UqeKU6VwzFOQGcALM8Bk64AThBjEnSDgBTpnhE98g9glCAdRu0zllho/z1siMLRSHIkV4MzsrWau3H++Ksf8ORfbRsixD1/V7LCuKopShDUgYRdFiv98/z+dz52zCVqtVBskrLpvY+iBYYE9khqZpNf492Gw2Vdd1g1xCIoN649H0p9OpJ3HYg4MHnDMZqZphR2RERoYyMsJkMnFUVa1SGQqFwlg819KeoXogu5OlksZyuQyLxeIVAuhB++v1OjiJECl0ofzfyBJst9sndiiNlf6uJwt4q+BwmOwbjYaF1AyRCDYBlQOOQ2S1gE1ZSigCDuK2kRA6UB5ff8LO+Ikwbo1USnV26D8RYWp9LR6mCSn8GvSANpSScDmDTqdj7na7TJkIx5+CBh5BmVQ7dgaQQZdrR0o4m81cKA9RjjF6Zh4ZnHZROxsyzG1sjFafxgwN+95sNgciEc14u91+hFOHZxWJNiezTLVBGuSdUoofBGoVeiT4Q0EY8fmmEbTRRsc6aiIhTQE636UJgPEXornF5RvIB+QFk1THa+OuViuvVCpRQDZsGe747C+AEtgQh10MvgGkjexyZNJuMAAAAABJRU5ErkJggg==",u4=jd.div.attrs({className:"graph-toolbar-floatbar-root"})`
253
+ position: absolute;
254
+ z-index: 200;
255
+ top: 50%;
256
+ right: 12px;
257
+ transform: translateY(-50%);
258
+ display: flex;
259
+ flex-direction: column;
260
+ align-items: stretch;
261
+ gap: 0;
262
+ padding: 4px;
263
+ background: #ffffff;
264
+ border: 1px solid #e5e6eb;
265
+ border-radius: 10px;
266
+ box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
267
+ `,Tl=jd.button.attrs({type:"button",className:"graph-toolbar-floatbar-btn"})`
268
+ display: inline-flex;
269
+ align-items: center;
270
+ justify-content: center;
271
+ width: 36px;
272
+ height: 36px;
273
+ padding: 0;
274
+ border: none;
275
+ background: transparent;
276
+ color: #334155;
277
+ cursor: pointer;
278
+ border-radius: 8px;
279
+ transition: background 0.15s ease;
280
+
281
+ &:hover {
282
+ background: #f2f3f5;
283
+ }
284
+
285
+ &:active {
286
+ background: #e8e9eb;
287
+ }
288
+
289
+ svg {
290
+ width: 18px;
291
+ height: 18px;
292
+ flex-shrink: 0;
293
+ }
294
+ `,o1=jd.span.attrs({className:"graph-toolbar-floatbar-divider"})`
295
+ width: 18px;
296
+ height: 1px;
297
+ background: #e5e6eb;
298
+ margin: 2px auto;
299
+ `;function c4({showFullscreen:n=!0,onAction:t}){return nn.jsxs(u4,{role:"toolbar","aria-label":"\u56FE\u8C31\u5DE5\u5177\u680F",children:[nn.jsx(Tl,{title:"\u5168\u5C4F",onClick:()=>t("fullscreen"),children:nn.jsx("img",{src:i4,width:20})}),nn.jsx(o1,{}),nn.jsx(Tl,{title:"\u653E\u5927",onClick:()=>t("zoom-in"),children:nn.jsx("img",{src:o4,width:20})}),nn.jsx(o1,{}),nn.jsx(Tl,{title:"\u7F29\u5C0F",onClick:()=>t("zoom-out"),children:nn.jsx("img",{src:s4,width:20})}),nn.jsx(o1,{}),nn.jsx(Tl,{title:"\u56DE\u5230\u4E2D\u5FC3",onClick:()=>t("auto-fit"),children:nn.jsx("img",{src:a4,width:20})})]})}function _6(n){var t;try{const e=(t=n==null?void 0:n.context)==null?void 0:t.canvas;if(e&&typeof e.getContainer=="function"){const r=e.getContainer();return r instanceof HTMLElement?r:null}}catch{}return null}function eM(n){const t=_6(n),e=document.fullscreenElement;return!!(t&&e&&e===t)}function nM(n,t){var e,r,i,a;if(n)try{const o=n.getZoom?n.getZoom():1;switch(t){case"zoom-in":{const s=Math.min(o*1.2,10);n.zoomTo?n.zoomTo(s):n.zoom&&n.zoom(1.2);break}case"zoom-out":{const s=Math.max(o/1.2,.1);n.zoomTo?n.zoomTo(s):n.zoom&&n.zoom(.8);break}case"auto-fit":{n.fitView?n.fitView():n.fitCenter&&n.fitCenter();break}case"fullscreen":{const s=(e=n.getPluginInstance)==null?void 0:e.call(n,"fullscreen");if(s){eM(n)?(r=s.exit)==null||r.call(s):document.fullscreenElement||((i=s.request)==null||i.call(s));return}const u=_6(n);if(!u)return;eM(n)?document.exitFullscreen().catch(()=>{}):document.fullscreenElement||((a=u.requestFullscreen)==null||a.call(u).catch(()=>{}));break}default:break}}catch(o){console.warn("\u6267\u884C\u5DE5\u5177\u680F\u52A8\u4F5C\u5931\u8D25:",o)}}function y4({data:n,behaviors:t,interactionSwitch:e,title:r="\u77E5\u8BC6\u56FE\u8C31\u9884\u89C8",subtitle:i,centerNode:a,backgroundColor:o="#f8f9fa",showGrid:s=!0,showLegend:u=!0,showTooltip:c=!0,showFullscreen:l=!0,showMinimap:d=!1,layout:p,customPlugins:g={},tooltipRender:m,tooltipPosition:y="top",tooltipOffset:v=[0,-5],toolbarMode:x="default",node:E,nodeHoverStyle:w,nodeSelectedStyle:S,edge:k,edgeHoverStyle:A,edgeSelectedStyle:N,eventEmit:T,contextMenu:O,onReady:M,onDestroy:P,tooltipShow:L}){var Y;const j=Va(null),z=ii(()=>{var F;try{if(!n)return console.error("\u6570\u636E\u4E3A\u7A7A"),null;if(!n.nodeList||!n.edgeList)return console.error("\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u7F3A\u5C11 nodeList \u6216 edgeList"),null;console.log("\u5F00\u59CB\u8C03\u7528 transformGiengraphToG6...");const K=WJ(n);return console.log("transformed",K),K}catch(K){return console.error("=== \u6570\u636E\u8F6C\u6362\u9519\u8BEF ===",K),console.error("\u9519\u8BEF\u7C7B\u578B:",(F=K==null?void 0:K.constructor)==null?void 0:F.name),console.error("\u539F\u59CB\u6570\u636E:",n),null}},[n]),U=ii(()=>{if(!(z!=null&&z.nodes)||!a)return;if(a.id)return a.id;const F=Object.entries(a).filter(([ot,dt])=>ot!=="id"&&dt!==void 0&&dt!==null);if(F.length===0)return;const K=(ot,dt)=>{if(Array.isArray(ot)){for(const mt of ot)if(mt&&String(mt.name??"")===dt)return mt.value}};for(const ot of z.nodes){const dt=(ot==null?void 0:ot.data)??ot;let mt=!0;for(const[Ot,ne]of F){const Qt=(dt==null?void 0:dt[Ot])??(ot==null?void 0:ot[Ot]),_t=K(dt==null?void 0:dt.properties,Ot);if((Qt!==void 0?Qt:_t)!==ne){mt=!1;break}}if(mt&&(ot!=null&&ot.id))return ot.id}},[z,a]),J=ii(()=>{if(m)return QJ({render:F=>nn.jsx("div",{onWheel:K=>K.stopPropagation(),onTouchMove:K=>K.stopPropagation(),style:{maxWidth:310,maxHeight:300,overflowY:"auto",padding:"10px 12px"},children:m(F)}),containerClassName:"g6-react-tooltip-root"})},[m]),W=ii(()=>{const F={background:{backgroundColor:o,opacity:"0.8"},fullscreen:l||x!=="hide"?{autoFit:!0,trigger:{request:"F",exit:"Esc"}}:!1,gridLine:s?{size:40,stroke:"#e8e8e8",follow:!0}:!1,minimap:!!d,legend:u?{type:"legend",key:"legend",position:"bottom-right",trigger:"hover",nodeField:"nodeType",edgeField:"edgeType",width:300,height:200,backgroundColor:"rgba(255, 255, 255, 0.9)",border:"1px solid #e8e8e8",borderRadius:6,padding:[12,16]}:!1,title:{type:"title",key:"title",title:r,subtitle:i,align:"left"},toolbar:x==="default"?{type:"toolbar",key:"toolbar",position:"top-right",getItems:()=>{const K=[{id:"zoom-in",value:"zoom-in",title:"\u653E\u5927"},{id:"zoom-out",value:"zoom-out",title:"\u7F29\u5C0F"},{id:"auto-fit",value:"auto-fit",title:"\u9002\u5E94\u753B\u5E03"}];return K.push({id:"request-fullscreen",value:"fullscreen",title:"\u5168\u5C4F"}),K},onClick:K=>{nM(j.current,K)}}:!1,tooltip:c?{enable:(K,ot)=>!L||K.targetType==="node"&&(L!=null&&L.node)?!0:!!(K.targetType==="edge"&&(L!=null&&L.edge)),type:"tooltip",key:"tooltip",position:y,trigger:"hover",enterable:!0,offset:v,style:{".tooltip":m?{"background-color":"transparent",border:"none","box-shadow":"none","border-radius":"0",padding:"0",margin:"0","min-width":"0","max-width":"none","max-height":"300px","overflow-y":"auto",transition:"none",filter:"none"}:{"max-height":"300px","overflow-y":"auto"}},getContent:async(K,ot)=>{if(J)return J(K,ot);const dt=ot==null?void 0:ot[0];if(!dt)return"";const mt=dt.data||{},Ot=`<div style="font-weight:600;font-size:12px;padding-bottom:6px;border-bottom:1px solid #E5E6EB;">${mt.name||mt.label||dt.id}</div>`,ne=(()=>{const Qt=new Set(["id","name","nodeType","type","x","y","style","states"]),_t=[];if(Array.isArray(mt==null?void 0:mt.properties)&&mt.properties.length>0)for(const wt of mt.properties)wt&&_t.push({key:String(wt.name??""),value:wt.value});else Object.entries(mt||{}).forEach(([wt,we])=>{!Qt.has(wt)&&we!==void 0&&we!==null&&_t.push({key:wt,value:we})});return`<div>${_t.map(({key:wt,value:we},Et)=>`
300
+ <div style="display:flex; gap:8px; font-size:12px; line-height:20px; padding:6px 0; ${Et>0?"border-top:1px solid #F2F3F5;":""}">
301
+ <span style="color:#8F959E; min-width:120px; white-space:nowrap;">${wt}</span>
302
+ <span style="color:#1F2329; word-break:break-all;">${String(we)}</span>
303
+ </div>
304
+ `).join("")}</div>`})();return`
305
+ <div onwheel="event.stopPropagation();" onmousewheel="event.stopPropagation();" ontouchmove="event.stopPropagation();" style="max-width:310px; max-height:300px; overflow-y:auto; padding:10px 12px;">
306
+ ${Ot}${ne}
307
+ </div>
308
+ `}}:!1,...g};return(x==="hide"||x==="floatbar")&&(F.toolbar=!1),F},[r,i,o,s,u,c,l,d,g,J,m,y,v,x]),at=ii(()=>{if(!p)return{animate:!1,animation:!1};const F={...p};return F.animate=!1,F.animation=!1,F!=null&&F.options&&typeof F.options=="object"&&(F.options={...F.options,animate:!1,animation:!1}),F},[p]),ut=ii(()=>HJ(E,w,S),[E,w,S]),yt=ii(()=>KJ(k,A,N),[k,A,N]);if(!z)return nn.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"\u6570\u636E\u8F6C\u6362\u5931\u8D25"});const kt={dragCanvas:{direction:"both"},zoomCanvas:!0,dragElement:!0,optimizeViewportTransform:!0,hoverActivate:!0,clickSelect:!0},It=t?typeof t=="string"?t:{...kt,...t}:kt,ee=(()=>{if(!e||typeof It=="string")return It;const F={...It};if(e.hover){const K=e.hover.node!==!1,ot=e.hover.edge!==!1;F.hoverActivate={...typeof F.hoverActivate=="object"?F.hoverActivate:{},enable:dt=>(dt==null?void 0:dt.targetType)==="node"?K:(dt==null?void 0:dt.targetType)==="edge"?ot:!0}}return e.select&&(F.clickSelect=!1),F})(),$=e!=null&&e.select?{node:e.select.node!==!1,edge:e.select.edge!==!1}:void 0;try{return console.log("\u5F00\u59CB\u6E32\u67D3 NodeGraph..."),nn.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[nn.jsx(LJ,{data:z,node:ut,edge:yt,eventEmit:T,contextMenu:O,behaviors:ee,selectEnable:$,plugins:W,layout:at,onReady:(F=>{j.current=F,console.log("KnowledgeGraphPreview ready:",F);const K=U;if(K){const ot=()=>{var Qt,_t,wt;try{if(typeof F.fitView=="function"&&((Qt=F.fitView)==null||Qt.call(F,{padding:40})),typeof F.focusItem=="function")F.focusItem(K,!0);else if(typeof F.focusElement=="function")F.focusElement(K,!0);else if(typeof F.centerElement=="function")F.centerElement(K);else{const Et=typeof F.getNode=="function"?F.getNode(K):typeof F.findById=="function"?F.findById(K):null,ze=((_t=Et==null?void 0:Et.getModel)==null?void 0:_t.call(Et))??((wt=Et==null?void 0:Et.getData)==null?void 0:wt.call(Et)),_n=ze==null?void 0:ze.x,zn=ze==null?void 0:ze.y;_n!=null&&zn!=null&&(typeof F.panTo=="function"?F.panTo(_n,zn):typeof F.focusViewport=="function"&&F.focusViewport(_n,zn))}const we=F.getZoom?F.getZoom():1;typeof F.zoomTo=="function"&&we<.9&&F.zoomTo(.9)}catch(we){console.warn("\u5C45\u4E2D\u8282\u70B9\u5931\u8D25:",we)}};setTimeout(ot,80);const dt=Qt=>{try{const _t=F;if(typeof _t.once=="function")_t.once(Qt,()=>setTimeout(ot,30));else if(typeof _t.on=="function"){const wt=()=>{var we;setTimeout(ot,30);try{(we=_t.off)==null||we.call(_t,Qt,wt)}catch{}};_t.on(Qt,wt)}}catch{}};dt("afterlayout"),dt("layoutEnd");let mt=0;const Ot=1,ne=setInterval(()=>{mt+=1,ot(),mt>=Ot&&clearInterval(ne)},150)}M&&M(F)}),onDestroy:P}),x==="floatbar"?nn.jsx(c4,{showFullscreen:l,onAction:F=>nM(j.current,F)}):null]})}catch(F){return console.error("=== \u6E32\u67D3\u9519\u8BEF ==="),console.error("\u9519\u8BEF\u7C7B\u578B:",(Y=F==null?void 0:F.constructor)==null?void 0:Y.name),nn.jsxs("div",{style:{padding:"20px",textAlign:"center",color:"red"},children:["\u56FE\u8868\u6E32\u67D3\u5931\u8D25: ",F instanceof Error?F.message:"\u672A\u77E5\u9519\u8BEF"]})}}const b4=()=>"/proxy",x4=n=>{if(!n||typeof n!="string")return"";const t=n.split("/"),e=t.length;return t[e-1]},E4=n=>{if(typeof n=="string"){const t=n.split(".");return t.length?t[t.length-1]:""}else return""},l4=n=>{const t=(n||"").toLowerCase();return["png","jpg","jpeg","gif","bmp","webp","svg","ico"].includes(t)?"rag/pic":t==="pdf"?"rag/pdf":t==="ofd"?"rag/ofd":["doc","docx"].includes(t)?"rag/word":["xls","xlsx","xlsm","xlsb","xltx","xltm","xlt","xlam"].includes(t)?"rag/excel":["ppt","pptx"].includes(t)?"rag/ppt":t==="txt"||t==="md"?"rag/txt":t==="csv"?"rag/csv":["zip","rar","7z"].includes(t)?"rag/zip":["odt","ods","odp","odf"].includes(t)?"rag/odf":t==="json"?"rag/json":"rag/file"},w4=n=>{if(n.loading)return zc(pj,{size:"small",style:{marginRight:"5px",width:"12px",fontSize:"12px"}});if(n.type==="dir")return zc(tp,{type:"rag/folder",size:16});if(n.type==="file"&&n.fileType){const t=l4(n.fileType);return zc(tp,{type:t,size:16})}return zc(tp,{type:"rag/folder",size:16})};export{m4 as R,b4 as a,E4 as b,x4 as g,y4 as k,w4 as r};