UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

1 lines 855 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};o.props={};const a=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=a(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const d=({value:t})=>e=>e.map(t);d.props={};const h=({value:t})=>e=>e.map((e=>e[t]));h.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t,e){if(!g(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n},y=function(t){return"function"==typeof t},v=function(t){return null==t},b={}.toString,x=function(t,e){return b.call(t)==="[object "+e+"]"},w=function(t){return Array.isArray?Array.isArray(t):x(t,"Array")},M=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function O(t,e){if(t)if(w(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(M(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var E=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return O(t,(function(n,r){y(t)&&"prototype"===r||e.push(r)})),e};var k=function(t){return"object"==typeof t&&null!==t},S=function(t){if(!k(t)||!x(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function A(t,e){if(!w(t))return null;var n;if(y(e)&&(n=e),S(e)&&(n=function(t){return function(t,e){var n=E(e),r=n.length;if(v(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}var _=function(t){if(w(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},T=function(t){if(w(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},P=function(t,e,n){if(!w(t)&&!S(t))return t;var r=n;return O(t,(function(t,n){r=e(r,t,n)})),r},C=function(t){return x(t,"String")};function N(t){if(g(t)){return t[t.length-1]}}var L=function(t,e,n){return t<e?e:t>n?n:t},j=function(t){return x(t,"Number")},R=1e-5;function I(t,e,n){return void 0===n&&(n=R),Math.abs(t-e)<n}var B=function(t,e){if(w(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},D=function(t,e){if(w(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=y(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},F=function(t,e){return(t%e+e)%e},z=function(t){return v(t)?"":t.toString()},G=function(t){var e=z(t);return e.charAt(0).toLowerCase()+e.substring(1)};var W=function(t){var e=z(t);return e.charAt(0).toUpperCase()+e.substring(1)},$=function(t){return x(t,"Boolean")},H=function(t){return null===t},V=function(t){return void 0===t},Y=function(t){if("object"!=typeof t||null===t)return t;var e;if(w(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Y(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Y(t[i]):e[i]=t[i];return e},U=Y;function q(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function X(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function Z(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(X(e,i)){var o=e[i];null!==o&&S(o)?(S(t[i])||(t[i]={}),n<r?Z(t[i],o,n+1,r):t[i]=e[i]):w(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var K=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Z(t,e[r]);return t},Q=function(t,e){if(!g(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},J=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(C(t)||C(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=J(t[r],e[r]));r++);return n}if(k(t)||k(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=J(t[i[r]],e[i[r]]));r++);return n}return!1},tt=J,et=function(t,e,n){for(var r=0,i=C(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},nt=Object.prototype.hasOwnProperty,rt=function(t,e){if(null===t||!S(t))return{};var n={};return O(e,(function(e){nt.call(t,e)&&(n[e]=t[e])})),n},it=function(t,e){return P(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ot=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},at=function(){},st=function(t){return t};function ct(t){return v(t)?0:g(t)?t.length:Object.keys(t).length}var lt=1e-6,ut="undefined"!=typeof Float32Array?Float32Array:Array;function ft(){var t=new ut(9);return ut!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var dt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=n[0],h=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];return t[0]=d*r+h*a+p*l,t[1]=d*i+h*s+p*u,t[2]=d*o+h*c+p*f,t[3]=g*r+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*f,t[6]=v*r+b*a+x*l,t[7]=v*i+b*s+x*u,t[8]=v*o+b*c+x*f,t};function ht(){var t=new ut(16);return ut!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function pt(t){var e=new ut(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function mt(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=d,t[12]=h,t[13]=p,t[14]=g,t[15]=m,t}function yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function bt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,M=r*l-o*s,O=i*l-o*c,E=u*g-f*p,k=u*m-d*p,S=u*y-h*p,A=f*m-d*g,_=f*y-h*g,T=d*y-h*m,P=v*T-b*_+x*A+w*S-M*k+O*E;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-o*A)*P,t[2]=(g*O-m*M+y*w)*P,t[3]=(d*M-f*O-h*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-i*S+o*k)*P,t[6]=(m*x-p*O-y*b)*P,t[7]=(u*O-d*x+h*b)*P,t[8]=(a*_-s*S+l*E)*P,t[9]=(r*S-n*_-o*E)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-h*v)*P,t[12]=(s*k-a*A-c*E)*P,t[13]=(n*A-r*k+i*E)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+d*v)*P,t):null}function xt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],d=t[11],h=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-d*g)-(e*s-r*o)*(u*m-d*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-d*h)-(n*c-i*a)*(l*g-f*h)+(r*c-i*s)*(l*p-u*h)}function wt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12],m=e[13],y=e[14],v=e[15],b=n[0],x=n[1],w=n[2],M=n[3];return t[0]=b*r+x*s+w*f+M*g,t[1]=b*i+x*c+w*d+M*m,t[2]=b*o+x*l+w*h+M*y,t[3]=b*a+x*u+w*p+M*v,b=n[4],x=n[5],w=n[6],M=n[7],t[4]=b*r+x*s+w*f+M*g,t[5]=b*i+x*c+w*d+M*m,t[6]=b*o+x*l+w*h+M*y,t[7]=b*a+x*u+w*p+M*v,b=n[8],x=n[9],w=n[10],M=n[11],t[8]=b*r+x*s+w*f+M*g,t[9]=b*i+x*c+w*d+M*m,t[10]=b*o+x*l+w*h+M*y,t[11]=b*a+x*u+w*p+M*v,b=n[12],x=n[13],w=n[14],M=n[15],t[12]=b*r+x*s+w*f+M*g,t[13]=b*i+x*c+w*d+M*m,t[14]=b*o+x*l+w*h+M*y,t[15]=b*a+x*u+w*p+M*v,t}function Mt(t,e,n){var r,i,o,a,s,c,l,u,f,d,h,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=d,t[10]=h,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+d*y+e[13],t[14]=o*g+l*m+h*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function Ot(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Et(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+d*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=d*i-c*r,t}function kt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-d*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+d*i,t}function St(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function At(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _t(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<lt?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Tt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Pt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Nt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,d=r*l,h=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(h+g),t[1]=f+v,t[2]=d-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=d+y,t[9]=p-m,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function Rt(t,e){var n=new ut(3);jt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,d=e[8]*r,h=e[9]*i,p=e[10]*o,g=a+u+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-h)/m,t[1]=(d-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-h)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(d+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(d-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+h)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(d+c)/m,t[1]=(f+h)/m,t[2]=.25*m),t}function It(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,d=o*l,h=o*u,p=o*f,g=a*u,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],O=r[2],E=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,_=(h+x)*w,T=(p-b)*w,P=(h-x)*M,C=(1-(d+y))*M,N=(m+v)*M,L=(p+b)*O,j=(m-v)*O,R=(1-(d+g))*O;return t[0]=A,t[1]=_,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+E-(A*E+P*k+L*S),t[13]=n[1]+k-(_*E+C*k+j*S),t[14]=n[2]+S-(T*E+N*k+R*S),t[15]=1,t}function Bt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*c,g=o*a,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=d-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=h+g,t[7]=0,t[8]=d+m,t[9]=h-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var Ft=Dt;function zt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var Gt=zt;function Wt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function $t(t,e,n,r){var i,o,a,s,c,l,u,f,d,h,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<lt&&Math.abs(g-w)<lt&&Math.abs(m-M)<lt?yt(t):(u=p-x,f=g-w,d=m-M,i=v*(d*=h=1/Math.hypot(u,f,d))-b*(f*=h),o=b*(u*=h)-y*d,a=y*f-v*u,(h=Math.hypot(i,o,a))?(i*=h=1/h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,c=d*i-u*a,l=u*o-f*i,(h=Math.hypot(s,c,l))?(s*=h=1/h,c*=h,l*=h):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(i*p+o*g+a*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+d*m),t[15]=1,t)}function Ht(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Vt=wt,Yt=Ht,Ut=Object.freeze({__proto__:null,create:ht,clone:pt,copy:gt,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g){var m=new ut(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=d,m[13]=h,m[14]=p,m[15]=g,m},set:mt,identity:yt,transpose:vt,invert:bt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(d*y-h*m)-f*(c*y-l*m)+g*(c*h-l*d),t[1]=-(r*(d*y-h*m)-f*(i*y-o*m)+g*(i*h-o*d)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*h-l*d)-s*(i*h-o*d)+f*(i*l-o*c)),t[4]=-(a*(d*y-h*m)-u*(c*y-l*m)+p*(c*h-l*d)),t[5]=n*(d*y-h*m)-u*(i*y-o*m)+p*(i*h-o*d),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*h-l*d)-a*(i*h-o*d)+u*(i*l-o*c),t[8]=a*(f*y-h*g)-u*(s*y-l*g)+p*(s*h-l*f),t[9]=-(n*(f*y-h*g)-u*(r*y-o*g)+p*(r*h-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*h-l*f)-a*(r*h-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-d*g)-u*(s*m-c*g)+p*(s*d-c*f)),t[13]=n*(f*m-d*g)-u*(r*m-i*g)+p*(r*d-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*d-c*f)-a*(r*d-i*f)+u*(r*c-i*s),t},determinant:xt,multiply:wt,translate:Mt,scale:Ot,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,d,h,p,g,m,y,v,b,x,w,M,O,E,k,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<lt?null:(_*=C=1/C,T*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],d=e[5],h=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=_*_*a+o,x=T*_*a+P*i,w=P*_*a-T*i,M=_*T*a-P*i,O=T*T*a+o,E=P*T*a+_*i,k=_*P*a+T*i,S=T*P*a-_*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+d*x+m*w,t[2]=l*b+h*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*O+g*E,t[5]=c*M+d*O+m*E,t[6]=l*M+h*O+y*E,t[7]=u*M+p*O+v*E,t[8]=s*k+f*S+g*A,t[9]=c*k+d*S+m*A,t[10]=l*k+h*S+y*A,t[11]=u*k+p*S+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Et,rotateY:kt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+d*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=d*i-c*r,t},fromTranslation:St,fromScaling:At,fromRotation:_t,fromXRotation:Tt,fromYRotation:Pt,fromZRotation:Ct,fromRotationTranslation:Nt,fromQuat2:function(t,e){var n=new ut(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),Nt(t,e,n),t},getTranslation:Lt,getScaling:jt,getRotation:Rt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,d=i*l,h=i*u,p=o*l,g=o*u,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(d+b)*x,t[2]=(h-v)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(h+v)*M,t[9]=(g-y)*M,t[10]=(1-(f+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:It,fromQuat:Bt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Dt,perspective:Ft,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:zt,ortho:Gt,orthoZO:Wt,lookAt:$t,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(u*=h=1/Math.sqrt(h),f*=h,d*=h);var p=c*d-l*f,g=l*u-s*d,m=s*f-c*u;return(h=p*p+g*g+m*m)>0&&(p*=h=1/Math.sqrt(h),g*=h,m*=h),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-d*g,t[5]=d*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Ht,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],O=e[5],E=e[6],k=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=lt*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=lt*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=lt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=lt*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=lt*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-O)<=lt*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=lt*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=lt*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=lt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=lt*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=lt*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(h-T)<=lt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(p-P)<=lt*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=lt*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=lt*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=lt*Math.max(1,Math.abs(y),Math.abs(L))},mul:Vt,sub:Yt});function qt(){var t=new ut(3);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Xt(t){var e=new ut(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Zt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Kt(t,e,n){var r=new ut(3);return r[0]=t,r[1]=e,r[2]=n,r}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Jt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function te(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ee(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ne(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function re(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function oe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function ae(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function se(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ce(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function le(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=lt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=lt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=lt*Math.max(1,Math.abs(i),Math.abs(s))}var ue=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},fe=Zt;function de(){var t=new ut(4);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function he(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function pe(){var t=new ut(4);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ge(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function me(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function ye(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function ve(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}qt(),function(){var t=de()}();var be=function(t,e,n,r){var i=new ut(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},xe=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},we=me,Me=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};qt(),Kt(1,0,0),Kt(0,1,0),pe(),pe(),ft(),function(){var t,e=(t=new ut(2),ut!=Float32Array&&(t[0]=0,t[1]=0),t)}();var Oe=function(t,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Oe(t,e)};function Ee(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Oe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ke=function(){return ke=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ke.apply(this,arguments)};function Se(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function Ae(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function _e(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function Te(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function Pe(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ce(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Ne(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Le(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var je={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Re(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ie={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Be(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ie[e]===t.length-1&&"achlmqstvz".includes(e)}))}function De(t){return Be(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Fe(t){return De(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function ze(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ie[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Ie[n]))),Ie[n]););}function Ge(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function We(t){return t>=48&&t<=57||43===t||45===t||46===t}function $e(t){return t>=48&&t<=57}function He(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),$e(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&$e(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&$e(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;$e(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&$e(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&$e(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number'}function Ve(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Ye(t){for(var e=t.pathValue,n=t.max;t.index<n&&Ve(e.charCodeAt(t.index));)t.index+=1}function Ue(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Ie[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){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}}(i))if(t.index+=1,Ye(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?He(t):Ge(t),t.err.length)return;t.data.push(t.param),Ye(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ye(t))}if(t.index>=t.max)break;if(!We(n.charCodeAt(t.index)))break}ze(t)}else ze(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var qe=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Xe(t){if(De(t))return[].concat(t);var e=function(t){if(Be(t))return[].concat(t);var e=new qe(t);for(Ye(e);e.index<e.max&&!e.err.length;)Ue(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function Ze(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,d=2*i-e.qy;e.qx=f,e.qy=d,c=["Q",f,d].concat(s)}else if("Q"===n){var h=s[0],p=s[1];e.qx=h,e.qy=p}return c}function Ke(t){if(Fe(t))return[].concat(t);for(var e=Xe(t),n=ke({},je),r=0;r<e.length;r+=1){e[r]=Ze(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Qe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Je(t,e,n,r,i,o,a,s,c,l){var u,f,d,h,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),O=[];if(l)f=l[0],d=l[1],h=l[2],p=l[3];else{g=(u=Qe(g,m,-M)).x,m=u.y;var E=(g-(b=(u=Qe(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=E*E/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,_=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((A*_-A*k*k-_*E*E)/(A*k*k+_*E*E)));h=T*y*k/v+(g+b)/2,p=T*-v*E/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),d=Math.asin(((x-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<h?Math.PI-f:f,d=b<h?Math.PI-d:d,f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),a&&f>d&&(f-=2*Math.PI),!a&&d>f&&(d-=2*Math.PI)}var P=d-f;if(Math.abs(P)>w){var C=d,N=b,L=x;d=f+w*(a&&d>f?1:-1),O=Je(b=h+y*Math.cos(d),x=p+v*Math.sin(d),y,v,i,0,a,N,L,[d,C,h,p])}P=d-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(d),B=Math.sin(d),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,O);for(var V=[],Y=0,U=(O=W.concat($,H,O)).length;Y<U;Y+=1)V[Y]=Y%2?Qe(O[Y-1],O[Y],M).y:Qe(O[Y],O[Y+1],M).x;return V}function tn(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var en=function(t,e,n,r){return Ne(Ne([],tn([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function nn(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],d=t.slice(1).map(Number),h=d[0],p=d[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=h,e.y=p,t;case"A":return n=[g,m].concat(d),["C"].concat(Je(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[g,m].concat(d),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(en(g,m,h,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(en(g,m,y,v))}return t}function rn(t,e){if(void 0===e&&(e=!1),function(t){return Fe(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Ke(t),a=ke({},je),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var d=nn(o[f],a);o[f]=d,Re(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function on(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function an(t,e,n,r,i){var o=on([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=tn([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function sn(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function cn(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,g=u(n),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return an(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:d(y)*v+f(y)*b,y:-f(y)*v+d(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=h(w),m*=h(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),O=(o!==a?1:-1)*h(M=M<0?0:M),E=O*(g*x.y/m),k=O*(-m*x.x/g),S=d(y)*E-f(y)*k+(t+s)/2,A=f(y)*E+d(y)*k+(e+c)/2,_={x:(x.x-E)/g,y:(x.y-k)/m},T=sn({x:1,y:0},_),P=sn(_,{x:(-x.x-E)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*d(C),L=m*f(C);return{x:d(y)*N-f(y)*L+S,y:f(y)*N+d(y)*L+A}}function ln(t,e,n,r,i,o,a,s,c,l,u){var f,d=u.bbox,h=void 0===d||d,p=u.length,g=void 0===p||p,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],O=[b,x],E={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(E={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=cn(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,h&&k.push({x:b,y:x}),g&&(w+=on(O,[b,x])),O=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);E={x:O[0]*(1-A)+M[0]*A,y:O[1]*(1-A)+M[1]*A}}M=[b,x,w]}return v&&l>=w&&(E={x:s,y:c}),{length:w,point:E,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function un(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function fn(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,d=void 0===f||f,h=l.length,p=void 0===h||h,g=l.sampleSize,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],O={x:0,y:0},E=[{x:v,y:b}];y&&c<=0&&(O={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=un(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,d&&E.push({x:v,y:b}),p&&(x+=on(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);O={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(O={x:a,y:s}),{length:x,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function dn(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function hn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,d=void 0===f||f,h=s.sampleSize,p=void 0===h?10:h,g="number"==typeof a,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var O=0;O<=p;O+=1){if(m=(c=dn(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),d&&(v+=on(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var E=(v-a)/(v-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[m,y,v]}return g&&a>=v&&(w={x:i,y:o}),{length:v,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function pn(t,e,n){for(var r,i,o,a,s,c,l,u,f,d=Ke(t),h="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},O=M,E=M,k=M,S=0,A=0,_=d.length;A<_;A+=1)p=(l="M"===(u=(f=d[A])[0]))?p:[g,m].concat(f.slice(1)),l?(O=M={x:y=f[1],y:v=f[2]},w=0,h&&e<.001&&(k=M)):"L"===u?(w=(r=an(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,O=r.max,E=r.point):"A"===u?(w=(i=ln(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,O=i.max,E=i.point):"C"===u?(w=(o=fn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,O=o.max,E=o.point):"Q"===u?(w=(a=hn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,O=a.max,E=a.point):"Z"===u&&(w=(s=an((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,O=s.max,E=s.point),h&&S<e&&S+w>=e&&(k=E),x.push(O),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return h&&e>=S&&(k={x:g,y:m}),{length:S,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function gn(t){return function(t){var e=0,n=0,r=0;return rn(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function mn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?fn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=tn(n,r,e),s=tn(r,i,e),c=tn(i,o,e),l=tn(a,s,e),u=tn(s,c,e),f=tn(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function yn(t,e,n){var r=mn(t),i=mn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),d=[l,u],h=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&h[e]&&t.l>=d[e],h[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:yn(g[0],g[1],f)}function vn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function bn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function xn(t,e){const n=bn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function wn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Mn(t,e){const n=bn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function On(t,e){const n=[];for(const r of t)n[r]=e;return n}function En(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function kn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=En(t,n);if(null!==e)return[e,r]}}return[null,null]}function Sn(t){return!(t instanceof Date)&&"object"==typeof t}const An=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{y1:xn(On(t,0))}})]};function _n(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Pn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=_n,n=(e,n)=>_n(t(e),n),r=(e,n)=>t(e)-n):(e=t===_n||t===Tn?t:Cn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Cn(){return 0}function Nn(t){return null===t?NaN:+t}An.props={};const Ln=Pn(_n),jn=Ln.right,Rn=Ln.left,In=Pn(Nn).center;var Bn=jn;function Dn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Fn(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function zn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Gn extends Map{constructor(t,e=$n){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Wn(this,t))}has(t){return super.has(Wn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function Wn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function $n(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Hn(t){return t}function Vn(t,...e){return Xn(t,Hn,Hn,e)}function Yn(t,...e){return Xn(t,Array.from,Hn,e)}function Un(t,e,...n){return Xn(t,Hn,e,n)}function qn(t,e,...n){return Xn(t,Array.from,e,n)}function Xn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Gn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Zn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=Qn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Qn(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(Kn(n))}function Kn(t=_n){if(t===_n)return Qn;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Qn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Jn=Array.prototype.slice;function tr(t){return()=>t}const er=Math.sqrt(50),nr=Math.sqrt(10),rr=Math.sqrt(2);function ir(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=er?10:o>=nr?5:o>=rr?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?ir(t,e,2*n):[s,c,l]}function or(t,e,n){return ir(t=+t,e=+e,n=+n)[2]}function ar(t){return Math.max(1,Math.ceil(Math.log(Dn(t))/Math.LN2)+1)}function sr(){var t=Hn,e=zn,n=ar;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],d=n(c,u,f);if(!Array.isArray(d)){const t=f,n=+d;if(e===zn&&([u,f]=function(t,e,n){let r;for(;;){const i=or(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),d=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?ir(e,t,n):ir(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),d[0]<=u&&(a=or(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===zn){const t=or(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else d.pop()}for(var h=d.length,p=0,g=h;d[p]<=u;)++p;for(;d[g-1]>f;)--g;(p||g<h)&&(d=d.slice(p,g),h=g-p);var m,y=new Array(h+1);for(i=0;i<=h;++i)(m=y[i]=[]).x0=i>0?d[i-1]:u,m.x1=i<h?d[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Math.min(h,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);y[Math.min(h,t+(d[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Bn(d,o,0,h)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:tr(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:tr([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:tr(Array.isArray(t)?Jn.call(t):t),r):n},r}function cr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function lr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function ur(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=