@neo4j-nvl/base 0.3.1-4d1a39ed → 0.3.1-61fc472d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.mjs +1 -1
- package/dist/types/layouts/forcedirectedlayout/ForceCytoLayout.d.ts +2 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +103 -112
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-fragment-verlet.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-repulsive-fragment-verlet.d.ts +2 -0
- package/dist/types/modules/state.d.ts +5 -1
- package/dist/types/utils/constants.d.ts +1 -0
- package/package.json +2 -2
package/dist/base.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see base.mjs.LICENSE.txt */
|
|
2
|
-
import*as t from"@neo4j-nvl/layout-workers";import*as e from"@segment/analytics-next";var n={931:t=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},269:(t,e,n)=>{var r=n(931),i=n(975),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},4:(t,e,n)=>{var r=n(861);t.exports=function(t){var e=r(t);return Math.round((299*parseInt(e[0])+587*parseInt(e[1])+114*parseInt(e[2]))/1e3)<=180?"dark":"light"}},792:(t,e,n)=>{var r=n(45),i=n(360),o=n(804);t.exports=function(t,e){if(!e)return t;var n=Object.keys(e);if(0===n.length)return t;for(var a=r(t),s=n.length-1;s>=0;s--){var u=n[s],l=String(e[u]);l&&(l=" "+l),o(a,{type:"preprocessor",data:"#define "+u+l})}return i(a)}},804:t=>{t.exports=function(t,i){Array.isArray(i)||(i=[i]);var o=function(t){for(var e=-1,n=0;n<t.length;n++){var i=t[n];if("preprocessor"===i.type)/^#(extension|version)/.test(i.data)&&(e=Math.max(e,n));else if("keyword"===i.type&&"precision"===i.data){var o=r(t,n);if(-1===o)throw new Error("precision statement not followed by any semicolons!");e=Math.max(e,o)}}return e+1}(t),a=o>0?t[o-1]:null;a&&n.test(a.data)&&t.splice(o++,0,e),t.splice.apply(t,[o,0].concat(i));var s=o+i.length;return t[s]&&/[^\r\n]$/.test(t[s].data)&&t.splice(s,0,e),t};var e={data:"\n",type:"whitespace"},n=/[^\r\n]$/;function r(t,e){for(var n=e;n<t.length;n++)if("operator"===t[n].type&&";"===t[n].data)return n;return-1}},360:t=>{t.exports=function(t){for(var e=[],n=0;n<t.length;n++)"eof"!==t[n].type&&e.push(t[n].data);return e.join("")}},206:(t,e,n)=>{t.exports=function(t){var e,n,S,T=0,O=0,A=u,E=[],P=[],k=1,j=0,C=0,R=!1,D=!1,I="",L=o,M=r;"300 es"===(t=t||{}).version&&(L=s,M=a);var N={},U={};for(T=0;T<L.length;T++)N[L[T]]=!0;for(T=0;T<M.length;T++)U[M[T]]=!0;return function(t){return P=[],null!==t?function(t){var n;for(T=0,t.toString&&(t=t.toString()),I+=t.replace(/\r\n/g,"\n"),S=I.length;e=I[T],T<S;){switch(n=T,A){case c:T=G();break;case f:case h:T=V();break;case d:T=W();break;case p:T=Y();break;case w:T=H();break;case v:T=$();break;case l:T=q();break;case b:T=B();break;case u:T=z()}n!==T&&("\n"===I[n]?(j=0,++k):++j)}return O+=T,I=I.slice(T),P}(t):(E.length&&F(E.join("")),A=_,F("(eof)"),P)};function F(t){t.length&&P.push({type:x[A],data:t,position:C,line:k,column:j})}function z(){return E=E.length?[]:E,"/"===n&&"*"===e?(C=O+T-1,A=c,n=e,T+1):"/"===n&&"/"===e?(C=O+T-1,A=f,n=e,T+1):"#"===e?(A=h,C=O+T,T):/\s/.test(e)?(A=b,C=O+T,T):(R=/\d/.test(e),D=/[^\w_]/.test(e),C=O+T,A=R?p:D?d:l,T)}function B(){return/[^\s]/g.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===n?(E.push(e),n=e,T+1):(F(E.join("")),A=u,T)}function G(){return"/"===e&&"*"===n?(E.push(e),F(E.join("")),A=u,T+1):(E.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return A=v,T;if("/"===n&&"*"===e)return A=c,T;if("/"===n&&"/"===e)return A=f,T;if("."===e&&E.length){for(;X(E););return A=v,T}if(";"===e||")"===e||"("===e){if(E.length)for(;X(E););return F(e),A=u,T+1}var t=2===E.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(E););return A=u,T}return E.push(e),n=e,T+1}function X(t){for(var e,n,r=0;;){if(e=i.indexOf(t.slice(0,t.length+r).join("")),n=i[e],-1===e){if(r--+t.length>0)continue;n=t.slice(0,1).join("")}return F(n),C+=n.length,(E=E.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(E.push(e),A=v,n=e,T+1):"x"===e&&1===E.length&&"0"===E[0]?(A=w,E.push(e),n=e,T+1):/[^\d]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function $(){return"f"===e&&(E.push(e),n=e,T+=1),/[eE]/.test(e)?(E.push(e),n=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(n))&&/[^\d]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=E.join("");return A=U[t]?g:N[t]?m:y,F(E.join("")),A=u,T}return E.push(e),n=e,T+1}};var r=n(704),i=n(63),o=n(192),a=n(784),s=n(592),u=999,l=9999,c=0,f=1,h=2,d=3,p=4,v=5,y=6,m=7,g=8,b=9,_=10,w=11,x=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},592:(t,e,n)=>{var r=n(192);r=r.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},192:t=>{t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},784:(t,e,n)=>{var r=n(704);t.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},704:t=>{t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},63:t=>{t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},45:(t,e,n)=>{var r=n(206);t.exports=function(t,e){var n=r(e),i=[];return(i=i.concat(n(t))).concat(n(null))}},861:t=>{t.exports=function(t){t.charAt&&"#"===t.charAt(0)&&(t=function(t){var e=t.split("");return e.shift(),e.join("")}(t)),3===t.length&&(t=function(t){return t.split("").reduce((function(t,e){return t.concat([e,e])}),[]).join("")}(t));var e=parseInt(t,16);return[e>>16&255,e>>8&255,255&e]}},250:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",T="[object Object]",O="[object Promise]",A="[object RegExp]",E="[object Set]",P="[object String]",k="[object Symbol]",j="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",I="[object Float64Array]",L="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Y=RegExp(X.source),$=RegExp(H.source),q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",Ot="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Pt="["+wt+"]",kt="["+Et+"]",jt="["+xt+"]",Ct="\\d+",Rt="["+St+"]",Dt="["+Tt+"]",It="[^"+wt+Et+Ct+St+Tt+Ot+"]",Lt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+wt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ut="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Ot+"]",zt="\\u200d",Bt="(?:"+Dt+"|"+It+")",Vt="(?:"+Ft+"|"+It+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+jt+"|"+Lt+")?",Ht="["+At+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Mt,Nt,Ut].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Rt,Nt,Ut].join("|")+")"+Yt,qt="(?:"+[Mt+jt+"?",jt,Nt,Ut,Pt].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(jt,"g"),Jt=RegExp(Lt+"(?="+Lt+")|"+qt+Yt,"g"),Qt=RegExp([Ft+"?"+Dt+"+"+Gt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+Gt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,$t].join("|"),"g"),te=RegExp("["+zt+wt+xt+At+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["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"],re=-1,ie={};ie[D]=ie[I]=ie[L]=ie[M]=ie[N]=ie[U]=ie[F]=ie[z]=ie[B]=!0,ie[v]=ie[y]=ie[C]=ie[m]=ie[R]=ie[g]=ie[b]=ie[_]=ie[x]=ie[S]=ie[T]=ie[A]=ie[E]=ie[P]=ie[j]=!1;var oe={};oe[v]=oe[y]=oe[C]=oe[R]=oe[m]=oe[g]=oe[D]=oe[I]=oe[L]=oe[M]=oe[N]=oe[x]=oe[S]=oe[T]=oe[A]=oe[E]=oe[P]=oe[k]=oe[U]=oe[F]=oe[z]=oe[B]=!0,oe[b]=oe[_]=oe[j]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ve=pe&&le.process,ye=function(){try{return de&&de.require&&de.require("util").types||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,ge=ye&&ye.isDate,be=ye&&ye.isMap,_e=ye&&ye.isRegExp,we=ye&&ye.isSet,xe=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ee(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Pe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ke(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function je(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Re(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function De(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Me=Ge("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ue(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ue(t,Be,n)}function ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?He(t,e)/n:h}function Ge(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function He(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function $e(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function qe(t){return function(e){return t(e)}}function Ze(t,e){return Ce(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}var tn=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Me(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,wt=e.Error,xt=e.Function,St=e.Math,Tt=e.Object,Ot=e.RegExp,At=e.String,Et=e.TypeError,Pt=r.prototype,kt=xt.prototype,jt=Tt.prototype,Ct=e["__core-js_shared__"],Rt=kt.toString,Dt=jt.hasOwnProperty,It=0,Lt=(n=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Mt=jt.toString,Nt=Rt.call(Tt),Ut=fe._,Ft=Ot("^"+Rt.call(Dt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:i,Bt=e.Symbol,Vt=e.Uint8Array,Gt=zt?zt.allocUnsafe:i,Wt=an(Tt.getPrototypeOf,Tt),Xt=Tt.create,Ht=jt.propertyIsEnumerable,Yt=Pt.splice,$t=Bt?Bt.isConcatSpreadable:i,qt=Bt?Bt.iterator:i,Jt=Bt?Bt.toStringTag:i,te=function(){try{var t=uo(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=it&&it.now!==fe.Date.now&&it.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=St.ceil,de=St.floor,ve=Tt.getOwnPropertySymbols,ye=zt?zt.isBuffer:i,Me=e.isFinite,We=Pt.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,_n=St.random,wn=Pt.reverse,xn=uo(e,"DataView"),Sn=uo(e,"Map"),Tn=uo(e,"Promise"),On=uo(e,"Set"),An=uo(e,"WeakMap"),En=uo(Tt,"create"),Pn=An&&new An,kn={},jn=No(xn),Cn=No(Sn),Rn=No(Tn),Dn=No(On),In=No(An),Ln=Bt?Bt.prototype:i,Mn=Ln?Ln.valueOf:i,Nn=Ln?Ln.toString:i;function Un(t){if(ts(t)&&!Ga(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(Dt.call(t,"__wrapped__"))return Uo(t)}return new Bn(t)}var Fn=function(){function t(){}return function(e){if(!Qa(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function $n(t,e){var n=Ga(t),r=!n&&Va(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&us(t),a=n||r||i||o,s=a?Ye(t.length,At):[],u=s.length;for(var l in t)!e&&!Dt.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yo(l,u))||s.push(l);return s}function qn(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Ro(Ai(t),or(e,0,t.length))}function Kn(t){return Ro(Ai(t))}function Jn(t,e,n){(n!==i&&!Fa(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Dt.call(t,e)&&Fa(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Fa(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Ei(e,js(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:Os(t,e[n]);return a}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ar(t,e,n,r,o,a){var s,u=1&e,l=2&e,c=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!Qa(t))return t;var f=Ga(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Dt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ai(t,s)}else{var h=fo(t),d=h==_||h==w;if(Ya(t))return _i(t,u);if(h==T||h==v||d&&!o){if(s=l||d?{}:po(t),!u)return l?function(t,e){return Ei(t,co(t),e)}(t,function(t,e){return t&&Ei(e,Cs(e),t)}(s,t)):function(t,e){return Ei(t,lo(t),e)}(t,nr(s,t))}else{if(!oe[h])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case C:return wi(t);case m:case g:return new i(+t);case R:return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case D:case I:case L:case M:case N:case U:case F:case z:case B:return xi(t,n);case x:return new i;case S:case P:return new i(t);case A:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case E:return new i;case k:return r=t,Mn?Tt(Mn.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),os(t)?t.forEach((function(r){s.add(ar(r,e,n,r,t,a))})):es(t)&&t.forEach((function(r,i){s.set(i,ar(r,e,n,i,t,a))}));var y=f?i:(c?l?eo:to:l?Cs:js)(t);return Oe(y||t,(function(r,i){y&&(r=t[i=r]),Qn(s,i,ar(r,e,n,i,t,a))})),s}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new Et(o);return Po((function(){t.apply(i,n)}),e)}function lr(t,e,n,r){var i=-1,o=ke,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Ce(e,qe(n))),r?(o=je,a=!1):e.length>=200&&(o=Ke,a=!1,e=new Hn(e));t:for(;++i<s;){var c=t[i],f=null==n?c:n(c);if(c=r||0!==c?c:0,a&&f==f){for(var h=l;h--;)if(e[h]===f)continue t;u.push(c)}else o(e,f,r)||u.push(c)}return u}Un.templateSettings={escape:q,evaluate:Z,interpolate:K,variable:"",imports:{_:Un}},Un.prototype=zn.prototype,Un.prototype.constructor=Un,Bn.prototype=Fn(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Fn(zn.prototype),Vn.prototype.constructor=Vn,Gn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(En){var n=e[t];return n===a?i:n}return Dt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return En?e[t]!==i:Dt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=En&&e===i?a:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Sn||Wn),string:new Gn}},Xn.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ao(this,t).get(t)},Xn.prototype.has=function(t){return ao(this,t).has(t)},Xn.prototype.set=function(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,a),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var cr=ji(gr),fr=ji(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,l=a}return l}function pr(t,e){var n=[];return cr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?vr(s,e-1,n,r,i):Re(i,s):r||(i[i.length]=s)}return i}var yr=Ci(),mr=Ci(!0);function gr(t,e){return t&&yr(t,e,js)}function br(t,e){return t&&mr(t,e,js)}function _r(t,e){return Pe(e,(function(e){return Za(t[e])}))}function wr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Mo(e[n++])];return n&&n==r?t:i}function xr(t,e,n){var r=e(t);return Ga(t)?r:Re(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Tt(t)?function(t){var e=Dt.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(t){}var o=Mt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Mt.call(t)}(t)}function Tr(t,e){return t>e}function Or(t,e){return null!=t&&Dt.call(t,e)}function Ar(t,e){return null!=t&&e in Tt(t)}function Er(t,e,n){for(var o=n?je:ke,a=t[0].length,s=t.length,u=s,l=r(s),c=1/0,f=[];u--;){var h=t[u];u&&e&&(h=Ce(h,qe(e))),c=mn(h.length,c),l[u]=!n&&(e||a>=120&&h.length>=120)?new Hn(u&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&f.length<c;){var v=h[d],y=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ke(p,y):o(f,y,n))){for(u=s;--u;){var m=l[u];if(!(m?Ke(m,y):o(t[u],y,n)))continue t}p&&p.push(y),f.push(v)}}return f}function Pr(t,e,n){var r=null==(t=Oo(t,e=yi(e,t)))?t:t[Mo(qo(e))];return null==r?i:Se(r,t,n)}function kr(t){return ts(t)&&Sr(t)==v}function jr(t,e,n,r,o){return t===e||(null==t||null==e||!ts(t)&&!ts(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=Ga(t),u=Ga(e),l=s?y:fo(t),c=u?y:fo(e),f=(l=l==v?T:l)==T,h=(c=c==v?T:c)==T,d=l==c;if(d&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||us(t)?Ji(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case m:case g:case S:return Fa(+t,+e);case b:return t.name==e.name&&t.message==e.message;case A:case P:return t==e+"";case x:var s=on;case E:var u=1&r;if(s||(s=un),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=Ji(s(t),s(e),r,i,o,a);return a.delete(t),c;case k:if(Mn)return Mn.call(t)==Mn.call(e)}return!1}(t,e,l,n,r,o,a);if(!(1&n)){var p=f&&Dt.call(t,"__wrapped__"),_=h&&Dt.call(e,"__wrapped__");if(p||_){var w=p?t.value():t,O=_?e.value():e;return a||(a=new Yn),o(w,O,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=to(t),l=u.length;if(l!=to(e).length&&!s)return!1;for(var c=l;c--;){var f=u[c];if(!(s?f in e:Dt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++c<l;){var y=t[f=u[c]],m=e[f];if(r)var g=s?r(m,y,f,e,t,a):r(y,m,f,t,e,a);if(!(g===i?y===m||o(y,m,n,r,a):g)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,jr,o))}function Cr(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=n[o])[0],c=t[l],f=u[1];if(s&&u[2]){if(c===i&&!(l in t))return!1}else{var h=new Yn;if(r)var d=r(c,f,l,t,e,h);if(!(d===i?jr(f,c,3,r,h):d))return!1}}return!0}function Rr(t){return!(!Qa(t)||(e=t,Lt&&Lt in e))&&(Za(t)?Ft:vt).test(No(t));var e}function Dr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Ur(t[0],t[1]):Nr(t):fu(t)}function Ir(t){if(!wo(t))return vn(t);var e=[];for(var n in Tt(t))Dt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t,e){return t<e}function Mr(t,e){var n=-1,i=Xa(t)?r(t.length):[];return cr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Cr(n,t,e)}}function Ur(t,e){return go(t)&&xo(e)?So(Mo(t),e):function(n){var r=Os(n,t);return r===i&&r===e?As(n,t):jr(e,r,3)}}function Fr(t,e,n,r,o){t!==e&&yr(e,(function(a,s){if(o||(o=new Yn),Qa(a))!function(t,e,n,r,o,a,s){var u=Ao(t,n),l=Ao(e,n),c=s.get(l);if(c)Jn(t,n,c);else{var f=a?a(u,l,n+"",t,e,s):i,h=f===i;if(h){var d=Ga(l),p=!d&&Ya(l),v=!d&&!p&&us(l);f=l,d||p||v?Ga(u)?f=u:Ha(u)?f=Ai(u):p?(h=!1,f=_i(l,!0)):v?(h=!1,f=xi(l,!0)):f=[]:rs(l)||Va(l)?(f=u,Va(u)?f=ys(u):Qa(u)&&!Za(u)||(f=po(l))):h=!1}h&&(s.set(l,f),o(f,l,r,a,s),s.delete(l)),Jn(t,n,f)}}(t,e,s,n,Fr,r,o);else{var u=r?r(Ao(t,s),a,s+"",t,e,o):i;u===i&&(u=a),Jn(t,s,u)}}),Cs)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Br(t,e,n){e=e.length?Ce(e,(function(t){return Ga(t)?function(e){return wr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=Ce(e,qe(oo()));var i=Mr(t,(function(t,n,i){var o=Ce(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Si(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=wr(t,a);n(s,a)&&Zr(o,yi(a,t),s)}return o}function Gr(t,e,n,r){var i=r?ze:Fe,o=-1,a=e.length,s=t;for(t===e&&(e=Ai(e)),n&&(s=Ce(t,qe(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Yt.call(s,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function Xr(t,e){return t+de(_n()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(To(t,e,nu),t+"")}function $r(t){return qn(Fs(t))}function qr(t,e){var n=Fs(t);return Ro(n,or(e,0,n.length))}function Zr(t,e,n,r){if(!Qa(t))return t;for(var o=-1,a=(e=yi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=Mo(e[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var f=u[l];(c=r?r(f,l,u):i)===i&&(c=Qa(f)?f:yo(e[o+1])?[]:{})}Qn(u,l,c),u=u[l]}return t}var Kr=Pn?function(t,e){return Pn.set(t,e),t}:nu,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qs(e),writable:!0})}:nu;function Qr(t){return Ro(Fs(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ei(t,e){var n;return cr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=ss(e),c=e===i;o<a;){var f=de((o+a)/2),h=n(t[f]),d=h!==i,p=null===h,v=h==h,y=ss(h);if(s)var m=r||v;else m=c?v&&(r||d):u?v&&d&&(r||!p):l?v&&d&&!p&&(r||!y):!p&&!y&&(r?h<=e:h<e);m?o=f+1:a=f}return mn(a,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Fa(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function oi(t){return"number"==typeof t?t:ss(t)?h:+t}function ai(t){if("string"==typeof t)return t;if(Ga(t))return Ce(t,ai)+"";if(ss(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=ke,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=je;else if(o>=200){var l=e?null:Hi(t);if(l)return un(l);a=!1,i=Ke,u=new Hn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(c)}else i(u,f,n)||(u!==s&&u.push(f),s.push(c))}return s}function ui(t,e){return null==(t=Oo(t,e=yi(e,t)))||delete t[Mo(qo(e))]}function li(t,e,n,r){return Zr(t,e,n(wr(t,e)),r)}function ci(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),De(e,(function(t,e){return e.func.apply(e.thisArg,Re([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=lr(a[o]||s,t[u],e,n));return si(vr(a,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function pi(t){return Ha(t)?t:[]}function vi(t){return"function"==typeof t?t:nu}function yi(t,e){return Ga(t)?t:go(t,e)?[t]:Lo(ms(t))}var mi=Yr;function gi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var bi=ae||function(t){return fe.clearTimeout(t)};function _i(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function wi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function xi(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=ss(t),s=e!==i,u=null===e,l=e==e,c=ss(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!c&&t<e||c&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,l=e.length,c=yn(a-s,0),f=r(l+c),h=!i;++u<l;)f[u]=e[u];for(;++o<s;)(h||o<a)&&(f[n[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}function Oi(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,l=-1,c=e.length,f=yn(a-u,0),h=r(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++l<c;)h[p+l]=e[l];for(;++s<u;)(d||o<a)&&(h[p+n[s]]=t[o++]);return h}function Ai(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ei(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=r?r(n[u],t[u],u,n,t):i;l===i&&(l=t[u]),o?rr(n,u,l):Qn(n,u,l)}return n}function Pi(t,e){return function(n,r){var i=Ga(n)?Te:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function ki(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&mo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function ji(t,e){return function(n,r){if(null==n)return n;if(!Xa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ci(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Ri(t){return function(e){var n=rn(e=ms(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?gi(n,1).join(""):e.slice(1);return r[t]()+o}}function Di(t){return function(e){return De(Zs(Vs(e).replace(Zt,"")),t,"")}}function Ii(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Fn(t.prototype),r=t.apply(n,e);return Qa(r)?r:n}}function Li(t){return function(e,n,r){var o=Tt(e);if(!Xa(e)){var a=oo(n,3);e=js(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Mi(t){return Qi((function(e){var n=e.length,r=n,a=Bn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Et(o);if(a&&!u&&"wrapper"==ro(s))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var l=ro(s=e[r]),c="wrapper"==l?no(s):i;u=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ro(c[0])].apply(u,c[3]):1==s.length&&bo(s)?u[l]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ga(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,a,s,u,c,f,h){var d=e&l,p=1&e,v=2&e,y=24&e,m=512&e,g=v?i:Ii(t);return function l(){for(var b=arguments.length,_=r(b),w=b;w--;)_[w]=arguments[w];if(y)var x=io(l),S=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,x);if(o&&(_=Ti(_,o,a,y)),s&&(_=Oi(_,s,u,y)),b-=S,y&&b<h){var T=sn(_,x);return Wi(t,e,Ni,l.placeholder,n,_,T,c,f,h-b)}var O=p?n:this,A=v?O[t]:t;return b=_.length,c?_=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Ai(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}(_,c):m&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==fe&&this instanceof l&&(A=g||Ii(A)),A.apply(O,_)}}function Ui(t,e){return function(n,r){return function(t,e,n,r){return gr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Fi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ai(n),r=ai(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function zi(t){return Qi((function(e){return e=Ce(e,qe(oo())),Yr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Bi(t,e){var n=(e=e===i?" ":ai(e)).length;if(n<2)return n?Hr(e,t):e;var r=Hr(e,he(t/cn(e)));return rn(e)?gi(fn(r),0,t).join(""):r.slice(0,t)}function Vi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n,i){for(var o=-1,a=yn(he((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:hs(o),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vs(e),n=vs(n)),t(e,n)}}function Wi(t,e,n,r,o,a,s,l,c,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,l,c,f],p=n.apply(i,d);return bo(t)&&Eo(p,d),p.placeholder=r,jo(p,t,e)}function Xi(t){var e=St[t];return function(t,n){if(t=vs(t),(n=null==n?0:mn(ds(n),292))&&Me(t)){var r=(ms(t)+"e").split("e");return+((r=(ms(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Hi=On&&1/un(new On([,-0]))[1]==c?function(t){return new On(t)}:su;function Yi(t){return function(e){var n=fo(e);return n==x?on(e):n==E?ln(e):function(t,e){return Ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function $i(t,e,n,a,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Et(o);var v=a?a.length:0;if(v||(e&=-97,a=c=i),h=h===i?h:yn(ds(h),0),d=d===i?d:ds(d),v-=c?c.length:0,64&e){var y=a,m=c;a=c=i}var g=p?i:no(t),b=[t,e,n,a,c,y,m,f,h,d];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Ti(c,u,e[4]):u,t[4]=c?sn(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Oi(c,u,e[6]):u,t[6]=c?sn(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&l&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,g),t=b[0],e=b[1],n=b[2],a=b[3],c=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,n){var o=Ii(t);return function a(){for(var s=arguments.length,u=r(s),l=s,c=io(a);l--;)u[l]=arguments[l];var f=s<3&&u[0]!==c&&u[s-1]!==c?[]:sn(u,c);return(s-=f.length)<n?Wi(t,e,Ni,a.placeholder,i,u,f,i,i,n-s):Se(this&&this!==fe&&this instanceof a?o:t,this,u)}}(t,e,d):e!=u&&33!=e||c.length?Ni.apply(i,b):function(t,e,n,i){var o=1&e,a=Ii(t);return function e(){for(var s=-1,u=arguments.length,l=-1,c=i.length,f=r(c+u),h=this&&this!==fe&&this instanceof e?a:t;++l<c;)f[l]=i[l];for(;u--;)f[l++]=arguments[++s];return Se(h,o?n:this,f)}}(t,e,n,a);else var _=function(t,e,n){var r=1&e,i=Ii(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return jo((g?Kr:Eo)(_,b),t,e)}function qi(t,e,n,r){return t===i||Fa(t,jt[n])&&!Dt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return Qa(t)&&Qa(e)&&(a.set(e,t),Fr(t,e,i,Zi,a),a.delete(e)),t}function Ki(t){return rs(t)?i:t}function Ji(t,e,n,r,o,a){var s=1&n,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),f=a.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Hn:i;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],y=e[h];if(r)var m=s?r(y,v,h,e,t,a):r(v,y,h,t,e,a);if(m!==i){if(m)continue;d=!1;break}if(p){if(!Le(e,(function(t,e){if(!Ke(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==y&&!o(v,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Qi(t){return ko(To(t,i,Wo),t+"")}function to(t){return xr(t,js,lo)}function eo(t){return xr(t,Cs,co)}var no=Pn?function(t){return Pn.get(t)}:su;function ro(t){for(var e=t.name+"",n=kn[e],r=Dt.call(kn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Dt.call(Un,"placeholder")?Un:t).placeholder}function oo(){var t=Un.iteratee||ru;return t=t===ru?Dr:t,arguments.length?t(arguments[0],arguments[1]):t}function ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=js(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,xo(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Rr(n)?n:i}var lo=ve?function(t){return null==t?[]:(t=Tt(t),Pe(ve(t),(function(e){return Ht.call(t,e)})))}:pu,co=ve?function(t){for(var e=[];t;)Re(e,lo(t)),t=Wt(t);return e}:pu,fo=Sr;function ho(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Mo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ja(i)&&yo(a,i)&&(Ga(t)||Va(t))}function po(t){return"function"!=typeof t.constructor||wo(t)?{}:Fn(Wt(t))}function vo(t){return Ga(t)||Va(t)||!!($t&&t&&t[$t])}function yo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!Qa(n))return!1;var r=typeof e;return!!("number"==r?Xa(n)&&yo(e,n.length):"string"==r&&e in n)&&Fa(n[e],t)}function go(t,e){if(Ga(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ss(t))||Q.test(t)||!J.test(t)||null!=e&&t in Tt(e)}function bo(t){var e=ro(t),n=Un[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(xn&&fo(new xn(new ArrayBuffer(1)))!=R||Sn&&fo(new Sn)!=x||Tn&&fo(Tn.resolve())!=O||On&&fo(new On)!=E||An&&fo(new An)!=j)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?No(n):"";if(r)switch(r){case jn:return R;case Cn:return x;case Rn:return O;case Dn:return E;case In:return j}return e});var _o=Ct?Za:vu;function wo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||jt)}function xo(t){return t==t&&!Qa(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Tt(n))}}function To(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Se(t,this,u)}}function Oo(t,e){return e.length<2?t:wr(t,ti(e,0,-1))}function Ao(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Eo=Co(Kr),Po=ce||function(t,e){return fe.setTimeout(t,e)},ko=Co(Jr);function jo(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(p,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function Co(t){var e=0,n=0;return function(){var r=gn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Ro(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Do,Io,Lo=(Do=Da((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Io.size&&Io.clear(),t})),Io=Do.cache,Do);function Mo(t){if("string"==typeof t||ss(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Uo(t){if(t instanceof Vn)return t.clone();var e=new Bn(t.__wrapped__,t.__chain__);return e.__actions__=Ai(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fo=Yr((function(t,e){return Ha(t)?lr(t,vr(e,1,Ha,!0)):[]})),zo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),oo(n,2)):[]})),Bo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Ue(t,oo(e,3),i)}function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ds(n),o=n<0?yn(r+o,0):mn(o,r-1)),Ue(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Xo(t){return t&&t.length?t[0]:i}var Ho=Yr((function(t){var e=Ce(t,pi);return e.length&&e[0]===t[0]?Er(e):[]})),Yo=Yr((function(t){var e=qo(t),n=Ce(t,pi);return e===qo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Er(n,oo(e,2)):[]})),$o=Yr((function(t){var e=qo(t),n=Ce(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Er(n,i,e):[]}));function qo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Zo=Yr(Ko);function Ko(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Jo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,Ce(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function Qo(t){return null==t?t:wn.call(t)}var ta=Yr((function(t){return si(vr(t,1,Ha,!0))})),ea=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),si(vr(t,1,Ha,!0),oo(e,2))})),na=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,si(vr(t,1,Ha,!0),i,e)}));function ra(t){if(!t||!t.length)return[];var e=0;return t=Pe(t,(function(t){if(Ha(t))return e=yn(t.length,e),!0})),Ye(e,(function(e){return Ce(t,Ge(e))}))}function ia(t,e){if(!t||!t.length)return[];var n=ra(t);return null==e?n:Ce(n,(function(t){return Se(e,i,t)}))}var oa=Yr((function(t,e){return Ha(t)?lr(t,e):[]})),aa=Yr((function(t){return hi(Pe(t,Ha))})),sa=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),hi(Pe(t,Ha),oo(e,2))})),ua=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,hi(Pe(t,Ha),i,e)})),la=Yr(ra),ca=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ia(t,n)}));function fa(t){var e=Un(t);return e.__chain__=!0,e}function ha(t,e){return e(t)}var da=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),pa=Pi((function(t,e,n){Dt.call(t,n)?++t[n]:rr(t,n,1)})),va=Li(Vo),ya=Li(Go);function ma(t,e){return(Ga(t)?Oe:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Ae:fr)(t,oo(e,3))}var ba=Pi((function(t,e,n){Dt.call(t,n)?t[n].push(e):rr(t,n,[e])})),_a=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=Xa(t)?r(t.length):[];return cr(t,(function(t){a[++i]=o?Se(e,t,n):Pr(t,e,n)})),a})),wa=Pi((function(t,e,n){rr(t,n,e)}));function xa(t,e){return(Ga(t)?Ce:Mr)(t,oo(e,3))}var Sa=Pi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,vr(e,1),[])})),Oa=le||function(){return fe.Date.now()};function Aa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,$i(t,l,i,i,i,i,e)}function Ea(t,e){var n;if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Pa=Yr((function(t,e,n){var r=1;if(n.length){var i=sn(n,io(Pa));r|=u}return $i(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=sn(n,io(ka));r|=u}return $i(e,r,t,n,i)}));function ja(t,e,n){var r,a,s,u,l,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Et(o);function v(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function y(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=s}function m(){var t=Oa();if(y(t))return g(t);l=Po(m,function(t){var n=e-(t-c);return d?mn(n,s-(t-f)):n}(t))}function g(t){return l=i,p&&r?v(t):(r=a=i,u)}function b(){var t=Oa(),n=y(t);if(r=arguments,a=this,c=t,n){if(l===i)return function(t){return f=t,l=Po(m,e),h?v(t):u}(c);if(d)return bi(l),l=Po(m,e),v(c)}return l===i&&(l=Po(m,e)),u}return e=vs(e)||0,Qa(n)&&(h=!!n.leading,s=(d="maxWait"in n)?yn(vs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==i&&bi(l),f=0,r=c=a=l=i},b.flush=function(){return l===i?u:g(Oa())},b}var Ca=Yr((function(t,e){return ur(t,1,e)})),Ra=Yr((function(t,e,n){return ur(t,vs(e)||0,n)}));function Da(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Et(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Da.Cache||Xn),n}function Ia(t){if("function"!=typeof t)throw new Et(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Da.Cache=Xn;var La=mi((function(t,e){var n=(e=1==e.length&&Ga(e[0])?Ce(e[0],qe(oo())):Ce(vr(e,1),qe(oo()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Ma=Yr((function(t,e){var n=sn(e,io(Ma));return $i(t,u,i,e,n)})),Na=Yr((function(t,e){var n=sn(e,io(Na));return $i(t,64,i,e,n)})),Ua=Qi((function(t,e){return $i(t,256,i,i,i,e)}));function Fa(t,e){return t===e||t!=t&&e!=e}var za=Gi(Tr),Ba=Gi((function(t,e){return t>=e})),Va=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Dt.call(t,"callee")&&!Ht.call(t,"callee")},Ga=r.isArray,Wa=me?qe(me):function(t){return ts(t)&&Sr(t)==C};function Xa(t){return null!=t&&Ja(t.length)&&!Za(t)}function Ha(t){return ts(t)&&Xa(t)}var Ya=ye||vu,$a=ge?qe(ge):function(t){return ts(t)&&Sr(t)==g};function qa(t){if(!ts(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Za(t){if(!Qa(t))return!1;var e=Sr(t);return e==_||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==ds(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=be?qe(be):function(t){return ts(t)&&fo(t)==x};function ns(t){return"number"==typeof t||ts(t)&&Sr(t)==S}function rs(t){if(!ts(t)||Sr(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var n=Dt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Nt}var is=_e?qe(_e):function(t){return ts(t)&&Sr(t)==A},os=we?qe(we):function(t){return ts(t)&&fo(t)==E};function as(t){return"string"==typeof t||!Ga(t)&&ts(t)&&Sr(t)==P}function ss(t){return"symbol"==typeof t||ts(t)&&Sr(t)==k}var us=xe?qe(xe):function(t){return ts(t)&&Ja(t.length)&&!!ie[Sr(t)]},ls=Gi(Lr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Ai(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=fo(t);return(e==x?on:e==E?un:Fs)(t)}function hs(t){return t?(t=vs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ds(t){var e=hs(t),n=e%1;return e==e?n?e-n:e:0}function ps(t){return t?or(ds(t),0,d):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return h;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var n=pt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return Ei(t,Cs(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(wo(e)||Xa(e))Ei(e,js(e),t);else for(var n in e)Dt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Ei(e,Cs(e),t)})),_s=ki((function(t,e,n,r){Ei(e,Cs(e),t,r)})),ws=ki((function(t,e,n,r){Ei(e,js(e),t,r)})),xs=Qi(ir),Ss=Yr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=Cs(a),u=-1,l=s.length;++u<l;){var c=s[u],f=t[c];(f===i||Fa(f,jt[c])&&!Dt.call(t,c))&&(t[c]=a[c])}return t})),Ts=Yr((function(t){return t.push(i,Zi),Se(Ds,i,t)}));function Os(t,e,n){var r=null==t?i:wr(t,e);return r===i?n:r}function As(t,e){return null!=t&&ho(t,e,Ar)}var Es=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=n}),Qs(nu)),Ps=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),Dt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),ks=Yr(Pr);function js(t){return Xa(t)?$n(t):Ir(t)}function Cs(t){return Xa(t)?$n(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=wo(t),n=[];for(var r in t)("constructor"!=r||!e&&Dt.call(t,r))&&n.push(r);return n}(t)}var Rs=ki((function(t,e,n){Fr(t,e,n)})),Ds=ki((function(t,e,n,r){Fr(t,e,n,r)})),Is=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ce(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ei(t,eo(t),n),r&&(n=ar(n,7,Ki));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ls=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return As(t,n)}))}(t,e)}));function Ms(t,e){if(null==t)return{};var n=Ce(eo(t),(function(t){return[t]}));return e=oo(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var Ns=Yi(js),Us=Yi(Cs);function Fs(t){return null==t?[]:Ze(t,js(t))}var zs=Di((function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)}));function Bs(t){return qs(ms(t).toLowerCase())}function Vs(t){return(t=ms(t))&&t.replace(gt,tn).replace(Kt,"")}var Gs=Di((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Di((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Ri("toLowerCase"),Hs=Di((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Di((function(t,e,n){return t+(n?" ":"")+qs(e)})),$s=Di((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),qs=Ri("toUpperCase");function Zs(t,e,n){return t=ms(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ks=Yr((function(t,e){try{return Se(t,i,e)}catch(t){return qa(t)?t:new wt(t)}})),Js=Qi((function(t,e){return Oe(e,(function(e){e=Mo(e),rr(t,e,Pa(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Mi(),eu=Mi(!0);function nu(t){return t}function ru(t){return Dr("function"==typeof t?t:ar(t,1))}var iu=Yr((function(t,e){return function(n){return Pr(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Pr(t,n,e)}}));function au(t,e,n){var r=js(e),i=_r(e,r);null!=n||Qa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,js(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=Za(t);return Oe(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Re([this.value()],arguments))})})),t}function su(){}var uu=zi(Ce),lu=zi(Ee),cu=zi(Le);function fu(t){return go(t)?Ge(Mo(t)):function(t){return function(e){return wr(e,t)}}(t)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var yu,mu=Fi((function(t,e){return t+e}),0),gu=Xi("ceil"),bu=Fi((function(t,e){return t/e}),1),_u=Xi("floor"),wu=Fi((function(t,e){return t*e}),1),xu=Xi("round"),Su=Fi((function(t,e){return t-e}),0);return Un.after=function(t,e){if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){if(--t<1)return e.apply(this,arguments)}},Un.ary=Aa,Un.assign=gs,Un.assignIn=bs,Un.assignInWith=_s,Un.assignWith=ws,Un.at=xs,Un.before=Ea,Un.bind=Pa,Un.bindAll=Js,Un.bindKey=ka,Un.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ga(t)?t:[t]},Un.chain=fa,Un.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(ds(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(he(o/e));a<o;)u[s++]=ti(t,a,a+=e);return u},Un.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Un.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Re(Ga(n)?Ai(n):[n],vr(e,1))},Un.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?Ce(t,(function(t){if("function"!=typeof t[1])throw new Et(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Un.conforms=function(t){return function(t){var e=js(t);return function(n){return sr(n,t,e)}}(ar(t,1))},Un.constant=Qs,Un.countBy=pa,Un.create=function(t,e){var n=Fn(t);return null==e?n:nr(n,e)},Un.curry=function t(e,n,r){var o=$i(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.curryRight=function t(e,n,r){var o=$i(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.debounce=ja,Un.defaults=Ss,Un.defaultsDeep=Ts,Un.defer=Ca,Un.delay=Ra,Un.difference=Fo,Un.differenceBy=zo,Un.differenceWith=Bo,Un.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:ds(e))<0?0:e,r):[]},Un.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:ds(e)))<0?0:e):[]},Un.dropRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0,!0):[]},Un.dropWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0):[]},Un.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ds(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ds(r))<0&&(r+=o),r=n>r?0:ps(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Un.filter=function(t,e){return(Ga(t)?Pe:pr)(t,oo(e,3))},Un.flatMap=function(t,e){return vr(xa(t,e),1)},Un.flatMapDeep=function(t,e){return vr(xa(t,e),c)},Un.flatMapDepth=function(t,e,n){return n=n===i?1:ds(n),vr(xa(t,e),n)},Un.flatten=Wo,Un.flattenDeep=function(t){return null!=t&&t.length?vr(t,c):[]},Un.flattenDepth=function(t,e){return null!=t&&t.length?vr(t,e=e===i?1:ds(e)):[]},Un.flip=function(t){return $i(t,512)},Un.flow=tu,Un.flowRight=eu,Un.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Un.functions=function(t){return null==t?[]:_r(t,js(t))},Un.functionsIn=function(t){return null==t?[]:_r(t,Cs(t))},Un.groupBy=ba,Un.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Un.intersection=Ho,Un.intersectionBy=Yo,Un.intersectionWith=$o,Un.invert=Es,Un.invertBy=Ps,Un.invokeMap=_a,Un.iteratee=ru,Un.keyBy=wa,Un.keys=js,Un.keysIn=Cs,Un.map=xa,Un.mapKeys=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Un.mapValues=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Un.matches=function(t){return Nr(ar(t,1))},Un.matchesProperty=function(t,e){return Ur(t,ar(e,1))},Un.memoize=Da,Un.merge=Rs,Un.mergeWith=Ds,Un.method=iu,Un.methodOf=ou,Un.mixin=au,Un.negate=Ia,Un.nthArg=function(t){return t=ds(t),Yr((function(e){return zr(e,t)}))},Un.omit=Is,Un.omitBy=function(t,e){return Ms(t,Ia(oo(e)))},Un.once=function(t){return Ea(2,t)},Un.orderBy=function(t,e,n,r){return null==t?[]:(Ga(e)||(e=null==e?[]:[e]),Ga(n=r?i:n)||(n=null==n?[]:[n]),Br(t,e,n))},Un.over=uu,Un.overArgs=La,Un.overEvery=lu,Un.overSome=cu,Un.partial=Ma,Un.partialRight=Na,Un.partition=Sa,Un.pick=Ls,Un.pickBy=Ms,Un.property=fu,Un.propertyOf=function(t){return function(e){return null==t?i:wr(t,e)}},Un.pull=Zo,Un.pullAll=Ko,Un.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,oo(n,2)):t},Un.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,i,n):t},Un.pullAt=Jo,Un.range=hu,Un.rangeRight=du,Un.rearg=Ua,Un.reject=function(t,e){return(Ga(t)?Pe:pr)(t,Ia(oo(e,3)))},Un.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Wr(t,i),n},Un.rest=function(t,e){if("function"!=typeof t)throw new Et(o);return Yr(t,e=e===i?e:ds(e))},Un.reverse=Qo,Un.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),(Ga(t)?Zn:qr)(t,e)},Un.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Un.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Un.shuffle=function(t){return(Ga(t)?Kn:Qr)(t)},Un.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:ds(e),n=n===i?r:ds(n)),ti(t,e,n)):[]},Un.sortBy=Ta,Un.sortedUniq=function(t){return t&&t.length?ii(t):[]},Un.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Un.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ms(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=ai(e))&&rn(t)?gi(fn(t),0,n):t.split(e,n):[]},Un.spread=function(t,e){if("function"!=typeof t)throw new Et(o);return e=null==e?0:yn(ds(e),0),Yr((function(n){var r=n[e],i=gi(n,0,e);return r&&Re(i,r),Se(t,this,i)}))},Un.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Un.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:ds(e))<0?0:e):[]},Un.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:ds(e)))<0?0:e,r):[]},Un.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Un.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Un.tap=function(t,e){return e(t),t},Un.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Et(o);return Qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ja(t,e,{leading:r,maxWait:e,trailing:i})},Un.thru=ha,Un.toArray=fs,Un.toPairs=Ns,Un.toPairsIn=Us,Un.toPath=function(t){return Ga(t)?Ce(t,Mo):ss(t)?[t]:Ai(Lo(ms(t)))},Un.toPlainObject=ys,Un.transform=function(t,e,n){var r=Ga(t),i=r||Ya(t)||us(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qa(t)&&Za(o)?Fn(Wt(t)):{}}return(i?Oe:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Un.unary=function(t){return Aa(t,1)},Un.union=ta,Un.unionBy=ea,Un.unionWith=na,Un.uniq=function(t){return t&&t.length?si(t):[]},Un.uniqBy=function(t,e){return t&&t.length?si(t,oo(e,2)):[]},Un.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Un.unset=function(t,e){return null==t||ui(t,e)},Un.unzip=ra,Un.unzipWith=ia,Un.update=function(t,e,n){return null==t?t:li(t,e,vi(n))},Un.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:li(t,e,vi(n),r)},Un.values=Fs,Un.valuesIn=function(t){return null==t?[]:Ze(t,Cs(t))},Un.without=oa,Un.words=Zs,Un.wrap=function(t,e){return Ma(vi(e),t)},Un.xor=aa,Un.xorBy=sa,Un.xorWith=ua,Un.zip=la,Un.zipObject=function(t,e){return di(t||[],e||[],Qn)},Un.zipObjectDeep=function(t,e){return di(t||[],e||[],Zr)},Un.zipWith=ca,Un.entries=Ns,Un.entriesIn=Us,Un.extend=bs,Un.extendWith=_s,au(Un,Un),Un.add=mu,Un.attempt=Ks,Un.camelCase=zs,Un.capitalize=Bs,Un.ceil=gu,Un.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=vs(n))==n?n:0),e!==i&&(e=(e=vs(e))==e?e:0),or(vs(t),e,n)},Un.clone=function(t){return ar(t,4)},Un.cloneDeep=function(t){return ar(t,5)},Un.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:i)},Un.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:i)},Un.conformsTo=function(t,e){return null==e||sr(t,e,js(e))},Un.deburr=Vs,Un.defaultTo=function(t,e){return null==t||t!=t?e:t},Un.divide=bu,Un.endsWith=function(t,e,n){t=ms(t),e=ai(e);var r=t.length,o=n=n===i?r:or(ds(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Un.eq=Fa,Un.escape=function(t){return(t=ms(t))&&$.test(t)?t.replace(H,en):t},Un.escapeRegExp=function(t){return(t=ms(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Un.every=function(t,e,n){var r=Ga(t)?Ee:hr;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Un.find=va,Un.findIndex=Vo,Un.findKey=function(t,e){return Ne(t,oo(e,3),gr)},Un.findLast=ya,Un.findLastIndex=Go,Un.findLastKey=function(t,e){return Ne(t,oo(e,3),br)},Un.floor=_u,Un.forEach=ma,Un.forEachRight=ga,Un.forIn=function(t,e){return null==t?t:yr(t,oo(e,3),Cs)},Un.forInRight=function(t,e){return null==t?t:mr(t,oo(e,3),Cs)},Un.forOwn=function(t,e){return t&&gr(t,oo(e,3))},Un.forOwnRight=function(t,e){return t&&br(t,oo(e,3))},Un.get=Os,Un.gt=za,Un.gte=Ba,Un.has=function(t,e){return null!=t&&ho(t,e,Or)},Un.hasIn=As,Un.head=Xo,Un.identity=nu,Un.includes=function(t,e,n,r){t=Xa(t)?t:Fs(t),n=n&&!r?ds(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),as(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Un.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Fe(t,e,i)},Un.inRange=function(t,e,n){return e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=vs(t),e,n)},Un.invoke=ks,Un.isArguments=Va,Un.isArray=Ga,Un.isArrayBuffer=Wa,Un.isArrayLike=Xa,Un.isArrayLikeObject=Ha,Un.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Sr(t)==m},Un.isBuffer=Ya,Un.isDate=$a,Un.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Un.isEmpty=function(t){if(null==t)return!0;if(Xa(t)&&(Ga(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||us(t)||Va(t)))return!t.length;var e=fo(t);if(e==x||e==E)return!t.size;if(wo(t))return!Ir(t).length;for(var n in t)if(Dt.call(t,n))return!1;return!0},Un.isEqual=function(t,e){return jr(t,e)},Un.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?jr(t,e,i,n):!!r},Un.isError=qa,Un.isFinite=function(t){return"number"==typeof t&&Me(t)},Un.isFunction=Za,Un.isInteger=Ka,Un.isLength=Ja,Un.isMap=es,Un.isMatch=function(t,e){return t===e||Cr(t,e,so(e))},Un.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Cr(t,e,so(e),n)},Un.isNaN=function(t){return ns(t)&&t!=+t},Un.isNative=function(t){if(_o(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},Un.isNil=function(t){return null==t},Un.isNull=function(t){return null===t},Un.isNumber=ns,Un.isObject=Qa,Un.isObjectLike=ts,Un.isPlainObject=rs,Un.isRegExp=is,Un.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=f},Un.isSet=os,Un.isString=as,Un.isSymbol=ss,Un.isTypedArray=us,Un.isUndefined=function(t){return t===i},Un.isWeakMap=function(t){return ts(t)&&fo(t)==j},Un.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Sr(t)},Un.join=function(t,e){return null==t?"":We.call(t,e)},Un.kebabCase=Gs,Un.last=qo,Un.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ds(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Ue(t,Be,o,!0)},Un.lowerCase=Ws,Un.lowerFirst=Xs,Un.lt=ls,Un.lte=cs,Un.max=function(t){return t&&t.length?dr(t,nu,Tr):i},Un.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Tr):i},Un.mean=function(t){return Ve(t,nu)},Un.meanBy=function(t,e){return Ve(t,oo(e,2))},Un.min=function(t){return t&&t.length?dr(t,nu,Lr):i},Un.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Lr):i},Un.stubArray=pu,Un.stubFalse=vu,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=wu,Un.nth=function(t,e){return t&&t.length?zr(t,ds(e)):i},Un.noConflict=function(){return fe._===this&&(fe._=Ut),this},Un.noop=su,Un.now=Oa,Un.pad=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(de(i),n)+t+Bi(he(i),n)},Un.padEnd=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?t+Bi(e-r,n):t},Un.padStart=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Un.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ms(t).replace(rt,""),e||0)},Un.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=hs(t),e===i?(e=t,t=0):e=hs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=_n();return mn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Un.reduce=function(t,e,n){var r=Ga(t)?De:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,cr)},Un.reduceRight=function(t,e,n){var r=Ga(t)?Ie:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Un.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),Hr(ms(t),e)},Un.replace=function(){var t=arguments,e=ms(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Un.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Mo(e[r])];a===i&&(r=o,a=n),t=Za(a)?a.call(t):a}return t},Un.round=xu,Un.runInContext=t,Un.sample=function(t){return(Ga(t)?qn:$r)(t)},Un.size=function(t){if(null==t)return 0;if(Xa(t))return as(t)?cn(t):t.length;var e=fo(t);return e==x||e==E?t.size:Ir(t).length},Un.snakeCase=Hs,Un.some=function(t,e,n){var r=Ga(t)?Le:ei;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Un.sortedIndex=function(t,e){return ni(t,e)},Un.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Un.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Fa(t[r],e))return r}return-1},Un.sortedLastIndex=function(t,e){return ni(t,e,!0)},Un.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Un.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Fa(t[n],e))return n}return-1},Un.startCase=Ys,Un.startsWith=function(t,e,n){return t=ms(t),n=null==n?0:or(ds(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Un.subtract=Su,Un.sum=function(t){return t&&t.length?He(t,nu):0},Un.sumBy=function(t,e){return t&&t.length?He(t,oo(e,2)):0},Un.template=function(t,e,n){var r=Un.templateSettings;n&&mo(t,e,n)&&(e=i),t=ms(t),e=_s({},e,r,qi);var o,a,s=_s({},e.imports,r.imports,qi),u=js(s),l=Ze(s,u),c=0,f=e.interpolate||bt,h="__p += '",d=Ot((e.escape||bt).source+"|"+f.source+"|"+(f===K?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Dt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),h+=t.slice(c,u).replace(_t,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var v=Dt.call(e,"variable")&&e.variable;if(v){if(lt.test(v))throw new wt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(W,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ks((function(){return xt(u,p+"return "+h).apply(i,l)}));if(y.source=h,qa(y))throw y;return y},Un.times=function(t,e){if((t=ds(t))<1||t>f)return[];var n=d,r=mn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Un.toFinite=hs,Un.toInteger=ds,Un.toLength=ps,Un.toLower=function(t){return ms(t).toLowerCase()},Un.toNumber=vs,Un.toSafeInteger=function(t){return t?or(ds(t),-9007199254740991,f):0===t?t:0},Un.toString=ms,Un.toUpper=function(t){return ms(t).toUpperCase()},Un.trim=function(t,e,n){if((t=ms(t))&&(n||e===i))return $e(t);if(!t||!(e=ai(e)))return t;var r=fn(t),o=fn(e);return gi(r,Je(r,o),Qe(r,o)+1).join("")},Un.trimEnd=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,0,Qe(r,fn(e))+1).join("")},Un.trimStart=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,Je(r,fn(e))).join("")},Un.truncate=function(t,e){var n=30,r="...";if(Qa(e)){var o="separator"in e?e.separator:o;n="length"in e?ds(e.length):n,r="omission"in e?ai(e.omission):r}var a=(t=ms(t)).length;if(rn(t)){var s=fn(t);a=s.length}if(n>=a)return t;var u=n-cn(r);if(u<1)return r;var l=s?gi(s,0,u).join(""):t.slice(0,u);if(o===i)return l+r;if(s&&(u+=l.length-u),is(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=Ot(o.source,ms(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(t.indexOf(ai(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Un.unescape=function(t){return(t=ms(t))&&Y.test(t)?t.replace(X,dn):t},Un.uniqueId=function(t){var e=++It;return ms(t)+e},Un.upperCase=$s,Un.upperFirst=qs,Un.each=ma,Un.eachRight=ga,Un.first=Xo,au(Un,(yu={},gr(Un,(function(t,e){Dt.call(Un.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Un.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Un[t].placeholder=Un})),Oe(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===i?1:yn(ds(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return Pr(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(Ia(oo(t)))},Vn.prototype.slice=function(t,e){t=ds(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ds(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},gr(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Un[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Un.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Vn,l=s[0],c=u||Ga(e),f=function(t){var e=o.apply(Un,Re([t],s));return r&&h?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&c){e=v?e:new Vn(this);var y=t.apply(e,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,h)}return p&&v?t.apply(this,s):(y=this.thru(f),p?r?y.value()[0]:y.value():y)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Pt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Un.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ga(i)?i:[],t)}return this[n]((function(n){return e.apply(Ga(n)?n:[],t)}))}})),gr(Vn.prototype,(function(t,e){var n=Un[e];if(n){var r=n.name+"";Dt.call(kn,r)||(kn[r]=[]),kn[r].push({name:e,func:n})}})),kn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ga(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=mn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,y=t[l+=e];++v<f;){var m=c[v],g=m.iteratee,b=m.type,_=g(y);if(2==b)y=_;else if(!_){if(1==b)continue t;break t}}p[h++]=y}return p},Un.prototype.at=da,Un.prototype.chain=function(){return fa(this)},Un.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Uo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Un.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:i}),new Bn(e,this.__chain__)}return this.thru(Qo)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,qt&&(Un.prototype[qt]=function(){return this}),Un}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},880:function(t,e,n){var r,i;r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function l(t){return function(){typeof console!==e&&(u.call(this),this[t].apply(this,arguments))}}function c(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):t)}(r)||l.apply(this,arguments)}function f(t,n){var a,s,l,f=this,h="loglevel";function d(){var t;if(typeof window!==e&&h){try{t=window.localStorage[h]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(t=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(t){}return void 0===f.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==f.levels[e.toUpperCase()]&&(e=f.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=f.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?h+=":"+t:"symbol"==typeof t&&(h=void 0),f.name=t,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||c,f.getLevel=function(){return null!=l?l:null!=s?s:a},f.setLevel=function(t,n){return l=p(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(t){}}}(l),u.call(f)},f.setDefaultLevel=function(t){s=p(t),d()||f.setLevel(t,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==e&&h){try{window.localStorage.removeItem(h)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),u.call(f)},f.enableAll=function(t){f.setLevel(f.levels.TRACE,t)},f.disableAll=function(t){f.setLevel(f.levels.SILENT,t)},f.rebuild=function(){if(o!==f&&(a=p(o.getLevel())),u.call(f),o===f)for(var t in i)i[t].rebuild()},a=p(o?o.getLevel():"WARN");var v=d();null!=v&&(l=p(v)),u.call(f)}(o=new f).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=i[t];return e||(e=i[t]=new f(t,o.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},481:(t,e,n)=>{t.exports=n(137)},137:t=>{t.exports=class{constructor(t,e,n,r){let i;if("object"==typeof t){let o=t;t=o.k_p,e=o.k_i,n=o.k_d,r=o.dt,i=o.i_max}this.k_p="number"==typeof t?t:1,this.k_i=e||0,this.k_d=n||0,this.dt=r||0,this.i_max=i||0,this.sumError=0,this.lastError=0,this.lastTime=0,this.target=0}setTarget(t){this.target=t}update(t){this.currentValue=t;let e=this.dt;if(!e){let t=Date.now();e=0===this.lastTime?0:(t-this.lastTime)/1e3,this.lastTime=t}"number"==typeof e&&0!==e||(e=1);let n=this.target-this.currentValue;if(this.sumError=this.sumError+n*e,this.i_max>0&&Math.abs(this.sumError)>this.i_max){let t=this.sumError>0?1:-1;this.sumError=t*this.i_max}let r=(n-this.lastError)/e;return this.lastError=n,this.k_p*n+this.k_i*this.sumError+this.k_d*r}reset(){this.sumError=0,this.lastError=0,this.lastTime=0}}},803:t=>{var e,n,r=document.attachEvent,i=!1;function o(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function a(t){var e=this;o(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}if(!r){var s=(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return n(t)}),u=(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),l=!1,c="",f="animationstart",h="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(l=!0),!1===l)for(var v=0;v<h.length;v++)if(void 0!==p.style[h[v]+"AnimationName"]){c="-"+h[v].toLowerCase()+"-",f=d[v],l=!0;break}var y="resizeanim",m="@"+c+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",g=c+"animation: 1ms "+y+"; "}t.exports=function(t,e){return r?t.attachEvent("onresize",e):(t.__resizeTriggers__||("static"==getComputedStyle(t).position&&(t.style.position="relative"),function(){if(!i){var t=(m||"")+".resize-triggers { "+(g||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n),i=!0}}(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),o(t),t.addEventListener("scroll",a,!0),f&&t.__resizeTriggers__.addEventListener(f,(function(e){e.animationName==y&&o(t)}))),t.__resizeListeners__.push(e)),function(){r?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",a),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))}}},975:(t,e,n)=>{var r=n(101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},101:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={id:t,loaded:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};(()=>{i.d(o,{RL:()=>Mi,wK:()=>sa,x_:()=>ca,lv:()=>la,YQ:()=>ua,BP:()=>Mc,GZ:()=>Nc,Vw:()=>fa,Ay:()=>Uc,_G:()=>Ns});var n=i(250);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}var u=["onLayoutDone","onLayoutStep","onError","onLayoutComputing","onWebGLContextLost","restart"],l=function(){function t(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=s(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks=i}var e,n;return e=t,n=[{key:"onLayoutDone",value:function(){this.isValidFunction(this.callbacks.onLayoutDone)&&this.callbacks.onLayoutDone()}},{key:"onLayoutStep",value:function(t){this.isValidFunction(this.callbacks.onLayoutStep)&&this.callbacks.onLayoutStep(t)}},{key:"onLayoutComputing",value:function(t){this.isValidFunction(this.callbacks.onLayoutComputing)&&this.callbacks.onLayoutComputing(t)}},{key:"onError",value:function(t){this.isValidFunction(this.callbacks.onError)&&this.callbacks.onError(t)}},{key:"onWebGLContextLost",value:function(t){this.isValidFunction(this.callbacks.onWebGLContextLost)&&this.callbacks.onWebGLContextLost(t)}},{key:"isValidFunction",value:function(t){return void 0!==t&&"function"==typeof t}}],n&&a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function f(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){function t(t){void 0===t&&(t="Atom@"+re()),this.name=t,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Oe.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){He(this)},t.prototype.reportChanged=function(){We(),function(t){if(t.lowestObserverState!==Oe.STALE){t.lowestObserverState=Oe.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.UP_TO_DATE&&(r.isTracing!==Ae.NONE&&Ye(r,t),r.onBecomeStale()),r.dependenciesState=Oe.STALE}}}(this),Xe()},t.prototype.toString=function(){return this.name},t}(),d=function(t){function e(e,n,r){void 0===e&&(e="Atom@"+re()),void 0===n&&(n=le),void 0===r&&(r=le);var i=t.call(this,e)||this;return i.name=e,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return f(e,t),e.prototype.reportObserved=function(){return We(),t.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),Xe(),!!ke.trackingDerivation},e.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},e}(h),p=we("Atom",h);function v(t){return t.interceptors&&t.interceptors.length>0}function y(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function m(t,e){var n=rn();try{var r=t.interceptors;if(r)for(var i=0,o=r.length;i<o&&(oe(!(e=r[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{on(n)}}function g(t){return t.changeListeners&&t.changeListeners.length>0}function b(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function _(t,e){var n=rn(),r=t.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](e);on(n)}}function w(){return!!ke.spyListeners.length}function x(t){if(ke.spyListeners.length)for(var e=ke.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function S(t){x(pe({},t,{spyReportStart:!0}))}var T={spyReportEnd:!0};function O(t){x(t?pe({},t,T):T)}function A(t){return ke.spyListeners.push(t),ue((function(){var e=ke.spyListeners.indexOf(t);-1!==e&&ke.spyListeners.splice(e,1)}))}var E="__$$iterating";function P(t){oe(!0!==t[E],"Illegal state: cannot recycle array as iterator"),ge(t,E,!0);var e=-1;return ge(t,"next",(function(){return{done:++e>=this.length,value:e<this.length?this[e]:void 0}})),t}function k(t,e){ge(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var j,C,R=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,!1===t}(),D=0,I=function(){};j=I,C=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(j.prototype,C):void 0!==j.prototype.__proto__?j.prototype.__proto__=C:j.prototype=C,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(t){Object.defineProperty(I.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})}));var L=function(){function t(t,e,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new h(t||"ObservableArray@"+re()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer?t.map(this.dehancer):t},t.prototype.intercept=function(t){return y(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),b(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=e,e>0&&t+e+1>D&&z(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Qe(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=[]),v(this)){var o=m(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!o)return ee;e=o.removedCount,n=o.added}var a=(n=n.map((function(t){return r.enhancer(t,void 0)}))).length-e;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(t,e,n){if(n.length<1e4)return(r=this.values).splice.apply(r,[t,e].concat(n));var r,i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&w(),i=g(this),o=i||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&S(o),this.atom.reportChanged(),i&&_(this,o),r&&O()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&w(),i=g(this),o=i||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&S(o),this.atom.reportChanged(),i&&_(this,o),r&&O()},t}(),M=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableArray@"+re()),void 0===i&&(i=!1);var o=t.call(this)||this,a=new L(r,n,o,i);return ge(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),R&&Object.defineProperty(a.array,"0",N),o}return f(e,t),e.prototype.intercept=function(t){return this.$mobx.intercept(t)},e.prototype.observe=function(t,e){return void 0===e&&(e=!1),this.$mobx.observe(t,e)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),t.map((function(t){return V(t)?t.peek():t})))},e.prototype.replace=function(t){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,t)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(t,e,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},e.prototype.findIndex=function(t,e,n){void 0===n&&(n=0);for(var r=this.peek(),i=r.length,o=n;o<i;o++)if(t.call(e,r[o],o,this))return o;return-1},e.prototype.splice=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(t);case 2:return this.$mobx.spliceWithArray(t,e)}return this.$mobx.spliceWithArray(t,e,n)},e.prototype.spliceWithArray=function(t,e,n){return this.$mobx.spliceWithArray(t,e,n)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,t),n.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(0,0,t),n.values.length},e.prototype.reverse=function(){var t=this.slice();return t.reverse.apply(t,arguments)},e.prototype.sort=function(t){var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.dehanceValues(this.$mobx.values).indexOf(t);return e>-1&&(this.splice(e,1),!0)},e.prototype.move=function(t,e){function n(t){if(t<0)throw new Error("[mobx.array] Index out of bounds: "+t+" is negative");var e=this.$mobx.values.length;if(t>=e)throw new Error("[mobx.array] Index out of bounds: "+t+" is not smaller than "+e)}if(n.call(this,t),n.call(this,e),t!==e){var r,i=this.$mobx.values;r=t<e?i.slice(0,t).concat(i.slice(t+1,e+1),[i[t]],i.slice(e+1)):i.slice(0,e).concat([i[t]],i.slice(e,t),i.slice(t+1)),this.replace(r)}},e.prototype.get=function(t){var e=this.$mobx;if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(t,e){var n=this.$mobx,r=n.values;if(t<r.length){Qe(n.atom);var i=r[t];if(v(n)){var o=m(n,{type:"update",object:this,index:t,newValue:e});if(!o)return;e=o.newValue}(e=n.enhancer(e,i))!==i&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}},e}(I);k(M.prototype,(function(){return P(this.slice())})),Object.defineProperty(M.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(t){this.$mobx.setArrayLength(t)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach((function(t){var e=Array.prototype[t];oe("function"==typeof e,"Base function not defined on Array prototype: '"+t+"'"),me(M.prototype,t,(function(){return e.apply(this.peek(),arguments)}))})),function(t,e){for(var n=0;n<e.length;n++)me(t,e[n],t[e[n]])}(M.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var N=U(0);function U(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function F(t){Object.defineProperty(M.prototype,""+t,U(t))}function z(t){for(var e=D;e<t;e++)F(e);D=t}z(1e3);var B=we("ObservableArrayAdministration",L);function V(t){return he(t)&&B(t.$mobx)}var G={},W=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableValue@"+re()),void 0===i&&(i=!0);var o=t.call(this,r)||this;return o.enhancer=n,o.hasUnreportedChange=!1,o.dehancer=void 0,o.value=n(e,void 0,r),i&&w()&&x({type:"create",object:o,newValue:o.value}),o}return f(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){var e=this.value;if((t=this.prepareNewValue(t))!==G){var n=w();n&&S({type:"update",object:this,newValue:t,oldValue:e}),this.setNewValue(t),n&&O()}},e.prototype.prepareNewValue=function(t){if(Qe(this),v(this)){var e=m(this,{object:this,type:"update",newValue:t});if(!e)return G;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.value!==t?t:G},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),g(this)&&_(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return y(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),b(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Te(this.get())},e}(h);W.prototype[Se()]=W.prototype.valueOf;var X=we("ObservableValue",W),H={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"};function Y(t){return H[t]}function $(t,e){oe("function"==typeof e,Y("m026")),oe("string"==typeof t&&t.length>0,"actions should have valid names, got: '"+t+"'");var n=function(){return q(t,e,this,arguments)};return n.originalFn=e,n.isMobxAction=!0,n}function q(t,e,n,r){var i=function(t,e,n,r){var i=w()&&!!t,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];S({type:"action",name:t,fn:e,object:n,arguments:s})}var l=rn();return We(),{prevDerivation:l,prevAllowStateChanges:K(!0),notifySpy:i,startTime:o}}(t,e,n,r);try{return e.apply(n,r)}finally{!function(t){J(t.prevAllowStateChanges),Xe(),on(t.prevDerivation),t.notifySpy&&O({time:Date.now()-t.startTime})}(i)}}function Z(t){oe(null===ke.trackingDerivation,Y("m028")),ke.strictMode=t,ke.allowStateChanges=!t}function K(t){var e=ke.allowStateChanges;return ke.allowStateChanges=t,e}function J(t){ke.allowStateChanges=t}function Q(t,e,n,r,i){function o(o,a,s,u,l){if(void 0===l&&(l=0),oe(i||nt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){ye(o,"__mobxLazyInitializers")||me(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var c=s.value,f=s.initializer;return o.__mobxLazyInitializers.push((function(e){t(e,a,f?f.call(e):c,u,s)})),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&et(this),e.call(this,a)},set:function(t){!0!==this.__mobxDidRunLazyInitializers&&et(this),n.call(this,a,t)}}}var h={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||tt(this,a,void 0,t,u,s),e.call(this,a)},set:function(e){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,e):tt(this,a,e,t,u,s)}};return(arguments.length<3||5===arguments.length&&l<3)&&Object.defineProperty(o,a,h),h}return i?function(){if(nt(arguments))return o.apply(null,arguments);var t=arguments,e=arguments.length;return function(n,r,i){return o(n,r,i,t,e)}}:o}function tt(t,e,n,r,i,o){ye(t,"__mobxInitializedProps")||me(t,"__mobxInitializedProps",{}),t.__mobxInitializedProps[e]=!0,r(t,e,n,i,o)}function et(t){!0!==t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers&&(me(t,"__mobxDidRunLazyInitializers",!0),t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers.forEach((function(e){return e(t)})))}function nt(t){return(2===t.length||3===t.length)&&"string"==typeof t[1]}var rt=Q((function(t,e,n,r,i){var o=r&&1===r.length?r[0]:n.name||e||"<unnamed action>";me(t,e,ot(o,n))}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!0),it=Q((function(t,e,n){ut(t,e,n)}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!1),ot=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?$(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?$(t,e):1===arguments.length&&"string"==typeof t?at(t):at(e).apply(null,arguments)};function at(t){return function(e,n,r){if(r&&"function"==typeof r.value)return r.value=$(t,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return rt(t).apply(this,arguments)}}function st(t){return"function"==typeof t&&!0===t.isMobxAction}function ut(t,e,n){var r=function(){return q(e,n,t,arguments)};r.isMobxAction=!0,me(t,e,r)}ot.bound=function(t,e,n){if("function"==typeof t){var r=$("<not yet bound action>",t);return r.autoBind=!0,r}return it.apply(null,arguments)};var lt=Object.prototype.toString;function ct(t,e){return ft(t,e)}function ft(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&function(t,e,n,r){t=ht(t),e=ht(e);var i=lt.call(t);if(i!==lt.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!ft(t[u],e[u],n,r))return!1}else{var l,c=Object.keys(t);if(u=c.length,Object.keys(e).length!==u)return!1;for(;u--;)if(!dt(e,l=c[u])||!ft(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function ht(t){return V(t)?t.peek():te(t)?t.entries():xe(t)?function(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}(t.entries()):t}function dt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pt(t,e){return t===e}var vt={identity:pt,structural:function(t,e){return ct(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||pt(t,e)}};function yt(t,e,n){var r,i,o;"string"==typeof t?(r=t,i=e,o=n):(r=t.name||"Autorun@"+re(),i=t,o=e),oe("function"==typeof i,Y("m004")),oe(!1===st(i),Y("m005")),o&&(i=i.bind(o));var a=new ln(r,(function(){this.track(s)}));function s(){i(a)}return a.schedule(),a.getDisposer()}function mt(t,e,n){var r;arguments.length>3&&ie(Y("m007")),Wt(t)&&ie(Y("m008")),(r="object"==typeof n?n:{}).name=r.name||t.name||e.name||"Reaction@"+re(),r.fireImmediately=!0===n||!0===r.fireImmediately,r.delay=r.delay||0,r.compareStructural=r.compareStructural||r.struct||!1,e=ot(r.name,r.context?e.bind(r.context):e),r.context&&(t=t.bind(r.context));var i,o=!0,a=!1,s=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default,u=new ln(r.name,(function(){o||r.delay<1?l():a||(a=!0,setTimeout((function(){a=!1,l()}),r.delay))}));function l(){if(!u.isDisposed){var n=!1;u.track((function(){var e=t(u);n=o||!s(i,e),i=e})),o&&r.fireImmediately&&e(i,u),o||!0!==n||e(i,u),o&&(o=!1)}}return u.schedule(),u.getDisposer()}var gt=function(){function t(t,e,n,r,i){this.derivation=t,this.scope=e,this.equals=n,this.dependenciesState=Oe.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Oe.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+re(),this.value=new qe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Ae.NONE,this.name=r||"ComputedValue@"+re(),i&&(this.setter=$(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Oe.UP_TO_DATE){t.lowestObserverState=Oe.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.UP_TO_DATE&&(r.dependenciesState=Oe.POSSIBLY_STALE,r.isTracing!==Ae.NONE&&Ye(r,t),r.onBecomeStale())}}}(this)},t.prototype.onBecomeUnobserved=function(){en(this),this.value=void 0},t.prototype.get=function(){oe(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===ke.inBatch?(We(),Ke(this)&&(this.isTracing!==Ae.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),Xe()):(He(this),Ke(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState!==Oe.STALE){t.lowestObserverState=Oe.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.POSSIBLY_STALE?r.dependenciesState=Oe.STALE:r.dependenciesState===Oe.UP_TO_DATE&&(t.lowestObserverState=Oe.UP_TO_DATE)}}}(this));var t=this.value;if(Ze(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Ze(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){oe(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else oe(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){w()&&x({object:this.scope,type:"compute",fn:this.derivation});var t=this.value,e=this.dependenciesState===Oe.NOT_TRACKING,n=this.value=this.computeValue(!0);return e||Ze(t)||Ze(n)||!this.equals(t,n)},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ke.computationDepth++,t)e=tn(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new qe(t)}return ke.computationDepth--,this.isComputing=!1,e},t.prototype.observe=function(t,e){var n=this,r=!0,i=void 0;return yt((function(){var o=n.get();if(!r||e){var a=rn();t({type:"update",object:n,newValue:o,oldValue:i}),on(a)}r=!1,i=o}))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Te(this.get())},t.prototype.whyRun=function(){var t=Boolean(ke.trackingDerivation),e=ce(this.isComputing?this.newObserving:this.observing).map((function(t){return t.name})),n=ce(ze(this).map((function(t){return t.name})));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(t?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Oe.NOT_TRACKING?Y("m032"):" * This computation will re-run if any of the following observables changes:\n "+fe(e)+"\n "+(this.isComputing&&t?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+Y("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+fe(n)+"\n")},t}();gt.prototype[Se()]=gt.prototype.valueOf;var bt=we("ComputedValue",gt),_t=function(){function t(t,e){this.target=t,this.name=e,this.values={},this.changeListeners=null,this.interceptors=null}return t.prototype.observe=function(t,e){return oe(!0!==e,"`observe` doesn't support the fire immediately property for observable objects."),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();function wt(t,e){if(jt(t)&&t.hasOwnProperty("$mobx"))return t.$mobx;oe(Object.isExtensible(t),Y("m035")),de(t)||(e=(t.constructor.name||"ObservableObject")+"@"+re()),e||(e="ObservableObject@"+re());var n=new _t(t,e);return ge(t,"$mobx",n),n}function xt(t,e,n,r){if(t.values[e]&&!bt(t.values[e]))return oe("value"in n,"The property "+e+" in "+t.name+" is already observable, cannot redefine it as computed property"),void(t.target[e]=n.value);if("value"in n)if(Wt(n.value)){var i=n.value;St(t,e,i.initialValue,i.enhancer)}else st(n.value)&&!0===n.value.autoBind?ut(t.target,e,n.value.originalFn):bt(n.value)?function(t,e,n){var r=t.name+"."+e;n.name=r,n.scope||(n.scope=t.target),t.values[e]=n,Object.defineProperty(t.target,e,Et(e))}(t,e,n.value):St(t,e,n.value,r);else Tt(t,e,n.get,n.set,vt.default,!0)}function St(t,e,n,r){if(_e(t.target,e),v(t)){var i=m(t,{object:t.target,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(t.values[e]=new W(n,r,t.name+"."+e,!1)).value,Object.defineProperty(t.target,e,function(t){return Ot[t]||(Ot[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[t].get()},set:function(e){Pt(this,t,e)}})}(e)),function(t,e,n,r){var i=g(t),o=w(),a=i||o?{type:"add",object:e,name:n,newValue:r}:null;o&&S(a),i&&_(t,a),o&&O()}(t,t.target,e,n)}function Tt(t,e,n,r,i,o){o&&_e(t.target,e),t.values[e]=new gt(n,t.target,i,t.name+"."+e,r),o&&Object.defineProperty(t.target,e,Et(e))}var Ot={},At={};function Et(t){return At[t]||(At[t]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[t].get()},set:function(e){return this.$mobx.values[t].set(e)}})}function Pt(t,e,n){var r=t.$mobx,i=r.values[e];if(v(r)){if(!(s=m(r,{type:"update",object:t,name:e,newValue:n})))return;n=s.newValue}if((n=i.prepareNewValue(n))!==G){var o=g(r),a=w(),s=o||a?{type:"update",object:t,oldValue:i.value,name:e,newValue:n}:null;a&&S(s),i.setNewValue(n),o&&_(r,s),a&&O()}}var kt=we("ObservableObjectAdministration",_t);function jt(t){return!!he(t)&&(et(t),kt(t.$mobx))}function Ct(t,e){if(null==t)return!1;if(void 0!==e){if(V(t)||te(t))throw new Error(Y("m019"));if(jt(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return jt(t)||!!t.$mobx||p(t)||vn(t)||bt(t)}function Rt(t){return oe(!!t,":("),Q((function(e,n,r,i,o){_e(e,n),oe(!o||!o.get,Y("m022")),St(wt(e,void 0),n,r,t)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){Pt(this,t,e)}),!0,!1)}function Dt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Lt(t,Ht,e)}function It(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Lt(t,$t,e)}function Lt(t,e,n){oe(arguments.length>=2,Y("m014")),oe("object"==typeof t,Y("m015")),oe(!te(t),Y("m016")),n.forEach((function(t){oe("object"==typeof t,Y("m017")),oe(!Ct(t),Y("m018"))}));for(var r=wt(t),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&ye(a,s)){if(i[s]=!0,t===a&&!be(t,s))continue;xt(r,s,Object.getOwnPropertyDescriptor(a,s),e)}}return t}var Mt=Rt(Ht),Nt=Rt(Yt),Ut=Rt($t),Ft=Rt(qt),zt=Rt(Zt),Bt={box:function(t,e){return arguments.length>2&&Gt("box"),new W(t,Ht,e)},shallowBox:function(t,e){return arguments.length>2&&Gt("shallowBox"),new W(t,$t,e)},array:function(t,e){return arguments.length>2&&Gt("array"),new M(t,Ht,e)},shallowArray:function(t,e){return arguments.length>2&&Gt("shallowArray"),new M(t,$t,e)},map:function(t,e){return arguments.length>2&&Gt("map"),new Qt(t,Ht,e)},shallowMap:function(t,e){return arguments.length>2&&Gt("shallowMap"),new Qt(t,$t,e)},object:function(t,e){arguments.length>2&&Gt("object");var n={};return wt(n,e),Dt(n,t),n},shallowObject:function(t,e){arguments.length>2&&Gt("shallowObject");var n={};return wt(n,e),It(n,t),n},ref:function(){return arguments.length<2?Xt($t,arguments[0]):Ut.apply(null,arguments)},shallow:function(){return arguments.length<2?Xt(Yt,arguments[0]):Nt.apply(null,arguments)},deep:function(){return arguments.length<2?Xt(Ht,arguments[0]):Mt.apply(null,arguments)},struct:function(){return arguments.length<2?Xt(qt,arguments[0]):Ft.apply(null,arguments)}},Vt=function(t){if(void 0===t&&(t=void 0),"string"==typeof arguments[1])return Mt.apply(null,arguments);if(oe(arguments.length<=1,Y("m021")),oe(!Wt(t),Y("m020")),Ct(t))return t;var e=Ht(t,0,void 0);return e!==t?e:Vt.box(t)};function Gt(t){ie("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function Wt(t){return"object"==typeof t&&null!==t&&!0===t.isMobxModifierDescriptor}function Xt(t,e){return oe(!Wt(e),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:e,enhancer:t}}function Ht(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),Ct(t)?t:Array.isArray(t)?Vt.array(t,n):de(t)?Vt.object(t,n):xe(t)?Vt.map(t,n):t}function Yt(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),null==t||jt(t)||V(t)||te(t)?t:Array.isArray(t)?Vt.shallowArray(t,n):de(t)?Vt.shallowObject(t,n):xe(t)?Vt.shallowMap(t,n):ie("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function $t(t){return t}function qt(t,e,n){if(ct(t,e))return e;if(Ct(t))return t;if(Array.isArray(t))return new M(t,qt,n);if(xe(t))return new Qt(t,qt,n);if(de(t)){var r={};return wt(r,n),Lt(r,qt,[t]),r}return t}function Zt(t,e,n){return ct(t,e)?e:t}function Kt(t,e){void 0===e&&(e=void 0),We();try{return t.apply(e)}finally{Xe()}}Object.keys(Bt).forEach((function(t){return Vt[t]=Bt[t]})),Vt.deep.struct=Vt.struct,Vt.ref.struct=function(){return arguments.length<2?Xt(Zt,arguments[0]):zt.apply(null,arguments)};var Jt={},Qt=function(){function t(t,e,n){void 0===e&&(e=Ht),void 0===n&&(n="ObservableMap@"+re()),this.enhancer=e,this.name=n,this.$mobx=Jt,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new M(void 0,$t,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(t)}return t.prototype._has=function(t){return void 0!==this._data[t]},t.prototype.has=function(t){return!!this.isValidKey(t)&&(t=""+t,this._hasMap[t]?this._hasMap[t].get():this._updateHasMapEntry(t,!1).get())},t.prototype.set=function(t,e){this.assertValidKey(t),t=""+t;var n=this._has(t);if(v(this)){var r=m(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if(this.assertValidKey(t),t=""+t,v(this)&&!(i=m(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=w(),r=g(this),i=r||n?{type:"delete",object:this,oldValue:this._data[t].value,name:t}:null;return n&&S(i),Kt((function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data[t].setNewValue(void 0),e._data[t]=void 0})),r&&_(this,i),n&&O(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap[t];return n?n.setNewValue(e):n=this._hasMap[t]=new W(e,$t,this.name+"."+t+"?",!1),n},t.prototype._updateValue=function(t,e){var n=this._data[t];if((e=n.prepareNewValue(e))!==G){var r=w(),i=g(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&S(o),n.setNewValue(e),i&&_(this,o),r&&O()}},t.prototype._addValue=function(t,e){var n=this;Kt((function(){var r=n._data[t]=new W(e,n.enhancer,n.name+"."+t,!1);e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)}));var r=w(),i=g(this),o=i||r?{type:"add",object:this,name:t,newValue:e}:null;r&&S(o),i&&_(this,o),r&&O()},t.prototype.get=function(t){return t=""+t,this.has(t)?this.dehanceValue(this._data[t].get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return P(this._keys.slice())},t.prototype.values=function(){return P(this._keys.map(this.get,this))},t.prototype.entries=function(){var t=this;return P(this._keys.map((function(e){return[e,t.get(e)]})))},t.prototype.forEach=function(t,e){var n=this;this.keys().forEach((function(r){return t.call(e,n.get(r),r,n)}))},t.prototype.merge=function(t){var e=this;return te(t)&&(t=t.toJS()),Kt((function(){de(t)?Object.keys(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=t[0],r=t[1];return e.set(n,r)})):xe(t)?t.forEach((function(t,n){return e.set(n,t)})):null!=t&&ie("Cannot initialize map from "+t)})),this},t.prototype.clear=function(){var t=this;Kt((function(){nn((function(){t.keys().forEach(t.delete,t)}))}))},t.prototype.replace=function(t){var e=this;return Kt((function(){var n,r=de(n=t)?Object.keys(n):Array.isArray(n)?n.map((function(t){return t[0]})):xe(n)?Array.from(n.keys()):te(n)?n.keys():ie("Cannot get keys from "+n);e.keys().filter((function(t){return-1===r.indexOf(t)})).forEach((function(t){return e.delete(t)})),e.merge(t)})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toJS=function(){var t=this,e={};return this.keys().forEach((function(n){return e[n]=t.get(n)})),e},t.prototype.toJSON=function(){return this.toJS()},t.prototype.isValidKey=function(t){return null!=t&&("string"==typeof t||"number"==typeof t||"boolean"==typeof t)},t.prototype.assertValidKey=function(t){if(!this.isValidKey(t))throw new Error("[mobx.map] Invalid key: '"+t+"', only strings, numbers and booleans are accepted as key in observable maps.")},t.prototype.toString=function(){var t=this;return this.name+"[{ "+this.keys().map((function(e){return e+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return oe(!0!==e,Y("m033")),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();k(Qt.prototype,(function(){return this.entries()}));var te=we("ObservableMap",Qt),ee=[];function ne(){return"undefined"!=typeof window?window:i.g}function re(){return++ke.mobxGuid}function ie(t,e){throw oe(!1,t,e),"X"}function oe(t,e,n){if(!t)throw new Error("[mobx] Invariant failed: "+e+(n?" in '"+n+"'":""))}Object.freeze(ee);var ae=[];function se(t){return-1===ae.indexOf(t)&&(ae.push(t),console.error("[mobx] Deprecated: "+t),!0)}function ue(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var le=function(){};function ce(t){var e=[];return t.forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),e}function fe(t,e,n){return void 0===e&&(e=100),void 0===n&&(n=" - "),t?t.slice(0,e).join(n)+(t.length>e?" (... and "+(t.length-e)+"more)":""):""}function he(t){return null!==t&&"object"==typeof t}function de(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function pe(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)ye(r,i)&&(t[i]=r[i])}return t}var ve=Object.prototype.hasOwnProperty;function ye(t,e){return ve.call(t,e)}function me(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function ge(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function be(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}function _e(t,e){oe(be(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function we(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return he(t)&&!0===t[n]}}function xe(t){return void 0!==ne().Map&&t instanceof ne().Map}function Se(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function Te(t){return null===t?null:"object"==typeof t?""+t:t}var Oe,Ae,Ee=["mobxGuid","resetId","spyListeners","strictMode","runId"],Pe=function(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]},ke=new Pe,je=!1,Ce=!1,Re=!1,De=ne();function Ie(t,e){if("object"==typeof t&&null!==t){if(V(t))return oe(void 0===e,Y("m036")),t.$mobx.atom;if(te(t)){var n=t;return void 0===e?Ie(n._keys):(oe(!!(r=n._data[e]||n._hasMap[e]),"the entry '"+e+"' does not exist in the observable map '"+Me(t)+"'"),r)}var r;if(et(t),e&&!t.$mobx&&t[e],jt(t))return e?(oe(!!(r=t.$mobx.values[e]),"no observable property '"+e+"' found on the observable object '"+Me(t)+"'"),r):ie("please specify a property");if(p(t)||bt(t)||vn(t))return t}else if("function"==typeof t&&vn(t.$mobx))return t.$mobx;return ie("Cannot obtain atom from "+t)}function Le(t,e){return oe(t,"Expecting some object"),void 0!==e?Le(Ie(t,e)):p(t)||bt(t)||vn(t)||te(t)?t:(et(t),t.$mobx?t.$mobx:void oe(!1,"Cannot obtain administration from "+t))}function Me(t,e){return(void 0!==e?Ie(t,e):jt(t)||te(t)?Le(t):Ie(t)).name}function Ne(t,e){return Ue(Ie(t,e))}function Ue(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=ce(t.observing).map(Ue)),e}function Fe(t){var e={name:t.name};return function(t){return t.observers&&t.observers.length>0}(t)&&(e.observers=ze(t).map(Fe)),e}function ze(t){return t.observers}function Be(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Ve(t,e){if(1===t.observers.length)t.observers.length=0,Ge(t);else{var n=t.observers,r=t.observersIndexes,i=n.pop();if(i!==e){var o=r[e.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[e.__mapid]}}function Ge(t){t.isPendingUnobservation||(t.isPendingUnobservation=!0,ke.pendingUnobservations.push(t))}function We(){ke.inBatch++}function Xe(){if(0==--ke.inBatch){dn();for(var t=ke.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}ke.pendingUnobservations=[]}}function He(t){var e=ke.trackingDerivation;null!==e?e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t):0===t.observers.length&&Ge(t)}function Ye(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Ae.BREAK){var n=[];$e(Ne(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof gt?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function $e(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return $e(t,e,n+1)})))}De.__mobxInstanceCount?(De.__mobxInstanceCount++,setTimeout((function(){je||Ce||Re||(Re=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))}),1)):De.__mobxInstanceCount=1,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Oe||(Oe={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Ae||(Ae={}));var qe=function(t){this.cause=t};function Ze(t){return t instanceof qe}function Ke(t){switch(t.dependenciesState){case Oe.UP_TO_DATE:return!1;case Oe.NOT_TRACKING:case Oe.STALE:return!0;case Oe.POSSIBLY_STALE:for(var e=rn(),n=t.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(bt(o)){try{o.get()}catch(t){return on(e),!0}if(t.dependenciesState===Oe.STALE)return on(e),!0}}return an(t),on(e),!1}}function Je(){return null!==ke.trackingDerivation}function Qe(t){var e=t.observers.length>0;ke.computationDepth>0&&e&&ie(Y("m031")+t.name),!ke.allowStateChanges&&e&&ie(Y(ke.strictMode?"m030a":"m030b")+t.name)}function tn(t,e,n){an(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ke.runId;var r,i=ke.trackingDerivation;ke.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new qe(t)}return ke.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Oe.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++)0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState);for(n.length=i,t.newObserving=null,o=e.length;o--;)0===(s=e[o]).diffValue&&Ve(s,t),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Be(s,t))}r!==Oe.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function en(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Ve(e[n],t);t.dependenciesState=Oe.NOT_TRACKING}function nn(t){var e=rn(),n=t();return on(e),n}function rn(){var t=ke.trackingDerivation;return ke.trackingDerivation=null,t}function on(t){ke.trackingDerivation=t}function an(t){if(t.dependenciesState!==Oe.UP_TO_DATE){t.dependenciesState=Oe.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Oe.UP_TO_DATE}}function sn(t){return console.log(t),t}function un(t){switch(t.length){case 0:return ke.trackingDerivation;case 1:return Ie(t[0]);case 2:return Ie(t[0],t[1])}}var ln=function(){function t(t,e){void 0===t&&(t="Reaction@"+re()),this.name=t,this.onInvalidate=e,this.observing=[],this.newObserving=[],this.dependenciesState=Oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+re(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Ae.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ke.pendingReactions.push(this),dn())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(We(),this._isScheduled=!1,Ke(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&w()&&x({object:this,type:"scheduled-reaction"})),Xe())},t.prototype.track=function(t){We();var e,n=w();n&&(e=Date.now(),S({object:this,type:"reaction",fn:t})),this._isRunning=!0;var r=tn(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&en(this),Ze(r)&&this.reportExceptionInDerivation(r.cause),n&&O({time:Date.now()-e}),Xe()},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=Y("m037");console.error(n||r,t),w()&&x({type:"error",message:n,error:t,object:this}),ke.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(We(),en(this),Xe()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t.$mobx=this,t.onError=cn,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.whyRun=function(){var t=ce(this._isRunning?this.newObserving:this.observing).map((function(t){return t.name}));return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+fe(t)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+Y("m038")+"\n"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=un(t);if(!r)return ie("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===Ae.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Ae.BREAK:Ae.LOG}(this,t)},t}();function cn(t){oe(this&&this.$mobx&&vn(this.$mobx),"Invalid `this`"),oe(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=t}var fn=100,hn=function(t){return t()};function dn(){ke.inBatch>0||ke.isRunningReactions||hn(pn)}function pn(){ke.isRunningReactions=!0;for(var t=ke.pendingReactions,e=0;t.length>0;){++e===fn&&(console.error("Reaction doesn't converge to a stable state after "+fn+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}ke.isRunningReactions=!1}var vn=we("Reaction",ln);function yn(t){return Q((function(e,n,r,i,o){oe(void 0!==o,Y("m009")),oe("function"==typeof o.get,Y("m010")),Tt(wt(e,""),n,o.get,o.set,t,!1)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){this.$mobx.values[t].set(e)}),!1,!1)}var mn=yn(vt.default),gn=yn(vt.structural),bn=function(t,e,n){if("string"==typeof e)return mn.apply(null,arguments);oe("function"==typeof t,Y("m011")),oe(arguments.length<3,Y("m012"));var r="object"==typeof e?e:{};r.setter="function"==typeof e?e:r.setter;var i=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default;return new gt(t,r.context,i,r.name||t.name||"",r.setter)};function _n(t,e,n){function r(r){return e&&n.push([t,r]),r}if(void 0===e&&(e=!0),void 0===n&&(n=[]),Ct(t)){if(e&&null===n&&(n=[]),e&&null!==t&&"object"==typeof t)for(var i=0,o=n.length;i<o;i++)if(n[i][0]===t)return n[i][1];if(V(t)){var a=r([]),s=t.map((function(t){return _n(t,e,n)}));for(a.length=s.length,i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(jt(t)){for(var u in a=r({}),t)a[u]=_n(t[u],e,n);return a}if(te(t)){var l=r({});return t.forEach((function(t,r){return l[r]=_n(t,e,n)})),l}if(X(t))return _n(t.get(),e,n)}return t}bn.struct=gn,bn.equals=yn;var wn={allowStateChanges:function(t,e){var n,r=K(t);try{n=e()}finally{J(r)}return n},deepEqual:ct,getAtom:Ie,getDebugName:Me,getDependencyTree:Ne,getAdministration:Le,getGlobalState:function(){return ke},getObserverTree:function(t,e){return Fe(Ie(t,e))},interceptReads:function(t,e,n){var r;if(te(t)||V(t)||X(t))r=Le(t);else{if(!jt(t))return ie("Expected observable map, object or array as first array");if("string"!=typeof e)return ie("InterceptReads can only be used with a specific property, not with an object in general");r=Le(t,e)}return void 0!==r.dehancer?ie("An intercept reader was already established"):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},isComputingDerivation:Je,isSpyEnabled:w,onReactionError:function(t){return ke.globalReactionErrorHandlers.push(t),function(){var e=ke.globalReactionErrorHandlers.indexOf(t);e>=0&&ke.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:z,resetGlobalState:function(){ke.resetId++;var t=new Pe;for(var e in t)-1===Ee.indexOf(e)&&(ke[e]=t[e]);ke.allowStateChanges=!ke.strictMode},isolateGlobalState:function(){Ce=!0,ne().__mobxInstanceCount--},shareGlobalState:function(){se("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),je=!0;var t=ne(),e=ke;if(t.__mobservableTrackingStack||t.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(t.__mobxGlobal&&t.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");t.__mobxGlobal?ke=t.__mobxGlobal:t.__mobxGlobal=e},spyReport:x,spyReportEnd:O,spyReportStart:S,setReactionScheduler:function(t){var e=hn;hn=function(n){return t((function(){return e(n)}))}}},xn={Reaction:ln,untracked:nn,Atom:d,BaseAtom:h,useStrict:Z,isStrictModeEnabled:function(){return ke.strictMode},spy:A,comparer:vt,asReference:function(t){return se("asReference is deprecated, use observable.ref instead"),Vt.ref(t)},asFlat:function(t){return se("asFlat is deprecated, use observable.shallow instead"),Vt.shallow(t)},asStructure:function(t){return se("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),Vt.struct(t)},asMap:function(t){return se("asMap is deprecated, use observable.map or observable.shallowMap instead"),Vt.map(t||{})},isModifierDescriptor:Wt,isObservableObject:jt,isBoxedObservable:X,isObservableArray:V,ObservableMap:Qt,isObservableMap:te,map:function(t){return se("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),Vt.map(t)},transaction:Kt,observable:Vt,computed:bn,isObservable:Ct,isComputed:function(t,e){if(null==t)return!1;if(void 0!==e){if(!1===jt(t))return!1;if(!t.$mobx.values[e])return!1;var n=Ie(t,e);return bt(n)}return bt(t)},extendObservable:Dt,extendShallowObservable:It,observe:function(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return Le(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Le(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Le(t,e).intercept(n)}(t,e,n):function(t,e){return Le(t).intercept(e)}(t,e)},autorun:yt,autorunAsync:function(t,e,n,r){var i,o,a,s;"string"==typeof t?(i=t,o=e,a=n,s=r):(i=t.name||"AutorunAsync@"+re(),o=t,a=e,s=n),oe(!1===st(o),Y("m006")),void 0===a&&(a=1),s&&(o=o.bind(s));var u=!1,l=new ln(i,(function(){u||(u=!0,setTimeout((function(){u=!1,l.isDisposed||l.track(c)}),a))}));function c(){o(l)}return l.schedule(),l.getDisposer()},when:function(t,e,n,r){var i,o,a,s;return"string"==typeof t?(i=t,o=e,a=n,s=r):(i="When@"+re(),o=t,a=e,s=n),yt(i,(function(t){if(o.call(s)){t.dispose();var e=rn();a.call(s),on(e)}}))},reaction:mt,action:ot,isAction:st,runInAction:function(t,e,n){var r="string"==typeof t?t:t.name||"<unnamed action>",i="function"==typeof t?t:e,o="function"==typeof t?e:n;return oe("function"==typeof i,Y("m002")),oe(0===i.length,Y("m003")),oe("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),q(r,i,o,void 0)},expr:function(t,e){return Je()||console.warn(Y("m013")),bn(t,{context:e}).get()},toJS:_n,createTransformer:function(t,e){oe("function"==typeof t&&t.length<2,"createTransformer expects a function that accepts one argument");var n={},r=ke.resetId,i=function(r){function i(e,n){var i=r.call(this,(function(){return t(n)}),void 0,vt.default,"Transformer-"+t.name+"-"+e,void 0)||this;return i.sourceIdentifier=e,i.sourceObject=n,i}return f(i,r),i.prototype.onBecomeUnobserved=function(){var t=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],e&&e(t,this.sourceObject)},i}(gt);return function(t){r!==ke.resetId&&(n={},r=ke.resetId);var e=function(t){if("string"==typeof t||"number"==typeof t)return t;if(null===t||"object"!=typeof t)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+t);var e=t.$transformId;return void 0===e&&me(t,"$transformId",e=re()),e}(t),o=n[e];return o?o.get():(o=n[e]=new i(e,t)).get()}},whyRun:function(t,e){return se("`whyRun` is deprecated in favor of `trace`"),(t=un(arguments))?bt(t)||vn(t)?sn(t.whyRun()):ie(Y("m025")):sn(Y("m024"))},isArrayLike:function(t){return Array.isArray(t)||V(t)},extras:wn},Sn=!1,Tn=function(t){var e=xn[t];Object.defineProperty(xn,t,{get:function(){return Sn||(Sn=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),e}})};for(var On in xn)Tn(On);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:A,extras:wn});var An=i(803),En=i.n(An),Pn={value:()=>{}};function kn(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new jn(r)}function jn(t){this._=t}function Cn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Rn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Pn,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}jn.prototype=kn.prototype={constructor:jn,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=Rn(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Rn(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=Cn(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Dn=kn;var In,Ln,Mn=0,Nn=0,Un=0,Fn=1e3,zn=0,Bn=0,Vn=0,Gn="object"==typeof performance&&performance.now?performance:Date,Wn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xn(){return Bn||(Wn(Hn),Bn=Gn.now()+Vn)}function Hn(){Bn=0}function Yn(){this._call=this._time=this._next=null}function $n(t,e,n){var r=new Yn;return r.restart(t,e,n),r}function qn(){Bn=(zn=Gn.now())+Vn,Mn=Nn=0;try{!function(){Xn(),++Mn;for(var t,e=In;e;)(t=Bn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mn}()}finally{Mn=0,function(){for(var t,e,n=In,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:In=e);Ln=t,Kn(r)}(),Bn=0}}function Zn(){var t=Gn.now(),e=t-zn;e>Fn&&(Vn-=e,zn=t)}function Kn(t){Mn||(Nn&&(Nn=clearTimeout(Nn)),t-Bn>24?(t<1/0&&(Nn=setTimeout(qn,t-Gn.now()-Vn)),Un&&(Un=clearInterval(Un))):(Un||(zn=Gn.now(),Un=setInterval(Zn,Fn)),Mn=1,Wn(qn)))}Yn.prototype=$n.prototype={constructor:Yn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Xn():+n)+(null==e?0:+e),this._next||Ln===this||(Ln?Ln._next=this:In=this,Ln=this),this._call=t,this._time=n,Kn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Kn())}};const Jn=4294967296;function Qn(t){return t.x}function tr(t){return t.y}var er=Math.PI*(3-Math.sqrt(5));function nr(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,h,d=t._root,p={data:r},v=t._x0,y=t._y0,m=t._x1,g=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function rr(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ir(t){return t[0]}function or(t){return t[1]}function ar(t,e,n){var r=new sr(null==e?ir:e,null==n?or:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function sr(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ur(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var lr=ar.prototype=sr.prototype;function cr(t){return function(){return t}}function fr(t){return 1e-6*(t()-.5)}function hr(){var t,e,n,r,i,o=cr(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=ar(t,Qn,tr).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/u<p)return p<s&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:cr(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l}function dr(t){return t.x+t.vx}function pr(t){return t.y+t.vy}function vr(t){return t.index}function yr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}lr.copy=function(){var t,e,n=new sr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ur(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=ur(e));return n},lr.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return nr(this.cover(e,n),e,n,t)},lr.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)nr(this,a[n],s[n],t[n]);return this},lr.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},lr.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},lr.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},lr.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new rr(v,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<c||(s=u.y1)<f))if(v.length){var y=(i+a)/2,m=(o+s)/2;p.push(new rr(v[3],y,m,a,s),new rr(v[2],i,m,y,s),new rr(v[1],y,o,a,m),new rr(v[0],i,o,y,m)),(l=(e>=m)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var g=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=g*g+b*b;if(_<n){var w=Math.sqrt(n=_);c=t-w,f=e-w,h=t+w,d=e+w,r=v.data}}return r},lr.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,h,d=this._root,p=this._x0,v=this._y0,y=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(v+m)/2))?v=u:m=u,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},lr.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},lr.root=function(){return this._root},lr.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},lr.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new rr(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new rr(n,l,c,o,a)),(n=u[2])&&s.push(new rr(n,r,c,l,a)),(n=u[1])&&s.push(new rr(n,l,i,o,c)),(n=u[0])&&s.push(new rr(n,r,i,l,c))}return this},lr.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new rr(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new rr(o,a,s,c,f)),(o=i[1])&&n.push(new rr(o,c,s,u,f)),(o=i[2])&&n.push(new rr(o,a,f,c,l)),(o=i[3])&&n.push(new rr(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},lr.x=function(t){return arguments.length?(this._x=t,this):this._x},lr.y=function(t){return arguments.length?(this._y=t,this):this._y};var mr=256,gr=4096,br=25,_r="#ededed",wr={position:"absolute",top:0,bottom:0,left:0,right:0},xr=function(){return window.devicePixelRatio||1},Sr=["NVL_basic-wrapper","NVL_interactive-wrapper"];function Tr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Or(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ar=function(t){var e=new Map;return t.forEach((function(t){var n=t.id,r=t.from,i=t.to,o=t.color,a=t.width,s=t.disabled,u=[r,i].sort(),l="".concat(u[0],".").concat(u[1]),c=e.get(l);c?c.bundledRels.push({id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}):e.set(l,{bundledRels:[{id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}],key:l,from:r,to:i,color:null!=o?o:void 0,disabled:null!=s&&s,width:0})})),e.forEach((function(t){var e=(0,n.uniqBy)(t.bundledRels,"disabled"),r=1===e.length&&!0===e[0].disabled,i=1===e.length&&!0!==e[0].disabled;if(r)t.color=_r,t.width=1;else{var o=t.bundledRels.filter((function(t){return!0!==t.disabled})),a=(0,n.uniqBy)(o,"color");i?(t.color=a.length>1?void 0:t.bundledRels[0].color,t.bundledRels.forEach((function(e){t.width+=e.width}))):(t.color=1===a.length?a[0].color:void 0,t.disabled=!1,t.bundledRels.forEach((function(e){t.width+=!0!==e.disabled?e.width:0})))}})),Array.from(e.values())},Er=function(){return void 0!==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t}))};function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}var kr=function(t){var e,n;return"number"==typeof t.source||"number"==typeof t.target||"string"==typeof t.source||"string"==typeof t.target?45*devicePixelRatio:(null!==(e=t.source.size)&&void 0!==e?e:br)+(null!==(n=t.target.size)&&void 0!==n?n:br)+90*devicePixelRatio};function jr(t){return"object"===Pr(t)}var Cr=function(t){var e;return(null!==(e=t.size)&&void 0!==e?e:br)+25*devicePixelRatio},Rr=function(){return-400*Math.pow(devicePixelRatio,2)},Dr=function(){return 2*Rr()};function Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(t)}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ur(r.key),r)}}function Ur(t){var e=function(t,e){if("object"!=Ir(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ir(e)?e:String(e)}var Fr="d3ForceLayout",zr=function(t){return t?_n(t):t},Br=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.d3Nodes={},this.d3RelList={},this.computing=!0,this.center={x:0,y:0},this.nodeRelCount=[];var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Fr),a.addChannel(Fr),this.simulation=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=$n(f),l=Dn("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Jn)/Jn}();function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*er;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}().velocityDecay(.4).force("charge",hr().strength(Rr)).force("centerX",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).force("centerY",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).alpha(1).alphaMin(.05).on("end",(function(){n.simulationStopped=!0,n.shouldUpdate=!1,n.shouldReheatNodes=!1,n.shouldCountNodeRels=!1})).stop(),this.simulationStopped=!0,this.shouldUpdate=!0,this.shouldReheatNodes=!1,this.shouldCountNodeRels=!0,this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){var t=o.channels[Fr];if(void 0!==o.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),s=Er(i);e||r||s?(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0):n.shouldReheatNodes=!1}var u=a.channels[Fr];if(void 0!==a.version&&u){var l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;(l||c)&&(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0)}})))}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e=this;t.forEach((function(t){void 0===e.d3Nodes[t.id]&&(e.d3Nodes[t.id]={id:t.id}),null!=t&&t.pinned?(e.d3Nodes[t.id].fx=t.x,e.d3Nodes[t.id].fy=t.y):(e.d3Nodes[t.id].x=t.x,e.d3Nodes[t.id].y=t.y),e.d3Nodes[t.id].vy=0,e.d3Nodes[t.id].vx=0})),this.shouldUpdate=!0,this.simulation.tick().alpha(.2)}},{key:"update",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||n){var r=this.state,i=r.nodes,o=r.rels,a=i.channels[Fr],s=o.channels[Fr],u=Object.values(a.adds).length>0,l=Object.values(s.adds).length>0,c=Object.values(a.removes).length>0,f=Object.values(s.removes).length>0,h=Object.values(a.updates).length>0;if(u||l||c||f||h){var d=u&&0===Object.keys(this.d3Nodes).length,p=zr(a.removes);Object.keys(p).forEach((function(t){delete e.d3Nodes[t]}));var v=zr(a.adds);if(Object.keys(v).forEach((function(t){e.d3Nodes[t]=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mr(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Ur(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},v[t])})),h&&Object.values(a.updates).forEach((function(t){!0===t.pinned?(e.d3Nodes[t.id].fx=e.d3Nodes[t.id].x,e.d3Nodes[t.id].fy=e.d3Nodes[t.id].y):!1===t.pinned&&(e.d3Nodes[t.id].fx=null,e.d3Nodes[t.id].fy=null),void 0!==t.size&&(e.d3Nodes[t.id].size=t.size)})),(l||f)&&(this.d3RelList=Ar(zr(o.items)).filter((function(t){return t.from!==t.to})).map((function(t,e){return{source:t.from,target:t.to,index:e}}))),d){var y=Object.values(this.d3Nodes);!function(t,e,n){var r=t.filter((function(t){return void 0===t.x&&void 0===t.y}));r.forEach((function(t,i){t.x=e.x+n*Math.sin(2*Math.PI*i/r.length),t.y=e.y+n*Math.cos(2*Math.PI*i/r.length)}))}(y,this.center,(t=y.length,45*t/(2*Math.PI)))}this.layout(i.items,o.items,d)}i.clearChannel(Fr),o.clearChannel(Fr),this.shouldUpdate=!1,this.simulation.alpha()>this.simulation.alphaMin()&&(this.shouldUpdate=!0,this.simulationStopped&&(this.simulation.restart(),this.simulationStopped=!1))}}},{key:"layout",value:function(t,e,r){var i=this;if(!(0,n.isEmpty)(this.d3Nodes)){if(this.simulation.stop(),this.simulation.nodes(Object.values(this.d3Nodes)).force("collide",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=ar(e,dr,pr).visitAfter(s),t=0;t<d;++t)u=e[t],f=n[u.index],h=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(v);function v(t,e,n,o,a){var s=t.data,d=t.r,p=f+d;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var v=l-s.x-s.vx,y=c-s.y-s.vy,m=v*v+y*y;m<p*p&&(0===v&&(m+=(v=fr(r))*v),0===y&&(m+=(y=fr(r))*y),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(v*=m)*(p=(d*=d)/(h+d)),u.vy+=(y*=m)*p,s.vx-=v*(p=1-p),s.vy-=y*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=cr(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),u(),a):t},a}().radius(Cr)),this.shouldCountNodeRels&&(this.nodeRelCount=this.countNodeRels()),this.simulation.force("link",function(t){var e,n,r,i,o,a,s=vr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=cr(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,h,d,p,v,y=0;y<s;++y)l=(u=t[y]).source,h=(f=u.target).x+f.vx-l.x-l.vx||fr(a),d=f.y+f.vy-l.y-l.vy||fr(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[y])/p*r*e[y],d*=p,f.vx-=h*(v=o[y]),f.vy-=d*v,l.vx+=h*(v=1-v),l.vy+=d*v}function h(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=yr(f,u.source)),"object"!=typeof u.target&&(u.target=yr(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"==typeof t?t:cr(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:cr(+t),p(),f):l},f}(this.d3RelList).id((function(t){return t.id})).distance(kr).strength((function(t){return function(t,e){if(!jr(t.source)||!jr(t.target))return 1;var n=1.2/(Math.min(e[t.source.index],e[t.target.index])+(Math.max(e[t.source.index],e[t.target.index])-1)/100);return Math.max(Math.min(n,1),.06)}(t,i.nodeRelCount)}))),r){var o=0;this.simulation.force("charge",hr().strength(Dr));for(var a=performance.now();performance.now()-a<300&&o<200;)this.simulation.alpha(1),this.simulation.tick(1),o+=1;this.simulation.force("charge",hr().strength(Rr));for(var s=performance.now();performance.now()-s<100&&this.simulation.alpha()>=this.simulation.alphaMin();)this.simulation.tick(1);return this.computing=!1,void this.simulation.restart()}this.shouldReheatNodes?this.simulation.alpha(1).restart():this.simulation.restart()}}},{key:"getNodePositions",value:function(t){var e,n=[],r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.d3Nodes[i.id];if(void 0!==o){var a={id:o.id,x:o.x,y:o.y};n.push(a)}}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return this.computing}},{key:"terminateUpdate",value:function(){this.simulation.alpha(this.simulation.alphaMin()).stop(),this.simulationStopped=!0}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Fr),this.state.rels.removeChannel(Fr),this.simulation.stop()}},{key:"setAlpha",value:function(t){this.simulation.alpha(t),this.simulation.restart(),this.simulation.shouldUpdate=!0}},{key:"countNodeRels",value:function(){for(var t=new Map(Object.entries(this.d3Nodes)),e=Object.values(this.d3RelList),n=new Array(t.length),r=0;r<e.length;++r){var i=e[r];i.index=r,"object"!==Ir(i.source)&&(i.source=t.get(i.source)),"object"!==Ir(i.target)&&(i.target=t.get(i.target)),n[i.source.index]=(n[i.source.index]||0)+1,n[i.target.index]=(n[i.target.index]||0)+1}return n}}],r&&Nr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vr=i(880),Gr=i.n(Vr)().getLogger("NVL");const Wr=(t=>{var e={};return i.d(e,t),e})({createCoseBilkentLayoutWorker:()=>t.createCoseBilkentLayoutWorker,createHierarchicalLayoutWorker:()=>t.createHierarchicalLayoutWorker});function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Hr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hr(Object(n),!0).forEach((function(e){Kr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return qr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}function Kr(t,e,n){return(e=Jr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jr(t){var e=function(t,e){if("object"!=Xr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:String(e)}var Qr=function(t,e,n){return t+(e-t)*function(t){return t*t*(3-2*t)}(n)},ti=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Kr(this,"positions",void 0),Kr(this,"oldPositions",void 0),Kr(this,"startTime",void 0),Kr(this,"t",void 0),Kr(this,"currentT",void 0),Kr(this,"state",void 0),Kr(this,"shouldUpdateAnimator",void 0),Kr(this,"parents",void 0),Kr(this,"animationCompleteCallback",void 0),Kr(this,"shouldUpdate",void 0);var n=e.state;this.positions={},this.oldPositions={},this.startTime=0,this.t=1,this.currentT=1,this.state=n,this.shouldUpdateAnimator=!1,this.parents={},this.animationCompleteCallback=e.animationCompleteCallback}var e,n;return e=t,n=[{key:"getPositionMapFromState",value:function(){var t,e=this.state.nodes,n=e.idToPosition,r={},i=$r(e.items);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id];void 0!==a&&(r[o.id]={id:o.id,x:a.x,y:a.y})}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"updatePositionsFromState",value:function(){this.positions=Yr({},this.getPositionMapFromState())}},{key:"updateOldPositionFromState",value:function(){this.oldPositions=Yr({},this.getPositionMapFromState())}},{key:"startAnimation",value:function(){this.updateOldPositionFromState(),this.startTime=Date.now(),this.t=0,this.currentT=0,this.shouldUpdateAnimator=!0}},{key:"update",value:function(){var t=this.shouldUpdateAnimator,e=(Date.now()-this.startTime)/400;this.t=Math.min(e,1),this.currentT<1?this.shouldUpdateAnimator=!0:(this.shouldUpdateAnimator=!1,t&&!this.shouldUpdateAnimator&&void 0!==this.animationCompleteCallback&&this.animationCompleteCallback(),this.shouldUpdateAnimator||this.updatePositionsFromState())}},{key:"updateNodes",value:function(t){var e,n=$r(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={id:r.id,x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"getNodePositions",value:function(t){var e,n=this.parents,r=this.state.nodes.idToPosition,i=function(t,e){for(var n={x:0,y:0},r=t.length,i=0,o=0;o<r;o++){var a=e[t[o].id];void 0===a||isNaN(a.x)||isNaN(a.y)||0===a.x||0===a.y||(n.x+=a.x,n.y+=a.y,i+=1)}return i>0?[n.x/i,n.y/i]:[0,0]}(t,r),o={x:i[0],y:i[1]},a=[],s=$r(t);try{for(s.s();!(e=s.n()).done;){var u=e.value,l=this.positions[u.id],c=r[u.id],f={id:u.id};if(void 0!==l){for(var h,d,p,v=u.id,y=null!==(h=this.oldPositions[u.id])&&void 0!==h?h:Yr({},o);void 0===y&&void 0!==n[v];)v=n[v],y=this.oldPositions[v];y.x=null!==(d=y.x)&&void 0!==d?d:o.x,y.y=null!==(p=y.y)&&void 0!==p?p:o.y,f.x=Qr(y.x,l.x,this.t),f.y=Qr(y.y,l.y,this.t)}else void 0!==c&&(f.x=c.x||o.x,f.y=c.y||o.y);a.push(f)}}catch(t){s.e(t)}finally{s.f()}return this.currentT=this.t,a}}],n&&Zr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ei(t){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(t)}function ni(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ri(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ni(Object(n),!0).forEach((function(e){vi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ii(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ai(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oi(t){return function(t){if(Array.isArray(t))return si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ai(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ai(t,e){if(t){if("string"==typeof t)return si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yi(r.key),r)}}function li(t,e,n){return e=di(e),function(t,e){if(e&&("object"===ei(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fi(t)}(t,ci()?Reflect.construct(e,n||[],di(t).constructor):e.apply(t,n))}function ci(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ci=function(){return!!t})()}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hi(){return hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=di(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},hi.apply(this,arguments)}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(t)}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t,e,n){return(e=yi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yi(t){var e=function(t,e){if("object"!=ei(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ei(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ei(e)?e:String(e)}var mi=function(t){return void 0!==t?_n(t):t},gi=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),vi(fi(n=li(this,e,[t])),"stateDisposers",void 0),vi(fi(n),"cytoCompleteCallback",void 0),vi(fi(n),"computing",void 0),vi(fi(n),"pendingLayoutData",void 0),vi(fi(n),"worker",void 0),n.stateDisposers=[],n.stateDisposers.push(n.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var r=n.state,i=r.nodes,o=r.rels;return n.cytoCompleteCallback=t.cytoCompleteCallback,n.shouldUpdate=!0,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createCoseBilkentLayoutWorker)(),n.worker.port.start(),n.setOptions(),n.layout(i.items,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(){this.shouldUpdate=!0}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.shouldUpdate||t){var i=mi(n),o=mi(r);(i.length>0||o.length>0)&&(this.updatePositionsFromState(),this.layout(i,o))}hi(di(e.prototype),"update",this).call(this),this.shouldUpdate=!1}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e){var n=this;if(t.length){var r=t.map((function(t){return{group:"nodes",data:{id:t.id}}})),i=e.map((function(t){return{group:"edges",data:{id:"rel".concat(t.id),source:t.from,target:t.to}}})),o={elements:[].concat(oi(r),oi(i)),spacingFactor:t.reduce((function(t,e){var n;return t+(null!==(n=e.size)&&void 0!==n?n:br)}),0)/t.length*4.5/50*xr()};this.computing?this.pendingLayoutData=o:(this.computing=!0,this.worker.port.onmessage=function(t){var e=t.data.positions;if(n.computing){for(var r=0,i=Object.entries(e);r<i.length;r++){var o=ii(i[r],2),a=o[0],s=o[1];n.positions[a]=ri({id:a},s)}n.cytoCompleteCallback(),n.startAnimation()}n.computing=!1,n.shouldUpdate=!0},setTimeout((function(){n.computing&&n.worker.port.postMessage(o)}),0))}}},{key:"terminateUpdate",value:function(){this.computing=!1}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.worker.port.close()}}],r&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti),bi="undefined"!=typeof Float32Array?Float32Array:Array;function _i(){var t=new bi(16);return bi!=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}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var wi=function(t,e,n,r,i,o,a){var s=1/(e-n),u=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*u,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)*u,t[14]=(a+o)*l,t[15]=1,t},xi=i(792),Si=i.n(xi);function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Oi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ei(r.key),r)}}function Ai(t,e,n){return(e=Ei(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ei(t){var e=function(t,e){if("object"!=Ti(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:String(e)}var Pi=function(){function t(e,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ai(this,"shaderProgram",void 0),Ai(this,"gl",void 0),Ai(this,"curTexture",void 0),Ai(this,"attributeInfo",void 0),Ai(this,"uniformInfo",void 0);var a=e.createShader(e.FRAGMENT_SHADER);if(!e.isShader(a))throw new Error("Could not create shader object");var s=Si()(i,o);e.shaderSource(a,s),e.compileShader(a),(0,n.isNil)(e.getShaderParameter(a,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(a));var u=e.createShader(e.VERTEX_SHADER);if(!e.isShader(u))throw new Error("Could not create shader object");var l=Si()(r,o);if(e.shaderSource(u,l),e.compileShader(u),(0,n.isNil)(e.getShaderParameter(u,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(u)),this.shaderProgram=e.createProgram(),e.attachShader(this.shaderProgram,a),e.attachShader(this.shaderProgram,u),e.linkProgram(this.shaderProgram),(0,n.isNil)(e.getProgramParameter(this.shaderProgram,e.LINK_STATUS)))throw new Error("Could not initialise shader");this.gl=e,this.curTexture=0,this.scanUniforms(),this.scanAttributes()}var e,r;return e=t,r=[{key:"setUniform",value:function(t,e){var n=this.gl,r=this.uniformInfo[t];if(void 0===r)throw new Error("Shader.setUniform - Uniform ".concat(t," not found in shader"));switch(r.type){case n.INT:n.uniform1i(r.location,e);break;case n.INT_VEC2:n.uniform2iv(r.location,e);break;case n.INT_VEC3:n.uniform3iv(r.location,e);break;case n.INT_VEC4:n.uniform4iv(r.location,e);break;case n.SAMPLER_2D:n.activeTexture(n.TEXTURE0+r.texture),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(r.location,r.texture);break;case n.SAMPLER_CUBE:case n.FLOAT:n.uniform1f(r.location,e);break;case n.FLOAT_VEC2:n.uniform2fv(r.location,e);break;case n.FLOAT_VEC3:n.uniform3fv(r.location,e);break;case n.FLOAT_VEC4:n.uniform4fv(r.location,e);break;case n.FLOAT_MAT2:n.uniformMatrix2fv(r.location,!1,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(r.location,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(r.location,!1,e)}}},{key:"setAttributePointer",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t],a=n*Float32Array.BYTES_PER_ELEMENT,s=r*Float32Array.BYTES_PER_ELEMENT;i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,s,a)}},{key:"setAttributePointerFloat",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,r,n)}},{key:"setAttributePointerUShort",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_SHORT,!1,r,n)}},{key:"setAttributePointerByteNorm",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!0,r,n)}},{key:"setAttributePointerByte",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!1,r,n)}},{key:"use",value:function(){this.gl.useProgram(this.shaderProgram)}},{key:"remove",value:function(){this.gl.deleteProgram(this.shaderProgram)}},{key:"scanAttributes",value:function(){var t=this.gl;this.attributeInfo={};for(var e,n,r=t.getProgramParameter(this.shaderProgram,t.ACTIVE_ATTRIBUTES),i=0;i<r;i++)e=t.getActiveAttrib(this.shaderProgram,i),n=t.getAttribLocation(this.shaderProgram,e.name),this.attributeInfo[e.name]={type:e.type,position:n}}},{key:"scanUniforms",value:function(){var t=this.gl;this.uniformInfo={};for(var e,n=t.getProgramParameter(this.shaderProgram,t.ACTIVE_UNIFORMS),r=0;r<n;r++){e=t.getActiveUniform(this.shaderProgram,r);var i=t.getUniformLocation(this.shaderProgram,e.name),o={type:e.type,location:i};e.type===t.SAMPLER_2D&&(o.texture=this.curTexture,this.curTexture+=1),this.uniformInfo[e.name]=o}}}],r&&Oi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function ji(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ci(r.key),r)}}function Ci(t){var e=function(t,e){if("object"!=ki(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ki(e)?e:String(e)}function Ri(t){var e="function"==typeof Map?new Map:void 0;return Ri=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Di())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ii(i,n.prototype),i}(t,arguments,Li(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ii(n,t)},Ri(t)}function Di(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Di=function(){return!!t})()}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Li(t){return Li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Li(t)}var Mi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=arguments,n=Li(n=e),function(t,e){if(e&&("object"===ki(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Di()?Reflect.construct(n,r||[],Li(t).constructor):n.apply(t,r));var t,n,r}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&ji(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Ri(Error));const Ni="uniform mat4 u_projection;\n\nattribute vec2 a_position;\n//attribute float a_index;\n\n//varying highp float index;\n\nvoid main() {\n// index = a_index;\n gl_Position = u_projection * vec4(a_position, 0.0, 1.0);\n}";function Ui(t){return Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ui(t)}function Fi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zi(r.key),r)}}function zi(t){var e=function(t,e){if("object"!=Ui(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ui(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ui(e)?e:String(e)}var Bi=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=this.constructGraphObjects(e,n),this.subGraphs=[],this.sunMap={}}var e,n;return e=t,n=[{key:"constructGraphObjects",value:function(t,e){var n=new Array(t.nodes.length),r=new Array(t.rels.length),i={},o=[];return t.nodes.forEach((function(t,e){n[e]=[],r[e]=[],o.push(t)})),t.rels.forEach((function(t){var o=e[t.from],a=e[t.to];void 0!==o&&void 0!==a&&(n[o].push(a),n[a].push(o),r[o].push(t.id),r[a].push(t.id),i[t.id]=t)})),this.relIdMap=r,{nodes:o,relationships:n,idToRel:i}}},{key:"coarsenTo",value:function(t){for(var e=this.graph,n=e.nodes.length,r=0;e.nodes.length>t&&e.relationships.some((function(t){return t.length>0}));){var i=this.coarsen(e,0===r);if(0===r&&(this.nodeSortMap=i.nodeSortMap),this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,r++}return this.subGraphs.push(e),e}},{key:"coarsenBy",value:function(t){for(var e=this.graph,n=e.nodes.length,r=t;t>0;){var i=this.coarsen(e,t===r);if(this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,t--}return this.subGraphs.push(e),e}},{key:"coarsen",value:function(t,e){var n=this,r=t.nodes,i=t.relationships,o=r.map((function(t,e){return e})),a={},s={};r.forEach((function(t,e){a[e]=t,s[t.id]=e}));for(var u=i.map((function(t){return t.slice()})),l={suns:{},planets:{},moons:{}},c=[],f=[],h=function(){var t=o[0];o.splice(o.indexOf(t),1),i[t].forEach((function(e){var n=o.indexOf(e);n>=0&&o.splice(n,1);var r=-1,i=u[e];i.forEach((function(e,n){var i=o.indexOf(e);i>=0?o.splice(i,1):e===t&&(r=n)})),i.splice(r,1)}));var n={id:t};if(e)n.originalId=a[t].id;else{var r=a[t];n.finestIndex=r.finestIndex,n.originalId=r.originalId}c.push(n),l.suns[t]=n};o.length>0;)h();c.forEach((function(t,e){f[e]=[]})),c.forEach((function(t,n){var r={},o=[];i[t.id].forEach((function(i){if(i!==t.id&&!r[i]){var s={id:i,parent:t,sunId:n,moons:[]},u=a[i];s.size=function(){return s.moons.length+1},s.weight=u.weight||1,s.children=function(){return s.moons},e?s.originalId=u.id:(s.finestIndex=u.finestIndex,s.originalId=u.originalId),o.push(s),r[i]=!0}})),o.forEach((function(t){l.planets[t.id]=t})),t.planets=o,t.children=function(){return t.planets},t.weight=t.planets.reduce((function(t,e){return t+(e.weight||1)}),0)+(a[t.id].weight||1),t.size=function(){return t.planets.reduce((function(t,e){return t+e.size()}),0)+1}}));var d=r.filter((function(t,e){return!c.find((function(t){return t.id===e}))&&!l.planets[e]})),p=[];d.forEach((function(t){for(var n=s[t.id],r=u[n],i=null,o=-1,c=0;c<r.length;c++){var f=r[c];if(f!==n&&(i=l.planets[f])){o=c;break}}if(r.splice(o,1),i){var h={id:n,size:function(){return 0}};h.weight=a[n].weight||1,h.parent=i,h.sunId=i.sunId,e?h.originalId=t.id:(h.finestIndex=t.finestIndex,h.originalId=t.originalId),l.moons[n]=h,i.moons.push(h),i.weight+=h.weight,i.parent.weight+=h.weight;var d=u[i.id];d.splice(d.indexOf(n),1)}else p.push(t)})),u.forEach((function(t,e){if(!l.suns[e]){var n=l.planets[e]||l.moons[e];u[e].forEach((function(t){var e=l.planets[t];if(e||(e=l.moons[t]),n.sunId!==e.sunId){var r=f[n.sunId];r.includes(e.sunId)||r.push(e.sunId)}}))}}));var v=[],y=0,m={};c.forEach((function(t,i){var o=r[t.id];m[t.id]=y,t.previousIndex=i,t.id=y++,e&&(o.finestIndex=t.id,t.finestIndex=t.id),v.push(o),t.planets.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o),i.moons.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o)}))}))}));var g=[],b=[];return i.forEach((function(t,r){var i=m[r];g[i]=t.map((function(t){return m[t]})),e&&(b[i]=t.map((function(t,e){return n.relIdMap[r][e]})))})),b&&b.length>0&&(this.relIdMap=b),{output:{nodes:c,relationships:f},sortedInput:{nodes:v,relationships:g},nodeSortMap:m}}}],n&&Fi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vi=function(t,e,n){for(var r=2*Math.PI/n,i=[],o=0;o<n;o++){var a=r*o;i.push({x:t.x+e*Math.cos(a),y:t.y+e*Math.sin(a)})}return i};function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Wi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yi(r.key),r)}}function Yi(t){var e=function(t,e){if("object"!=Gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gi(e)?e:String(e)}var $i="PhysLayout",qi=new Float32Array(4),Zi=256,Ki=function(t){for(var e={},n={},r=0;r<t.length;r++)e[t[r].id]=r,n[r]=t[r].id;return{nodeIdToIndex:e,nodeIndexToId:n}},Ji=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state,i=e.webGLContext;if(Gr.info("layout - webGLContext",Boolean(i)),void 0===e.webGLContext)throw new Error("PhysLayout missing options: webGLContext - webgl context");if(void 0===e.state)throw new Error("PhysLayout missing options: state - state object");var o=i;this._checkCompatibility(o),this._printGlStats(o),this._physVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this._physVbo);var a=new Float32Array([0,0,mr,0,0,mr,mr,mr]);o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),this._physSmallVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this._physSmallVbo);var s=new Float32Array([0,0,Zi,0,0,Zi,Zi,Zi]);o.bufferData(o.ARRAY_BUFFER,s,o.STATIC_DRAW),this._physProjection=_i(),wi(this._physProjection,0,mr,mr,0,0,1e6),this._physSmallProjection=_i(),wi(this._physSmallProjection,0,Zi,Zi,0,0,1e6),o.disable(o.DEPTH_TEST),this._gl=o,this._useReadpixelWorkaround&&this._setupReadpixelWorkaround(),this._setupUpdates(),this._averageNodeSize=br,this.shouldUpdate=!0,this.iterationCount=0,this.lastSpeedValues=[],this.rollingAvgGraphSpeed=0,this.nodeVariation=0,this.nodeCenterPoint=[0,0],this.peakIterationMultiplier=160,this.setOptions(e,!0),this._definePhysicsArrays();var u=r.nodes,l=r.rels;u.addChannel($i),l.addChannel($i),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[$i];if(void 0!==u.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),o=Er(i);(e||r||o)&&(n.shouldUpdate=!0,n._checkForUpdates())}var a=l.channels[$i];if(void 0!==l.version&&a){var s=Object.values(a.adds).length>0,c=Object.values(a.removes).length>0;(s||c)&&(n.shouldUpdate=!0,n._checkForUpdates())}}))),this.setData({nodes:u.items,rels:l.items}),this._state=r,this._dpr=window.devicePixelRatio||1}var e,n;return e=t,n=[{key:"setOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t.intelWorkaround,r=t.simulationStopVelocity,i=void 0===r?100:r,o=t.gravity,a=void 0===o?100:o;e&&(this.intelWorkaround=n),i?this.simulationStopVelocitySquared=i*i:e&&(this.simulationStopVelocitySquared=1e4),this.gravity=a,this.force=0}}},{key:"setData",value:function(t){var e=Ki(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this._nodeIdToIndex=n,this._nodeIndexToId=r,this._numNodes=t.nodes.length,this.solarMerger=new Bi(t,n),this.solarMerger.coarsenTo(1),this.subGraphs=this.solarMerger.subGraphs,this.nodeSortMap=this.solarMerger.nodeSortMap,this._setupSprings(this.subGraphs[0]),this._setupSize(this.subGraphs[0]),this._setupPhysics(),this._firstUpdate=!0,this._curPhysData=0,this.shouldUpdate=!0,this.iterationCount=0,this.subGraphs[0]}},{key:"update",value:function(t){var e=this._gl;if(this._checkForUpdates(t),!this.shouldUpdate)return e.bindFramebuffer(e.FRAMEBUFFER,this._getPhysData(0).frameBuffer),void e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this._physPositions);e.disable(e.BLEND);for(var n=this.nodeVariation/(this._numNodes||1)>.3,r=this._getScaleNumber(this.iterationCount),i=this.subGraphs?this.subGraphs.length:0,o=this._getPhysData(0).texture,a=i-1;a>0;a--){var s=this.subGraphs[a].nodes.length,u=a===i-1;this._apprxRepForceShader.use(),this._apprxRepForceShader.setUniform("u_physData",o),this._apprxRepForceShader.setUniform("u_clusterData",this.levelsClusterTexture[a]),this._apprxRepForceShader.setUniform("u_finestIndexes",this.levelsFinestIndexTexture[a]),this._apprxRepForceShader.setUniform("u_prevForce",u?this.initalLevelTexture:this.levelsData[a+1].texture),this._apprxRepForceShader.setUniform("u_numNodes",s),this._apprxRepForceShader.setUniform("u_iterationMultiplier",r),this._apprxRepForceShader.setUniform("u_baseLength",this._getBaseLength(s)),this._apprxRepForceShader.setUniform("u_isTopLevel",u?1:0),e.bindBuffer(e.ARRAY_BUFFER,this._physSmallVbo),this._apprxRepForceShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.levelsData[a].frameBuffer),e.viewport(0,0,Zi,Zi),e.drawArrays(e.TRIANGLE_STRIP,0,4)}if(this.collisionDetectionMultiplier=0,this.collisionDetectionMultiplier=n?Math.min(this.iterationCount/Math.min(this._numNodes,300),1):1,this.force=i<=1?this.initalLevelTexture:this.levelsData[1].texture,this._physShader.use(),this._physShader.setUniform("u_prevForce",i<=1?this.initalLevelTexture:this.levelsData[1].texture),this._physShader.setUniform("u_connections",this._springTexture),this._physShader.setUniform("u_sizeTexture",this._sizeTexture),this._physShader.setUniform("u_connectionOffsets",this._offsetTexture),this._physShader.setUniform("u_physData",o),this._physShader.setUniform("u_pinnedNodes",this._pinTexture),this._physShader.setUniform("u_iterationMultiplier",r),this._physShader.setUniform("u_curIteration",this.iterationCount),this._physShader.setUniform("u_numNodes",this._numNodes),this._physShader.setUniform("u_clusterData",this.levelsClusterTexture[0]),this._physShader.setUniform("u_collisionMultiplier",this.collisionDetectionMultiplier),this._physShader.setUniform("u_baseLength",this._getBaseLength()),this._firstUpdate=!1,e.bindBuffer(e.ARRAY_BUFFER,this._physVbo),this._physShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this._getPhysData(1).frameBuffer),e.viewport(0,0,mr,mr),e.drawArrays(e.TRIANGLE_STRIP,0,4),this._useReadpixelWorkaround?this._doReadpixelWorkaround():(e.bindFramebuffer(e.FRAMEBUFFER,this._getPhysData(0).frameBuffer),e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this._physPositions)),this._curPhysData=(this._curPhysData+1)%this._physData.length,this.iterationCount++,this._numNodes<2)this.shouldUpdate=!1,this.iterationCount=0;else if(this.iterationCount%5==0){var l=this.iterationCount<300,c=l?this._getMaxSpeedSquared():this._getMedianSpeedSquared(this.addedNodes);this.lastSpeedValues.push(c),this.rollingAvgGraphSpeed=this.lastSpeedValues.reduce((function(t,e){return t+e}),0)/this.lastSpeedValues.length;var f=l&&c>=this.rollingAvgGraphSpeed,h=this.simulationStopVelocitySquared&&this.rollingAvgGraphSpeed<this.simulationStopVelocitySquared;this.lastSpeedValues.length>20&&this.lastSpeedValues.shift(),!f&&h&&this.iterationCount>2&&this.terminateUpdate()}return this.shouldUpdate}},{key:"terminateUpdate",value:function(){Gr.info("Cooling down after ".concat(this.iterationCount," iterations at graph speed of ").concat(Math.sqrt(this.rollingAvgGraphSpeed))),this.shouldUpdate=!1,this.iterationCount=0,this.rollingAvgGraphSpeed=0,this.lastSpeedValues=[],this.addedNodes=null,this.nodeVariation=0}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"getNodePositions",value:function(t){var e=[];if(this._useReadpixelWorkaround){var n,r=Wi(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this._nodeIdToIndex[i.id],a={id:i.id};void 0!==o&&(a.x=this._workaroundData[0].dataFloat[o],a.y=this._workaroundData[1].dataFloat[o]),e.push(a)}}catch(t){r.e(t)}finally{r.f()}}else{var s,u=Wi(t);try{for(u.s();!(s=u.n()).done;){var l=s.value,c=this._nodeIdToIndex[l.id],f={id:l.id};void 0!==c&&(f.x=this._physPositions[4*c+0],f.y=this._physPositions[4*c+1]),e.push(f)}}catch(t){u.e(t)}finally{u.f()}}return e}},{key:"reheat",value:function(t){this._setupSize(this.subGraphs[0]),this.shouldUpdate=!0,this.iterationCount=0,this.nodeVariation=t.nodes.length}},{key:"updateNodes",value:function(t){var e=this._gl,n=new Set;e.bindTexture(e.TEXTURE_2D,this._getPhysData().texture);var r,i=Wi(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this._nodeIdToIndex[o.id];if(void 0!==o.x&&void 0!==o.y){qi[0]=o.x,qi[1]=o.y,qi[2]=0,qi[3]=0;var s=a%mr,u=(a-s)/mr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,qi),this._useReadpixelWorkaround?(this._workaroundData[0].dataFloat[a]=o.x,this._workaroundData[1].dataFloat[a]=o.y):(this._physPositions[4*a+0]=o.x,this._physPositions[4*a+1]=o.y)}void 0!==o.pinned&&(this._pinData[a]=o.pinned?255:0),Object.keys(o).forEach((function(t){return n.add(t)}))}}catch(t){i.e(t)}finally{i.f()}n.has("pinned")&&(e.bindTexture(e.TEXTURE_2D,this._pinTexture),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,mr,mr,0,e.ALPHA,e.UNSIGNED_BYTE,this._pinData)),(n.has("x")||n.has("y")||n.has("size"))&&(this.shouldUpdate=!0,this.iterationCount=0)}},{key:"addRemoveData",value:function(t,e){var n=this._gl;this._numNodes=t.nodes.length,this._physShader.use(),this._physShader.setUniform("u_numNodes",this._numNodes),this._physShader.setUniform("u_baseLength",this._getBaseLength());var r=Ki(t.nodes).nodeIdToIndex,i=new Bi(t,r);i.coarsenTo(1);var o=i.subGraphs[0],a=this.subGraphs[0],s=function(t){return a.nodes.findIndex((function(e){return e.id===t}))},u=Object.values(e.adds),l=Object.values(e.removes);this.addedNodes=u.length>0?{}:null,this.nodeVariation=u.length+l.length;for(var c,f=3*Math.sqrt(t.nodes.length),h={x:0,y:0},d=o.nodes.length,p=new Uint8Array(65536),v=0;v<d;v++){var y=0,m=0,g=o.nodes[v];if(c=g.id,Boolean(e.adds[c])){if(this.addedNodes[v]=g.id,y=g.position?g.position.x:void 0,m=g.position?g.position.y:void 0,void 0===y||void 0===m){var b=i.sunMap,_=void 0;for(_=b[g.id];void 0!==_;_=b[_]){var w=s(_);if(-1!==w){var x=this._getNodePosition(w);y=x.x+10*(Math.random()-.5),m=x.y+10*(Math.random()-.5);break}}void 0===_&&(y=this.nodeCenterPoint[0]+f*(Math.random()-.5),m=this.nodeCenterPoint[1]+f*(Math.random()-.5))}this._updateData[2*v]=y,this._updateData[2*v+1]=m,p[v]=g.pinned?255:0}else{var S=s(g.id),T=this._getNodePosition(S);y=T.x,m=T.y,this._updateData[2*v]=S,this._updateData[2*v+1]=999999,p[v]=this._pinData[S]}h.x+=y||0,h.y+=m||0}this.nodeCenterPoint=d?[h.x/d,h.y/d]:[0,0],this._pinData=p,this.subGraphs=i.subGraphs,this.nodeSortMap=i.nodeSortMap,this._setupSprings(this.subGraphs[0]),this._setupSize(this.subGraphs[0]);var O=Ki(this.subGraphs[0].nodes),A=O.nodeIdToIndex,E=O.nodeIndexToId;return this._nodeIdToIndex=A,this._nodeIndexToId=E,n.bindTexture(n.TEXTURE_2D,this._updateTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.FLOAT,this._updateData),Gr.info("Setting gravity center to ",this.nodeCenterPoint),this._physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this._updateShader.use(),this._updateShader.setUniform("u_numNodesNew",o.nodes.length),this._updateShader.setUniform("u_physData",this._getPhysData(0).texture),this._updateShader.setUniform("u_updateData",this._updateTexture),n.disable(n.BLEND),n.bindBuffer(n.ARRAY_BUFFER,this._physVbo),this._updateShader.setAttributePointer("a_position",2,0,2),n.bindFramebuffer(n.FRAMEBUFFER,this._getPhysData(1).frameBuffer),n.viewport(0,0,mr,mr),n.drawArrays(n.TRIANGLE_STRIP,0,4),this._curPhysData=(this._curPhysData+1)%this._physData.length,this._useReadpixelWorkaround?this._doReadpixelWorkaround():(n.bindFramebuffer(n.FRAMEBUFFER,this._getPhysData().frameBuffer),n.readPixels(0,0,mr,mr,n.RGBA,n.FLOAT,this._physPositions)),(u.length>0||l.length>0)&&(n.bindTexture(n.TEXTURE_2D,this._pinTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.UNSIGNED_BYTE,this._pinData)),this.shouldUpdate=!0,this.iterationCount=0,this._setupPhysicsForCoarse(),this.subGraphs[0]}},{key:"destroy",value:function(){var t=this;this._gl.deleteBuffer(this._physVbo),this._gl.deleteBuffer(this._physSmallVbo),this._physData.forEach((function(e){t._gl.deleteFramebuffer(e.frameBuffer),t._gl.deleteTexture(e.texture)})),this.levelsData.forEach((function(e){t._gl.deleteFramebuffer(e.frameBuffer),t._gl.deleteTexture(e.texture)})),this.levelsClusterTexture.forEach((function(e){t._gl.deleteTexture(e)})),this.levelsFinestIndexTexture.forEach((function(e){t._gl.deleteTexture(e)})),this._gl.deleteTexture(this.initalLevelTexture),this._gl.deleteTexture(this._sizeTexture),this._gl.deleteTexture(this._offsetTexture),this._gl.deleteTexture(this._springTexture),this._gl.deleteTexture(this._pinTexture),this._gl.deleteTexture(this._updateTexture),this._apprxRepForceShader&&this._apprxRepForceShader.remove(),this._updateShader&&this._updateShader.remove(),this._physShader&&this._physShader.remove(),this._physPositions=null,this._gl=null,this.stateDisposers.forEach((function(t){t()})),this._state.nodes.removeChannel($i),this._state.rels.removeChannel($i)}},{key:"_dumpTexture",value:function(t,e,n){var r=this._gl;Gr.info("--- Dumping texture ",n),r.bindFramebuffer(r.FRAMEBUFFER,t),r.readPixels(0,0,mr,mr,r.RGBA,r.FLOAT,this._physPositions);for(var i=0;i<e;i++)Gr.info(i,": ",this._physPositions[4*i+0],this._physPositions[4*i+1],this._physPositions[4*i+2],this._physPositions[4*i+3])}},{key:"_getScaleNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e,n){return n+Math.pow(10,6)*Math.pow(t-120,-1.7)};return 0===t?0:t<300?200+-1/Math.pow(10,5)*3*Math.pow(Math.abs(t-200+12),3):e(t,200,10)}},{key:"_getBaseLength",value:function(t){if(!t||t===this._numNodes)return 100*this._dpr;var e=Math.pow(this._averageNodeSize/2,2)*Math.PI,n=this._numNodes/t*e;return(100+Math.sqrt(n/Math.PI)/2/t)*this._dpr}},{key:"_checkForUpdates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._state,n=e.nodes,r=e.rels,i={nodes:n.items,rels:r.items},o=Object.values(n.channels[$i].adds).length>0,a=Object.values(r.channels[$i].adds).length>0,s=Object.values(n.channels[$i].removes).length>0,u=Object.values(r.channels[$i].removes).length>0,l=Object.values(n.channels[$i].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[$i].adds,removes:n.channels[$i].removes}),t?(this.updateNodes(i.nodes),this.reheat(i,this.solarMerger)):l.length>0&&(this.updateNodes(l),Er(l)&&this.reheat(i,this.solarMerger)),n.clearChannel($i),r.clearChannel($i)}},{key:"_getNodePosition",value:function(t){return this._useReadpixelWorkaround?{x:this._workaroundData[0].dataFloat[t],y:this._workaroundData[1].dataFloat[t]}:{x:this._physPositions[4*t+0],y:this._physPositions[4*t+1]}}},{key:"_getMaxSpeedSquared",value:function(){var t=0;if(this._useReadpixelWorkaround)for(var e=0;e<this._numNodes;e++){var n=this._workaroundData[2].dataFloat[e],r=this._workaroundData[3].dataFloat[e],i=n*n+r*r;i>t&&(t=i)}else for(var o=0;o<this._numNodes;o++){var a=this._physPositions[4*o+2],s=this._physPositions[4*o+3],u=a*a+s*s;u>t&&(t=u)}return t}},{key:"_getMedianSpeedSquared",value:function(t){var e=[];if(this._useReadpixelWorkaround)for(var n=0;n<this._numNodes;n++){var r=this._workaroundData[2].dataFloat[n],i=this._workaroundData[3].dataFloat[n],o=r*r+i*i;e[n]=o}else for(var a=0;a<this._numNodes;a++)if(!t||t[a]){var s=this._physPositions[4*a+2],u=this._physPositions[4*a+3],l=s*s+u*u;e.push(l)}return e.sort((function(t,e){return t-e})),e[Math.floor(e.length/2)]}},{key:"_getPhysData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this._physData[(this._curPhysData+t)%this._physData.length]}},{key:"_getLevelData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this._levelData[(this._curPhysData+t)%this._levelData.length]}},{key:"_newTexture",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.FLOAT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.RGBA,o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,i,n,n,0,i,r,e),o}},{key:"_newFramebuffer",value:function(t,e){var n=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),n}},{key:"_checkCompatibility",value:function(t){function e(t){throw new Mi(t)}t||e("Could not initialize WebGL"),0===t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)&&e("Vertex shader texture access not available"),t.getExtension("OES_texture_float")||e("OES_texture_float extension not available");var n=t.getParameter(t.MAX_TEXTURE_SIZE),r=Math.max(mr,gr);n<r&&e("Need larger WebGL texture support. Avaliable: ".concat(n," needed: ").concat(r));var i=new Float32Array(4),o=this._newTexture(t,i,1),a=this._newFramebuffer(t,o);t.bindFramebuffer(t.FRAMEBUFFER,a),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),t.getError()!==t.NO_ERROR&&(Gr.info("gl.readPixels doesnt work for float texture, activating workaround"),this._useReadpixelWorkaround=!0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(a),t.deleteTexture(o)}},{key:"_printGlStats",value:function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n="?",r="?";null!==e&&(n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),Gr.trace("Vendor: ".concat(n)),Gr.trace("Renderer: ".concat(r));var i=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);Gr.trace("Line width range: ".concat(i));var o=t.getSupportedExtensions();Gr.trace("Extentions:"),o.length>0&&o.forEach((function(t){return Gr.trace(t)}))}},{key:"_adjustToGlSize",value:function(t){return t*this._dpr*2.5}},{key:"_setupSize",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=new Float32Array(65536),n=t.nodes,r=n.length,i=0,o=0;o<r;o++){var a=parseInt(n[o].size||br);e[o]=this._adjustToGlSize(a),i+=a}this._averageNodeSize=r?i/r:br;var s=this._gl;void 0===this._sizeTexture&&(this._sizeTexture=s.createTexture()),s.bindTexture(s.TEXTURE_2D,this._sizeTexture),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,mr,mr,0,s.ALPHA,s.FLOAT,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE)}},{key:"_setupSprings",value:function(t){var e,n,r=this._gl,i=t.relationships;this.connections=i;var o=new Float32Array(16777216),a=new Float32Array(65536),s=0;for(e=0;e<t.nodes.length;e++)for(a[e]=s,o[s]=i[e].length,s++,n=0;n<i[e].length;n++)o[s]=i[e][n],s++;for(n=s;n<o.length;n++)o[n]=1;for(n=e;n<a.length;n++)a[n]=0;void 0===this._offsetTexture&&(this._offsetTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this._offsetTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,mr,mr,0,r.ALPHA,r.FLOAT,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),void 0===this._springTexture&&(this._springTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this._springTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,gr,gr,0,r.ALPHA,r.FLOAT,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}},{key:"_setupPhysics",value:function(){this._setupPhysicsForCoarse(),this._setupPhysicsForNodes(),this._physPositions=new Float32Array(262144),this._setupPinData()}},{key:"_setupPhysicsForNodes",value:function(){var t=this._gl,e=this.subGraphs.length,n=this.subGraphs[0].nodes,r=3*Math.sqrt(n.length),i=new Float32Array(262144),o=new Float32Array(262144);this._numNodes=n.length;for(var a=0;a<262144;a++)i[a]=0,o[a]=0;for(var s=function(t,e,n,r){r[4*t+0]=e,r[4*t+1]=n,r[4*t+2]=0,r[4*t+3]=0},u=e-1;u>=0;u--){var l=u===e-1?[]:this.subGraphs[u+1].nodes;0===l.length?this.subGraphs[u].nodes.forEach((function(t,e){var n=t.placement?t.placement.x:r*(Math.random()-.5),o=t.placement?t.placement.y:r*(Math.random()-.5);s(void 0===t.finestIndex?e:t.finestIndex,n,o,i)})):l.forEach((function(t){var e=t.finestIndex,n=i[4*t.finestIndex],r=i[4*t.finestIndex+1],o=Vi({x:n,y:r},10,t.planets.length+1);e++,t.planets.forEach((function(t,n){var r=o[n];s(e++,r.x,r.y,i);var a=Vi({x:r.x,y:r.y},10,t.moons.length+1);t.moons.forEach((function(t,n){var r=a[n];s(e++,r.x,r.y,i)}))}))}))}this._physData=[];for(var c=0;c<2;c++){var f=this._newTexture(t,0===c?i:o,mr),h=this._newFramebuffer(t,f);this._physData.push({texture:f,frameBuffer:h})}this._physShader=new Pi(t,Ni,"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 500000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = ((combinedNodeSize - dist) / dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * (fScale / 1.5)) / dist;\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, acceleration * TIMESTEP * 0.5);\n } else {\n myPosition.zw = myPosition.zw * VELOCITYDECAY;\n gl_FragColor = vec4(myPosition.xy + myPosition.zw * TIMESTEP, myPosition.zw + acceleration * TIMESTEP);\n }\n}",{INTEL_WORKAROUND:this.intelWorkaround?1:0}),this._physShader.use(),this._physShader.setUniform("u_projection",this._physProjection),this._physShader.setUniform("u_baseLength",this._getBaseLength()),this._physShader.setUniform("u_connections",this._springTexture),this._physShader.setUniform("u_sizeTexture",this._sizeTexture),this._physShader.setUniform("u_connectionOffsets",this._offsetTexture),this._physShader.setUniform("u_pinnedNodes",this._pinTexture),this._physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this._physShader.setUniform("u_numNodes",this._numNodes),this._physShader.setUniform("u_gravity",this.gravity)}},{key:"_setupPhysicsForCoarse",value:function(){var t=this,e=this._gl;this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[];var n,r,i=this.subGraphs.length,o=function(t,e,r,i,o){n[4*t+0]=e,n[4*t+1]=r,n[4*t+2]=o.size(),n[4*t+3]=i||1};if(1===i){n=new Float32Array(262144);var a=this.subGraphs[0].nodes;a.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return a.length}})})),this.levelsClusterTexture[0]=this._newTexture(e,n,Zi)}else for(var s=function(){var i=t.subGraphs[u].nodes,a=u===t.subGraphs.length-1?[]:t.subGraphs[u+1].nodes;n=new Float32Array(262144),r=new Float32Array(65536);var s=0;if(a.length>0){var l=a.slice();l.sort((function(t,e){return t.previousIndex-e.previousIndex})),l.forEach((function(t,e){var n=s,u=a.indexOf(t);o(s,u,n,i[t.id].weight,t),r[s]=i[s].finestIndex,s++,t.planets.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++,e.moons.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++}))}))}))}else i.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return i.length}}),r[e]=i[e].finestIndex}));var c=t._newTexture(e,null,Zi),f=t._newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t._newTexture(e,n,Zi),t.levelsFinestIndexTexture[u]=t._newTexture(e,r,mr,e.FLOAT,e.ALPHA)},u=this.subGraphs.length-1;u>=0;u--)s();for(var l=new Float32Array(262144),c=0;c<l.length;c++)l[c]=0;this.initalLevelTexture=this._newTexture(e,l,Zi),this._apprxRepForceShader=new Pi(e,Ni,"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = ((u_baseLength * u_baseLength) * (fScale / 1.5)) / dist;\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / dist) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / dist;\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}"),this._apprxRepForceShader.use(),this._apprxRepForceShader.setUniform("u_projection",this._physSmallProjection)}},{key:"_setupPinData",value:function(){var t=this._gl;this._pinTexture=t.createTexture(),this._pinData=new Uint8Array(65536);for(var e=0;e<65536;e++)this._pinData[e]=0;t.bindTexture(t.TEXTURE_2D,this._pinTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.UNSIGNED_BYTE,this._pinData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}},{key:"_setupUpdates",value:function(){var t=this._gl;this._updateData=new Float32Array(65536),this._updateTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this._updateTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.FLOAT,this._updateData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this._updateShader=new Pi(t,Ni,"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_updateData;\nuniform float u_numNodesNew;\n\nconst float INDEX_FLAG = 999999.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5)*textureSide;\n\n if (index >= u_numNodesNew) {\n discard;\n }\n\n float firstValue = getTextureData(u_updateData, index * 2.0, 256.0).a;\n float secondValue = getTextureData(u_updateData, index * 2.0 + 1.0, 256.0).a;\n\n if (secondValue == INDEX_FLAG) {\n vec4 myPosition = getTextureData(u_physData, firstValue, 256.0);\n gl_FragColor = myPosition;\n } else {\n gl_FragColor = vec4(firstValue, secondValue, 0.0, 0.0);\n }\n}\n"),this._updateShader.use(),this._updateShader.setUniform("u_projection",this._physProjection)}},{key:"_setupReadpixelWorkaround",value:function(){var t=this._gl;this._workaroundShader=new Pi(t,Ni,"precision lowp float;\n\nuniform sampler2D u_physData;\nuniform float u_index;\n\nfloat shift_right (float v, float amt) { \n v = floor(v) + 0.5; \n return floor(v / exp2(amt)); \n}\n\nfloat shift_left (float v, float amt) { \n return floor(v * exp2(amt) + 0.5); \n}\n\nfloat mask_last (float v, float bits) { \n return mod(v, shift_left(1.0, bits)); \n}\n\nfloat extract_bits (float num, float from, float to) { \n from = floor(from + 0.5); to = floor(to + 0.5); \n return mask_last(shift_right(num, from), to - from); \n}\n\n// From https://stackoverflow.com/questions/17981163/webgl-read-pixels-from-floating-point-render-target\nvec4 encode_float (float val) { \n if (val == 0.0) return vec4(0, 0, 0, 0); \n float sign = val > 0.0 ? 0.0 : 1.0; \n val = abs(val); \n float exponent = floor(log2(val)); \n float biased_exponent = exponent + 127.0; \n float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; \n float t = biased_exponent / 2.0; \n float last_bit_of_biased_exponent = fract(t) * 2.0; \n float remaining_bits_of_biased_exponent = floor(t); \n float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; \n float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; \n float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; \n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; \n return vec4(byte4, byte3, byte2, byte1); \n}\n\nvoid main(void) {\n vec4 texData = texture2D(u_physData, gl_FragCoord.xy / 255.0);\n float data;\n if (u_index == 0.0) {\n data = texData.x;\n } else if (u_index == 1.0) {\n data = texData.y;\n } else if (u_index == 2.0) {\n data = texData.z;\n } else if (u_index == 3.0) {\n data = texData.w;\n }\n\n gl_FragColor = encode_float(data);\n}\n"),this._workaroundShader.use(),this._workaroundShader.setUniform("u_projection",this._physProjection),this._workaroundData=[];for(var e=0;e<4;e++){var n=new Uint8Array(262144),r=this._newTexture(t,null,mr,t.UNSIGNED_BYTE),i=this._newFramebuffer(t,r);this._workaroundData.push({dataByte:n,dataFloat:new Float32Array(n.buffer),texture:r,fb:i})}}},{key:"_doReadpixelWorkaround",value:function(){for(var t=this._gl,e=0;e<4;e++){var n=this._workaroundData[e];t.bindFramebuffer(t.FRAMEBUFFER,n.fb),t.viewport(0,0,mr,mr),this._workaroundShader.use(),this._workaroundShader.setUniform("u_index",e),this._workaroundShader.setUniform("u_physData",this._getPhysData(0).texture),t.bindBuffer(t.ARRAY_BUFFER,this._physVbo),this._workaroundShader.setAttributePointer("a_position",2,0,2),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.readPixels(0,0,mr,mr,t.RGBA,t.UNSIGNED_BYTE,n.dataByte)}}},{key:"_definePhysicsArrays",value:function(){this._physData=[],this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[]}}],n&&Hi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qi(t){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qi(t)}function to(t){return function(t){if(Array.isArray(t))return eo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return eo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eo(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function no(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,io(r.key),r)}}function ro(t,e,n){return(e=io(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function io(t){var e=function(t,e){if("object"!=Qi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Qi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qi(e)?e:String(e)}var oo="ForceCytoLayout",ao="forceDirected",so="coseBilkent",uo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ro(this,"physLayout",void 0),ro(this,"coseBilkentLayout",void 0),ro(this,"state",void 0),ro(this,"currentLayoutType",void 0),ro(this,"isCytoscapeEnabled",void 0),ro(this,"currentLayout",void 0);var r=e.state,i=e.isCytoscapeEnabled;this.isCytoscapeEnabled=null==i||i,this.physLayout=new Ji(e),this.coseBilkentLayout=new gi({state:r,cytoCompleteCallback:function(){for(n.physLayout.update(!0),n.copyLayoutPositions(n.state.nodes.items,n.coseBilkentLayout,n.physLayout);n.physLayout.update(!1););n.copyLayoutPositions(n.state.nodes.items,n.physLayout,n.coseBilkentLayout)},animationCompleteCallback:function(){n.currentLayoutType===so&&setTimeout((function(){return n.setLayout(ao)}),50)}}),this.currentLayout=this.physLayout,this.currentLayoutType=ao;var o=r.nodes,a=r.rels;o.addChannel(oo),a.addChannel(oo),this.state=r}var e,n;return e=t,n=[{key:"setOptions",value:function(t){void 0!==t&&(this.currentLayout.setOptions(t),this.isCytoscapeEnabled=t.isCytoscapeEnabled)}},{key:"getLayout",value:function(t){return t===so?this.coseBilkentLayout:this.physLayout}},{key:"setLayout",value:function(t){if(t!==this.currentLayoutType){Gr.info("Switching to layout: ".concat(t," in ForceCyto"));var e=this.getLayout(t);this.currentLayout=e,this.currentLayoutType=t}}},{key:"copyLayoutPositions",value:function(t,e,n){var r=e.getNodePositions(t);n.updateNodes(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i=n.channels[oo],o=r.channels[oo],a=Object.values(i.adds).length,s=Object.values(o.adds).length,u=Object.values(i.adds).map((function(t){return t.id})),l=Object.values(o.adds).map((function(t){return t.id})),c=new Set(Object.keys(i.adds)),f=new Set(Object.keys(o.adds));if(n.clearChannel(oo),r.clearChannel(oo),this.currentLayoutType===ao&&this.isCytoscapeEnabled&&n.items.length<=100&&a<100&&a>0&&s>0){var h=n.items.map((function(t){return t.id})),d=new Set([].concat(to(h),to(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(to(p),to(l)));if(d.size<=100&&v.size<=300){var y=function(t,e,n,r){var i,o=new Set(t),a=Tr(new Set(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=r.idToItem[s];if(u){var l=u.from,c=u.to;o.add(l),o.add(c)}}}catch(t){a.e(t)}finally{a.f()}var f,h=function(t){var e,n={},r={},i=Tr(t);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,a=o.from,s=o.to,u="".concat(a,"-").concat(s),l="".concat(s,"-").concat(a),c=0,f=[u,l];c<f.length;c++){var h=f[c];void 0!==r[h]?r[h].push(o):r[h]=[o]}n[a]||(n[a]=new Set),n[s]||(n[s]=new Set),n[a].add(s),n[s].add(a)}}catch(t){i.e(t)}finally{i.f()}return{adjNodesMap:n,relMap:r}}(r.items),d=h.adjNodesMap,p=h.relMap,v={},y={},m=function(t){var e=[];for(v[t]||e.push(t);e.length>0;){var r=e.shift();if(v[r]=n.idToItem[r],void 0!==d[r]){var i,o=Tr(d[r]);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!v[a]){e.push(a);var s=p["".concat(r,"-").concat(a)];if(s){var u,l=Tr(s);try{for(l.s();!(u=l.n()).done;){var c=u.value;y[c.id]||(y[c.id]=c)}}catch(t){l.e(t)}finally{l.f()}}}}}catch(t){o.e(t)}finally{o.f()}}}},g=Tr(o);try{for(g.s();!(f=g.n()).done;)m(f.value)}catch(t){g.e(t)}finally{g.f()}return{connectedNodes:v,connectedRels:y}}(c,f,n,r),m=y.connectedNodes,g=y.connectedRels,b=Object.values(m),_=Object.values(g),w=b.length,x=_.length;w===c.size&&x===f.size&&(f.size>0||c.size>0)?(this.setLayout(so),this.coseBilkentLayout.update(!0,n.items,r.items)):x>0&&f.size/x>.25&&(this.setLayout(so),this.coseBilkentLayout.update(!0,b,_))}}this.physLayout.update(t),this.coseBilkentLayout.update(t)}},{key:"getShouldUpdate",value:function(){return this.currentLayout.getShouldUpdate()}},{key:"getComputing",value:function(){return this.currentLayout.getComputing()}},{key:"updateNodes",value:function(t){this.setLayout(ao),this.physLayout.updateNodes(t)}},{key:"getNodePositions",value:function(t){return this.currentLayout.getNodePositions(t)}},{key:"terminateUpdate",value:function(){this.physLayout.terminateUpdate(),this.coseBilkentLayout.terminateUpdate()}},{key:"destroy",value:function(){this.physLayout.destroy(),this.coseBilkentLayout.destroy()}}],n&&no(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function co(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?co(Object(n),!0).forEach((function(e){yo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ho(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return po(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mo(r.key),r)}}function yo(t,e,n){return(e=mo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mo(t){var e=function(t,e){if("object"!=lo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=lo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lo(e)?e:String(e)}var go="FreeLayout",bo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),yo(this,"state",void 0),yo(this,"positions",void 0),yo(this,"shouldUpdate",void 0),yo(this,"stateDisposers",void 0);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(go),a.addChannel(go),this.shouldUpdate=!0,this.setOptions(),this.layout(o.items,o.idToItem,o.idToPosition)}var e,r;return e=t,r=[{key:"setOptions",value:function(){}},{key:"updateNodes",value:function(t){var e,n=ho(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[go].adds).length>0,o=Object.values(r.channels[go].adds).length>0,a=Object.values(n.channels[go].removes).length>0,s=Object.values(r.channels[go].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(go),r.clearChannel(go)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r){var i,o=void 0!==(i=t)?_n(i):i;if(!(0,n.isEmpty)(o)){for(var a={},s=0;s<o.length;++s){var u,l=o[s].id,c=null!==(u=r[l])&&void 0!==u?u:{},f=c.x,h=void 0===f?0:f,d=c.y,p=void 0===d?0:d;a[l]={id:l,x:h,y:p}}this.positions=a,this.shouldUpdate=!1}}},{key:"setNodePositions",value:function(t){this.positions=t}},{key:"getNodePositions",value:function(t){var e,n=[],r=ho(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=fo({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){}},{key:"destroy",value:function(){this.state.nodes.removeChannel(go),this.state.rels.removeChannel(go)}}],r&&vo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _o(t){return _o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_o(t)}function wo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Ao(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function So(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return To(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?To(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function To(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ao(r.key),r)}}function Ao(t){var e=function(t,e){if("object"!=_o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=_o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_o(e)?e:String(e)}var Eo="GridLayout",Po=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Eo),a.addChannel(Eo),this.shouldUpdate=!0,this.setOptions(e),this.layout(o.items,o.idToItem,o.idToPosition,a.items)}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e,n=So(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[Eo].adds).length>0,o=Object.values(r.channels[Eo].adds).length>0,a=Object.values(n.channels[Eo].removes).length>0,s=Object.values(r.channels[Eo].removes).length>0;(i||o||a||s)&&(this.layout(n.items,n.idToItem,n.idToPosition,r.items),n.idToPosition=this.positions),n.clearChannel(Eo),r.clearChannel(Eo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r,i){var o;if(t=(o=t)?_n(o):o,!(0,n.isEmpty)(t)){for(var a=t.length,s=Math.ceil(Math.sqrt(a)),u=new Array(a),l=0,c=0;c<s;++c){for(var f=0;f<s&&(u[l]={y:0+150*c,x:0+150*f},++l!==a);++f);if(l===a)break}for(var h=t.sort(),d={},p=0;p<a;++p){var v=h[p],y=u[p];v.x===y.x&&v.y===y.y||(d[v.id]=xo({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{key:"getNodePositions",value:function(t){var e,n=[],r=So(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=xo({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){this.shouldUpdate=!1}},{key:"destroy",value:function(){this.state.nodes.removeChannel(Eo),this.state.rels.removeChannel(Eo)}}],r&&Oo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ko=i(269),jo=i.n(ko);function Co(t){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(t)}function Ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Do(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Co(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Co(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Io=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},r=0;r<t.length;r++)n.minX>t[r].x&&(n.minX=t[r].x),n.minY>t[r].y&&(n.minY=t[r].y),n.maxX<t[r].x&&(n.maxX=t[r].x),n.maxY<t[r].y&&(n.maxY=t[r].y);var i=(n.minX+n.maxX)/2,o=(n.minY+n.maxY)/2,a=2*e,s=xr()*a;return{centerX:i,centerY:o,nodesWidth:n.maxX-n.minX+a+s,nodesHeight:n.maxY-n.minY+a+s}},Lo=function(t,e,n,r){var i=1/0,o=1/0;return t>1&&(i=n/t),e>1&&(o=r/e),{zoomX:i,zoomY:o}},Mo=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=Math.min(t,e);return Math.min(r,Math.max(n,i))},No=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},Uo=function(t,e,n,r,i,o){var a=e;return function(t,e,n){return t<e&&t<n}(i,o,e)&&t.length>1?(a=function(t,e,n){var r=function(t){var e=new Array(4).fill(t[0]);return t.forEach((function(t){e[0]=t.x<e[0].x?e[0]:Do({},t),e[1]=t.y<e[1].y?e[1]:Do({},t),e[2]=t.x<e[2].x?Do({},t):e[2],e[3]=t.y<e[3].y?Do({},t):e[3]})),e}(t),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0,n=0,r=0;r<t.length;r++)for(var i=r+1;i<t.length;i++)e=Math.hypot(Math.abs(t[r].x-t[i].x),Math.abs(t[r].y-t[i].y)),n=Math.max(n,e);return n}(r),o=2*n,a=xr()*o,s=e.height<=e.width?e.height-o-a:e.width-o-a;return i>s?.9*s/i:.9*i/s}(t,r,25),No(i,o,Math.min(e,a),n)):No(i,o,e,n)};function Fo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return zo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Bo(t){this.channels[t]={adds:{},updates:{},removes:{}}}function Vo(t){delete this.channels[t]}function Go(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var Wo=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function Xo(t,e){var r,i=!1,o=Fo(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.id;if(void 0===this.idToItem[s]){if(a=(0,n.cloneDeep)(a),this.items.push(a),this.idToItem[s]=a,this.idToPosition[s]={id:s,x:0,y:0},"x"in a&&"y"in a){var u=a,l=u.x,c=u.y;isNaN(l)||isNaN(c)||(this.idToPosition[s].x=l,this.idToPosition[s].y=c)}var f=Wo(a);if(f instanceof HTMLElement){var h=document.createElement("div");Object.assign(h.style,{position:"absolute"}),h.appendChild(f),this.idToHtmlOverlay[s]=h}for(var d=Object.values(this.channels),p=0,v=d;p<v.length;p++){var y=v[p];void 0===y.removes[s]?y.adds[s]=a:(delete y.removes[s],y.updates[s]=a)}i=!0}}}catch(t){o.e(t)}finally{o.f()}i&&(this.version+=1,void 0!==e&&(e.added=!0))}function Ho(t,e){var n,r=!1,i=Fo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.id,s=this.idToItem[a];if(void 0!==s){Object.assign(s,o);var u=Wo(o);if(u instanceof HTMLElement){var l;null===(l=this.idToHtmlOverlay[a])||void 0===l||l.remove(),delete this.idToHtmlOverlay[a];var c=document.createElement("div");Object.assign(c.style,{position:"absolute"}),c.appendChild(u),this.idToHtmlOverlay[a]=c}for(var f=Object.values(this.channels),h=0,d=f;h<d.length;h++){var p=d[h];if(void 0===p.adds[a]){var v=p.updates[a];void 0===v&&(v={id:a},p.updates[a]=v),Object.assign(v,o)}}void 0!==e&&(e.updated=!0)}r=!0}}catch(t){i.e(t)}finally{i.f()}r&&(this.version+=1)}function Yo(t,e){var n,r=!1,i=Fo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=this.idToItem[o];if(void 0!==a){var s;r=!0,delete this.idToItem[a.id],delete this.idToPosition[a.id],null===(s=this.idToHtmlOverlay[a.id])||void 0===s||s.remove(),delete this.idToHtmlOverlay[a.id],this.items.splice(this.items.indexOf(a),1);for(var u=Object.values(this.channels),l=0,c=u;l<c.length;l++){var f=c[l];void 0!==f.adds[o]?delete f.adds[o]:(delete f.updates[o],f.removes[o]=a)}}}}catch(t){i.e(t)}finally{i.f()}r&&(void 0!==e&&(e.removed=!0),this.version+=1)}function $o(t){var e,n=Fo(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(void 0!==this.idToPosition[r.id]){var i=this.idToPosition[r.id];Object.assign(i,r)}else this.idToPosition[r.id]={id:r.id,x:r.x,y:r.y,pinned:r.pinned}}}catch(t){n.e(t)}finally{n.f()}}function qo(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var Zo=function(){return{idToItem:Vt.shallow({}),items:Vt.shallow([]),channels:Vt.shallow({}),idToPosition:Vt.shallow({}),idToHtmlOverlay:Vt.shallow({}),version:0,addChannel:ot(Bo),removeChannel:ot(Vo),clearChannel:ot(Go),add:ot(Xo),update:ot(Ho),remove:ot(Yo),updatePositions:ot($o),updateHtmlOverlay:ot(qo)}};function Ko(t){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(t)}function Jo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Ko(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ko(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ko(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ta="#bbb",ea="#fff",na="#45bff8",ra={selected:{rings:[{widthFactor:.05,color:ea},{widthFactor:.1,color:na}],shadow:{width:10,opacity:1,color:ta}},default:{rings:[]}},ia={selected:{rings:[{color:ea,width:2},{color:na,width:4}],shadow:{width:18,opacity:1,color:ta}},default:{rings:[]}},oa=.75,aa=new Set(["direction","packing"]),sa="forceDirected",ua="hierarchical",la="grid",ca="free",fa="d3Force",ha="webgl",da="canvas";function pa(t){return pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pa(t)}function va(t,e,n){return e=function(t){var e=function(t,e){if("object"!=pa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=pa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pa(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ya="down",ma=va(va(va(va({},"up","BT"),ya,"TB"),"left","RL"),"right","LR"),ga="bin",ba=[ga,"stack"],_a=["html"],wa=["html"],xa=["captionHtml"];function Sa(t){return Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sa(t)}function Ta(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Da(r.key),r)}}function Aa(t,e,n){return e=ja(e),function(t,e){if(e&&("object"===Sa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Pa(t)}(t,Ea()?Reflect.construct(e,n||[],ja(t).constructor):e.apply(t,n))}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function Pa(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ka(){return ka="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ja(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ka.apply(this,arguments)}function ja(t){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ja(t)}function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ca(t,e)}function Ra(t,e,n){return(e=Da(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Da(t){var e=function(t,e){if("object"!=Sa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Sa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sa(e)?e:String(e)}var Ia="HierarchicalLayout",La=function(t){return void 0!==t?_n(t):t},Ma=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ra(Pa(n=Aa(this,e,[t])),"direction",void 0),Ra(Pa(n),"packing",void 0),Ra(Pa(n),"stateDisposers",void 0),Ra(Pa(n),"oldComputing",void 0),Ra(Pa(n),"computing",void 0),Ra(Pa(n),"pendingLayoutData",void 0),Ra(Pa(n),"worker",void 0),Ra(Pa(n),"directionChanged",void 0),Ra(Pa(n),"packingChanged",void 0),n.direction=ya,n.packing=ga;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(Ia),o.addChannel(Ia),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[Ia],e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,a=Object.values(t.updates),s=Er(a);n.shouldUpdate=n.shouldUpdate||e||r||s}if(void 0!==o.version){var u=o.channels[Ia],l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;n.shouldUpdate=n.shouldUpdate||l||c}}))],n.shouldUpdate=!0,n.oldComputing=!1,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createHierarchicalLayoutWorker)(),n.worker.port.start(),n.setOptions(t),n.layout(i.items,i.idToItem,i.idToPosition,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ca(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){if(void 0!==t&&function(t){return Object.keys(t).every((function(t){return aa.has(t)}))}(t)){var e=t.direction,n=void 0===e?ya:e,r=t.packing,i=void 0===r?ga:r;Object.keys(ma).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),ba.includes(i)&&(this.packingChanged=this.packing&&this.packing!==i,this.packing=i),this.shouldUpdate=this.directionChanged||this.packingChanged}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var n=this.state,r=n.nodes,i=n.rels,o=this.directionChanged,a=this.packingChanged,s=Object.values(r.channels[Ia].adds).length>0,u=Object.values(i.channels[Ia].adds).length>0,l=Object.values(r.channels[Ia].removes).length>0,c=Object.values(i.channels[Ia].removes).length>0,f=Object.values(r.channels[Ia].updates),h=Er(f);(t||s||u||l||c||o||a||h)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(Ia),i.clearChannel(Ia),this.directionChanged=!1,this.packingChanged=!1}ka(ja(e.prototype),"update",this).call(this),this.shouldUpdate=!1,this.oldComputing=this.computing}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e,n,r){var i=this,o=La(t).map((function(t){return t.html,Ta(t,_a)})),a=La(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Ta(e,wa));s[t]=n}));var u=La(r).map((function(t){return t.captionHtml,Ta(t,xa)})),l=La(n),c=this.direction,f=this.packing,h=window.devicePixelRatio,d={nodes:o,nodeIds:s,idToPosition:l,rels:u,direction:c,packing:f,pixelRatio:h,forcedDelay:0};this.computing?this.pendingLayoutData=d:(this.worker.port.onmessage=function(t){var e=t.data,n=e.positions,r=e.parents,o=e.waypoints;i.computing&&(i.positions=n),i.parents=r,i.state.setWaypoints(o),null!==i.pendingLayoutData?(i.worker.port.postMessage(i.pendingLayoutData),i.pendingLayoutData=null):i.computing=!1,i.shouldUpdate=!0,i.startAnimation()},this.computing=!0,this.worker.port.postMessage(d))}},{key:"terminateUpdate",value:function(){var t,e;this.computing=!1,this.shouldUpdate=!1,null===(t=this.state.nodes)||void 0===t||t.clearChannel(Ia),null===(e=this.state.rels)||void 0===e||e.clearChannel(Ia)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ia),this.state.rels.removeChannel(Ia),this.worker.port.close()}}],r&&Oa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti);function Na(t){return Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Na(t)}function Ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,za(r.key),r)}}function Fa(t,e,n){return(e=za(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function za(t){var e=function(t,e){if("object"!=Na(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Na(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Na(e)?e:String(e)}var Ba=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Fa(this,"elementId",void 0),Fa(this,"currentValue",void 0),Fa(this,"startValue",void 0),Fa(this,"currentTime",void 0),Fa(this,"duration",void 0),Fa(this,"status",void 0),Fa(this,"endValue",void 0),Fa(this,"startTime",void 0),Fa(this,"endTime",void 0),Fa(this,"hasNextAnimation",void 0),this.elementId=e,this.startValue=n,this.status=0,this.currentValue=n,this.duration=0}var e,n;return e=t,(n=[{key:"setDuration",value:function(t){this.duration=t,this.setEndTime(this.startTime+this.duration)}},{key:"getStatus",value:function(){return this.status}},{key:"advance",value:function(){if(1!==this.status)return!1;this.currentTime=(new Date).getTime();var t,e=this.endTime-this.startTime;return(t=e>0?(this.currentTime-this.startTime)/e:1)>=1?(this.currentValue=this.endValue,this.status=2):(this.currentValue=this.startValue+t*(this.endValue-this.startValue),this.hasNextAnimation=!0),this.hasNextAnimation}},{key:"setEndValue",value:function(t){this.endValue!==t&&(t-this.currentValue!=0?(this.currentTime=(new Date).getTime(),this.status=1,this.startValue=this.currentValue,this.endValue=t,this.startTime=this.currentTime,this.setEndTime(this.startTime+this.duration)):this.endValue=t)}},{key:"setEndTime",value:function(t){this.endTime=Math.max(t,this.startTime)}}])&&Ua(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Va(t){return Va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(t)}function Ga(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ga(Object(n),!0).forEach((function(e){Ha(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ga(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Xa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ya(r.key),r)}}function Ha(t,e,n){return(e=Ya(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ya(t){var e=function(t,e){if("object"!=Va(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Va(e)?e:String(e)}var $a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ha(this,"animations",void 0),Ha(this,"durations",void 0),Ha(this,"defaultDuration",void 0),Ha(this,"hasNextAnimation",void 0),Ha(this,"ignoreAnimationsFlag",void 0),this.animations=new Map,this.durations=[],this.durations[0]=0,this.durations[1]=0,this.defaultDuration=150,this.hasNextAnimation=!1,this.ignoreAnimationsFlag=!1}var e,n;return e=t,n=[{key:"advance",value:function(){var t=this;return this.hasNextAnimation=!1,this.animations.forEach((function(e){Object.values(e).forEach((function(e){e.advance()&&(t.hasNextAnimation=!0)}))})),this.hasNextAnimation}},{key:"ignoreAnimations",value:function(t){this.ignoreAnimationsFlag=t}},{key:"setOptions",value:function(t){void 0!==t.fadeDuration&&(this.durations[0]=t.fadeDuration),void 0!==t.sizeDuration&&(this.durations[1]=t.sizeDuration)}},{key:"needsToRun",value:function(){return this.hasNextAnimation}},{key:"getValueForAnimationName",value:function(t,e,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.ignoreAnimationsFlag)return n;var a=null!==(r=this.getById(t))&&void 0!==r?r:{};if(void 0===a[e]){var s=1===o?this.createSizeAnimation(0,t,e):this.createFadeAnimation(0,t,e);s.setEndValue(n),i=s.currentValue}else{var u=a[e];if(u.currentValue===n)return n;u.setEndValue(n),i=u.currentValue}return this.hasNextAnimation=!0,i}},{key:"createAnimation",value:function(t,e,n){var r,i=new Ba(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Wa(Wa({},o),{},Ha({},n,i))),i}},{key:"getById",value:function(t){return this.animations.get(t)}},{key:"createFadeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[0])&&void 0!==r?r:this.defaultDuration),i}},{key:"createSizeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[1])&&void 0!==r?r:this.defaultDuration),i}}],n&&Xa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qa(t){return qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qa(t)}function Za(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ka(r.key),r)}}function Ka(t){var e=function(t,e){if("object"!=qa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=qa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qa(e)?e:String(e)}var Ja=64,Qa=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=Ka(n="cache"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.cache={}}var e,n;return e=t,n=[{key:"getImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOrCreateEntry(t),r=e?"inverted":"image",i=n[r];return void 0===i&&(i=this.loadImage(t),n[r]=i),this.drawIfNeeded(i,e),i.canvas}},{key:"getOrCreateEntry",value:function(t){return void 0===this.cache[t]&&(this.cache[t]={}),this.cache[t]}},{key:"invertCanvas",value:function(t){for(var e=t.getImageData(0,0,Ja,Ja),n=e.data,r=0;r<4096;r++){var i=4*r;n[i]^=255,n[i+1]^=255,n[i+2]^=255}t.putImageData(e,0,0)}},{key:"loadImage",value:function(t){var e=document.createElement("canvas");e.width=Ja,e.height=Ja;var n=new Image;return n.src=t,n.crossOrigin="anonymous",{canvas:e,image:n,drawn:!1}}},{key:"drawIfNeeded",value:function(t,e){var n=t.image,r=t.canvas;if(!t.drawn&&n.complete){var i=r.getContext("2d");try{i.drawImage(n,0,0,Ja,Ja)}catch(t){Gr.error("Failed to draw image",n.src,t),i.beginPath(),i.strokeStyle="black",i.rect(0,0,Ja,Ja),i.moveTo(0,0),i.lineTo(Ja,Ja),i.moveTo(0,Ja),i.lineTo(Ja,0),i.stroke(),i.closePath()}e&&this.invertCanvas(i),t.drawn=!0}}}],n&&Za(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const ts=Qa;function es(t){return es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},es(t)}function ns(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,os(r.key),r)}}function is(t,e,n){return(e=os(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function os(t){var e=function(t,e){if("object"!=es(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=es(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==es(e)?e:String(e)}var as=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),is(this,"key",void 0),is(this,"rels",void 0),is(this,"waypointPath",void 0),is(this,"selfReferring",void 0),is(this,"fromId",void 0),is(this,"toId",void 0),is(this,"angles",void 0),is(this,"labelInfo",void 0),this.key=e,this.rels=[],this.selfReferring=n===r,this.fromId=n,this.toId=r,this.labelInfo={},this.angles=[]}var e,r;return e=t,r=[{key:"insert",value:function(t){this.rels.push({rel:t})}},{key:"setLabelInfo",value:function(t,e){this.labelInfo[t]=e}},{key:"remove",value:function(t){var e=t.id,n=this.rels,r=n.findIndex((function(t){return t.rel.id===e}));if(-1!==r&&(n.splice(r,1),0===r&&n.length>0)){var i=n[0].rel,o=i.from,a=i.to;this.fromId=o,this.toId=a}}},{key:"size",value:function(){return this.rels.length}},{key:"maxFontSize",value:function(){return Math.max.apply(Math,function(t){if(Array.isArray(t))return ns(t)}(t=this.rels.map((function(t){var e=t.rel;return(0,n.isNumber)(e.captionSize)?e.captionSize:1})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ns(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ns(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var t}},{key:"relIsOppositeDirection",value:function(t){var e=t.from,n=t.to,r=this.fromId,i=this.toId;return e!==r&&n!==i||e===i&&n===r}},{key:"indexOf",value:function(t){var e=t.id;return this.rels.findIndex((function(t){return t.rel.id===e}))}},{key:"getRel",value:function(t){var e=this.rels;return t<0||t>=e.length?null:e[t].rel}},{key:"setWaypoints",value:function(t){this.waypointPath=t}},{key:"setAngles",value:function(t){this.angles=t}}],r&&rs(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ss="#848484",us=2*Math.PI/50,ls=.1*Math.PI,cs=_r;function fs(t){return fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fs(t)}function hs(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ds(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ds(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ds(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ps(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ys(r.key),r)}}function vs(t,e,n){return(e=ys(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ys(t){var e=function(t,e){if("object"!=fs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=fs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fs(e)?e:String(e)}var ms=function(t){var e=[];if(0===t.length)e.push({size:2*Math.PI,start:0});else{for(var n=t.length-1;n>=0;n--){var r=void 0,i=void 0;0===n?(i=t[t.length-1],r=t[n]-t[t.length-1]+2*Math.PI):(i=t[n-1],r=t[n]-t[n-1]),e.push({size:r,start:i})}e.sort((function(t,e){return e.size-t.size}))}return e},gs=function(t,e){for(;e>t.length||t[0].size>2*t[e-1].size;)t.push({size:t[0].size/2,start:t[0].start}),t.push({size:t[0].size/2,start:t[0].start+t[0].size/2}),t.shift(),t.sort((function(t,e){return e.size-t.size}));return t},bs=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vs(this,"bundles",void 0),vs(this,"nodeToBundles",void 0),this.bundles={},this.nodeToBundles={};var r=e.reduce((function(t,e){return t[e.id]=e,t}),{});this.updateData(r,{},n)}var e,n;return e=t,n=[{key:"getBundle",value:function(t){var e=this.bundles,n=this.nodeToBundles,r=this.generatePairId(t.from,t.to),i=e[r];return void 0===i&&(i=new as(r,t.from,t.to),e[r]=i,void 0===n[t.from]&&(n[t.from]=[]),void 0===n[t.to]&&(n[t.to]=[]),n[t.from].push(i),n[t.to].push(i)),i}},{key:"updateData",value:function(t,e,n){for(var r=this.bundles,i=this.nodeToBundles,o=function(t,e){var n=i[e].findIndex((function(e){return e===t}));-1!==n&&i[e].splice(n,1)},a=Object.values(t),s=Object.values(e),u=0,l=a;u<l.length;u++){var c=l[u];this.getBundle(c).insert(c)}for(var f=0,h=s;f<h.length;f++){var d=h[f],p=this.getBundle(d);p.remove(d),0===p.size()&&(delete r[p.key],o(p,d.from),o(p,d.to))}for(var v=0,y=Object.keys(r);v<y.length;v++){var m=r[y[v]];m.setWaypoints(n["".concat(m.fromId,"-").concat(m.toId)])}}},{key:"updatePositions",value:function(t){for(var e=this.nodeToBundles,n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],a=null!==(i=e[o])&&void 0!==i?i:[];if(0!==a.length){var s=a.find((function(t){return t.selfReferring})),u=a.filter((function(t){return!t.selfReferring}));if(void 0!==s){var l,c=[],f=hs(u);try{for(f.s();!(l=f.n()).done;)for(var h=l.value,d=t[h.fromId],p=t[h.toId],v=us*h.size(),y=d.id===o?Math.atan2(p.y-d.y,p.x-d.x):Math.atan2(d.y-p.y,d.x-p.x),m=0;m<h.size();m++)c.push(y+v/2-m*us)}catch(t){f.e(t)}finally{f.f()}var g=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),b=ms(g);gs(b,s.size());var _=b.map((function(t){return t.start+t.size/2})).slice(0,s.size());s.setAngles(_)}}}}},{key:"generatePairId",value:function(t,e){return[t.toString(),e.toString()].sort((function(t,e){return t.localeCompare(e)})).join("-")}}],n&&ps(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _s(t){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(t)}function ws(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ts(r.key),r)}}function Ss(t,e,n){return(e=Ts(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ts(t){var e=function(t,e){if("object"!=_s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=_s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_s(e)?e:String(e)}var Os=function(t,e){return(0,n.isFinite)(t.x)&&(0,n.isFinite)(t.y)&&(0,n.isFinite)(e.x)&&(0,n.isFinite)(e.y)},As=function(t,e){if(void 0===t||void 0===e||!Os(t,e))return!1;var n=e.x-t.x,r=e.y-t.y,i=xr();return n*n+r*r<100*i*i},Es=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ss(this,"p1",void 0),Ss(this,"p2",void 0),Ss(this,"unit",void 0),Ss(this,"norm",void 0),Ss(this,"length",void 0),Ss(this,"vector",void 0),this.p1=e,this.p2=n,this.vector=this.getVector(),this.length=this.getLength(),this.unit=this.getUnitVector(),this.norm=this.getUnitNormalVector()}var e,n;return e=t,n=[{key:"getVector",value:function(){return{x:this.p2.x-this.p1.x,y:this.p2.y-this.p1.y}}},{key:"getLength",value:function(){var t=this.vector,e=t.x,n=t.y;return Math.sqrt(e*e+n*n)}},{key:"getUnitVector",value:function(){var t=this.vector,e=this.length;return{x:t.x/e,y:t.y/e}}},{key:"getUnitNormalVector",value:function(){return{x:this.unit.y,y:-this.unit.x}}}],n&&xs(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ps=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o=function(t,e){var r=(t.x*e.x+t.y*e.y)/(e.x*e.x+e.y*e.y);return(0,n.clamp)(r,0,1)}({x:r.x-t.x,y:r.y-t.y},i),a=t.x+o*i.x,s=t.y+o*i.y,u=a-r.x,l=s-r.y;return Math.sqrt(u*u+l*l)},ks=function(t,e,n,r){if(e.x===n.x&&e.y===n.y)return e;var i=e.y-t.y,o=t.x-e.x,a=i*t.x+o*t.y,s=r.y-n.y,u=n.x-r.x,l=s*n.x+u*n.y,c=i*u-s*o;return 0===c?null:{x:(u*a-o*l)/c,y:(i*l-s*a)/c}},js=function(t,e,n,r){var i,o,a,s=1e9,u=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ws(Object(n),!0).forEach((function(e){Ss(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),l={x:0,y:0};for(o=1;o<10;o++)a=.1*o,l.x=Math.pow(1-a,2)*t.x+2*a*(1-a)*n.x+Math.pow(a,2)*e.x,l.y=Math.pow(1-a,2)*t.y+2*a*(1-a)*n.y+Math.pow(a,2)*e.y,o>0&&(s=(i=Ps(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function Cs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Rs=[[.04,1],[100,2]],Ds=[[.8,1.1],[3,1.6],[8,2.5]],Is=[[Ds[0][0],1],[100,1.25]],Ls=function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba(".concat(n[0],",").concat(n[1],",").concat(n[2],",").concat(e,")")}var r=jo().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},Ms=function(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=r.headPosition,s=r.headAngle,u=r.headHeight,l=r.headChinHeight,c=r.headWidth;t.save(),t.lineWidth=e,t.strokeStyle=n,t.fillStyle=n,t.translate(a.x,a.y),t.rotate(s),function(t,e,n,r){if(t.beginPath(),e.length>0){var i=e[0];t.moveTo(i.x,i.y)}for(var o=1;o<e.length;o++){var a=e[o];t.lineTo(a.x,a.y)}t.closePath(),n&&t.fill(),r&&t.stroke()}(t,[{x:l-u,y:0},{x:-u,y:c/2},{x:0,y:0},{x:-u,y:-c/2}],i,o),t.restore()},Ns=function(t,e,n,r,i){var o=r;i.forEach((function(r){var i=r.width,a=r.color,s=o+i;t.beginPath(),t.fillStyle=a,t.arc(e,n,s,0,2*Math.PI,!1),t.arc(e,n,o,2*Math.PI,0,!0),t.fill(),t.closePath(),o=s}))},Us=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},Fs=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,Us(t,e,n,i),t.fill(),t.closePath()};function zs(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Bs=function(t,e,n,r,i,o,a,s,u){var l,c=r,f=0,h=0,d=null===(l=t.measureText("..."))||void 0===l?void 0:l.width;e.forEach((function(e){var r;t.font="normal ".concat(i,"px ").concat(o);var l,p=-(null===(r=t.measureText(e.text))||void 0===r?void 0:r.width)/2,v=e.text?function(t){if(Array.isArray(t))return Cs(t)}(l=e.text)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||function(t,e){if(t){if("string"==typeof t)return Cs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cs(t,e):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[];e.hasHyphenChar||e.hasEllipsisChar||v.push(" "),v.forEach((function(r){var a,l,v,y,m,g;null!==(a=n[h])&&void 0!==a&&a.includes("italic")&&null!==(l=n[h])&&void 0!==l&&l.includes("bold")?t.font="italic 600 ".concat(i,"px ").concat(o):null!==(v=n[h])&&void 0!==v&&v.includes("italic")?t.font="italic 400 ".concat(i,"px ").concat(o):null!==(y=n[h])&&void 0!==y&&y.includes("bold")?t.font="bold ".concat(i,"px ").concat(o):t.font="normal ".concat(i,"px ").concat(o),null!==(m=n[h])&&void 0!==m&&m.includes("underline")&&t.fillRect(s+p+f,u+c+.2,null===(g=t.measureText(r))||void 0===g?void 0:g.width,.2),e.hasEllipsisChar?t.fillText(r,s+p+f-d/2,u+c):t.fillText(r,s+p+f,u+c),f+=t.measureText(r).width,h+=1})),t.font="normal ".concat(i,"px ").concat(o),e.hasHyphenChar&&t.fillText("-",s+p+f,u+c),e.hasEllipsisChar&&t.fillText("...",s+p+f-d/2,u+c),f=0,c+=a}))},Vs=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Gs=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Ws=function(t,e){return{x:t.x*e,y:t.y*e}},Xs=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Gs(t,e))},Hs=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};function Ys(t){return Ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ys(t)}function $s(t){return function(t){if(Array.isArray(t))return Js(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ks(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qs(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Ys(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ys(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ys(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ks(t,e){if(t){if("string"==typeof t)return Js(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Js(t,e):void 0}}function Js(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Qs=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},tu=function(t){var e=t[t.length-1],n=t[t.length-2];return!(!e||!isNaN(Number(e))||e.toLowerCase()===e.toUpperCase())&&!(!n||!isNaN(Number(n))||n.toLowerCase()===n.toUpperCase())&&Qs(e)&&!Qs(n)},eu=function(t,e,n,r){for(var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],s=[],u=0,l=0,c=!1,f=!1,h=0;h<r;h++)a[h]=n(h,r);for(var d,p=function(){i=t.slice(u,v);var n,h,d=e(i),p=a[l];if(d>p||(h=t[v-1],"\n\r\v".includes(h))){if(!(l<r-1)){if(o)return{v:[]};for(var y=v;d>p;){for(y-=1;n=t[y-1]," \t\n\r\v".includes(n);)y-=1;if(!(y-u>1)){i="",f=!0,c=!1;break}i=t.slice(u,y),d=e(i),f=!0,c=!1}return s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},{v:s}}c=!1,f=!1;var m=function(t){var e=t.length,n=Math.min(e-1,3);if(1===e)return{hyphen:!1,cnt:0};for(var r=0;r<n;r++){var i=t[t.length-(r+1)];if(" "===i||i.toLowerCase()===i.toUpperCase())return{hyphen:!1,cnt:r+1};var o=t.slice(0,t.length-r);if(tu(o))return{hyphen:!1,cnt:r+1}}return{hyphen:!0,cnt:1}}(i),g=v-m.cnt;if(m.hyphen)for(i=t.slice(u,g),d=e(i),c=!0;d>p;){if(!(g-u>1)){i=t[u],g=u+1,d=e(i),c=!1;break}g--,i=t.slice(u,g),d=e(i),c=!0}else i=(i=t.slice(u,g)).trim();s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},u=g,l+=1}},v=1;v<=t.length;v++)if(d=p())return d.v;return i=t.slice(u,t.length),s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:!1},s},nu=function(t,e,n,r,i,o,a,s){t.font="bold ".concat(r,"px ").concat(n).replace(/"/g,"");var u=function(e){var n;return null===(n=t.measureText(e))||void 0===n?void 0:n.width},l=2;a===Ds[1][1]?l=3:a===Ds[2][1]&&(l=4);for(var c=a<Ds[2][1]?["",""]:[""],f=o?c.length:0,h=function(t,e){return function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top",i=.98*n,o=.89*n,a=.95*n;return 1===e?i:2===e?a:3===e&&"top"===r?0===t||2===t?o:i:4===e&&"top"===r?0===t||3===t?.78*n:a:5===e&&"top"===r?0===t||4===t?.65*n:1===t||3===t?o:a:i}(t+f,e+f,i)},d=1,p=[],v=function(){if(0===(p=function(t,e,n,r){var i,o=t.split(/\s/g).filter((function(t){return t.length>0})),a=[],s=null,u=function(t){return e(t)>n(a.length,r)},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ks(t))){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,f=s?"".concat(s," ").concat(c):c;if(e(f)<n(a.length,r))s=f;else{if(null!==s){var h=u(s);a.push({text:s,overflowed:h})}if(s=c,a.length>r)return[]}}}catch(t){l.e(t)}finally{l.f()}if(s){var d=u(s);a.push({text:s,overflowed:d})}return a.length<=r?a:[]}(e,u,h,d)).length)p=eu(e,u,h,d,l>d);else if(p.some((function(t){return t.overflowed}))){var t=d;p=p.reduce((function(e,n){var r=l-e.length;if(0===r){var i=e[e.length-1];return i.text.endsWith("…")||(u(i.text)+u("…")>h(e.length,t)?(e[e.length-1].text=i.text.slice(0,-2),e[e.length-1].hasEllipsisChar=!0):(e[e.length-1].text=i.text,e[e.length-1].hasEllipsisChar=!0)),e}if(n.overflowed){var o=eu(n.text,u,h,r);e=e.concat(o)}else e.push({text:n.text,hasEllipsisChar:!1,hasHyphenChar:!1});return e}),[])}else p=p.map((function(t){return Zs(Zs({},t),{},{hasEllipsisChar:!1,hasHyphenChar:!1})}));d+=1};0===p.length;)v();return Array.from(p)},ru=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e,n){var r=e.value;if(r){var i="".concat(n>0&&t.length?", ":"").concat(r);return[].concat($s(t),[Zs(Zs({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:$s(null!==(o=e.styles)&&void 0!==o?o:[]):$s(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat($s(t),$s(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function iu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ou(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ou(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var au=2*Math.PI,su=Math.PI/2,uu=function(t,e,n,r,i,o){var a={x:(t.x+e.x)/2,y:(t.y+e.y)/2},s={x:t.x,y:t.y},u={x:e.x,y:e.y},l=new Es(u,s),c=function(t,e){var n=0;return t&&(n+=t),e&&(n-=e),n}(r,n);a.x+=c/2*l.unit.x,a.y+=c/2*l.unit.y;var f=o.size()/2-o.indexOf(i);return a.x+=f*l.unit.x,a.y+=f*l.unit.y,a},lu=function(t){var e=xr(),n=t.size,r=t.selected;return((null!=n?n:br)+4+(!0===r?4:0))*e},cu=function(t,e){var n=xr();t.shadowColor=e.color,t.shadowBlur=e.width*n,t.shadowOffsetX=0,t.shadowOffsetY=0},fu=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},hu=function(t,e,n,r,i){var o,a,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.norm.x,r=t.norm.y;return e?{x:-n,y:-r}:t.norm},l=xr(),c=e.indexOf(t),f=(e.size()-1)/2,h=c>f,d=Math.abs(c-f),p=i?17*e.maxFontSize():8,v=(e.size()-1)*p*l,y=function(t,e,n,r,i,o,a){var s,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=xr(),c=t.size(),f=c>1,h=t.relIsOppositeDirection(o),d=h?n:e,p=h?e:n,v=t.waypointPath,y=null==v?void 0:v.points,m=null==v?void 0:v.from,g=null==v?void 0:v.to,b=As(d,m)&&As(p,g)||As(p,m)&&As(d,g),_=b?y[1]:null,w=b?y[y.length-2]:null,x=lu(d),S=lu(p),T=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},O=Math.max(Math.PI,au/(c/2)),A=f?r*O*(a?1:-1)/(null!==(s=d.size)&&void 0!==s?s:br):0,E=T(b?_:p,d),P=b?T(p,w):E,k=function(t,e,n,r){return{x:t.x+Math.cos(e)*n*(r?-1:1),y:t.y+Math.sin(e)*n*(r?-1:1)}},j=function(t,e){return k(d,E+t,e,!1)},C=function(t,e){return k(p,P-t,e,!0)},R=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},D=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))*l},I=j(A,x),L=C(A,S),M=f?j(0,x):null,N=f?C(0,S):null,U=200*l,F=[];if(b){var z=D(I,_)<U;if(f&&!z){var B=R(M,_);F.push(new Es(I,B)),F.push(new Es(B,_))}else F.push(new Es(I,_));for(var V=2;V<y.length-1;V++)F.push(new Es(y[V-1],y[V]));var G=D(L,w)<U;if(f&&!G){var W=R(N,w);F.push(new Es(w,W)),F.push(new Es(W,L))}else F.push(new Es(w,L))}else{var X=f?D(M,N):0;if(f&&X>2*(30*l+Math.min(x,S)))if(u){var H=uu(d,p,x,S,o,t);F.push(new Es(I,H)),F.push(new Es(H,L))}else{var Y=r*i,$=30+x,q=Math.sqrt($*$+Y*Y),Z=30+S,K=Math.sqrt(Z*Z+Y*Y),J=j(0,q),Q=C(0,K);F.push(new Es(I,J)),F.push(new Es(J,Q)),F.push(new Es(Q,L))}else if(X>(x+S)/2){var tt=uu(d,p,x,S,o,t);F.push(new Es(I,tt)),F.push(new Es(tt,L))}else F.push(new Es(I,L))}return F}(e,n,r,d,p,t,h,s),m=[],g=y[0],b=u(g,h);m.push({x:g.p1.x+b.x,y:g.p1.y+b.y});for(var _=1;_<y.length;_++)if(1===e.size())m.push(y[_-1].p2);else{var w=y[_-1],x=y[_],S=u(w,h),T=u(x,h),O=Vs(w.p1,Ws(S,v/2)),A=Vs(w.p2,Ws(S,v/2)),E=Vs(x.p1,Ws(T,v/2)),P=Vs(x.p2,Ws(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=ks(O,A,E,P));var j=null!==k?Gs(k,w.p2):Ws(S,v/2);m.push(Vs(w.p2,Ws(j,d/f)))}var C=y[y.length-1],R=u(C,h);return m.push({x:C.p2.x+R.x,y:C.p2.y+R.y}),e.relIsOppositeDirection(t)?m.reverse():m},du=function(t,e,n,r,i,o){var a,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=xr(),l=i.selected,c=i.captions,f=void 0===c?[]:c,h=i.caption,d=void 0===h?"":h,p=i.width,v=i.disabled,y=i.captionAlign,m=void 0===y?"top":y,g=i.captionSize,b=void 0===g?1:g,_=f.length>0?null===(a=ru(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==_){var w=!0===v?"#DDDDDD":"#848484",x=6*b*u,S=!0===l?"bold":"normal",T=_;t.fillStyle=w,t.font="".concat(S," ").concat(x,"px ").concat('"Open Sans", sans-serif');var O=function(e){return t.measureText(e).width},A=(null!=p?p:1)*(!0===l?1.5:1),E=O(T);if(E>r){var P=eu(T,O,(function(){return r}),1,!1)[0];T=!0===P.hasEllipsisChar?"".concat(P.text,"..."):T,E=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-su),t.translate(2*x,0),t.rotate(-su)):t.rotate(n);var k=(1+b)*u,j="bottom"===m?x/2+A+k:-(A+k);t.fillText(T,-E/2,j),t.restore();var C=2*j*Math.sin(n),R=2*j*Math.cos(n),D={position:{x:e.x-C,y:e.y+R},rotation:s?n-Math.PI:n,width:r/u,height:(x+k)/u};o.setLabelInfo(i.id,D)}},pu=function(t,e,n,r,i){if(t.beginPath(),t.moveTo(e[0].x,e[0].y),i&&e.length>2){for(var o=1;o<e.length-2;){var a=(e[o].x+e[o+1].x)/2,s=(e[o].y+e[o+1].y)/2;t.quadraticCurveTo(e[o].x,e[o].y,a,s),o+=1}t.quadraticCurveTo(e[o].x,e[o].y,e[o+1].x,e[o+1].y)}else for(var u=1;u<e.length;u++)t.lineTo(e[u].x,e[u].y);t.lineWidth=n,t.strokeStyle=r,t.lineCap="round",t.stroke()},vu=function(t){return t.rings[0].width*xr()*1.5},yu=function(t){return 6*t*xr()},mu=function(t,e,n){var r,i;return{widthAlign:e/2*(null!==(r=t[0])&&void 0!==r?r:0),heightAlign:n/2*(null!==(i=t[1])&&void 0!==i?i:0)}},gu=function(t,e,n){var r=Math.cos(n),i=Math.sin(n);return{xRotated:t*r+e*i,yRotated:t*i-e*r}},bu=function(t,e,n){var r,i,o=n.indexOf(t),a=null!==(r=n.angles[o])&&void 0!==r?r:0,s=a-ls/2,u=a+ls/2,l=null!==(i=t.width)&&void 0!==i?i:1,c=xr(),f=lu(e),h={x:e.x+Math.cos(s)*(f+l/2),y:e.y+Math.sin(s)*(f+l/2)},d={x:e.x+Math.cos(u)*(f+l/2),y:e.y+Math.sin(u)*(f+l/2)},p={x:e.x+Math.cos(a)*(f+35*c),y:e.y+Math.sin(a)*(f+35*c)};return{startAngle:s,endAngle:u,startPoint:h,endPoint:d,apexPoint:p,control1Point:{x:p.x+25*Math.cos(a-su)*c/2,y:p.y+25*Math.sin(a-su)*c/2},control2Point:{x:p.x+25*Math.cos(a+su)*c/2,y:p.y+25*Math.sin(a+su)*c/2}}},_u=function(t,e,n,r,i,o){t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(i.x,i.y,r.x,r.y),t.quadraticCurveTo(o.x,o.y,n.x,n.y),t.stroke()},wu=function(t,e,n,r,i,o,a,s){var u=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];Os(n,r)&&(n.id===r.id?function(t,e,n,r,i,o,a){var s=e.overlayIcon,u=e.selected,l=e.width,c=e.hovered,f=e.disabled,h=e.color,d=bu(e,n,r),p=d.startPoint,v=d.endPoint,y=d.apexPoint,m=d.control1Point,g=d.control2Point,b=a.rings,_=a.shadow,w=xr(),x=b[0].color,S=b[1].color,T=b[0].width*w,O=b[1].width*w,A=40*w,E=(null!=l?l:1)*w,P=E>1?E/2:1,k=9*P,j=2*P,C=7*P,R=!0===u,D=!0===f,I=Math.atan2(v.y-g.y,v.x-g.x),L=!0===u?T*Math.sqrt(1+2*k/C*(2*k/C)):0,M={x:v.x-Math.cos(I)*(.5*k-j+L),y:v.y-Math.sin(I)*(.5*k-j+L)},N={headPosition:{x:v.x+Math.cos(I)*(.5*k-j-L),y:v.y+Math.sin(I)*(.5*k-j-L)},headAngle:I,headHeight:k,headChinHeight:j,headWidth:C};if(t.save(),t.lineCap="round",R&&(cu(t,_),t.lineWidth=E+O,t.strokeStyle=S,_u(t,p,M,y,m,g),Ms(t,O,S,N,!1,!0),fu(t),t.lineWidth=E+T,t.strokeStyle=x,_u(t,p,M,y,m,g),Ms(t,T,x,N,!1,!0)),t.lineWidth=E,!0===c&&!R&&!D){var U=_.color;cu(t,_),t.strokeStyle=U,t.fillStyle=U,_u(t,p,M,y,m,g),Ms(t,E,U,N),fu(t)}var F=D?cs:null!=h?h:ss;if(t.fillStyle=F,t.strokeStyle=F,_u(t,p,M,y,m,g),Ms(t,E,F,N),o||s){var z,B=r.indexOf(e),V=null!==(z=r.angles[B])&&void 0!==z?z:0,G=y.x-Math.cos(I)*(L/4),W=y.y-Math.sin(I)*(L/4),X=(V+au)%au<Math.PI;if(o&&du(t,{x:G,y:W},(V+su)%au,A,e,r,X),s){var H=s.position,Y=void 0===H?[0,0]:H,$=s.url,q=s.size,Z=yu(void 0===q?1:q),K=mu(Y,A,Z),J=K.widthAlign,Q=K.heightAlign+(R?vu(a):0)*(Y[1]<0?-1:1),tt=gu(Q,J*(X?-1:1),V),et=Z/2,nt=G-et-tt.xRotated,rt=W-et-tt.yRotated;t.drawImage(i.getImage($),nt,rt,Z,Z)}}t.restore()}(t,e,n,i,o,a,s):function(t,e,n,r,i,o,a,s,u){var l=e.overlayIcon,c=e.color,f=e.disabled,h=e.selected,d=e.width,p=e.hovered,v=e.captionAlign,y=!0===h,m=!0===f,g=u.rings,b=u.shadow,_=hu(e,i,n,r,a,s),w=xr(),x=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*xr()}(e),S=m?cs:null!=c?c:ss,T=g[0].width*w,O=g[1].width*w,A=w*(d>1?d/2:1),E=9*A,P=2*A,k=7*A,j=Xs(_[_.length-2],_[_.length-1]),C=2*E,R=y?T*Math.sqrt(1+C/k*(C/k)):0,D=2-R,I=Math.floor(_.length/2);_.length>2&&y&&j<E+R-P&&(D+=j,R-=j/2+P,_.pop(),I=Math.floor(_.length/2));var L,M,N=_[_.length-2],U=_[_.length-1],F=(L=N,M=U,Math.atan2(M.y-L.y,M.x-L.x)),z=E/2+R,B=Math.cos(F),V=Math.sin(F);_[_.length-1]={x:U.x-B*z,y:U.y-V*z};var G,W={headPosition:{x:U.x+B*D,y:U.y+V*D},headAngle:F,headHeight:E,headChinHeight:P,headWidth:k},X=iu(_);try{for(X.s();!(G=X.n()).done;){var H=G.value;H.x=Math.round(H.x),H.y=Math.round(H.y)}}catch(t){X.e(t)}finally{X.f()}if(t.save(),y){var Y=g[0].color,$=g[1].color,q=Math.atan2(_[1].y-_[0].y,_[1].x-_[0].x),Z=Hs(q,vu(u));_[0]=Vs(_[0],Z),cu(t,b),pu(t,_,x+O,$,s),Ms(t,O,$,W,!1,!0),fu(t),pu(t,_,x+T,Y,s),Ms(t,T,Y,W,!1,!0)}if(!0===p&&!y&&!m){var K=b.color;cu(t,b),pu(t,_,x,K,s),Ms(t,x,K,W),fu(t)}if(pu(t,_,x,S,s),Ms(t,x,S,W),a||l){var J,Q,tt,et,nt,rt=n.x>r.x,it=_[I];1==(1&_.length)?(J=_[rt?I+1:I-1],Q=_[rt?I-1:I+1],s?(tt=(it.x+(J.x+Q.x)/2)/2,et=(it.y+(J.y+Q.y)/2)/2,nt=rt?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Xs(it,J)>Xs(it,Q)?Q=it:J=it,tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x))):(J=_[rt?I:I-1],Q=_[rt?I-1:I],tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x));var ot=y?Hs(nt+su,vu(u)):{x:0,y:0},at=Xs(J,Q);if(a){var st="bottom"===v?1:-1,ut={x:tt+ot.x*st,y:et+ot.y*st};du(t,ut,nt,at,e,i)}if(l){var lt=l.position,ct=void 0===lt?[0,0]:lt,ft=l.url,ht=l.size,dt=yu(void 0===ht?1:ht),pt=mu(ct,at,dt),vt=pt.widthAlign,yt=pt.heightAlign,mt=gu(yt,vt,nt+su),gt=mt.xRotated,bt=mt.yRotated,_t=ct[1]<0?-1:1,wt=dt/2,xt=tt-wt+gt+ot.x*_t,St=et-wt+bt+ot.y*_t;t.drawImage(o.getImage(ft),xt,St,dt,dt)}}t.restore()}(t,e,n,r,i,o,a,u,s))},xu=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Os(n,r)?n.id===r.id?function(t,e,n){for(var r=bu(t,e,n),i={left:1/0,top:1/0,right:-1/0,bottom:-1/0},o=["startPoint","endPoint","apexPoint","control1Point","control2Point"],a=0;a<o.length;a++){var s=r[o[a]],u=s.x,l=s.y;u<i.left&&(i.left=u),u>i.right&&(i.right=u),l<i.top&&(i.top=l),l>i.bottom&&(i.bottom=l)}return i}(t,n,e):function(t,e,n,r,i,o){var a,s={left:1/0,top:1/0,right:-1/0,bottom:-1/0},u=iu(hu(t,e,n,r,i,o));try{for(u.s();!(a=u.n()).done;){var l=a.value,c=l.x,f=l.y;c<s.left&&(s.left=c),c>s.right&&(s.right=c),f<s.top&&(s.top=f),f>s.bottom&&(s.bottom=f)}}catch(t){u.e(t)}finally{u.f()}return s}(t,e,n,r,i,o):null},Su=i(4),Tu=i.n(Su),Ou=function(t){return t&&"light"===Tu()(t)?"#000":"#fff"};function Au(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Eu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eu(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Pu=function(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.size,a=void 0===o?br:o;return{top:i-a,left:n-a,right:n+a,bottom:i+a}},ku=function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=e.x,s=void 0===a?0:a,u=e.y,l=void 0===u?0:u,c=e.size,f=void 0===c?br:c,h=e.caption,d=void 0===h?"":h,p=e.captions,v=void 0===p?[]:p,y=e.captionAlign,m=void 0===y?"center":y,g=e.captionSize,b=void 0===g?1:g,_=e.disabled,w=e.activated,x=e.selected,S=e.hovered,T=e.id,O=e.icon,A=e.overlayIcon,E=i.selected,P=xr(),k=function(t,e,n){var r=t.selected?n.selected.rings:n.default.rings;if(!r.length){var i=e.getById(t.id);return void 0!==i&&Object.entries(i).forEach((function(t){var e=Au(t,2),n=e[0],r=e[1];n.startsWith("ring-")&&r.setEndValue(0)})),[{width:0,color:""}]}return r.map((function(n,r){var i=n.widthFactor,o=n.color,a=(t.size||br)*i*xr();return{width:e.getValueForAnimationName(t.id,"ring-".concat(r),a),color:o}}))}(e,r,i),j=k.reduce((function(t,e){return t+e.width}),0),C=E.shadow.width*P,R=E.shadow.opacity,D=E.shadow.color,I=f*P,L=2*I,M=function(t,e){if(!t||!e)return{nodeInfoLevel:0,fontInfoLevel:1.25,iconInfoLevel:1};var n=xr(),r=1600*n*(1200*n),i=Math.pow(t,2)*Math.PI*Math.pow(e,2)/(r/100);return{nodeInfoLevel:zs(i,Rs),fontInfoLevel:zs(i,Ds),iconInfoLevel:zs(i,Is)}}(I,o),N=M.nodeInfoLevel,U=M.fontInfoLevel,F=M.iconInfoLevel,z=e.color||"#478BFF",B=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:br)/({1:3.5,2:2.75,3:2}[arguments.length>2&&void 0!==arguments[2]?arguments[2]:1]+(arguments.length>3&&void 0!==arguments[3]&&arguments[3]?1:0))/t}(U,I,b,Boolean(O)),V=Ou(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(O),$=Boolean(A);if(j>0&&(G=I+j),_)z="#EDEDED",V="#DDDDDD";else{if(w){var q=Date.now()%1e3/1e3,Z=q<.7?q/.7:0,K=Ls(z,.4-.4*Z);Fs(t,s,l,K,I+.88*I*Z)}var J=x||S?C:0,Q=r.getValueForAnimationName(T,"shadowWidth",J);Q>0&&function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=i+o,u=t.createRadialGradient(e,n,i,e,n,s);u.addColorStop(0,"transparent"),u.addColorStop(.01,Ls(r,.5*a)),u.addColorStop(.05,Ls(r,.5*a)),u.addColorStop(.5,Ls(r,.12*a)),u.addColorStop(.75,Ls(r,.03*a)),u.addColorStop(1,Ls(r,0)),t.fillStyle=u,Us(t,e,n,s),t.fill()}(t,s,l,D,G,Q,R)}if(Fs(t,s,l,z,I),j>0&&Ns(t,s,l,W,k),Y){var tt=N<2||!(X||H),et=N>0?1:0,nt=tt?1*I:.75*I;nt/=F;var rt=tt?.5*nt:nt*(1===F?"center"===m?1.3:"bottom"===m||tt?1.1:0:"center"===m?1.35:"bottom"===m||tt?1.1:0),it=nt/2;nt=r.getValueForAnimationName(T,"iconSize",nt),it=r.getValueForAnimationName(T,"iconXPos",it),rt=r.getValueForAnimationName(T,"iconYPos",rt),t.save();var ot=!0===_?.1:et;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",ot);var at="#fff"===V,st=n.getImage(O,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=L*(null!==(ut=A.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=A.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=A.position)||void 0===ht?void 0:ht[0])&&void 0!==ft?ft:0);t.save();var yt=!0===_?.1:1;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",yt);var mt=n.getImage(A.url);t.drawImage(mt,s-vt,l-pt,dt,dt),t.restore()}var gt=N<2?0:1,bt=r.getValueForAnimationName(T,"textOpacity",gt,0),_t=Ls(V,bt),wt='"Open Sans", sans-serif';if(X&&bt>0){var xt=nu(t,d,wt,B,.7*L,Y,U,null==e||e.captionAlign);t.fillStyle=_t,t.font="normal ".concat(B,"px ").concat(wt);var St=1+B,Tt=-(xt.length-2)*St/2,Ot=d.split("").map((function(t){return[]}));Bs(t,xt,Ot,Tt,B,wt,St,s,l)}if(H){var At=N<2?0:1,Et=r.getValueForAnimationName(T,"textOpacity",At,0),Pt=Ls(V,Et),kt='"Open Sans", sans-serif',jt=Boolean(O);if(Et>0){var Ct=ru(v),Rt=Ct.stylesPerChar,Dt=Ct.fullCaption,It="center"===m?.7*L:2*Math.sqrt(Math.pow(L/2,2)-Math.pow(L/3,2)),Lt=nu(t,Dt,kt,B,It,jt,U,null==e||e.captionAlign);t.fillStyle=Pt;var Mt,Nt=B,Ut=-(Lt.length-2)*Nt/2;Mt=m&&"center"!==m?"bottom"===m?Ut+I/Math.PI:Ut-I/Math.PI:Ut,Bs(t,Lt,Rt,Mt,B,kt,Nt,s,l)}}t.save(),t.restore()};function ju(t){return ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(t)}function Cu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ru(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cu(Object(n),!0).forEach((function(e){Mu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Du(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Iu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Iu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nu(r.key),r)}}function Mu(t,e,n){return(e=Nu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nu(t){var e=function(t,e){if("object"!=ju(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ju(e)?e:String(e)}var Uu="canvasRenderer",Fu=function(){function t(e,n,r){var i=this,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).relationshipThreshold,a=void 0===o?2.5:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mu(this,"arrowBundler",void 0),Mu(this,"activeNodes",void 0),Mu(this,"canvas",void 0),Mu(this,"context",void 0),Mu(this,"state",void 0),Mu(this,"stateDisposers",void 0),Mu(this,"relationshipThreshold",void 0),Mu(this,"animationHandler",void 0),Mu(this,"imageCache",void 0),Mu(this,"needsRun",void 0),Mu(this,"nodeVersion",void 0),Mu(this,"relVersion",void 0),Mu(this,"waypointVersion",void 0),this.activeNodes=new Set,this.canvas=e,this.context=n,this.state=r,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){void 0!==r.zoom&&(i.needsRun=!0),void 0!==r.panX&&(i.needsRun=!0),void 0!==r.panY&&(i.needsRun=!0),void 0!==r.nodes.version&&(i.needsRun=!0),void 0!==r.rels.version&&(i.needsRun=!0),r.waypoints.counter>0&&(i.needsRun=!0),void 0!==r.layout&&(i.needsRun=!0)}))),r.nodes.addChannel(Uu),r.rels.addChannel(Uu),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new $a,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new bs(r.rels.items,r.waypoints.data),this.imageCache=new ts,this.needsRun=!0}var e,n;return e=t,n=[{key:"needsToRun",value:function(){return this.needsRun||this.animationHandler.needsToRun()||this.activeNodes.size>0}},{key:"processUpdates",value:function(){var t=this.state,e=!1,n=t.nodes.channels[Uu],r=t.rels.channels[Uu],i=n.adds,o=n.removes,a=r.adds,s=r.removes;this.nodeVersion<t.nodes.version&&(Object.keys(i).length>0||Object.keys(o).length,this.handleChannelUpdate(n,t.nodes,!0),this.nodeVersion=t.nodes.version,t.nodes.clearChannel(Uu)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(Uu),this.relVersion=t.rels.version),(e||this.waypointVersion<t.waypoints.counter)&&(this.arrowBundler.updateData(a,s,t.waypoints.data),this.waypointVersion=t.waypoints.counter)}},{key:"render",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state,o=this.animationHandler,a=this.arrowBundler,s=i.zoom,u=i.layout,l=i.nodes.idToPosition,c=null!==(e=r.canvas)&&void 0!==e?e:this.canvas,f=null!==(n=r.context)&&void 0!==n?n:this.context,h=xr(),d=c.clientWidth*h,p=c.clientHeight*h;f.save(),void 0!==r.backgroundColor?(f.fillStyle=r.backgroundColor,f.fillRect(0,0,d,p)):f.clearRect(0,0,d,p),this.zoomAndPan(f,c),o.ignoreAnimations(Boolean(r.ignoreAnimations)),!0!==r.ignoreAnimations&&o.advance(),a.updatePositions(l);var v=this.getRelationshipsToRender(r.showCaptions,d,p);this.renderRelationships(v,f,u!==ua);var y=this.getNodesToRender(t,d,p);this.renderNodes(y,f,s),f.restore(),this.needsRun=!1}},{key:"getRelationshipsToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.arrowBundler,u=this.state,l=this.relationshipThreshold,c=u.layout,f=u.zoom,h=u.rels,d=u.nodes,p=d.idToItem,v=d.idToPosition,y=Du(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=Ru(Ru({},p[m.from]),v[m.from]),_=Ru(Ru({},p[m.to]),v[m.to]),w=t||f>l||void 0!==m.captionHtml,x=xu(m,g,b,_,w,c!==ua);if(null!==x){var S,T,O,A,E,P,k=this.isBoundingBoxOffScreen(x,e,n),j=Xs({x:null!==(S=b.x)&&void 0!==S?S:0,y:null!==(T=b.y)&&void 0!==T?T:0},{x:null!==(O=_.x)&&void 0!==O?O:0,y:null!==(A=_.y)&&void 0!==A?A:0}),C=((null!==(E=b.size)&&void 0!==E?E:br)+(null!==(P=_.size)&&void 0!==P?P:br))*devicePixelRatio,R=b.id!==_.id&&C>j;k||R||(!0===m.disabled?o.push(Ru(Ru({},m),{},{fromNode:b,toNode:_,showLabel:w})):!0===m.selected?i.push(Ru(Ru({},m),{},{fromNode:b,toNode:_,showLabel:w})):a.push(Ru(Ru({},m),{},{fromNode:b,toNode:_,showLabel:w})))}}}catch(t){y.e(t)}finally{y.f()}return[].concat(o,a,i)}},{key:"getNodesToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.state.nodes.idToItem,u=Du(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=Pu(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(Ru({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(Ru({},f)):a.push(Ru({},f)))}}catch(t){u.e(t)}finally{u.f()}return[].concat(i,a,o)}},{key:"renderNodes",value:function(t,e,n){var r,i=this.imageCache,o=this.animationHandler,a=this.state,s=a.nodes.idToItem,u=a.nodeBorderStyles,l=Du(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;ku(e,Ru(Ru({},s[c.id]),c),i,o,u,n)}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderRelationships",value:function(t,e,n){var r,i=this.state.relationshipBorderStyles.selected,o=this.arrowBundler,a=this.imageCache,s=Du(t);try{for(s.s();!(r=s.n()).done;){var u=r.value,l=o.getBundle(u),c=u.fromNode,f=u.toNode,h=u.showLabel;wu(e,u,c,f,l,a,h,i,n)}}catch(t){s.e(t)}finally{s.f()}}},{key:"getNodesAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=this.state.nodes,o=i.items,a=i.idToPosition,s=xr(),u=Du(o);try{var l=function(){var i=e.value,o=i.id,u=i.size,l=void 0===u?br:u,c=a[o],f=c.x,h=c.y,d=Math.sqrt(Math.pow(t.x-f,2)+Math.pow(t.y-h,2));if(d<=(l+n)*s){var p=r.findIndex((function(t){return t.distance>d}));r.splice(-1!==p?p:r.length,0,{data:i,targetCoordinates:{x:f,y:h},pointerCoordinates:t,distanceVector:{x:t.x-f,y:t.y-h},insideNode:d<=l*s,distance:d})}};for(u.s();!(e=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return r}},{key:"getRelsAt",value:function(t){var e,n=[],r=this.state,i=this.arrowBundler,o=this.relationshipThreshold,a=r.zoom,s=r.rels.items,u=r.nodes.idToPosition,l=r.layout,c=a>o,f=Du(s);try{var h=function(){var r=e.value,o=i.getBundle(r),a=u[r.from],s=u[r.to];if(void 0!==a&&void 0!==s&&-1!==o.indexOf(r)){var f=function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(!Os(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=bu(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=js(o,s,u,t),f=js(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=hu(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=js(s[0],s[2],s[1],t);else for(var l=1;l<s.length;l++){var c=s[l-1],f=s[l],h=Ps(c,f,t);u=h<u?h:u}return u}(t,e,i,n,r,o,a);return s}(t,r,a,s,o,c,l!==ua);if(f<10){var h=n.findIndex((function(t){return t.distance>f}));n.splice(-1!==h?h:n.length,0,{data:r,fromTargetCoordinates:a,toTargetCoordinates:s,pointerCoordinates:t,distance:f})}}};for(f.s();!(e=f.n()).done;)h()}catch(t){f.e(t)}finally{f.f()}return n}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Uu),this.state.rels.removeChannel(Uu)}},{key:"isBoundingBoxOffScreen",value:function(t,e,n){var r=this.state,i=r.zoom,o=e/i,a=n/i,s=r.panX-o/2,u=r.panY-a/2,l=t.right<s,c=t.bottom<u,f=t.left>s+o,h=t.top>u+a;return l||f||c||h}},{key:"handleChannelUpdate",value:function(t,e,n){for(var r=Object.keys(t.adds),i=0;i<r.length;i++){var o=r[i];t.adds[o].activated&&this.activeNodes.add(o)}for(var a=Object.keys(t.removes),s=0;s<a.length;s++){var u=a[s];this.activeNodes.delete(u)}if(n)for(var l=Object.keys(t.updates),c=0;c<l.length;c++){var f=l[c];e.idToItem[f].activated?this.activeNodes.add(f):this.activeNodes.delete(f)}}},{key:"zoomAndPan",value:function(t,e){var n=e.width,r=e.height,i=this.state,o=i.zoom,a=i.panX,s=i.panY;t.translate(-n/2*o,-r/2*o),t.translate(-a*o,-s*o),t.scale(o,o),t.translate(n/2/o,r/2/o),t.translate(n/2,r/2)}}],n&&Lu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),zu=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=function(t,e){if((0,n.isNil)(t)||(0,n.isNil)(e))return{offsetX:0,offsetY:0};var r=e.getBoundingClientRect(),i=window.devicePixelRatio||1;return{offsetX:i*(t.clientX-r.left-.5*r.width),offsetY:i*(t.clientY-r.top-.5*r.height)}}(t,e);return{x:i+a.offsetX/r,y:o+a.offsetY/r}};function Bu(t){return Bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(t)}function Vu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hu(r.key),r)}}function Wu(t,e,n){return e&&Gu(t.prototype,e),n&&Gu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xu(t,e,n){return(e=Hu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hu(t){var e=function(t,e){if("object"!=Bu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Bu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bu(e)?e:String(e)}var Yu="WebGLRenderer",$u=function(){function t(e){var n=this;if(Vu(this,t),Xu(this,"mainSceneRenderer",void 0),Xu(this,"minimapRenderer",void 0),Xu(this,"needsRun",void 0),Xu(this,"minimapMouseDown",void 0),Xu(this,"stateDisposers",void 0),Xu(this,"state",void 0),void 0===e.state)throw new Error("Renderer missing options: state - state object");var r=e.state,i=e.mainSceneRenderer,o=e.minimapRenderer,a=r.nodes,s=r.rels;this.mainSceneRenderer=i,this.minimapRenderer=o,this.needsRun=!1,this.minimapMouseDown=!1,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){n.updateMainViewport(r.zoom,r.panX,r.panY)}))),this.stateDisposers.push(r.autorun((function(){n.updateMinimapViewport(r.minimapZoom,r.minimapPanX,r.minimapPanY)}))),this.stateDisposers.push(r.autorun((function(){void 0!==r.nodes.version&&(n.needsRun=!0),void 0!==r.rels.version&&(n.needsRun=!0)}))),a.addChannel(Yu),s.addChannel(Yu),this.state=r,this.setupMinimapInteractions()}return Wu(t,[{key:"needsToRun",value:function(){return this.needsRun||Object.keys(this.mainSceneRenderer.activeNodes).length>0}},{key:"renderMainScene",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.mainSceneRenderer.render(t,n,r),this.needsRun=!1}},{key:"renderMinimap",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.minimapRenderer.render(t,n,r),this.minimapRenderer.renderViewbox(),this.needsRun=!1}},{key:"checkForUpdates",value:function(t,e){var n=Object.values(t.channels[Yu].adds).length>0,r=Object.values(e.channels[Yu].adds).length>0,i=Object.values(t.channels[Yu].removes).length>0,o=Object.values(e.channels[Yu].removes).length>0,a=Object.values(t.channels[Yu].updates),s=Object.values(e.channels[Yu].updates);n||r||i||o?(this.mainSceneRenderer.setData({nodes:t.items,rels:e.items}),this.minimapRenderer.setData({nodes:t.items,rels:e.items})):(a.length>0&&(this.mainSceneRenderer.updateNodes(a),this.minimapRenderer.updateNodes(a)),s.length>0&&(this.mainSceneRenderer.updateRelationships(e.items),this.minimapRenderer.updateRelationships(e.items))),t.clearChannel(Yu),e.clearChannel(Yu)}},{key:"onResize",value:function(){var t=this.state,e=t.zoom,n=t.panX,r=t.panY,i=t.minimapZoom,o=t.minimapPanX,a=t.minimapPanY;this.updateMainViewport(e,n,r),this.updateMinimapViewport(i,o,a)}},{key:"updateMainViewport",value:function(t,e,n){this.mainSceneRenderer.updateViewport(t,e,n);var r=this.mainSceneRenderer.canvas.clientWidth,i=this.mainSceneRenderer.canvas.clientHeight;this.minimapRenderer.updateViewportBox(t,e,n,r,i),this.needsRun=!0}},{key:"updateMinimapViewport",value:function(t,e,n){this.minimapRenderer.updateViewport(t,e,n),this.needsRun=!0}},{key:"handleMinimapDrag",value:function(t){var e=this.state,n=this.minimapRenderer,r=zu(t,n.canvas,e.minimapZoom,e.minimapPanX,e.minimapPanY),i=r.x,o=r.y;e.setPan(i,o)}},{key:"handleMinimapWheel",value:function(t){var e=this.state,r=this.mainSceneRenderer;e.setZoom(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,n.isNil)(t)||isNaN(t.deltaY)?e:e-t.deltaY/500*Math.min(1,e)}(t,e.zoom),r.canvas),t.preventDefault()}},{key:"setupMinimapInteractions",value:function(){var t=this,e=this.minimapRenderer.canvas;e.addEventListener("mousedown",(function(e){t.handleMinimapDrag(e),t.minimapMouseDown=!0})),e.addEventListener("mousemove",(function(e){t.minimapMouseDown&&t.handleMinimapDrag(e)})),e.addEventListener("mouseup",(function(){t.minimapMouseDown=!1})),e.addEventListener("mouseleave",(function(){t.minimapMouseDown=!1})),e.addEventListener("wheel",(function(e){t.handleMinimapWheel(e)}))}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Yu),this.state.rels.removeChannel(Yu),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),qu=function(){function t(){Vu(this,t),Xu(this,"mainSceneRenderer",void 0),Xu(this,"minimapRenderer",void 0),Xu(this,"needsRun",void 0),Xu(this,"minimapMouseDown",void 0),Xu(this,"stateDisposers",void 0),Xu(this,"state",void 0)}return Wu(t,[{key:"renderMainScene",value:function(t){}},{key:"renderMinimap",value:function(t){}},{key:"checkForUpdates",value:function(t,e){}},{key:"onResize",value:function(){}},{key:"updateMainViewport",value:function(t,e,n){}},{key:"updateMinimapViewport",value:function(t,e,n){}},{key:"handleMinimapDrag",value:function(t){}},{key:"handleMinimapWheel",value:function(t){}},{key:"setupMinimapInteractions",value:function(){}},{key:"destroy",value:function(){}},{key:"needsToRun",value:function(){return!1}}]),t}();function Zu(t){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(t)}function Ku(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ju(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ju(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ju(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,el(r.key),r)}}function tl(t,e,n){return(e=el(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function el(t){var e=function(t,e){if("object"!=Zu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zu(e)?e:String(e)}var nl,rl=24,il=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=jo().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},ol=function(){function t(e,n,r,i){var o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),tl(this,"nodeShader",void 0),tl(this,"nodeAnimShader",void 0),tl(this,"relShader",void 0),tl(this,"relDataBuffer",void 0),tl(this,"viewportBoxShader",void 0),tl(this,"defaultRelColor",void 0),tl(this,"defaultNodeColor",void 0),tl(this,"disableRelColor",void 0),tl(this,"disableNodeColor",void 0),tl(this,"gl",void 0),tl(this,"activeNodes",void 0),tl(this,"canvas",void 0),tl(this,"projection",void 0),tl(this,"idToIndex",void 0),tl(this,"posBuffer",void 0),tl(this,"numRels",void 0),tl(this,"numNodes",void 0),tl(this,"nodeDataByte",void 0),tl(this,"relIdToIndex",void 0),tl(this,"relData",void 0),tl(this,"viewportBoxBuffer",void 0),tl(this,"relBuffer",void 0),tl(this,"nodeBuffer",void 0),tl(this,"posTexture",void 0),void 0===(null!==(o=e.getExtension("OES_texture_float"))&&void 0!==o?o:void 0))throw new Error("Renderer needs floating point texture support");this.nodeShader=new Pi(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp float u_drawDefaultBorder;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}","uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float ringSize = 0.43;\nmediump float ringSize2 = 0.47;\nmediump float shadowSize = 0.51;\nlowp vec3 shadowColor = vec3(0.73);\nlowp vec3 lineColor = vec3(1.0);\n\nlowp float getShadowAlpha(lowp float size, lowp float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nlowp float getCircleAlpha(lowp float ringSize, lowp float nodeSize, lowp float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float nodeSize = 1.0 / varNodeSize;\n lowp float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n lowp float ringAlpha = getCircleAlpha(ringSize, nodeSize, dist);\n lowp vec3 finalColor = color.xyz;\n lowp float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize2, dist);\n lowp float ringAlpha2 = getCircleAlpha(ringSize2, nodeSize, dist);\n\n finalColor = mix(lineColor, finalColor, nodeAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n } else if (hovered > 0.0) {\n if (drawDefaultBorder > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize, dist);\n \n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n lowp float shadowAlpha = getShadowAlpha(circleSize, dist);\n\n finalColor = mix(shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = ringAlpha;\n }\n }\n gl_FragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n"),this.nodeAnimShader=new Pi(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_active;\n\nvarying lowp float varNodeSize;\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = a_size * u_zoom * u_glAdjust;\n nodeSize = nodeSize * (0.4 / 0.5); // Remove extra space added for shadow and selection ring\n\n gl_PointSize = a_active > 0.5\n ? nodeSize + 0.88 * nodeSize * u_animPos\n : 0.0;\n\n color = a_color;\n varNodeSize = a_size;\n}","uniform mediump float u_zoom;\nuniform lowp float u_animPos;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float varNodeSize;\nmediump float circleSize = 0.50;\n\nvoid main(void) {\n\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float alpha = 1.0 - smoothstep(circleSize - (1.0 / (varNodeSize * 2.0 * u_zoom * u_glAdjust)), circleSize, dist);\n lowp float pulseAlpha = 0.9 - 0.9 * u_animPos;\n gl_FragColor = vec4(color.xyz, 1.0) * alpha * pulseAlpha;\n }\n}\n"),this.relShader=new Pi(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nattribute vec2 a_from;\nattribute vec2 a_to;\nattribute lowp vec4 a_color;\nattribute lowp float a_triside;\nattribute float a_width;\n\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture2D(u_positions, a_from);\n vec4 to = texture2D(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n direction = vec2(-direction.y, direction.x);\n\n float width = a_width * u_glAdjust * 0.5;\n\n if (a_triside == 0.0) {\n from.y += (width / 2.0) * direction.y;\n from.x += (width / 2.0) * direction.x;\n } else {\n from.y -= (width / 2.0) * direction.y;\n from.x -= (width / 2.0) * direction.x;\n }\n\n color = a_color;\n gl_Position = u_projection * vec4(from.xy, 0.0, 1.0);\n}\n","varying lowp vec4 color;\n\nvoid main(void) {\n gl_FragColor = vec4(color.xyz, 1.0) * color.w;\n}\n"),this.viewportBoxShader=new Pi(e,"attribute vec2 coordinates;\nuniform mat4 u_projection;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n}\n","void main(void) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n"),this.setShaderUniforms(i),e.clearColor(0,0,0,0),e.disable(e.DEPTH_TEST),this.defaultRelColor=4284900966,this.defaultNodeColor=4294937415,this.disableRelColor="#EDEDED",this.disableNodeColor="#EDEDED",e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),this.gl=e,this.activeNodes={},this.canvas=e.canvas,this.projection=_i(),this.setData({nodes:n.items,rels:r.items}),this.createPositionTexture(),this.setupViewportRendering()}var e,r;return e=t,r=[{key:"setShaderUniforms",value:function(t){var e,n,r=jo().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=jo().get.rgb(null===(n=t.nodeBorderStyles.selected)||void 0===n||null===(n=n.rings[1])||void 0===n?void 0:n.color);if(this.nodeShader.use(),null!=r&&r.length){var o=r.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_nodeBorderColor",o),this.nodeShader.setUniform("u_drawDefaultBorder",1)}else this.nodeShader.setUniform("u_drawDefaultBorder",0);var a=i.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_selectedBorderColor",a)}},{key:"setData",value:function(t){var e=Ar(t.rels);this.setupNodeRendering(t.nodes),this.setupRelationshipRendering(e)}},{key:"render",value:function(t,e,n){var r,i=this.gl,o=this.idToIndex,a=Ku(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=o[s.id];this.posBuffer[4*u+0]=s.x,this.posBuffer[4*u+1]=s.y}}catch(t){a.e(t)}finally{a.f()}i.bindTexture(i.TEXTURE_2D,this.posTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,mr,mr,0,i.RGBA,i.FLOAT,this.posBuffer),i.enable(i.BLEND),i.bindFramebuffer(i.FRAMEBUFFER,null),i.clear(i.COLOR_BUFFER_BIT),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),this.renderAnimations(this.posTexture),this.numRels>0&&(this.relShader.use(),this.relShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.relBuffer),this.relShader.setAttributePointerByteNorm("a_color",4,0,16),this.relShader.setAttributePointerByteNorm("a_from",2,4,16),this.relShader.setAttributePointerByteNorm("a_to",2,6,16),this.relShader.setAttributePointerByteNorm("a_triside",1,8,16),this.relShader.setAttributePointerFloat("a_width",1,12,16),i.drawArrays(i.TRIANGLES,0,6*this.numRels)),this.numNodes>0&&(this.nodeShader.use(),this.nodeShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.nodeBuffer),this.nodeShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeShader.setAttributePointerByteNorm("a_selected",1,4,12),this.nodeShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeShader.setAttributePointerByte("a_size",4,8,12),this.nodeShader.setAttributePointerByteNorm("a_hovered",1,9,12),i.drawArrays(i.POINTS,0,this.numNodes))}},{key:"renderViewbox",value:function(){var t=this.gl,e=this.projection,n=this.viewportBoxBuffer;this.viewportBoxShader.use(),this.viewportBoxShader.setUniform("u_projection",e),t.bindBuffer(t.ARRAY_BUFFER,n),this.viewportBoxShader.setAttributePointerFloat("coordinates",2,0,0),t.drawArrays(t.LINES,0,8)}},{key:"updateNodes",value:function(t){var e,r=this.gl,i=this.idToIndex,o=this.disableNodeColor,a=this.nodeBuffer,s=this.nodeDataByte,u=!1,l=Ku(t);try{for(l.s();!(e=l.n()).done;){var c=e.value,f=i[c.id];if(!(0,n.isNil)(c.color)||!0===c.disabled){var h=jo().get.rgb(!0===c.disabled?o:c.color);this.nodeDataByte[3*f*4+0]=h[0],this.nodeDataByte[3*f*4+1]=h[1],this.nodeDataByte[3*f*4+2]=h[2],this.nodeDataByte[3*f*4+3]=255*h[3],u=!0}if(void 0!==c.selected){var d=c.selected;this.nodeDataByte[3*f*4+4]=d?255:0,u=!0}if(void 0!==c.activated&&(this.nodeDataByte[3*f*4+7]=c.activated?255:0,u=!0,c.activated?this.activeNodes[c.id]=!0:delete this.activeNodes[c.id]),void 0!==c.hovered){var p=!0!==c.disabled&&c.hovered;this.nodeDataByte[3*f*4+9]=p?255:0,u=!0}if(void 0!==c.size){var v=c.size;this.nodeDataByte[3*f*4+8]=v||br,u=!0}}}catch(t){l.e(t)}finally{l.f()}u&&(r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,s,r.DYNAMIC_DRAW))}},{key:"updateRelationships",value:function(t){var e,n=Ar(t),r=this.gl,i=!1,o=Ku(n);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=a.key,u=a.width,l=a.color,c=a.disabled,f=this.relIdToIndex[s],h=void 0===l?this.defaultRelColor:il(!0===c?this.disableRelColor:l);this.relData.positionsAndColors[f*rl+0]=h,this.relData.positionsAndColors[f*rl+4]=h,this.relData.positionsAndColors[f*rl+8]=h,this.relData.positionsAndColors[f*rl+12]=h,this.relData.positionsAndColors[f*rl+16]=h,this.relData.positionsAndColors[f*rl+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*rl+3]=u,this.relData.widths[f*rl+7]=u,this.relData.widths[f*rl+11]=u,this.relData.widths[f*rl+15]=u,this.relData.widths[f*rl+19]=u,this.relData.widths[f*rl+23]=u,i=!0)}}catch(t){o.e(t)}finally{o.f()}i&&(r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,this.relDataBuffer,r.DYNAMIC_DRAW))}},{key:"createPositionTexture",value:function(){var t=this.gl,e=t.createTexture(),n=new Float32Array(262144);t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,mr,mr,0,t.RGBA,t.FLOAT,n),this.posTexture=e,this.posBuffer=n}},{key:"updateViewportBox",value:function(t,e,n,r,i){var o=this.gl,a=xr(),s=r*a,u=i*a,l=(.5*s+e*t)/t,c=(.5*u+n*t)/t,f=(.5*-s+e*t)/t,h=(.5*-u+n*t)/t,d=[l,c,f,c,f,c,f,h,f,h,l,h,l,h,l,c];o.bindBuffer(o.ARRAY_BUFFER,this.viewportBoxBuffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array(d),o.DYNAMIC_DRAW)}},{key:"updateViewport",value:function(t,e,n){var r=this.gl,i=1/t,o=e-r.drawingBufferWidth*i*.5,a=n-r.drawingBufferHeight*i*.5,s=r.drawingBufferWidth*i,u=r.drawingBufferHeight*i,l=_i(),c=2.6315789473684212*xr();wi(l,o,o+s,a+u,a,0,1e6),this.nodeShader.use(),this.nodeShader.setUniform("u_zoom",t),this.nodeShader.setUniform("u_glAdjust",c),this.nodeShader.setUniform("u_projection",l),this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_zoom",t),this.nodeAnimShader.setUniform("u_glAdjust",c),this.nodeAnimShader.setUniform("u_projection",l),this.relShader.use(),this.relShader.setUniform("u_glAdjust",c),this.relShader.setUniform("u_projection",l),this.projection=l}},{key:"setupViewportRendering",value:function(){this.viewportBoxBuffer=this.gl.createBuffer()}},{key:"setupNodeRendering",value:function(t){var e=this.gl,r=new ArrayBuffer(8),i=new Uint32Array(r),o=new Uint8Array(r);void 0===this.nodeBuffer&&(this.nodeBuffer=e.createBuffer()),this.numNodes=t.length;var a=new ArrayBuffer(3*t.length*8),s=new Uint32Array(a),u={};this.activeNodes={};for(var l=0;l<t.length;l++){var c=t[l],f=c.selected,h=c.hovered,d=c.color,p=c.activated,v=c.size,y=c.id,m=c.disabled,g=(0,n.isNil)(d)?this.defaultNodeColor:il(d);s[3*l+0]=!0===m?il(this.disableNodeColor):g,o[0]=!0===f?255:0,o[1]=l%mr,o[2]=Math.floor(l/mr),o[3]=!0===p?255:0,o[4]=!1===m&&!0===h?255:0,!0===p&&(this.activeNodes[y]=!0),s[3*l+1]=i[0],s[3*l+2]=null!=v?v:br,s[3*l+3]=i[1],u[y]=l}e.bindBuffer(e.ARRAY_BUFFER,this.nodeBuffer),e.bufferData(e.ARRAY_BUFFER,s,e.DYNAMIC_DRAW),this.numNodes=t.length,this.nodeDataByte=new Uint8Array(a),this.idToIndex=u}},{key:"setupRelationshipRendering",value:function(t){var e=this,r=this.gl,i=new ArrayBuffer(4),o=new Uint32Array(i),a=new Uint8Array(i),s={};void 0===this.relBuffer&&(this.relBuffer=r.createBuffer());for(var u=new ArrayBuffer(t.length*rl*4),l=new Uint32Array(u),c=new Float32Array(u),f=function(r){var i=t[r],u=i.from,f=i.to,h=i.color,d=i.width,p=i.key,v=i.disabled,y=e.idToIndex[u],m=e.idToIndex[f],g=y%mr,b=Math.floor(y/mr),_=m%mr,w=Math.floor(m/mr),x=[g,b,_,w],S=[_,w,g,b],T=(0,n.isNil)(h)?e.defaultRelColor:il(h),O=!0===v?il(e.disableRelColor):T,A=null!=d?d:1;s[p]=r;var E=0,P=function(t,e,n,i){l[r*rl+E]=t,E+=1;for(var s=0;s<e.length;s++)a[s]=e[s];l[r*rl+E]=o[0],E+=1,a[0]=n,l[r*rl+E]=o[0],c[r*rl+(E+=1)]=i,E+=1};P(O,x,255,A),P(O,S,0,A),P(O,x,0,A),P(O,S,0,A),P(O,x,0,A),P(O,S,255,A)},h=0;h<t.length;h++)f(h);r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,u,r.DYNAMIC_DRAW),this.numRels=t.length,this.relDataBuffer=u,this.relData={positionsAndColors:l,widths:c},this.relIdToIndex=s}},{key:"renderAnimations",value:function(t){var e=this.gl,n=this.nodeBuffer,r=this.numNodes,i=Date.now()%1e3/1e3,o=i<.7?i/.7:0;this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_positions",t),this.nodeAnimShader.setUniform("u_animPos",o),e.bindBuffer(e.ARRAY_BUFFER,n),this.nodeAnimShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeAnimShader.setAttributePointerByteNorm("a_active",1,7,12),this.nodeAnimShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeAnimShader.setAttributePointerByte("a_size",4,8,12),e.drawArrays(e.POINTS,0,r)}},{key:"destroy",value:function(){this.gl.deleteBuffer(this.nodeBuffer),this.gl.deleteBuffer(this.relBuffer),this.nodeShader.remove(),this.nodeAnimShader.remove(),this.relShader.remove()}}],r&&Qu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),al=function(t,e,n){var r=xr();t.width=e*r,t.height=n*r,t.style.width="".concat(e,"px"),t.style.height="".concat(n,"px")},sl=function(t){Gr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==nl&&nl(t)},ul=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;al(t,n,r)},ll=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),al(n,t,e),n},cl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,wr),void 0!==t&&(t.appendChild(n),ul(n)),function(t,e){nl=e,t.addEventListener("webglcontextlost",sl)}(n,e),n},fl=function(t){t.width=0,t.height=0,t.remove()},hl=function(t){return t.getContext("2d")},dl=function(t){var e={antialias:!0},n=t.getContext("webgl",e);return null===n&&(n=t.getContext("experimental-webgl",e)),function(t){return t instanceof WebGLRenderingContext}(n)?n:null},pl=function(t){t.canvas.removeEventListener("webglcontextlost",sl);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function vl(t){return function(t){if(Array.isArray(t))return gl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ml(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ml(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ml(t,e){if(t){if("string"==typeof t)return gl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gl(t,e):void 0}}function gl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var bl=br*xr();function _l(t){return _l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_l(t)}function wl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xl(r.key),r)}}function xl(t){var e=function(t,e){if("object"!=_l(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=_l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_l(e)?e:String(e)}var Sl=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=xl(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks={}}var e,n;return e=t,n=[{key:"register",value:function(t,e){this.isCallbackRegistered(t)||(this.callbacks[t]=[]),this.callbacks[t].push(e)}},{key:"isCallbackRegistered",value:function(t){return void 0!==this.callbacks[t]}},{key:"callIfRegistered",value:function(){var t,e=arguments,n=Array.prototype.slice.call(arguments)[0];t=n,u.includes(t)&&this.isCallbackRegistered(n)&&this.callbacks[n].slice(0).forEach((function(t){return t.apply(null,Array.prototype.slice.call(e,1))}))}}],n&&wl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Tl=i(481),Ol=i.n(Tl);function Al(t){return Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Al(t)}function El(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kl(r.key),r)}}function Pl(t,e,n){return(e=kl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kl(t){var e=function(t,e){if("object"!=Al(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Al(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Al(e)?e:String(e)}var jl=5e-5,Cl=function(){function t(e){var n,r=this,i=e.state,o=e.getNodePositions,a=e.canvas,s=e.defaultZoomLevel;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Pl(this,"xCtrl",void 0),Pl(this,"yCtrl",void 0),Pl(this,"zoomCtrl",void 0),Pl(this,"getNodePositions",void 0),Pl(this,"firstUpdate",void 0),Pl(this,"state",void 0),Pl(this,"canvas",void 0),Pl(this,"defaultZoomLevel",void 0),Pl(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(Ol())(.35,jl,.05,1),this.yCtrl=new(Ol())(.35,jl,.05,1),this.zoomCtrl=new(Ol())(.3,1e-5,.01,1),this.defaultZoomLevel=s,this.stateDisposers=[],this.stateDisposers.push(i.autorun((function(){null===i.fitNodeIds&&(r.xCtrl.reset(),r.yCtrl.reset(),r.zoomCtrl.reset())}))),this.stateDisposers.push(i.autorun((function(){n!==i.fitNodeIds&&(n=i.fitNodeIds,r.firstUpdate=!0)}))),this.stateDisposers.push(i.autorun((function(){i.resetZoom&&(r.firstUpdate=!0)})))}var e,n;return e=t,n=[{key:"needsToRun",value:function(){var t=this.state,e=t.fitNodeIds,n=t.resetZoom;return e.length>0||n}},{key:"update",value:function(t){var e=this.state,n=e.fitNodeIds,r=e.resetZoom;n.length>0?this.fitNodes(n,t):r&&this.reset(t)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){return t()}))}},{key:"recalculateTarget",value:function(t,e,n,r){for(var i=this.xCtrl,o=this.yCtrl,a=this.zoomCtrl,s=this.state,u=this.defaultZoomLevel,l=[],c=0;c<t.length;c++)l.push({id:t[c]});var f=s.zoom,h=s.panX,d=s.panY,p=s.maxNodeRadius,v=s.nodes,y=this.getNodePositions(l);v.updatePositions(y);var m=Io(y,p),g=m.centerX,b=m.centerY,_=m.nodesWidth,w=m.nodesHeight;if(isNaN(g)||isNaN(b))return Gr.info("fit() function couldn't calculate center point, not updating viewport"),!1;i.setTarget(!0===e.noPan?h:g),o.setTarget(!0===e.noPan?d:b);var x=Lo(_,w,n,r),S=x.zoomX,T=x.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var O=Mo(S,T,e.minZoom,e.maxZoom);!0===e.outOnly&&f<O?a.setTarget(f):a.setTarget(O)}return!0}},{key:"allNodesAreVisible",value:function(t,e,n){var r=Lo(e,n,this.canvas.width,this.canvas.height),i=r.zoomX,o=r.zoomY;return t<i&&t<o}},{key:"reset",value:function(t){var e=this.state,n=e.zoom,r=e.panX,i=e.panY,o=e.nodes,a=e.maxNodeRadius,s=e.defaultZoomLevel;if(this.firstUpdate||t){this.zoomCtrl.setTarget(s);var u=Io(Object.values(o.idToPosition),a),l=u.centerX,c=u.centerY,f=u.nodesWidth,h=u.nodesHeight;this.allNodesAreVisible(n,f,h)?(this.xCtrl.setTarget(l),this.yCtrl.setTarget(c)):(this.xCtrl.setTarget(r),this.yCtrl.setTarget(i)),this.firstUpdate=!1}var d=n+this.zoomCtrl.update(n),p=r+this.xCtrl.update(r),v=i+this.yCtrl.update(i);this.state.updateZoomToFit(d,p,v,this.canvas),Math.abs(this.zoomCtrl.target-d)<.01&&(this.state.updateZoomToFit(s,p,v,this.canvas),this.state.clearReset())}},{key:"fitNodes",value:function(t,e){var n=this.state,r=n.zoomOptions,i=void 0===r?{}:r,o=n.zoom,a=n.panX,s=n.panY,u=!0;if(this.firstUpdate||e){var l=this.canvas,c=l.width,f=l.height;u=this.recalculateTarget(t,i,c,f),this.firstUpdate=!1}if(u){var h=a+this.xCtrl.update(a),d=s+this.yCtrl.update(s),p=o+this.zoomCtrl.update(o);this.state.updateZoomToFit(p,h,d,this.canvas);var v=Math.max(5,10/this.zoomCtrl.target),y=Math.min(.01,.01*this.zoomCtrl.target);!e&&Math.abs(this.zoomCtrl.target-p)<y&&Math.abs(this.xCtrl.target-h)<v&&Math.abs(this.yCtrl.target-d)<v&&(this.state.setZoom(this.zoomCtrl.target,this.canvas),this.state.clearFit())}}}],n&&El(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Rl(t){return Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(t)}function Dl(){Dl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:A(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(C([])));x&&x!==n&&r.call(x,a)&&(_=x);var S=b.prototype=m.prototype=Object.create(_);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Rl(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Rl(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function Il(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Ll(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ml(Object(n),!0).forEach((function(e){Fl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ul(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zl(r.key),r)}}function Fl(t,e,n){return(e=zl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zl(t){var e=function(t,e){if("object"!=Rl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Rl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:String(e)}var Bl="NvlController",Vl={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},Gl="onError",Wl="onLayoutDone",Xl={},Hl=function(){var t;return null!==(t=Xl[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Xl).pop()},Yl=function(){function t(e,n){var r,i,o,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Fl(this,"destroyed",void 0),Fl(this,"state",void 0),Fl(this,"callbacks",void 0),Fl(this,"instanceId",void 0),Fl(this,"glController",void 0),Fl(this,"webGLContext",void 0),Fl(this,"webGLMinimapContext",void 0),Fl(this,"htmlOverlay",void 0),Fl(this,"hasResized",void 0),Fl(this,"hierarchicalLayout",void 0),Fl(this,"gridLayout",void 0),Fl(this,"freeLayout",void 0),Fl(this,"d3ForceLayout",void 0),Fl(this,"forceLayout",void 0),Fl(this,"canvasRenderer",void 0),Fl(this,"glCanvas",void 0),Fl(this,"canvasRect",void 0),Fl(this,"glMinimapCanvas",void 0),Fl(this,"c2dCanvas",void 0),Fl(this,"isInRenderSwitchAnimation",void 0),Fl(this,"justSwitchedRenderer",void 0),Fl(this,"justSwitchedLayout",void 0),Fl(this,"layoutUpdating",void 0),Fl(this,"layoutComputing",void 0),Fl(this,"isRenderingDisabled",void 0),Fl(this,"setRenderSwitchAnimation",void 0),Fl(this,"stateDisposers",void 0),Fl(this,"zoomTransitionHandler",void 0),Fl(this,"currentLayout",void 0),Fl(this,"layoutTimeLimit",void 0),Fl(this,"pixelRatio",void 0),Fl(this,"removeResizeListener",void 0),Fl(this,"removeMinimapResizeListener",void 0),Fl(this,"pendingZoomOperation",void 0),Fl(this,"layoutRunner",void 0),Fl(this,"animationRequestId",void 0),Fl(this,"layoutDoneCallback",void 0),Fl(this,"layoutComputingCallback",void 0),Fl(this,"currentLayoutType",void 0),this.destroyed=!1;var s=n.frame,u=n.minimapContainer,l=void 0===u?document.createElement("span"):u,c=n.layoutOptions,f=n.layout,h=n.instanceId,d=void 0===h?"default":h,p=e.nodes,v=e.rels,y=e.webGLVisible,m=e.disableWebGL;this.state=e,this.callbacks=new Sl,this.instanceId=d;var g=s;g.setAttribute("instanceId",d),g.setAttribute("data-testid","nvl-parent"),null!==(r=g.style.height)&&void 0!==r&&r.length||Object.assign(g.style,{height:"100%"}),null!==(i=g.style.outline)&&void 0!==i&&i.length||Object.assign(g.style,{outline:"none"});var b=cl(g,this.onWebGLContextLost.bind(this)),_=cl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new qu;else{var w=dl(b),x=dl(_);this.glController=new $u({mainSceneRenderer:new ol(w,p,v,this.state),minimapRenderer:new ol(x,p,v,this.state),state:e}),this.webGLContext=w,this.webGLMinimapContext=x}var S=cl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),O=document.createElement("div");Object.assign(O.style,Nl(Nl({},wr),{},{overflow:"hidden"})),g.appendChild(O),this.htmlOverlay=O,this.hasResized=!0,this.hierarchicalLayout=new Ma(Nl(Nl({},c),{},{state:this.state})),this.gridLayout=new Po({state:this.state}),this.freeLayout=new bo({state:this.state}),this.d3ForceLayout=new Br({state:this.state}),this.forceLayout=m?this.d3ForceLayout:new uo(Nl(Nl({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var A=new Fu(S,T,e,n);this.canvasRenderer=A,this.glCanvas=b,this.canvasRect=b.getBoundingClientRect(),this.glMinimapCanvas=_,this.c2dCanvas=S,this.glCanvas.style.opacity=y?"1":"0",this.c2dCanvas.style.opacity=y?"0":"1",this.isInRenderSwitchAnimation=!1,this.justSwitchedRenderer=!1,this.justSwitchedLayout=!1,this.hasResized=!1,this.layoutUpdating=!1,this.layoutComputing=!1,this.isRenderingDisabled=!1,p.addChannel(Bl),v.addChannel(Bl),this.setRenderSwitchAnimation=function(){a.isInRenderSwitchAnimation=!1},this.stateDisposers=[],this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("zoom",e.zoom)}))),this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("pan",{panX:e.panX,panY:e.panY})}))),this.stateDisposers.push(e.autorun((function(){a.setLayout(e.layout)}))),this.stateDisposers.push(e.autorun((function(){a.setLayoutOptions(e.layoutOptions)}))),this.stateDisposers.push(e.autorun((function(){var t=e.webGLVisible?"1":"0";t!==a.glCanvas.style.opacity&&(a.justSwitchedRenderer=!0,a.glCanvas.style.opacity=t,a.c2dCanvas.style.opacity=e.webGLVisible?"0":"1")}))),this.startMainLoop(),this.zoomTransitionHandler=new Cl({state:e,getNodePositions:function(t){return a.currentLayout.getNodePositions(t)},canvas:b,defaultZoomLevel:oa}),this.layoutTimeLimit=null!==(o=n.layoutTimeLimit)&&void 0!==o?o:16,this.pixelRatio=xr(),this.removeResizeListener=En()(g,(function(){ul(b),ul(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=En()(l,(function(){ul(_)})),Xl[d]=this,window.__Nvl_dumpNodes=function(t){var e;return null===(e=Hl(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Hl(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Hl(e))||void 0===n?void 0:n.on(Wl,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Hl(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Hl(t))||void 0===e?void 0:e.getScale()},this.pendingZoomOperation=null}var e,n,r,i;return e=t,n=[{key:"onWebGLContextLost",value:function(t){this.callIfRegistered("onWebGLContextLost",t)}},{key:"updateMinimapZoom",value:function(){var t=this.state,e=t.nodes,n=t.maxNodeRadius,r=t.maxMinimapZoom,i=t.minMinimapZoom,o=Io(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=Lo(u,l,this.glMinimapCanvas.width,this.glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=Mo(f,h,i,r);this.state.updateMinimapZoomToFit(d,a,s)}},{key:"startMainLoop",value:function(){var t=this,e=this.state,n=e.nodes,r=e.rels;this.currentLayout.update();var i=this.currentLayout.getNodePositions(n.items);n.updatePositions(i),this.isRenderingDisabled||(this.glController.renderMainScene(i),this.glController.renderMinimap(i),this.canvasRenderer.processUpdates(),this.canvasRenderer.render(i)),this.layoutRunner=setInterval((function(){try{!function(){var e=t.currentLayout.getShouldUpdate(),n=e||t.justSwitchedLayout,r=n&&!t.layoutUpdating&&!t.justSwitchedLayout;if(n)for(var i=window.performance.now(),o=r?0:50,a=0;a<o;a++){t.currentLayout.update(t.justSwitchedLayout),t.justSwitchedLayout=!1;var s=window.performance.now();if(!e||s-i>t.layoutTimeLimit)break}}()}catch(e){if(!t.callbacks.isCallbackRegistered(Gl))throw e;t.callIfRegistered(Gl,e)}}),13),this.animationRequestId=window.requestAnimationFrame((function e(){try{!function(e){if(t.destroyed)Gr.info("STEP IN A DESTROYED STRIP");else{var i=xr();if(i!==t.pixelRatio)return t.pixelRatio=i,void t.callIfRegistered("restart");var o=t.currentLayout.getShouldUpdate(),a=o||t.justSwitchedLayout,s=t.currentLayout.getComputing(),u=t.zoomTransitionHandler.needsToRun(),l=a&&!t.layoutUpdating&&!t.justSwitchedLayout,c=t.layoutComputing&&!s,f=t.state.webGLVisible&&t.glController.needsToRun(),h=!t.state.webGLVisible&&t.canvasRenderer.needsToRun(),d=t.isInRenderSwitchAnimation||t.justSwitchedRenderer,p=t.hasResized,v=null!==t.pendingZoomOperation,y=t.glController.minimapMouseDown;if(n.clearChannel(Bl),r.clearChannel(Bl),u||a||c||d||f||h||y||p||v){!t.pendingZoomOperation||l||t.currentLayout.getComputing()||(t.pendingZoomOperation(),t.pendingZoomOperation=null),t.zoomTransitionHandler.update(o||s||c),p&&t.glController.onResize();var m=t.currentLayout.getNodePositions(n.items);if(n.updatePositions(m),t.callIfRegistered("onLayoutStep",t.dumpNodes()),t.updateMinimapZoom(),t.glController.renderMinimap(m),!t.isRenderingDisabled){if((t.state.webGLVisible||d)&&t.glController.renderMainScene(m),!t.state.webGLVisible||d){t.canvasRenderer.processUpdates(),t.canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b=r.items[g].id,_=t.canvasRenderer.arrowBundler.getBundle(r.items[g]),w=r.idToHtmlOverlay[b],x=_.labelInfo[b];if(w&&x){var S=x.rotation,T=x.position,O=x.width,A=x.height,E=t.mapCanvasSpaceToRelativePosition(T.x,T.y),P=E.x,k=E.y,j=O>5&&!t.state.webGLVisible;Object.assign(w.style,{top:"".concat(k,"px"),left:"".concat(P,"px"),width:"".concat(O,"px"),height:"".concat(A,"px"),display:j?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),") rotate(").concat(S,"rad")})}}}for(var C=0;C<n.items.length;C++){var R=n.items[C],D=R.id,I=R.size,L=n.idToHtmlOverlay[D];if(L){var M=t.state.nodes.idToPosition[D],N=t.mapCanvasSpaceToRelativePosition(M.x,M.y),U=N.x,F=N.y,z="".concat(2*(null!=I?I:br),"px");Object.assign(L.style,{top:"".concat(F,"px"),left:"".concat(U,"px"),width:z,height:z,transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),")")})}}}}var B=!a&&t.layoutUpdating,V=s!==t.layoutComputing;t.layoutComputing=s,t.layoutUpdating=a,B&&t.callIfRegistered(Wl),V&&t.callIfRegistered("onLayoutComputing",s),t.justSwitchedRenderer=!1,t.hasResized=!1,void 0!==e&&e()}}((function(){t.animationRequestId=window.requestAnimationFrame(e)}))}catch(e){if(!t.callbacks.isCallbackRegistered(Gl))throw e;t.callIfRegistered(Gl,e)}}))}},{key:"updateHtmlOverlay",value:function(){this.state.nodes.updateHtmlOverlay(this.htmlOverlay),this.state.rels.updateHtmlOverlay(this.htmlOverlay)}},{key:"dumpNodes",value:function(){var t,e=this.state.nodes.items,n=this.state.nodes.idToPosition,r=[],i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ll(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ll(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id],s=this.mapCanvasSpaceToRelativePosition(a.x,a.y);r.push(Nl(Nl({},o),{},{x:s.x,y:s.y}))}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"dumpRelationships",value:function(){return _n(this.state.rels.items)}},{key:"mapCanvasSpaceToRelativePosition",value:function(t,e){var n=this.canvasRect,r=window.devicePixelRatio||1,i=(t-this.state.panX)*this.state.zoom/r,o=(e-this.state.panY)*this.state.zoom/r;return{x:i+.5*n.width,y:o+.5*n.height}}},{key:"mapRelativePositionToCanvasSpace",value:function(t,e){var n=this.glCanvas.getBoundingClientRect(),r=window.devicePixelRatio||1,i=r*(t-.5*n.width),o=r*(e-.5*n.height);return{x:this.state.panX+i/this.state.zoom,y:this.state.panY+o/this.state.zoom}}},{key:"getNodePositions",value:function(){return Object.values(_n(this.state.nodes.idToPosition))}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state.nodes.updatePositions(t),this.currentLayout.updateNodes(t),e||this.currentLayout.terminateUpdate(),this.hasResized=!0,0===this.getNodesOnScreen().nodes.length&&this.state.setPan(0,0),this.state.clearFit()}},{key:"isLayoutMoving",value:function(){return this.layoutUpdating}},{key:"getNodesOnScreen",value:function(){var t=this.glCanvas.getBoundingClientRect(),e=this.mapRelativePositionToCanvasSpace(0,0),n=e.x,r=e.y,i=this.mapRelativePositionToCanvasSpace(t.width,t.height);return function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:["node"],a=i.nodes,s=i.rels,u=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),h=[],d=[];if(o.includes("node"))for(var p=0,v=Object.values(a.idToPosition);p<v.length;p++){var y=v[p],m=y.x,g=y.y;void 0!==m&&void 0!==g&&m>u&&m<l&&g>c&&g<f&&h.push(y)}if(o.includes("relationship")){var b,_=yl(s.items);try{for(_.s();!(b=_.n()).done;){var w=b.value,x=w.from,S=w.to,T=a.idToPosition[x],O=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==O.x&&void 0!==O.y){var A=T.x>u&&T.x<l&&T.y>c&&T.y<f,E=O.x>u&&O.x<l&&O.y>c&&O.y<f;A&&E&&d.push(w)}}}catch(t){_.e(t)}finally{_.f()}}return{nodes:h,rels:d}}(n,r,i.x,i.y,this.state,["node"])}},{key:"registerDoneCallback",value:function(t){this.layoutDoneCallback=t}},{key:"registerComputingCallback",value:function(t){this.layoutComputingCallback=t}},{key:"getPosition",value:function(t){return this.currentLayout.getNodePositions([{id:t}])[0]}},{key:"getScale",value:function(){return this.state.zoom}},{key:"getPan",value:function(){return{x:this.state.panX,y:this.state.panY}}},{key:"setZoomLevel",value:function(t){var e=this;this.pendingZoomOperation=function(){return e.state.setZoom(t,e.glCanvas)}}},{key:"setPanCoordinates",value:function(t,e){this.state.setPan(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){var r=this;this.pendingZoomOperation=function(){return r.state.setZoomPan(t,e,n,r.glCanvas)}}},{key:"fit",value:function(t,e){var n=this;this.pendingZoomOperation=function(){return n.state.fitNodes(t,e)}}},{key:"resetZoom",value:function(){var t=this;this.pendingZoomOperation=function(){return t.state.setZoomReset()}}},{key:"setRenderer",value:function(t){this.state.setRenderer(t)}},{key:"on",value:function(t,e){this.callbacks.register(t,e)}},{key:"isDestroyed",value:function(){return this.destroyed}},{key:"destroy",value:function(){var t;this.destroyed||(this.animationRequestId&&window.cancelAnimationFrame(this.animationRequestId),void 0!==this.layoutRunner&&window.clearInterval(this.layoutRunner),this.glController.destroy(),this.glCanvas.removeEventListener("transitionend",this.setRenderSwitchAnimation),void 0!==this.webGLContext&&pl(this.webGLContext),void 0!==this.webGLMinimapContext&&pl(this.webGLMinimapContext),fl(this.glCanvas),fl(this.glMinimapCanvas),this.canvasRenderer.destroy(),fl(this.c2dCanvas),this.removeResizeListener(),this.removeMinimapResizeListener(),this.forceLayout.destroy(),this.hierarchicalLayout.destroy(),this.gridLayout.destroy(),this.freeLayout.destroy(),this.htmlOverlay.remove(),this.zoomTransitionHandler.destroy(),this.stateDisposers.forEach((function(t){t()})),t=this.instanceId,delete Xl[t],this.destroyed=!0)}},{key:"callIfRegistered",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks.callIfRegistered.apply(this.callbacks,arguments)}},{key:"getCanvasRelsAt",value:function(t){return this.canvasRenderer.getRelsAt(t)}},{key:"getCanvasNodesAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.canvasRenderer.getNodesAt(t,e)}},{key:"getLayout",value:function(t){return t===ua?this.hierarchicalLayout:t===sa?this.forceLayout:t===la?this.gridLayout:t===ca?this.freeLayout:t===fa?this.d3ForceLayout:this.forceLayout}},{key:"setLayout",value:function(t){Gr.info("Switching to layout: ".concat(t));var e=this.currentLayoutType,n=this.getLayout(t);"free"===t&&n.setNodePositions(this.state.nodes.idToPosition),this.currentLayout=n,this.currentLayoutType=t,e&&e!==this.currentLayoutType&&(this.justSwitchedLayout=!0)}},{key:"setLayoutOptions",value:function(t){this.getLayout(this.state.layout).setOptions(t)}},{key:"createDownloadLink",value:function(t,e){var n=document.createElement("a");n.style.display="none",n.setAttribute("download",t);var r=e.toDataURL("image/png").replace(/^data:image\/png/,"data:application/octet-stream");return n.setAttribute("href",r),n}},{key:"saveToFile",value:function(t){var e=Nl(Nl({},Vl),t),n=e.filename,r=e.backgroundColor,i=this.state.nodes.items;this.currentLayout.update(this.justSwitchedLayout),this.justSwitchedLayout=!1;var o=this.currentLayout.getNodePositions(i);this.state.nodes.updatePositions(o);var a=ll(this.c2dCanvas.width,this.c2dCanvas.height),s=hl(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),fl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=Nl(Nl({},Vl),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Io(a,100),u=s.nodesWidth,l=s.nodesHeight,c=s.centerX,f=s.centerY,h=Math.max(Math.min(u+100,15e3),5e3),d=Math.max(Math.min(l+100,15e3),5e3);return this.isRenderingDisabled=!0,new Promise((function(t,n){try{e.setPanCoordinates(c,f);var r=Math.max(h/u-.02,e.state.minZoom),s=Math.max(d/l-.02,e.state.minZoom);e.setZoomLevel(Math.min(r,s))}catch(t){return Gr.error("An error occurred while downloading the file"),void n(t)}setTimeout((function(){try{e.currentLayout.update(e.justSwitchedLayout),e.justSwitchedLayout=!1,e.state.nodes.updatePositions(a);var r=ll(h,d),s=hl(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),fl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=Dl().mark((function t(e){var n,r,i,o;return Dl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Nl(Nl({},Vl),e),r=this.state.zoom,i=this.state.panX,o=this.state.panY,t.prev=4,t.next=7,this.prepareLargeFileForDownload(n);case 7:t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(4),Gr.error("An error occurred while downloading the image"),!this.callbacks.isCallbackRegistered(Gl)){t.next=16;break}this.callIfRegistered(Gl,t.t0),t.next=17;break;case 16:throw t.t0;case 17:return t.prev=17,this.isRenderingDisabled=!1,this.setZoomLevel(r),this.setPanCoordinates(i,o),t.finish(17);case 22:case"end":return t.stop()}}),t,this,[[4,9,17,22]])})),i=function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function a(t){Il(o,n,i,a,s,"next",t)}function s(t){Il(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&Ul(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $l(t){return $l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(t)}function ql(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jl(r.key),r)}}function Kl(t,e,n){return e&&Zl(t.prototype,e),n&&Zl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jl(t){var e=function(t,e){if("object"!=$l(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=$l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$l(e)?e:String(e)}var Ql=function(){function t(e,n){if(ql(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Kl(t,[{key:"addChild",value:function(t){this.children.push(t)}},{key:"isRoot",value:function(){return null===this.parent}},{key:"print",value:function(){var t=this.data.name;this.isRoot()||(t=t+"\t\t"+function(t){for(var e=(Math.round(1e3*t)/1e3).toFixed(3);e.length<6;)e=" "+e;return e}(this.data._timeSpent())+" ms",this.parent.isRoot()||(t=t+"\t"+this._percentageOfParentSpent()+"%"));var e=this.noOfChildren()>0;for(var n in e?(t=t+"\t Children: "+this.noOfChildren(),console.groupCollapsed(t)):console.log(t),this.children)this.children[n].print();e&&console.groupEnd()}},{key:"noOfChildren",value:function(){return this.children.length}},{key:"_percentageOfParentSpent",value:function(){return Math.round(this.data._timeSpent()/this.parent.data._timeSpent()*100)}}]),t}(),tc=function(){function t(e){ql(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Kl(t,[{key:"close",value:function(){this.endTime=performance.now()}},{key:"_timeSpent",value:function(){if(null===this.startTime||null===this.endTime)throw new Error("You have an error in your performance measurements that makes the whole tree unreliable. You probably forgot to call performanceTestEnd on "+this.name);return this.endTime-this.startTime}}]),t}(),ec=function(){function t(){ql(this,t),this.root=new Ql(new tc("Performance Tree"),null),this.current=this.root}return Kl(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Ql(t,this.current);this.current.addChild(e),this.current=e}else{if(this.root)throw new Error("Performance tree is screwed up");this.root=new Ql(t,null),this.current=this.root}}},{key:"close",value:function(){if(this.current.isRoot())throw new Error("Tried to close performance tree root. You probably have one too many Performance.endTest() in your code.");this.current.data.close(),this.current=this.current.parent}},{key:"getCurrentData",value:function(){return this.current.data}},{key:"print",value:function(){this.root.noOfChildren()>0&&this.root.print()}}]),t}(),nc=function(){function t(){ql(this,t),window.performance?(this.disabled=!1,this.tree=new ec):(this.disabled=!0,this.tree=null)}return Kl(t,[{key:"startTest",value:function(t){if(!this.disabled){var e;t||(1,t="at"===(e=(new Error).stack.split("\n")[3].trim()).split(" ")[0]?e.split(" ")[1]:e.split("@")[0]);var n=new tc(t);this.tree.add(n)}}},{key:"endTest",value:function(){this.disabled||this.tree.close()}},{key:"reset",value:function(){this.disabled||this.tree.clear()}},{key:"print",value:function(){this.disabled||this.tree.print()}}]),t}(),rc=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};const ic=(t=>{var e={};return i.d(e,t),e})({AnalyticsBrowser:()=>e.AnalyticsBrowser});var oc,ac=new Uint8Array(16);function sc(){if(!oc&&!(oc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oc(ac)}const uc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var lc=[],cc=0;cc<256;++cc)lc.push((cc+256).toString(16).substr(1));const fc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(lc[t[e+0]]+lc[t[e+1]]+lc[t[e+2]]+lc[t[e+3]]+"-"+lc[t[e+4]]+lc[t[e+5]]+"-"+lc[t[e+6]]+lc[t[e+7]]+"-"+lc[t[e+8]]+lc[t[e+9]]+"-"+lc[t[e+10]]+lc[t[e+11]]+lc[t[e+12]]+lc[t[e+13]]+lc[t[e+14]]+lc[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&uc.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n};var hc,dc,pc=0,vc=0;const yc=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||hc,a=void 0!==t.clockseq?t.clockseq:dc;if(null==o||null==a){var s=t.random||(t.rng||sc)();null==o&&(o=hc=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=dc=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:vc+1,c=u-pc+(l-vc)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||u>pc)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");pc=u,vc=l,dc=a;var f=(1e4*(268435455&(u+=122192928e5))+l)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=255&f;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var d=0;d<6;++d)i[r+d]=o[d];return e||fc(i)};function mc(t){return mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(t)}function gc(){gc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new j(r||[]);return i(a,"_invoke",{value:A(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(C([])));x&&x!==n&&r.call(x,a)&&(_=x);var S=b.prototype=m.prototype=Object.create(_);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==mc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(mc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function bc(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function _c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wc(r.key),r)}}function wc(t){var e=function(t,e){if("object"!=mc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=mc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mc(e)?e:String(e)}var xc=window.localStorage,Sc="neo4j.nvl.sTid",Tc=!1,Oc=function(){function t(){var e,n,r;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),e=this,r=void 0,(n=wc(n="analytics"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r;var i=new ic.AnalyticsBrowser;this.analytics=i}var e,n,r,i,o;return r=t,i=[{key:"init",value:function(t){this.analytics.load({writeKey:t}),this.analytics.addSourceMiddleware((function(t){var e=t.payload,n=t.next,r=e.obj.context.page;void 0!==r&&(r.url="",r.title="",r.search="",r.referrer="",r.path=""),n(e)}))}},{key:"trackEvent",value:(e=gc().mark((function t(e){var n;return gc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ready();case 2:n="".concat(e.eventPrefix?e.eventPrefix:"NVL_core","-").concat(e.event),this.analytics.track(n,e.properties).catch((function(t){Gr.warn("TRACKING: Event tracking is failed. err: ".concat(t))}));case 4:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){bc(o,r,i,a,s,"next",t)}function s(t){bc(o,r,i,a,s,"throw",t)}a(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"identify",value:function(){if(!Tc){var t=this.getSegmentTrackingId();this.analytics.identify(t).catch((function(t){Gr.debug("TRACKING: Identifying user for Segment tracking failed. err: ".concat(t))})),Tc=!0}}},{key:"loadSavedSegmentId",value:function(){try{var t=xc.getItem(Sc);return"string"==typeof t?t:null}catch(t){return Gr.debug("TRACKING: Retrieving tracking Id failed. err: ".concat(t)),null}}},{key:"getSegmentTrackingId",value:function(){var t=this.loadSavedSegmentId(),e=null!=t?t:yc();return this.saveTrackingId(e),e}},{key:"saveTrackingId",value:function(t){xc.setItem(Sc,t)}},{key:"ready",value:function(){return this.analytics.ready().catch((function(t){Gr.debug("TRACKING: segment track instance not ready. err: ".concat(t))}))}}],i&&_c(r.prototype,i),o&&_c(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function Ac(t){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(t)}function Ec(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||kc(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=kc(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function kc(t,e){if(t){if("string"==typeof t)return jc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jc(t,e):void 0}}function jc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cc(Object(n),!0).forEach((function(e){Ic(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Dc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Lc(r.key),r)}}function Ic(t,e,n){return(e=Lc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lc(t){var e=function(t,e){if("object"!=Ac(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ac(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ac(e)?e:String(e)}var Mc=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ic(this,"externalCallbackHandler",void 0),Ic(this,"performance",void 0),Ic(this,"visState",void 0),Ic(this,"nvlController",void 0),Ic(this,"options",void 0),Ic(this,"segmentTrack",void 0),!0!==i.disableTelemetry&&(this.segmentTrack=new Oc,this.segmentTrack.init("4SGwdwzuDm5WkFvQtz7D6ATQlo14yjmW"),this.segmentTrack.identify()),this.setupLogging(i),this.externalCallbackHandler=new l(o),this.performance=new nc,this.options=i,this.options.frame=e,this.checkWebGLCompatibility(),this.initialise(n,r,i)}var e,r;return e=t,r=[{key:"restart",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getNodePositions(),r=this.visState,i=r.zoom,o=r.layout,a=r.layoutOptions,s=r.nodes,u=r.rels;this.nvlController.destroy(),Object.assign(this.options,t),this.initialise(s.items,u.items,this.options),this.setZoom(i),this.setLayout(o),this.setLayoutOptions(a),this.addAndUpdateElementsInGraph(s.items,u.items),e&&this.setNodePositions(n)}},{key:"addAndUpdateElementsInGraph",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.update(t,Rc({},n)),this.visState.rels.update(e,Rc({},n)),this.visState.nodes.add(t,Rc({},n)),this.visState.rels.add(e,Rc({},n)),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}},{key:"getSelectedNodes",value:function(){var t=this;return this.visState.nodes.items.filter((function(t){return t.selected})).map((function(e){return Rc(Rc({},e),t.visState.nodes.idToPosition[e.id])}))}},{key:"getSelectedRelationships",value:function(){return this.visState.rels.items.filter((function(t){return t.selected}))}},{key:"updateElementsInGraph",value:function(t,e){var n={added:!1,updated:!1};this.validateNodes(t),this.validateRelationships(e,t),this.visState.nodes.update(t,Rc({},n)),this.visState.rels.update(e,Rc({},n)),this.nvlController.updateHtmlOverlay()}},{key:"addElementsToGraph",value:function(t,e){this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.add(t,Rc({},n)),this.visState.rels.add(e,Rc({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,n.isEmpty)(t)){var e,r={},i=Pc(t);try{for(i.s();!(e=i.n()).done;)r[e.value]=!0}catch(t){i.e(t)}finally{i.f()}var o,a=[],s=Pc(this.visState.rels.items);try{for(s.s();!(o=s.n()).done;){var u=o.value;!0!==r[u.from]&&!0!==r[u.to]||a.push(u.id)}}catch(t){s.e(t)}finally{s.f()}a.length>0&&this.edgeRemoval(a),this.nodeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}}},{key:"removeRelationshipsWithIds",value:function(t){Array.isArray(t)&&!(0,n.isEmpty)(t)&&(this.edgeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay())}},{key:"getNodes",value:function(){return this.nvlController.dumpNodes()}},{key:"getRelationships",value:function(){return this.nvlController.dumpRelationships()}},{key:"getNodeById",value:function(t){return this.visState.nodes.idToItem[t]}},{key:"getRelationshipById",value:function(t){return this.visState.rels.idToItem[t]}},{key:"getPositionById",value:function(t){return this.visState.nodes.idToPosition[t]}},{key:"getCurrentOptions",value:function(){return this.options}},{key:"destroy",value:function(){this.nvlController.destroy()}},{key:"deselectAll",value:function(){this.updateElementsInGraph(this.visState.nodes.items.map((function(t){return Rc(Rc({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return Rc(Rc({},t),{},{selected:!1})})))}},{key:"fit",value:function(t,e){this.nvlController.fit(t,e)}},{key:"resetZoom",value:function(){this.nvlController.resetZoom()}},{key:"setUseWebGLRenderer",value:function(t){this.nvlController.setRenderer(t?ha:da)}},{key:"setRenderer",value:function(t){this.nvlController.setRenderer(t)}},{key:"setDisableWebGL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.options.disableWebGL!==t&&(this.options.disableWebGL=t,this.restart())}},{key:"pinNode",value:function(t){this.visState.nodes.update([{id:t,pinned:!0}],{})}},{key:"unPinNode",value:function(t){this.visState.nodes.update(t.map((function(t){return{id:t,pinned:!1}})),{})}},{key:"setLayout",value:function(t){this.visState.setLayout(t)}},{key:"setLayoutOptions",value:function(t){this.visState.setLayoutOptions(t)}},{key:"getNodesOnScreen",value:function(){return this.nvlController.getNodesOnScreen()}},{key:"getNodePositions",value:function(){return this.nvlController.getNodePositions()}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.nvlController.setNodePositions(t,e)}},{key:"isLayoutMoving",value:function(){return this.nvlController.isLayoutMoving()}},{key:"saveToFile",value:function(t){this.nvlController.saveToFile(t)}},{key:"saveFullGraphToLargeFile",value:function(t){this.nvlController.saveFullGraphToLargeFile(t)}},{key:"setZoom",value:function(t){this.nvlController.setZoomLevel(t)}},{key:"setPan",value:function(t,e){this.nvlController.setPanCoordinates(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){this.nvlController.setZoomAndPan(t,e,n)}},{key:"getScale",value:function(){return this.nvlController.getScale()}},{key:"getPan",value:function(){return this.nvlController.getPan()}},{key:"getHits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["node","relationship"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{hitNodeMarginWidth:0},r=this.options,i=this.visState,o=this.nvlController,a=i.zoom,s=i.panX,u=i.panY,l=i.webGLVisible,c=zu(t,r.frame,a,s,u),f=c.x,h=c.y,d=l?function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[],s=n.nodes,u=n.rels;return r.includes("node")&&o.push.apply(o,vl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=[],a=yl(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a,s=n.value,u=r[s.id];if(void 0===(null==u?void 0:u.x)||void 0===u.y)return 1;var l=(null!==(a=s.size)&&void 0!==a?a:br)*xr(),c={x:u.x-t,y:u.y-e},f=Math.pow(l,2),h=Math.pow(l+i,2),d=Math.pow(c.x,2)+Math.pow(c.y,2),p=Math.sqrt(d);if(d<h){var v=o.findIndex((function(t){return t.distance>p}));o.splice(-1!==v?v:o.length,0,{data:s,targetCoordinates:{x:u.x,y:u.y},pointerCoordinates:{x:t,y:e},distanceVector:c,distance:p,insideNode:d<f})}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return o}(t,e,s.items,s.idToPosition,i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,vl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=yl(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a=n.value,s=a.from,u=a.to;if(void 0===o["".concat(s,".").concat(u)]){var l=r[s],c=r[u];if(void 0===(null==l?void 0:l.x)||void 0===l.y)return 0;if(void 0===(null==c?void 0:c.x)||void 0===c.y)return 0;var f=Ps({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=bl){var h=i.findIndex((function(t){return t.distance>f}));i.splice(-1!==h?h:i.length,0,{data:a,fromTargetCoordinates:{x:l.x,y:l.y},toTargetCoordinates:{x:c.x,y:c.y},pointerCoordinates:{x:t,y:e},distance:f})}o["".concat(s,".").concat(u)]=1,o["".concat(u,".").concat(s)]=1}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return i}(t,e,u.items,s.idToPosition))),{nodes:o,relationships:a}}(f,h,i,e,n):function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[];return r.includes("node")&&o.push.apply(o,vl(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,vl(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return Rc(Rc({},t),{},{nvlTargets:d})}},{key:"getContainer",value:function(){return this.options.frame}},{key:"initialise",value:function(){var t,e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.visState=function(t){var e=t.minZoom,r=t.maxZoom,i=t.allowDynamicMinZoom,o=void 0===i||i,a=t.layout,s=t.layoutOptions,u=t.nodeDefaultBorderColor,l=t.selectedBorderColor,c=t.panX,f=void 0===c?0:c,h=t.panY,d=void 0===h?0:h,p=t.initialZoom,v=t.renderer,y=void 0===v?!1===t.useWebGL?da:ha:v,m=t.disableWebGL,g=void 0!==m&&m,b=t.disableTelemetry,_=void 0!==b&&b;Z(!0),wn.isolateGlobalState();var w=void 0!==e?e:.075,x=void 0!==r?r:10,S=Qo({},ra.default);void 0!==u&&("string"==typeof u&&null!==jo().get.rgb(u)?S.rings=[{color:u,widthFactor:.05}]:Gr.warn("Invalid color string for nodeDefaultBorderColor:",u));var T=Qo({},ra.selected),O=Qo({},ia.selected);return void 0!==l&&("string"==typeof u&&null!==jo().get.rgb(l)?(T.rings[1].color=l,O.rings[1].color=l):Gr.warn("Invalid color string for selectedBorderColor:",l)),Vt({zoom:p||oa,minimapZoom:oa,defaultZoomLevel:oa,panX:f,panY:d,minimapPanX:0,minimapPanY:0,fitNodeIds:[],resetZoom:!1,zoomOptions:{},forceWebGL:!1,renderer:y,disableWebGL:g,disableTelemetry:_,fitMovement:0,layout:a,layoutOptions:s,maxDistance:0,maxNodeRadius:50,nodeBorderStyles:{default:S,selected:T},relationshipBorderStyles:{default:ia.default,selected:O},get minZoom(){return w},get maxZoom(){return x},get minMinimapZoom(){return 0},get maxMinimapZoom(){return.2},get webGLVisible(){var t=this.fitMovement>50;return this.renderer===ha||t},nodes:Zo(),rels:Zo(),graphUpdates:0,waypoints:{data:Vt.shallow({}),counter:0},setGraphUpdated:ot((function(){this.graphUpdates++})),setRenderer:ot((function(t){ot((function(){this.graphUpdates++})),this.renderer=t})),setWaypoints:ot((function(t){this.waypoints.data=t,this.waypoints.counter+=1})),setZoomPan:ot((function(t,e,n,r){if(o){var i=Object.values(this.nodes.idToPosition),a=Uo(i,w,x,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=No(t,this.zoom,w,x);s!==this.zoom&&(this.zoom=s,this.panX=e,this.panY=n)}this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setZoom:ot((function(t,e){if(o){var n=Object.values(this.nodes.idToPosition);this.zoom=Uo(n,w,x,e,t,this.zoom)}else this.zoom=No(t,this.zoom,w,x);this.fitNodeIds=[],this.fitMovement=0,this.resetZoom=!1,this.forceWebGL=!1})),setPan:ot((function(t,e){this.panX=t,this.panY=e,this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setLayout:ot((function(t){this.layout=t})),setLayoutOptions:ot((function(t){this.layoutOptions=t})),fitNodes:ot((function(t,e){this.fitNodeIds=(0,n.intersection)(t,(0,n.map)(this.nodes.items,"id")),this.zoomOptions=null!=e?e:{}})),setZoomReset:ot((function(){this.resetZoom=!0})),clearFit:ot((function(){this.fitNodeIds=[],this.forceWebGL=!1,this.fitMovement=0})),clearReset:ot((function(){this.resetZoom=!1,this.fitMovement=0})),updateZoomToFit:ot((function(t,e,n,r){var i;if(this.fitMovement=Math.abs(t-this.zoom)+Math.abs(e-this.panX)+Math.abs(n-this.panY),o){var a=Object.values(this.nodes.idToPosition);i=Uo(a,w,x,r,t,this.zoom)}else i=No(t,this.zoom,w,x);this.zoom=i,this.panX=e,this.panY=n})),updateMinimapZoomToFit:ot((function(t,e,n){this.minimapZoom=t,this.minimapPanX=e,this.minimapPanY=n})),autorun:yt,reaction:mt})}(o),o.minimapContainer instanceof HTMLElement||delete o.minimapContainer,this.nvlController=new Yl(this.visState,o),this.addAndUpdateElementsInGraph(r,i),this.nvlController.on("restart",this.restart.bind(this));var a,s,u=Pc((a=this.externalCallbackHandler.callbacks,Object.entries(a)));try{for(u.s();!(s=u.n()).done;){var l=Ec(s.value,2),c=l[0];void 0!==l[1]&&this.nvlController.on(c,this.externalCallbackHandler[c].bind(this.externalCallbackHandler))}}catch(t){u.e(t)}finally{u.f()}var f=null===(t=this.options.frame)||void 0===t?void 0:t.getAttribute("id");!0!==this.options.disableTelemetry&&setTimeout((function(){e.nvlController.isDestroyed()||e.segmentTrack.trackEvent({eventPrefix:Sr.includes(f)?f:null,event:"instantiated",properties:{}})}),200)}},{key:"setupLogging",value:function(t){var e,n=t.logging;void 0!==(null==n?void 0:n.level)&&(e=n.level,Gr.setLevel(e),function(t,e){var n=t.methodFactory;t.methodFactory=function(t,r,i){var o=n(t,r,i);return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];"function"==typeof e.logger?e.logger.apply(e,[t].concat(r)):o.apply(void 0,r)}},t.setLevel(t.getLevel())}(Gr,n))}},{key:"nodeRemoval",value:function(t){var e=Array.isArray(t)?t:[t],n=this.visState,r=n.nodes,i=n.fitNodeIds,o=n.zoomOptions;r.remove(e,{removed:!1}),i.length&&void 0!==e.find((function(t){return i.includes(t)}))&&this.visState.fitNodes(i.filter((function(t){return!e.includes(t)})),o)}},{key:"edgeRemoval",value:function(t){var e=Array.isArray(t)?t:[t];this.visState.rels.remove(e,{removed:!1})}},{key:"update",value:function(t,e){this.visState[e].update(t,{added:!1,updated:!1})}},{key:"validateNodes",value:function(t){var e=t.find((function(t){return!function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0}(t)}));if(e){var n="";throw/^\d+$/.test(e.id)||(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported."),new TypeError("Invalid node provided: ".concat(JSON.stringify(e),".").concat(n))}}},{key:"validateRelationships",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n="",r=null,i=this.visState,o=i.nodes,a=i.rels,s={},u=0;u<e.length;u++){var l=e[u];s[l.id]=l}for(var c=Rc(Rc({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!rc(d)){r=d,/^\d+$/.test(d.id)&&(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported.");break}if(void 0===f[d.id]){var p=c[d.from],v=c[d.to];if(void 0===p){n=' Node with id "'.concat(d.from,'" does not exist.'),r=d;break}if(void 0===v){n=' Node with id "'.concat(d.to,'" does not exist.'),r=d;break}}}if(null!==r)throw new TypeError("Invalid relationship provided: ".concat(JSON.stringify(r),".").concat(n))}},{key:"checkWebGLCompatibility",value:function(){if(void 0===this.options.disableWebGL||!this.options.disableWebGL){var t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.createElement("canvas");try{return Boolean(void 0!==window.WebGLRenderingContext&&(null!==t.getContext("webgl")||null!==t.getContext("experimental-webgl")))}catch(t){return!1}}();if(!t){if(void 0!==this.options.disableWebGL)throw new Mi("Could not initialize WebGL");this.options.renderer=da,console.warn("GPU acceleration is not available on your browser. Falling back to CPU layout and rendering. You can disable this warning by setting the disableWebGL option to true.")}void 0===this.options.disableWebGL&&(this.options.disableWebGL=!t)}}}],r&&Dc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Nc={textColorForBackground:Ou};const Uc=Mc})();var a=o.RL,s=o.wK,u=o.x_,l=o.lv,c=o.YQ,f=o.BP,h=o.GZ,d=o.Vw,p=o.Ay,v=o._G;export{a as CompatibilityError,s as ForceDirectedLayoutType,u as FreeLayoutType,l as GridLayoutType,c as HierarchicalLayoutType,f as NVL,h as colorMapperFunctions,d as d3ForceLayoutType,p as default,v as drawCircleBand};
|
|
2
|
+
import*as t from"@neo4j-nvl/layout-workers";import*as e from"@segment/analytics-next";var n={931:t=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},269:(t,e,n)=>{var r=n(931),i=n(975),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var u=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},4:(t,e,n)=>{var r=n(861);t.exports=function(t){var e=r(t);return Math.round((299*parseInt(e[0])+587*parseInt(e[1])+114*parseInt(e[2]))/1e3)<=180?"dark":"light"}},792:(t,e,n)=>{var r=n(45),i=n(360),o=n(804);t.exports=function(t,e){if(!e)return t;var n=Object.keys(e);if(0===n.length)return t;for(var a=r(t),s=n.length-1;s>=0;s--){var u=n[s],l=String(e[u]);l&&(l=" "+l),o(a,{type:"preprocessor",data:"#define "+u+l})}return i(a)}},804:t=>{t.exports=function(t,i){Array.isArray(i)||(i=[i]);var o=function(t){for(var e=-1,n=0;n<t.length;n++){var i=t[n];if("preprocessor"===i.type)/^#(extension|version)/.test(i.data)&&(e=Math.max(e,n));else if("keyword"===i.type&&"precision"===i.data){var o=r(t,n);if(-1===o)throw new Error("precision statement not followed by any semicolons!");e=Math.max(e,o)}}return e+1}(t),a=o>0?t[o-1]:null;a&&n.test(a.data)&&t.splice(o++,0,e),t.splice.apply(t,[o,0].concat(i));var s=o+i.length;return t[s]&&/[^\r\n]$/.test(t[s].data)&&t.splice(s,0,e),t};var e={data:"\n",type:"whitespace"},n=/[^\r\n]$/;function r(t,e){for(var n=e;n<t.length;n++)if("operator"===t[n].type&&";"===t[n].data)return n;return-1}},360:t=>{t.exports=function(t){for(var e=[],n=0;n<t.length;n++)"eof"!==t[n].type&&e.push(t[n].data);return e.join("")}},206:(t,e,n)=>{t.exports=function(t){var e,n,S,T=0,O=0,A=u,P=[],E=[],k=1,C=0,j=0,D=!1,R=!1,I="",L=o,N=r;"300 es"===(t=t||{}).version&&(L=s,N=a);var M={},F={};for(T=0;T<L.length;T++)M[L[T]]=!0;for(T=0;T<N.length;T++)F[N[T]]=!0;return function(t){return E=[],null!==t?function(t){var n;for(T=0,t.toString&&(t=t.toString()),I+=t.replace(/\r\n/g,"\n"),S=I.length;e=I[T],T<S;){switch(n=T,A){case c:T=G();break;case f:case h:T=V();break;case d:T=W();break;case p:T=Y();break;case x:T=H();break;case v:T=$();break;case l:T=q();break;case b:T=B();break;case u:T=z()}n!==T&&("\n"===I[n]?(C=0,++k):++C)}return O+=T,I=I.slice(T),E}(t):(P.length&&U(P.join("")),A=w,U("(eof)"),E)};function U(t){t.length&&E.push({type:_[A],data:t,position:j,line:k,column:C})}function z(){return P=P.length?[]:P,"/"===n&&"*"===e?(j=O+T-1,A=c,n=e,T+1):"/"===n&&"/"===e?(j=O+T-1,A=f,n=e,T+1):"#"===e?(A=h,j=O+T,T):/\s/.test(e)?(A=b,j=O+T,T):(D=/\d/.test(e),R=/[^\w_]/.test(e),j=O+T,A=D?p:R?d:l,T)}function B(){return/[^\s]/g.test(e)?(U(P.join("")),A=u,T):(P.push(e),n=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===n?(P.push(e),n=e,T+1):(U(P.join("")),A=u,T)}function G(){return"/"===e&&"*"===n?(P.push(e),U(P.join("")),A=u,T+1):(P.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return A=v,T;if("/"===n&&"*"===e)return A=c,T;if("/"===n&&"/"===e)return A=f,T;if("."===e&&P.length){for(;X(P););return A=v,T}if(";"===e||")"===e||"("===e){if(P.length)for(;X(P););return U(e),A=u,T+1}var t=2===P.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(P););return A=u,T}return P.push(e),n=e,T+1}function X(t){for(var e,n,r=0;;){if(e=i.indexOf(t.slice(0,t.length+r).join("")),n=i[e],-1===e){if(r--+t.length>0)continue;n=t.slice(0,1).join("")}return U(n),j+=n.length,(P=P.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(U(P.join("")),A=u,T):(P.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(P.push(e),A=v,n=e,T+1):"x"===e&&1===P.length&&"0"===P[0]?(A=x,P.push(e),n=e,T+1):/[^\d]/.test(e)?(U(P.join("")),A=u,T):(P.push(e),n=e,T+1)}function $(){return"f"===e&&(P.push(e),n=e,T+=1),/[eE]/.test(e)?(P.push(e),n=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(n))&&/[^\d]/.test(e)?(U(P.join("")),A=u,T):(P.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=P.join("");return A=F[t]?g:M[t]?m:y,U(P.join("")),A=u,T}return P.push(e),n=e,T+1}};var r=n(704),i=n(63),o=n(192),a=n(784),s=n(592),u=999,l=9999,c=0,f=1,h=2,d=3,p=4,v=5,y=6,m=7,g=8,b=9,w=10,x=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},592:(t,e,n)=>{var r=n(192);r=r.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},192:t=>{t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},784:(t,e,n)=>{var r=n(704);t.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},704:t=>{t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},63:t=>{t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},45:(t,e,n)=>{var r=n(206);t.exports=function(t,e){var n=r(e),i=[];return(i=i.concat(n(t))).concat(n(null))}},861:t=>{t.exports=function(t){t.charAt&&"#"===t.charAt(0)&&(t=function(t){var e=t.split("");return e.shift(),e.join("")}(t)),3===t.length&&(t=function(t){return t.split("").reduce((function(t,e){return t.concat([e,e])}),[]).join("")}(t));var e=parseInt(t,16);return[e>>16&255,e>>8&255,255&e]}},250:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",_="[object Map]",S="[object Number]",T="[object Object]",O="[object Promise]",A="[object RegExp]",P="[object Set]",E="[object String]",k="[object Symbol]",C="[object WeakMap]",j="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",I="[object Float64Array]",L="[object Int8Array]",N="[object Int16Array]",M="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Y=RegExp(X.source),$=RegExp(H.source),q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,xt="\\ud800-\\udfff",_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",Ot="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Et="["+xt+"]",kt="["+Pt+"]",Ct="["+_t+"]",jt="\\d+",Dt="["+St+"]",Rt="["+Tt+"]",It="[^"+xt+Pt+jt+St+Tt+Ot+"]",Lt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+xt+"]",Mt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+Ot+"]",zt="\\u200d",Bt="(?:"+Rt+"|"+It+")",Vt="(?:"+Ut+"|"+It+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+Ct+"|"+Lt+")?",Ht="["+At+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Nt,Mt,Ft].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Dt,Mt,Ft].join("|")+")"+Yt,qt="(?:"+[Nt+Ct+"?",Ct,Mt,Ft,Et].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(Ct,"g"),Jt=RegExp(Lt+"(?="+Lt+")|"+qt+Yt,"g"),Qt=RegExp([Ut+"?"+Rt+"+"+Gt+"(?="+[kt,Ut,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[kt,Ut+Bt,"$"].join("|")+")",Ut+"?"+Bt+"+"+Gt,Ut+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,$t].join("|"),"g"),te=RegExp("["+zt+xt+_t+At+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["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"],re=-1,ie={};ie[R]=ie[I]=ie[L]=ie[N]=ie[M]=ie[F]=ie[U]=ie[z]=ie[B]=!0,ie[v]=ie[y]=ie[j]=ie[m]=ie[D]=ie[g]=ie[b]=ie[w]=ie[_]=ie[S]=ie[T]=ie[A]=ie[P]=ie[E]=ie[C]=!1;var oe={};oe[v]=oe[y]=oe[j]=oe[D]=oe[m]=oe[g]=oe[R]=oe[I]=oe[L]=oe[N]=oe[M]=oe[_]=oe[S]=oe[T]=oe[A]=oe[P]=oe[E]=oe[k]=oe[F]=oe[U]=oe[z]=oe[B]=!0,oe[b]=oe[w]=oe[C]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ve=pe&&le.process,ye=function(){try{return de&&de.require&&de.require("util").types||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,ge=ye&&ye.isDate,be=ye&&ye.isMap,we=ye&&ye.isRegExp,xe=ye&&ye.isSet,_e=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Pe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ee(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ke(t,e){return!(null==t||!t.length)&&Ue(t,e,0)>-1}function Ce(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function De(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Re(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ne=Ge("length");function Me(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Fe(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ue(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Fe(t,Be,n)}function ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?He(t,e)/n:h}function Ge(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function He(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function $e(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function qe(t){return function(e){return t(e)}}function Ze(t,e){return je(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Ue(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ue(e,t[n],0)>-1;);return n}var tn=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Ne(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,xt=e.Error,_t=e.Function,St=e.Math,Tt=e.Object,Ot=e.RegExp,At=e.String,Pt=e.TypeError,Et=r.prototype,kt=_t.prototype,Ct=Tt.prototype,jt=e["__core-js_shared__"],Dt=kt.toString,Rt=Ct.hasOwnProperty,It=0,Lt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Nt=Ct.toString,Mt=Dt.call(Tt),Ft=fe._,Ut=Ot("^"+Dt.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:i,Bt=e.Symbol,Vt=e.Uint8Array,Gt=zt?zt.allocUnsafe:i,Wt=an(Tt.getPrototypeOf,Tt),Xt=Tt.create,Ht=Ct.propertyIsEnumerable,Yt=Et.splice,$t=Bt?Bt.isConcatSpreadable:i,qt=Bt?Bt.iterator:i,Jt=Bt?Bt.toStringTag:i,te=function(){try{var t=uo(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=it&&it.now!==fe.Date.now&&it.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=St.ceil,de=St.floor,ve=Tt.getOwnPropertySymbols,ye=zt?zt.isBuffer:i,Ne=e.isFinite,We=Et.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,wn=St.random,xn=Et.reverse,_n=uo(e,"DataView"),Sn=uo(e,"Map"),Tn=uo(e,"Promise"),On=uo(e,"Set"),An=uo(e,"WeakMap"),Pn=uo(Tt,"create"),En=An&&new An,kn={},Cn=Mo(_n),jn=Mo(Sn),Dn=Mo(Tn),Rn=Mo(On),In=Mo(An),Ln=Bt?Bt.prototype:i,Nn=Ln?Ln.valueOf:i,Mn=Ln?Ln.toString:i;function Fn(t){if(ts(t)&&!Ga(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(Rt.call(t,"__wrapped__"))return Fo(t)}return new Bn(t)}var Un=function(){function t(){}return function(e){if(!Qa(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function $n(t,e){var n=Ga(t),r=!n&&Va(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&us(t),a=n||r||i||o,s=a?Ye(t.length,At):[],u=s.length;for(var l in t)!e&&!Rt.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yo(l,u))||s.push(l);return s}function qn(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Do(Ai(t),or(e,0,t.length))}function Kn(t){return Do(Ai(t))}function Jn(t,e,n){(n!==i&&!Ua(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Rt.call(t,e)&&Ua(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Ua(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Pi(e,Cs(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:Os(t,e[n]);return a}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ar(t,e,n,r,o,a){var s,u=1&e,l=2&e,c=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!Qa(t))return t;var f=Ga(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Rt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ai(t,s)}else{var h=fo(t),d=h==w||h==x;if(Ya(t))return wi(t,u);if(h==T||h==v||d&&!o){if(s=l||d?{}:po(t),!u)return l?function(t,e){return Pi(t,co(t),e)}(t,function(t,e){return t&&Pi(e,js(e),t)}(s,t)):function(t,e){return Pi(t,lo(t),e)}(t,nr(s,t))}else{if(!oe[h])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case j:return xi(t);case m:case g:return new i(+t);case D:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case R:case I:case L:case N:case M:case F:case U:case z:case B:return _i(t,n);case _:return new i;case S:case E:return new i(t);case A:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case P:return new i;case k:return r=t,Nn?Tt(Nn.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),os(t)?t.forEach((function(r){s.add(ar(r,e,n,r,t,a))})):es(t)&&t.forEach((function(r,i){s.set(i,ar(r,e,n,i,t,a))}));var y=f?i:(c?l?eo:to:l?js:Cs)(t);return Oe(y||t,(function(r,i){y&&(r=t[i=r]),Qn(s,i,ar(r,e,n,i,t,a))})),s}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new Pt(o);return Eo((function(){t.apply(i,n)}),e)}function lr(t,e,n,r){var i=-1,o=ke,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=je(e,qe(n))),r?(o=Ce,a=!1):e.length>=200&&(o=Ke,a=!1,e=new Hn(e));t:for(;++i<s;){var c=t[i],f=null==n?c:n(c);if(c=r||0!==c?c:0,a&&f==f){for(var h=l;h--;)if(e[h]===f)continue t;u.push(c)}else o(e,f,r)||u.push(c)}return u}Fn.templateSettings={escape:q,evaluate:Z,interpolate:K,variable:"",imports:{_:Fn}},Fn.prototype=zn.prototype,Fn.prototype.constructor=Fn,Bn.prototype=Un(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Un(zn.prototype),Vn.prototype.constructor=Vn,Gn.prototype.clear=function(){this.__data__=Pn?Pn(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(Pn){var n=e[t];return n===a?i:n}return Rt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return Pn?e[t]!==i:Rt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pn&&e===i?a:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Sn||Wn),string:new Gn}},Xn.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ao(this,t).get(t)},Xn.prototype.has=function(t){return ao(this,t).has(t)},Xn.prototype.set=function(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,a),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var cr=Ci(gr),fr=Ci(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,l=a}return l}function pr(t,e){var n=[];return cr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?vr(s,e-1,n,r,i):De(i,s):r||(i[i.length]=s)}return i}var yr=ji(),mr=ji(!0);function gr(t,e){return t&&yr(t,e,Cs)}function br(t,e){return t&&mr(t,e,Cs)}function wr(t,e){return Ee(e,(function(e){return Za(t[e])}))}function xr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[No(e[n++])];return n&&n==r?t:i}function _r(t,e,n){var r=e(t);return Ga(t)?r:De(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Tt(t)?function(t){var e=Rt.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(t){}var o=Nt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Nt.call(t)}(t)}function Tr(t,e){return t>e}function Or(t,e){return null!=t&&Rt.call(t,e)}function Ar(t,e){return null!=t&&e in Tt(t)}function Pr(t,e,n){for(var o=n?Ce:ke,a=t[0].length,s=t.length,u=s,l=r(s),c=1/0,f=[];u--;){var h=t[u];u&&e&&(h=je(h,qe(e))),c=mn(h.length,c),l[u]=!n&&(e||a>=120&&h.length>=120)?new Hn(u&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&f.length<c;){var v=h[d],y=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ke(p,y):o(f,y,n))){for(u=s;--u;){var m=l[u];if(!(m?Ke(m,y):o(t[u],y,n)))continue t}p&&p.push(y),f.push(v)}}return f}function Er(t,e,n){var r=null==(t=Oo(t,e=yi(e,t)))?t:t[No(qo(e))];return null==r?i:Se(r,t,n)}function kr(t){return ts(t)&&Sr(t)==v}function Cr(t,e,n,r,o){return t===e||(null==t||null==e||!ts(t)&&!ts(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=Ga(t),u=Ga(e),l=s?y:fo(t),c=u?y:fo(e),f=(l=l==v?T:l)==T,h=(c=c==v?T:c)==T,d=l==c;if(d&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||us(t)?Ji(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case D:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case m:case g:case S:return Ua(+t,+e);case b:return t.name==e.name&&t.message==e.message;case A:case E:return t==e+"";case _:var s=on;case P:var u=1&r;if(s||(s=un),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=Ji(s(t),s(e),r,i,o,a);return a.delete(t),c;case k:if(Nn)return Nn.call(t)==Nn.call(e)}return!1}(t,e,l,n,r,o,a);if(!(1&n)){var p=f&&Rt.call(t,"__wrapped__"),w=h&&Rt.call(e,"__wrapped__");if(p||w){var x=p?t.value():t,O=w?e.value():e;return a||(a=new Yn),o(x,O,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=to(t),l=u.length;if(l!=to(e).length&&!s)return!1;for(var c=l;c--;){var f=u[c];if(!(s?f in e:Rt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++c<l;){var y=t[f=u[c]],m=e[f];if(r)var g=s?r(m,y,f,e,t,a):r(y,m,f,t,e,a);if(!(g===i?y===m||o(y,m,n,r,a):g)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,Cr,o))}function jr(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=n[o])[0],c=t[l],f=u[1];if(s&&u[2]){if(c===i&&!(l in t))return!1}else{var h=new Yn;if(r)var d=r(c,f,l,t,e,h);if(!(d===i?Cr(f,c,3,r,h):d))return!1}}return!0}function Dr(t){return!(!Qa(t)||(e=t,Lt&&Lt in e))&&(Za(t)?Ut:vt).test(Mo(t));var e}function Rr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Fr(t[0],t[1]):Mr(t):fu(t)}function Ir(t){if(!xo(t))return vn(t);var e=[];for(var n in Tt(t))Rt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t,e){return t<e}function Nr(t,e){var n=-1,i=Xa(t)?r(t.length):[];return cr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Mr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function Fr(t,e){return go(t)&&_o(e)?So(No(t),e):function(n){var r=Os(n,t);return r===i&&r===e?As(n,t):Cr(e,r,3)}}function Ur(t,e,n,r,o){t!==e&&yr(e,(function(a,s){if(o||(o=new Yn),Qa(a))!function(t,e,n,r,o,a,s){var u=Ao(t,n),l=Ao(e,n),c=s.get(l);if(c)Jn(t,n,c);else{var f=a?a(u,l,n+"",t,e,s):i,h=f===i;if(h){var d=Ga(l),p=!d&&Ya(l),v=!d&&!p&&us(l);f=l,d||p||v?Ga(u)?f=u:Ha(u)?f=Ai(u):p?(h=!1,f=wi(l,!0)):v?(h=!1,f=_i(l,!0)):f=[]:rs(l)||Va(l)?(f=u,Va(u)?f=ys(u):Qa(u)&&!Za(u)||(f=po(l))):h=!1}h&&(s.set(l,f),o(f,l,r,a,s),s.delete(l)),Jn(t,n,f)}}(t,e,s,n,Ur,r,o);else{var u=r?r(Ao(t,s),a,s+"",t,e,o):i;u===i&&(u=a),Jn(t,s,u)}}),js)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Br(t,e,n){e=e.length?je(e,(function(t){return Ga(t)?function(e){return xr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=je(e,qe(oo()));var i=Nr(t,(function(t,n,i){var o=je(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Si(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=xr(t,a);n(s,a)&&Zr(o,yi(a,t),s)}return o}function Gr(t,e,n,r){var i=r?ze:Ue,o=-1,a=e.length,s=t;for(t===e&&(e=Ai(e)),n&&(s=je(t,qe(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Yt.call(s,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function Xr(t,e){return t+de(wn()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(To(t,e,nu),t+"")}function $r(t){return qn(Us(t))}function qr(t,e){var n=Us(t);return Do(n,or(e,0,n.length))}function Zr(t,e,n,r){if(!Qa(t))return t;for(var o=-1,a=(e=yi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=No(e[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var f=u[l];(c=r?r(f,l,u):i)===i&&(c=Qa(f)?f:yo(e[o+1])?[]:{})}Qn(u,l,c),u=u[l]}return t}var Kr=En?function(t,e){return En.set(t,e),t}:nu,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qs(e),writable:!0})}:nu;function Qr(t){return Do(Us(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ei(t,e){var n;return cr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=ss(e),c=e===i;o<a;){var f=de((o+a)/2),h=n(t[f]),d=h!==i,p=null===h,v=h==h,y=ss(h);if(s)var m=r||v;else m=c?v&&(r||d):u?v&&d&&(r||!p):l?v&&d&&!p&&(r||!y):!p&&!y&&(r?h<=e:h<e);m?o=f+1:a=f}return mn(a,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ua(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function oi(t){return"number"==typeof t?t:ss(t)?h:+t}function ai(t){if("string"==typeof t)return t;if(Ga(t))return je(t,ai)+"";if(ss(t))return Mn?Mn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=ke,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Ce;else if(o>=200){var l=e?null:Hi(t);if(l)return un(l);a=!1,i=Ke,u=new Hn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(c)}else i(u,f,n)||(u!==s&&u.push(f),s.push(c))}return s}function ui(t,e){return null==(t=Oo(t,e=yi(e,t)))||delete t[No(qo(e))]}function li(t,e,n,r){return Zr(t,e,n(xr(t,e)),r)}function ci(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),Re(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=lr(a[o]||s,t[u],e,n));return si(vr(a,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function pi(t){return Ha(t)?t:[]}function vi(t){return"function"==typeof t?t:nu}function yi(t,e){return Ga(t)?t:go(t,e)?[t]:Lo(ms(t))}var mi=Yr;function gi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var bi=ae||function(t){return fe.clearTimeout(t)};function wi(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _i(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=ss(t),s=e!==i,u=null===e,l=e==e,c=ss(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!c&&t<e||c&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,l=e.length,c=yn(a-s,0),f=r(l+c),h=!i;++u<l;)f[u]=e[u];for(;++o<s;)(h||o<a)&&(f[n[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}function Oi(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,l=-1,c=e.length,f=yn(a-u,0),h=r(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++l<c;)h[p+l]=e[l];for(;++s<u;)(d||o<a)&&(h[p+n[s]]=t[o++]);return h}function Ai(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Pi(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=r?r(n[u],t[u],u,n,t):i;l===i&&(l=t[u]),o?rr(n,u,l):Qn(n,u,l)}return n}function Ei(t,e){return function(n,r){var i=Ga(n)?Te:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function ki(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&mo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function Ci(t,e){return function(n,r){if(null==n)return n;if(!Xa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function ji(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Di(t){return function(e){var n=rn(e=ms(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?gi(n,1).join(""):e.slice(1);return r[t]()+o}}function Ri(t){return function(e){return Re(Zs(Vs(e).replace(Zt,"")),t,"")}}function Ii(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Un(t.prototype),r=t.apply(n,e);return Qa(r)?r:n}}function Li(t){return function(e,n,r){var o=Tt(e);if(!Xa(e)){var a=oo(n,3);e=Cs(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Ni(t){return Qi((function(e){var n=e.length,r=n,a=Bn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Pt(o);if(a&&!u&&"wrapper"==ro(s))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var l=ro(s=e[r]),c="wrapper"==l?no(s):i;u=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ro(c[0])].apply(u,c[3]):1==s.length&&bo(s)?u[l]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ga(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Mi(t,e,n,o,a,s,u,c,f,h){var d=e&l,p=1&e,v=2&e,y=24&e,m=512&e,g=v?i:Ii(t);return function l(){for(var b=arguments.length,w=r(b),x=b;x--;)w[x]=arguments[x];if(y)var _=io(l),S=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(w,_);if(o&&(w=Ti(w,o,a,y)),s&&(w=Oi(w,s,u,y)),b-=S,y&&b<h){var T=sn(w,_);return Wi(t,e,Mi,l.placeholder,n,w,T,c,f,h-b)}var O=p?n:this,A=v?O[t]:t;return b=w.length,c?w=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Ai(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}(w,c):m&&b>1&&w.reverse(),d&&f<b&&(w.length=f),this&&this!==fe&&this instanceof l&&(A=g||Ii(A)),A.apply(O,w)}}function Fi(t,e){return function(n,r){return function(t,e,n,r){return gr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Ui(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ai(n),r=ai(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function zi(t){return Qi((function(e){return e=je(e,qe(oo())),Yr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Bi(t,e){var n=(e=e===i?" ":ai(e)).length;if(n<2)return n?Hr(e,t):e;var r=Hr(e,he(t/cn(e)));return rn(e)?gi(fn(r),0,t).join(""):r.slice(0,t)}function Vi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n,i){for(var o=-1,a=yn(he((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:hs(o),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vs(e),n=vs(n)),t(e,n)}}function Wi(t,e,n,r,o,a,s,l,c,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,l,c,f],p=n.apply(i,d);return bo(t)&&Po(p,d),p.placeholder=r,Co(p,t,e)}function Xi(t){var e=St[t];return function(t,n){if(t=vs(t),(n=null==n?0:mn(ds(n),292))&&Ne(t)){var r=(ms(t)+"e").split("e");return+((r=(ms(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Hi=On&&1/un(new On([,-0]))[1]==c?function(t){return new On(t)}:su;function Yi(t){return function(e){var n=fo(e);return n==_?on(e):n==P?ln(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function $i(t,e,n,a,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Pt(o);var v=a?a.length:0;if(v||(e&=-97,a=c=i),h=h===i?h:yn(ds(h),0),d=d===i?d:ds(d),v-=c?c.length:0,64&e){var y=a,m=c;a=c=i}var g=p?i:no(t),b=[t,e,n,a,c,y,m,f,h,d];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Ti(c,u,e[4]):u,t[4]=c?sn(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Oi(c,u,e[6]):u,t[6]=c?sn(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&l&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,g),t=b[0],e=b[1],n=b[2],a=b[3],c=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)w=8==e||16==e?function(t,e,n){var o=Ii(t);return function a(){for(var s=arguments.length,u=r(s),l=s,c=io(a);l--;)u[l]=arguments[l];var f=s<3&&u[0]!==c&&u[s-1]!==c?[]:sn(u,c);return(s-=f.length)<n?Wi(t,e,Mi,a.placeholder,i,u,f,i,i,n-s):Se(this&&this!==fe&&this instanceof a?o:t,this,u)}}(t,e,d):e!=u&&33!=e||c.length?Mi.apply(i,b):function(t,e,n,i){var o=1&e,a=Ii(t);return function e(){for(var s=-1,u=arguments.length,l=-1,c=i.length,f=r(c+u),h=this&&this!==fe&&this instanceof e?a:t;++l<c;)f[l]=i[l];for(;u--;)f[l++]=arguments[++s];return Se(h,o?n:this,f)}}(t,e,n,a);else var w=function(t,e,n){var r=1&e,i=Ii(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Co((g?Kr:Po)(w,b),t,e)}function qi(t,e,n,r){return t===i||Ua(t,Ct[n])&&!Rt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return Qa(t)&&Qa(e)&&(a.set(e,t),Ur(t,e,i,Zi,a),a.delete(e)),t}function Ki(t){return rs(t)?i:t}function Ji(t,e,n,r,o,a){var s=1&n,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),f=a.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Hn:i;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],y=e[h];if(r)var m=s?r(y,v,h,e,t,a):r(v,y,h,t,e,a);if(m!==i){if(m)continue;d=!1;break}if(p){if(!Le(e,(function(t,e){if(!Ke(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==y&&!o(v,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Qi(t){return ko(To(t,i,Wo),t+"")}function to(t){return _r(t,Cs,lo)}function eo(t){return _r(t,js,co)}var no=En?function(t){return En.get(t)}:su;function ro(t){for(var e=t.name+"",n=kn[e],r=Rt.call(kn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Rt.call(Fn,"placeholder")?Fn:t).placeholder}function oo(){var t=Fn.iteratee||ru;return t=t===ru?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=Cs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_o(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Dr(n)?n:i}var lo=ve?function(t){return null==t?[]:(t=Tt(t),Ee(ve(t),(function(e){return Ht.call(t,e)})))}:pu,co=ve?function(t){for(var e=[];t;)De(e,lo(t)),t=Wt(t);return e}:pu,fo=Sr;function ho(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=No(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ja(i)&&yo(a,i)&&(Ga(t)||Va(t))}function po(t){return"function"!=typeof t.constructor||xo(t)?{}:Un(Wt(t))}function vo(t){return Ga(t)||Va(t)||!!($t&&t&&t[$t])}function yo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!Qa(n))return!1;var r=typeof e;return!!("number"==r?Xa(n)&&yo(e,n.length):"string"==r&&e in n)&&Ua(n[e],t)}function go(t,e){if(Ga(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ss(t))||Q.test(t)||!J.test(t)||null!=e&&t in Tt(e)}function bo(t){var e=ro(t),n=Fn[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(_n&&fo(new _n(new ArrayBuffer(1)))!=D||Sn&&fo(new Sn)!=_||Tn&&fo(Tn.resolve())!=O||On&&fo(new On)!=P||An&&fo(new An)!=C)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?Mo(n):"";if(r)switch(r){case Cn:return D;case jn:return _;case Dn:return O;case Rn:return P;case In:return C}return e});var wo=jt?Za:vu;function xo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ct)}function _o(t){return t==t&&!Qa(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Tt(n))}}function To(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Se(t,this,u)}}function Oo(t,e){return e.length<2?t:xr(t,ti(e,0,-1))}function Ao(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Po=jo(Kr),Eo=ce||function(t,e){return fe.setTimeout(t,e)},ko=jo(Jr);function Co(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(p,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function jo(t){var e=0,n=0;return function(){var r=gn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Do(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Ro,Io,Lo=(Ro=Ra((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Io.size&&Io.clear(),t})),Io=Ro.cache,Ro);function No(t){if("string"==typeof t||ss(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Mo(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Fo(t){if(t instanceof Vn)return t.clone();var e=new Bn(t.__wrapped__,t.__chain__);return e.__actions__=Ai(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Uo=Yr((function(t,e){return Ha(t)?lr(t,vr(e,1,Ha,!0)):[]})),zo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),oo(n,2)):[]})),Bo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Fe(t,oo(e,3),i)}function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ds(n),o=n<0?yn(r+o,0):mn(o,r-1)),Fe(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Xo(t){return t&&t.length?t[0]:i}var Ho=Yr((function(t){var e=je(t,pi);return e.length&&e[0]===t[0]?Pr(e):[]})),Yo=Yr((function(t){var e=qo(t),n=je(t,pi);return e===qo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Pr(n,oo(e,2)):[]})),$o=Yr((function(t){var e=qo(t),n=je(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Pr(n,i,e):[]}));function qo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Zo=Yr(Ko);function Ko(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Jo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,je(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function Qo(t){return null==t?t:xn.call(t)}var ta=Yr((function(t){return si(vr(t,1,Ha,!0))})),ea=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),si(vr(t,1,Ha,!0),oo(e,2))})),na=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,si(vr(t,1,Ha,!0),i,e)}));function ra(t){if(!t||!t.length)return[];var e=0;return t=Ee(t,(function(t){if(Ha(t))return e=yn(t.length,e),!0})),Ye(e,(function(e){return je(t,Ge(e))}))}function ia(t,e){if(!t||!t.length)return[];var n=ra(t);return null==e?n:je(n,(function(t){return Se(e,i,t)}))}var oa=Yr((function(t,e){return Ha(t)?lr(t,e):[]})),aa=Yr((function(t){return hi(Ee(t,Ha))})),sa=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),hi(Ee(t,Ha),oo(e,2))})),ua=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,hi(Ee(t,Ha),i,e)})),la=Yr(ra),ca=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ia(t,n)}));function fa(t){var e=Fn(t);return e.__chain__=!0,e}function ha(t,e){return e(t)}var da=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),pa=Ei((function(t,e,n){Rt.call(t,n)?++t[n]:rr(t,n,1)})),va=Li(Vo),ya=Li(Go);function ma(t,e){return(Ga(t)?Oe:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Ae:fr)(t,oo(e,3))}var ba=Ei((function(t,e,n){Rt.call(t,n)?t[n].push(e):rr(t,n,[e])})),wa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=Xa(t)?r(t.length):[];return cr(t,(function(t){a[++i]=o?Se(e,t,n):Er(t,e,n)})),a})),xa=Ei((function(t,e,n){rr(t,n,e)}));function _a(t,e){return(Ga(t)?je:Nr)(t,oo(e,3))}var Sa=Ei((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,vr(e,1),[])})),Oa=le||function(){return fe.Date.now()};function Aa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,$i(t,l,i,i,i,i,e)}function Pa(t,e){var n;if("function"!=typeof e)throw new Pt(o);return t=ds(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Ea=Yr((function(t,e,n){var r=1;if(n.length){var i=sn(n,io(Ea));r|=u}return $i(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=sn(n,io(ka));r|=u}return $i(e,r,t,n,i)}));function Ca(t,e,n){var r,a,s,u,l,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Pt(o);function v(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function y(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=s}function m(){var t=Oa();if(y(t))return g(t);l=Eo(m,function(t){var n=e-(t-c);return d?mn(n,s-(t-f)):n}(t))}function g(t){return l=i,p&&r?v(t):(r=a=i,u)}function b(){var t=Oa(),n=y(t);if(r=arguments,a=this,c=t,n){if(l===i)return function(t){return f=t,l=Eo(m,e),h?v(t):u}(c);if(d)return bi(l),l=Eo(m,e),v(c)}return l===i&&(l=Eo(m,e)),u}return e=vs(e)||0,Qa(n)&&(h=!!n.leading,s=(d="maxWait"in n)?yn(vs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==i&&bi(l),f=0,r=c=a=l=i},b.flush=function(){return l===i?u:g(Oa())},b}var ja=Yr((function(t,e){return ur(t,1,e)})),Da=Yr((function(t,e,n){return ur(t,vs(e)||0,n)}));function Ra(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Pt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Xn),n}function Ia(t){if("function"!=typeof t)throw new Pt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ra.Cache=Xn;var La=mi((function(t,e){var n=(e=1==e.length&&Ga(e[0])?je(e[0],qe(oo())):je(vr(e,1),qe(oo()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Na=Yr((function(t,e){var n=sn(e,io(Na));return $i(t,u,i,e,n)})),Ma=Yr((function(t,e){var n=sn(e,io(Ma));return $i(t,64,i,e,n)})),Fa=Qi((function(t,e){return $i(t,256,i,i,i,e)}));function Ua(t,e){return t===e||t!=t&&e!=e}var za=Gi(Tr),Ba=Gi((function(t,e){return t>=e})),Va=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Rt.call(t,"callee")&&!Ht.call(t,"callee")},Ga=r.isArray,Wa=me?qe(me):function(t){return ts(t)&&Sr(t)==j};function Xa(t){return null!=t&&Ja(t.length)&&!Za(t)}function Ha(t){return ts(t)&&Xa(t)}var Ya=ye||vu,$a=ge?qe(ge):function(t){return ts(t)&&Sr(t)==g};function qa(t){if(!ts(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Za(t){if(!Qa(t))return!1;var e=Sr(t);return e==w||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==ds(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=be?qe(be):function(t){return ts(t)&&fo(t)==_};function ns(t){return"number"==typeof t||ts(t)&&Sr(t)==S}function rs(t){if(!ts(t)||Sr(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==Mt}var is=we?qe(we):function(t){return ts(t)&&Sr(t)==A},os=xe?qe(xe):function(t){return ts(t)&&fo(t)==P};function as(t){return"string"==typeof t||!Ga(t)&&ts(t)&&Sr(t)==E}function ss(t){return"symbol"==typeof t||ts(t)&&Sr(t)==k}var us=_e?qe(_e):function(t){return ts(t)&&Ja(t.length)&&!!ie[Sr(t)]},ls=Gi(Lr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Ai(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=fo(t);return(e==_?on:e==P?un:Us)(t)}function hs(t){return t?(t=vs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ds(t){var e=hs(t),n=e%1;return e==e?n?e-n:e:0}function ps(t){return t?or(ds(t),0,d):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return h;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var n=pt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return Pi(t,js(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(xo(e)||Xa(e))Pi(e,Cs(e),t);else for(var n in e)Rt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Pi(e,js(e),t)})),ws=ki((function(t,e,n,r){Pi(e,js(e),t,r)})),xs=ki((function(t,e,n,r){Pi(e,Cs(e),t,r)})),_s=Qi(ir),Ss=Yr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=js(a),u=-1,l=s.length;++u<l;){var c=s[u],f=t[c];(f===i||Ua(f,Ct[c])&&!Rt.call(t,c))&&(t[c]=a[c])}return t})),Ts=Yr((function(t){return t.push(i,Zi),Se(Rs,i,t)}));function Os(t,e,n){var r=null==t?i:xr(t,e);return r===i?n:r}function As(t,e){return null!=t&&ho(t,e,Ar)}var Ps=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Nt.call(e)),t[e]=n}),Qs(nu)),Es=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Nt.call(e)),Rt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),ks=Yr(Er);function Cs(t){return Xa(t)?$n(t):Ir(t)}function js(t){return Xa(t)?$n(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=xo(t),n=[];for(var r in t)("constructor"!=r||!e&&Rt.call(t,r))&&n.push(r);return n}(t)}var Ds=ki((function(t,e,n){Ur(t,e,n)})),Rs=ki((function(t,e,n,r){Ur(t,e,n,r)})),Is=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Pi(t,eo(t),n),r&&(n=ar(n,7,Ki));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ls=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return As(t,n)}))}(t,e)}));function Ns(t,e){if(null==t)return{};var n=je(eo(t),(function(t){return[t]}));return e=oo(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var Ms=Yi(Cs),Fs=Yi(js);function Us(t){return null==t?[]:Ze(t,Cs(t))}var zs=Ri((function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)}));function Bs(t){return qs(ms(t).toLowerCase())}function Vs(t){return(t=ms(t))&&t.replace(gt,tn).replace(Kt,"")}var Gs=Ri((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Ri((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Di("toLowerCase"),Hs=Ri((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Ri((function(t,e,n){return t+(n?" ":"")+qs(e)})),$s=Ri((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),qs=Di("toUpperCase");function Zs(t,e,n){return t=ms(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ks=Yr((function(t,e){try{return Se(t,i,e)}catch(t){return qa(t)?t:new xt(t)}})),Js=Qi((function(t,e){return Oe(e,(function(e){e=No(e),rr(t,e,Ea(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Ni(),eu=Ni(!0);function nu(t){return t}function ru(t){return Rr("function"==typeof t?t:ar(t,1))}var iu=Yr((function(t,e){return function(n){return Er(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Er(t,n,e)}}));function au(t,e,n){var r=Cs(e),i=wr(e,r);null!=n||Qa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=wr(e,Cs(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=Za(t);return Oe(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,De([this.value()],arguments))})})),t}function su(){}var uu=zi(je),lu=zi(Pe),cu=zi(Le);function fu(t){return go(t)?Ge(No(t)):function(t){return function(e){return xr(e,t)}}(t)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var yu,mu=Ui((function(t,e){return t+e}),0),gu=Xi("ceil"),bu=Ui((function(t,e){return t/e}),1),wu=Xi("floor"),xu=Ui((function(t,e){return t*e}),1),_u=Xi("round"),Su=Ui((function(t,e){return t-e}),0);return Fn.after=function(t,e){if("function"!=typeof e)throw new Pt(o);return t=ds(t),function(){if(--t<1)return e.apply(this,arguments)}},Fn.ary=Aa,Fn.assign=gs,Fn.assignIn=bs,Fn.assignInWith=ws,Fn.assignWith=xs,Fn.at=_s,Fn.before=Pa,Fn.bind=Ea,Fn.bindAll=Js,Fn.bindKey=ka,Fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ga(t)?t:[t]},Fn.chain=fa,Fn.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(ds(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(he(o/e));a<o;)u[s++]=ti(t,a,a+=e);return u},Fn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Fn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return De(Ga(n)?Ai(n):[n],vr(e,1))},Fn.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new Pt(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Fn.conforms=function(t){return function(t){var e=Cs(t);return function(n){return sr(n,t,e)}}(ar(t,1))},Fn.constant=Qs,Fn.countBy=pa,Fn.create=function(t,e){var n=Un(t);return null==e?n:nr(n,e)},Fn.curry=function t(e,n,r){var o=$i(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.curryRight=function t(e,n,r){var o=$i(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.debounce=Ca,Fn.defaults=Ss,Fn.defaultsDeep=Ts,Fn.defer=ja,Fn.delay=Da,Fn.difference=Uo,Fn.differenceBy=zo,Fn.differenceWith=Bo,Fn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:ds(e))<0?0:e,r):[]},Fn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:ds(e)))<0?0:e):[]},Fn.dropRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0,!0):[]},Fn.dropWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0):[]},Fn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ds(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ds(r))<0&&(r+=o),r=n>r?0:ps(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Fn.filter=function(t,e){return(Ga(t)?Ee:pr)(t,oo(e,3))},Fn.flatMap=function(t,e){return vr(_a(t,e),1)},Fn.flatMapDeep=function(t,e){return vr(_a(t,e),c)},Fn.flatMapDepth=function(t,e,n){return n=n===i?1:ds(n),vr(_a(t,e),n)},Fn.flatten=Wo,Fn.flattenDeep=function(t){return null!=t&&t.length?vr(t,c):[]},Fn.flattenDepth=function(t,e){return null!=t&&t.length?vr(t,e=e===i?1:ds(e)):[]},Fn.flip=function(t){return $i(t,512)},Fn.flow=tu,Fn.flowRight=eu,Fn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Fn.functions=function(t){return null==t?[]:wr(t,Cs(t))},Fn.functionsIn=function(t){return null==t?[]:wr(t,js(t))},Fn.groupBy=ba,Fn.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Fn.intersection=Ho,Fn.intersectionBy=Yo,Fn.intersectionWith=$o,Fn.invert=Ps,Fn.invertBy=Es,Fn.invokeMap=wa,Fn.iteratee=ru,Fn.keyBy=xa,Fn.keys=Cs,Fn.keysIn=js,Fn.map=_a,Fn.mapKeys=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Fn.mapValues=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Fn.matches=function(t){return Mr(ar(t,1))},Fn.matchesProperty=function(t,e){return Fr(t,ar(e,1))},Fn.memoize=Ra,Fn.merge=Ds,Fn.mergeWith=Rs,Fn.method=iu,Fn.methodOf=ou,Fn.mixin=au,Fn.negate=Ia,Fn.nthArg=function(t){return t=ds(t),Yr((function(e){return zr(e,t)}))},Fn.omit=Is,Fn.omitBy=function(t,e){return Ns(t,Ia(oo(e)))},Fn.once=function(t){return Pa(2,t)},Fn.orderBy=function(t,e,n,r){return null==t?[]:(Ga(e)||(e=null==e?[]:[e]),Ga(n=r?i:n)||(n=null==n?[]:[n]),Br(t,e,n))},Fn.over=uu,Fn.overArgs=La,Fn.overEvery=lu,Fn.overSome=cu,Fn.partial=Na,Fn.partialRight=Ma,Fn.partition=Sa,Fn.pick=Ls,Fn.pickBy=Ns,Fn.property=fu,Fn.propertyOf=function(t){return function(e){return null==t?i:xr(t,e)}},Fn.pull=Zo,Fn.pullAll=Ko,Fn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,oo(n,2)):t},Fn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,i,n):t},Fn.pullAt=Jo,Fn.range=hu,Fn.rangeRight=du,Fn.rearg=Fa,Fn.reject=function(t,e){return(Ga(t)?Ee:pr)(t,Ia(oo(e,3)))},Fn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Wr(t,i),n},Fn.rest=function(t,e){if("function"!=typeof t)throw new Pt(o);return Yr(t,e=e===i?e:ds(e))},Fn.reverse=Qo,Fn.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),(Ga(t)?Zn:qr)(t,e)},Fn.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Fn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Fn.shuffle=function(t){return(Ga(t)?Kn:Qr)(t)},Fn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:ds(e),n=n===i?r:ds(n)),ti(t,e,n)):[]},Fn.sortBy=Ta,Fn.sortedUniq=function(t){return t&&t.length?ii(t):[]},Fn.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Fn.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ms(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=ai(e))&&rn(t)?gi(fn(t),0,n):t.split(e,n):[]},Fn.spread=function(t,e){if("function"!=typeof t)throw new Pt(o);return e=null==e?0:yn(ds(e),0),Yr((function(n){var r=n[e],i=gi(n,0,e);return r&&De(i,r),Se(t,this,i)}))},Fn.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Fn.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:ds(e))<0?0:e):[]},Fn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:ds(e)))<0?0:e,r):[]},Fn.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Fn.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Fn.tap=function(t,e){return e(t),t},Fn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Pt(o);return Qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ca(t,e,{leading:r,maxWait:e,trailing:i})},Fn.thru=ha,Fn.toArray=fs,Fn.toPairs=Ms,Fn.toPairsIn=Fs,Fn.toPath=function(t){return Ga(t)?je(t,No):ss(t)?[t]:Ai(Lo(ms(t)))},Fn.toPlainObject=ys,Fn.transform=function(t,e,n){var r=Ga(t),i=r||Ya(t)||us(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qa(t)&&Za(o)?Un(Wt(t)):{}}return(i?Oe:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Aa(t,1)},Fn.union=ta,Fn.unionBy=ea,Fn.unionWith=na,Fn.uniq=function(t){return t&&t.length?si(t):[]},Fn.uniqBy=function(t,e){return t&&t.length?si(t,oo(e,2)):[]},Fn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Fn.unset=function(t,e){return null==t||ui(t,e)},Fn.unzip=ra,Fn.unzipWith=ia,Fn.update=function(t,e,n){return null==t?t:li(t,e,vi(n))},Fn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:li(t,e,vi(n),r)},Fn.values=Us,Fn.valuesIn=function(t){return null==t?[]:Ze(t,js(t))},Fn.without=oa,Fn.words=Zs,Fn.wrap=function(t,e){return Na(vi(e),t)},Fn.xor=aa,Fn.xorBy=sa,Fn.xorWith=ua,Fn.zip=la,Fn.zipObject=function(t,e){return di(t||[],e||[],Qn)},Fn.zipObjectDeep=function(t,e){return di(t||[],e||[],Zr)},Fn.zipWith=ca,Fn.entries=Ms,Fn.entriesIn=Fs,Fn.extend=bs,Fn.extendWith=ws,au(Fn,Fn),Fn.add=mu,Fn.attempt=Ks,Fn.camelCase=zs,Fn.capitalize=Bs,Fn.ceil=gu,Fn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=vs(n))==n?n:0),e!==i&&(e=(e=vs(e))==e?e:0),or(vs(t),e,n)},Fn.clone=function(t){return ar(t,4)},Fn.cloneDeep=function(t){return ar(t,5)},Fn.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:i)},Fn.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:i)},Fn.conformsTo=function(t,e){return null==e||sr(t,e,Cs(e))},Fn.deburr=Vs,Fn.defaultTo=function(t,e){return null==t||t!=t?e:t},Fn.divide=bu,Fn.endsWith=function(t,e,n){t=ms(t),e=ai(e);var r=t.length,o=n=n===i?r:or(ds(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Fn.eq=Ua,Fn.escape=function(t){return(t=ms(t))&&$.test(t)?t.replace(H,en):t},Fn.escapeRegExp=function(t){return(t=ms(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Fn.every=function(t,e,n){var r=Ga(t)?Pe:hr;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.find=va,Fn.findIndex=Vo,Fn.findKey=function(t,e){return Me(t,oo(e,3),gr)},Fn.findLast=ya,Fn.findLastIndex=Go,Fn.findLastKey=function(t,e){return Me(t,oo(e,3),br)},Fn.floor=wu,Fn.forEach=ma,Fn.forEachRight=ga,Fn.forIn=function(t,e){return null==t?t:yr(t,oo(e,3),js)},Fn.forInRight=function(t,e){return null==t?t:mr(t,oo(e,3),js)},Fn.forOwn=function(t,e){return t&&gr(t,oo(e,3))},Fn.forOwnRight=function(t,e){return t&&br(t,oo(e,3))},Fn.get=Os,Fn.gt=za,Fn.gte=Ba,Fn.has=function(t,e){return null!=t&&ho(t,e,Or)},Fn.hasIn=As,Fn.head=Xo,Fn.identity=nu,Fn.includes=function(t,e,n,r){t=Xa(t)?t:Us(t),n=n&&!r?ds(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),as(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ue(t,e,n)>-1},Fn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Ue(t,e,i)},Fn.inRange=function(t,e,n){return e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=vs(t),e,n)},Fn.invoke=ks,Fn.isArguments=Va,Fn.isArray=Ga,Fn.isArrayBuffer=Wa,Fn.isArrayLike=Xa,Fn.isArrayLikeObject=Ha,Fn.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Sr(t)==m},Fn.isBuffer=Ya,Fn.isDate=$a,Fn.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Fn.isEmpty=function(t){if(null==t)return!0;if(Xa(t)&&(Ga(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||us(t)||Va(t)))return!t.length;var e=fo(t);if(e==_||e==P)return!t.size;if(xo(t))return!Ir(t).length;for(var n in t)if(Rt.call(t,n))return!1;return!0},Fn.isEqual=function(t,e){return Cr(t,e)},Fn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Cr(t,e,i,n):!!r},Fn.isError=qa,Fn.isFinite=function(t){return"number"==typeof t&&Ne(t)},Fn.isFunction=Za,Fn.isInteger=Ka,Fn.isLength=Ja,Fn.isMap=es,Fn.isMatch=function(t,e){return t===e||jr(t,e,so(e))},Fn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,jr(t,e,so(e),n)},Fn.isNaN=function(t){return ns(t)&&t!=+t},Fn.isNative=function(t){if(wo(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(t)},Fn.isNil=function(t){return null==t},Fn.isNull=function(t){return null===t},Fn.isNumber=ns,Fn.isObject=Qa,Fn.isObjectLike=ts,Fn.isPlainObject=rs,Fn.isRegExp=is,Fn.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=f},Fn.isSet=os,Fn.isString=as,Fn.isSymbol=ss,Fn.isTypedArray=us,Fn.isUndefined=function(t){return t===i},Fn.isWeakMap=function(t){return ts(t)&&fo(t)==C},Fn.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Sr(t)},Fn.join=function(t,e){return null==t?"":We.call(t,e)},Fn.kebabCase=Gs,Fn.last=qo,Fn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ds(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Fe(t,Be,o,!0)},Fn.lowerCase=Ws,Fn.lowerFirst=Xs,Fn.lt=ls,Fn.lte=cs,Fn.max=function(t){return t&&t.length?dr(t,nu,Tr):i},Fn.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Tr):i},Fn.mean=function(t){return Ve(t,nu)},Fn.meanBy=function(t,e){return Ve(t,oo(e,2))},Fn.min=function(t){return t&&t.length?dr(t,nu,Lr):i},Fn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Lr):i},Fn.stubArray=pu,Fn.stubFalse=vu,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xu,Fn.nth=function(t,e){return t&&t.length?zr(t,ds(e)):i},Fn.noConflict=function(){return fe._===this&&(fe._=Ft),this},Fn.noop=su,Fn.now=Oa,Fn.pad=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(de(i),n)+t+Bi(he(i),n)},Fn.padEnd=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?t+Bi(e-r,n):t},Fn.padStart=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Fn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ms(t).replace(rt,""),e||0)},Fn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=hs(t),e===i?(e=t,t=0):e=hs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=wn();return mn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Fn.reduce=function(t,e,n){var r=Ga(t)?Re:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,cr)},Fn.reduceRight=function(t,e,n){var r=Ga(t)?Ie:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Fn.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),Hr(ms(t),e)},Fn.replace=function(){var t=arguments,e=ms(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fn.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[No(e[r])];a===i&&(r=o,a=n),t=Za(a)?a.call(t):a}return t},Fn.round=_u,Fn.runInContext=t,Fn.sample=function(t){return(Ga(t)?qn:$r)(t)},Fn.size=function(t){if(null==t)return 0;if(Xa(t))return as(t)?cn(t):t.length;var e=fo(t);return e==_||e==P?t.size:Ir(t).length},Fn.snakeCase=Hs,Fn.some=function(t,e,n){var r=Ga(t)?Le:ei;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Fn.sortedIndex=function(t,e){return ni(t,e)},Fn.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Fn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Ua(t[r],e))return r}return-1},Fn.sortedLastIndex=function(t,e){return ni(t,e,!0)},Fn.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Fn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Ua(t[n],e))return n}return-1},Fn.startCase=Ys,Fn.startsWith=function(t,e,n){return t=ms(t),n=null==n?0:or(ds(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Fn.subtract=Su,Fn.sum=function(t){return t&&t.length?He(t,nu):0},Fn.sumBy=function(t,e){return t&&t.length?He(t,oo(e,2)):0},Fn.template=function(t,e,n){var r=Fn.templateSettings;n&&mo(t,e,n)&&(e=i),t=ms(t),e=ws({},e,r,qi);var o,a,s=ws({},e.imports,r.imports,qi),u=Cs(s),l=Ze(s,u),c=0,f=e.interpolate||bt,h="__p += '",d=Ot((e.escape||bt).source+"|"+f.source+"|"+(f===K?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Rt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),h+=t.slice(c,u).replace(wt,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var v=Rt.call(e,"variable")&&e.variable;if(v){if(lt.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(W,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ks((function(){return _t(u,p+"return "+h).apply(i,l)}));if(y.source=h,qa(y))throw y;return y},Fn.times=function(t,e){if((t=ds(t))<1||t>f)return[];var n=d,r=mn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Fn.toFinite=hs,Fn.toInteger=ds,Fn.toLength=ps,Fn.toLower=function(t){return ms(t).toLowerCase()},Fn.toNumber=vs,Fn.toSafeInteger=function(t){return t?or(ds(t),-9007199254740991,f):0===t?t:0},Fn.toString=ms,Fn.toUpper=function(t){return ms(t).toUpperCase()},Fn.trim=function(t,e,n){if((t=ms(t))&&(n||e===i))return $e(t);if(!t||!(e=ai(e)))return t;var r=fn(t),o=fn(e);return gi(r,Je(r,o),Qe(r,o)+1).join("")},Fn.trimEnd=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,0,Qe(r,fn(e))+1).join("")},Fn.trimStart=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,Je(r,fn(e))).join("")},Fn.truncate=function(t,e){var n=30,r="...";if(Qa(e)){var o="separator"in e?e.separator:o;n="length"in e?ds(e.length):n,r="omission"in e?ai(e.omission):r}var a=(t=ms(t)).length;if(rn(t)){var s=fn(t);a=s.length}if(n>=a)return t;var u=n-cn(r);if(u<1)return r;var l=s?gi(s,0,u).join(""):t.slice(0,u);if(o===i)return l+r;if(s&&(u+=l.length-u),is(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=Ot(o.source,ms(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(t.indexOf(ai(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Fn.unescape=function(t){return(t=ms(t))&&Y.test(t)?t.replace(X,dn):t},Fn.uniqueId=function(t){var e=++It;return ms(t)+e},Fn.upperCase=$s,Fn.upperFirst=qs,Fn.each=ma,Fn.eachRight=ga,Fn.first=Xo,au(Fn,(yu={},gr(Fn,(function(t,e){Rt.call(Fn.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Fn.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),Oe(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===i?1:yn(ds(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return Er(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(Ia(oo(t)))},Vn.prototype.slice=function(t,e){t=ds(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ds(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},gr(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Fn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Fn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Vn,l=s[0],c=u||Ga(e),f=function(t){var e=o.apply(Fn,De([t],s));return r&&h?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&c){e=v?e:new Vn(this);var y=t.apply(e,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,h)}return p&&v?t.apply(this,s):(y=this.thru(f),p?r?y.value()[0]:y.value():y)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Et[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Fn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ga(i)?i:[],t)}return this[n]((function(n){return e.apply(Ga(n)?n:[],t)}))}})),gr(Vn.prototype,(function(t,e){var n=Fn[e];if(n){var r=n.name+"";Rt.call(kn,r)||(kn[r]=[]),kn[r].push({name:e,func:n})}})),kn[Mi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ga(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=mn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,y=t[l+=e];++v<f;){var m=c[v],g=m.iteratee,b=m.type,w=g(y);if(2==b)y=w;else if(!w){if(1==b)continue t;break t}}p[h++]=y}return p},Fn.prototype.at=da,Fn.prototype.chain=function(){return fa(this)},Fn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Fo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:i}),new Bn(e,this.__chain__)}return this.thru(Qo)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,qt&&(Fn.prototype[qt]=function(){return this}),Fn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},880:function(t,e,n){var r,i;r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function l(t){return function(){typeof console!==e&&(u.call(this),this[t].apply(this,arguments))}}function c(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):t)}(r)||l.apply(this,arguments)}function f(t,n){var a,s,l,f=this,h="loglevel";function d(){var t;if(typeof window!==e&&h){try{t=window.localStorage[h]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(t=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(t){}return void 0===f.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==f.levels[e.toUpperCase()]&&(e=f.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=f.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?h+=":"+t:"symbol"==typeof t&&(h=void 0),f.name=t,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||c,f.getLevel=function(){return null!=l?l:null!=s?s:a},f.setLevel=function(t,n){return l=p(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(t){}}}(l),u.call(f)},f.setDefaultLevel=function(t){s=p(t),d()||f.setLevel(t,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==e&&h){try{window.localStorage.removeItem(h)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),u.call(f)},f.enableAll=function(t){f.setLevel(f.levels.TRACE,t)},f.disableAll=function(t){f.setLevel(f.levels.SILENT,t)},f.rebuild=function(){if(o!==f&&(a=p(o.getLevel())),u.call(f),o===f)for(var t in i)i[t].rebuild()},a=p(o?o.getLevel():"WARN");var v=d();null!=v&&(l=p(v)),u.call(f)}(o=new f).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=i[t];return e||(e=i[t]=new f(t,o.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},481:(t,e,n)=>{t.exports=n(137)},137:t=>{t.exports=class{constructor(t,e,n,r){let i;if("object"==typeof t){let o=t;t=o.k_p,e=o.k_i,n=o.k_d,r=o.dt,i=o.i_max}this.k_p="number"==typeof t?t:1,this.k_i=e||0,this.k_d=n||0,this.dt=r||0,this.i_max=i||0,this.sumError=0,this.lastError=0,this.lastTime=0,this.target=0}setTarget(t){this.target=t}update(t){this.currentValue=t;let e=this.dt;if(!e){let t=Date.now();e=0===this.lastTime?0:(t-this.lastTime)/1e3,this.lastTime=t}"number"==typeof e&&0!==e||(e=1);let n=this.target-this.currentValue;if(this.sumError=this.sumError+n*e,this.i_max>0&&Math.abs(this.sumError)>this.i_max){let t=this.sumError>0?1:-1;this.sumError=t*this.i_max}let r=(n-this.lastError)/e;return this.lastError=n,this.k_p*n+this.k_i*this.sumError+this.k_d*r}reset(){this.sumError=0,this.lastError=0,this.lastTime=0}}},803:t=>{var e,n,r=document.attachEvent,i=!1;function o(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function a(t){var e=this;o(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}if(!r){var s=(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return n(t)}),u=(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),l=!1,c="",f="animationstart",h="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(l=!0),!1===l)for(var v=0;v<h.length;v++)if(void 0!==p.style[h[v]+"AnimationName"]){c="-"+h[v].toLowerCase()+"-",f=d[v],l=!0;break}var y="resizeanim",m="@"+c+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",g=c+"animation: 1ms "+y+"; "}t.exports=function(t,e){return r?t.attachEvent("onresize",e):(t.__resizeTriggers__||("static"==getComputedStyle(t).position&&(t.style.position="relative"),function(){if(!i){var t=(m||"")+".resize-triggers { "+(g||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n),i=!0}}(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),o(t),t.addEventListener("scroll",a,!0),f&&t.__resizeTriggers__.addEventListener(f,(function(e){e.animationName==y&&o(t)}))),t.__resizeListeners__.push(e)),function(){r?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",a),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))}}},975:(t,e,n)=>{var r=n(101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},101:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={id:t,loaded:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};(()=>{i.d(o,{RL:()=>Ni,wK:()=>ua,x_:()=>fa,lv:()=>ca,YQ:()=>la,BP:()=>Mc,GZ:()=>Fc,Vw:()=>ha,Ay:()=>Uc,_G:()=>Fs});var n=i(250);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}var u=["onLayoutDone","onLayoutStep","onError","onLayoutComputing","onWebGLContextLost","restart"],l=function(){function t(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=s(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks=i}var e,n;return e=t,n=[{key:"onLayoutDone",value:function(){this.isValidFunction(this.callbacks.onLayoutDone)&&this.callbacks.onLayoutDone()}},{key:"onLayoutStep",value:function(t){this.isValidFunction(this.callbacks.onLayoutStep)&&this.callbacks.onLayoutStep(t)}},{key:"onLayoutComputing",value:function(t){this.isValidFunction(this.callbacks.onLayoutComputing)&&this.callbacks.onLayoutComputing(t)}},{key:"onError",value:function(t){this.isValidFunction(this.callbacks.onError)&&this.callbacks.onError(t)}},{key:"onWebGLContextLost",value:function(t){this.isValidFunction(this.callbacks.onWebGLContextLost)&&this.callbacks.onWebGLContextLost(t)}},{key:"isValidFunction",value:function(t){return void 0!==t&&"function"==typeof t}}],n&&a(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function f(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){function t(t){void 0===t&&(t="Atom@"+re()),this.name=t,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Oe.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){He(this)},t.prototype.reportChanged=function(){We(),function(t){if(t.lowestObserverState!==Oe.STALE){t.lowestObserverState=Oe.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.UP_TO_DATE&&(r.isTracing!==Ae.NONE&&Ye(r,t),r.onBecomeStale()),r.dependenciesState=Oe.STALE}}}(this),Xe()},t.prototype.toString=function(){return this.name},t}(),d=function(t){function e(e,n,r){void 0===e&&(e="Atom@"+re()),void 0===n&&(n=le),void 0===r&&(r=le);var i=t.call(this,e)||this;return i.name=e,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return f(e,t),e.prototype.reportObserved=function(){return We(),t.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),Xe(),!!ke.trackingDerivation},e.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},e}(h),p=xe("Atom",h);function v(t){return t.interceptors&&t.interceptors.length>0}function y(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function m(t,e){var n=rn();try{var r=t.interceptors;if(r)for(var i=0,o=r.length;i<o&&(oe(!(e=r[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{on(n)}}function g(t){return t.changeListeners&&t.changeListeners.length>0}function b(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),ue((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function w(t,e){var n=rn(),r=t.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](e);on(n)}}function x(){return!!ke.spyListeners.length}function _(t){if(ke.spyListeners.length)for(var e=ke.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function S(t){_(pe({},t,{spyReportStart:!0}))}var T={spyReportEnd:!0};function O(t){_(t?pe({},t,T):T)}function A(t){return ke.spyListeners.push(t),ue((function(){var e=ke.spyListeners.indexOf(t);-1!==e&&ke.spyListeners.splice(e,1)}))}var P="__$$iterating";function E(t){oe(!0!==t[P],"Illegal state: cannot recycle array as iterator"),ge(t,P,!0);var e=-1;return ge(t,"next",(function(){return{done:++e>=this.length,value:e<this.length?this[e]:void 0}})),t}function k(t,e){ge(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var C,j,D=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,!1===t}(),R=0,I=function(){};C=I,j=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(C.prototype,j):void 0!==C.prototype.__proto__?C.prototype.__proto__=j:C.prototype=j,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(t){Object.defineProperty(I.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})}));var L=function(){function t(t,e,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new h(t||"ObservableArray@"+re()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer?t.map(this.dehancer):t},t.prototype.intercept=function(t){return y(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),b(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=e,e>0&&t+e+1>R&&z(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Qe(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=[]),v(this)){var o=m(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!o)return ee;e=o.removedCount,n=o.added}var a=(n=n.map((function(t){return r.enhancer(t,void 0)}))).length-e;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(t,e,n){if(n.length<1e4)return(r=this.values).splice.apply(r,[t,e].concat(n));var r,i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&x(),i=g(this),o=i||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&S(o),this.atom.reportChanged(),i&&w(this,o),r&&O()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&x(),i=g(this),o=i||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&S(o),this.atom.reportChanged(),i&&w(this,o),r&&O()},t}(),N=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableArray@"+re()),void 0===i&&(i=!1);var o=t.call(this)||this,a=new L(r,n,o,i);return ge(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),D&&Object.defineProperty(a.array,"0",M),o}return f(e,t),e.prototype.intercept=function(t){return this.$mobx.intercept(t)},e.prototype.observe=function(t,e){return void 0===e&&(e=!1),this.$mobx.observe(t,e)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),t.map((function(t){return V(t)?t.peek():t})))},e.prototype.replace=function(t){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,t)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(t,e,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},e.prototype.findIndex=function(t,e,n){void 0===n&&(n=0);for(var r=this.peek(),i=r.length,o=n;o<i;o++)if(t.call(e,r[o],o,this))return o;return-1},e.prototype.splice=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(t);case 2:return this.$mobx.spliceWithArray(t,e)}return this.$mobx.spliceWithArray(t,e,n)},e.prototype.spliceWithArray=function(t,e,n){return this.$mobx.spliceWithArray(t,e,n)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,t),n.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.$mobx;return n.spliceWithArray(0,0,t),n.values.length},e.prototype.reverse=function(){var t=this.slice();return t.reverse.apply(t,arguments)},e.prototype.sort=function(t){var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.dehanceValues(this.$mobx.values).indexOf(t);return e>-1&&(this.splice(e,1),!0)},e.prototype.move=function(t,e){function n(t){if(t<0)throw new Error("[mobx.array] Index out of bounds: "+t+" is negative");var e=this.$mobx.values.length;if(t>=e)throw new Error("[mobx.array] Index out of bounds: "+t+" is not smaller than "+e)}if(n.call(this,t),n.call(this,e),t!==e){var r,i=this.$mobx.values;r=t<e?i.slice(0,t).concat(i.slice(t+1,e+1),[i[t]],i.slice(e+1)):i.slice(0,e).concat([i[t]],i.slice(e,t),i.slice(t+1)),this.replace(r)}},e.prototype.get=function(t){var e=this.$mobx;if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(t,e){var n=this.$mobx,r=n.values;if(t<r.length){Qe(n.atom);var i=r[t];if(v(n)){var o=m(n,{type:"update",object:this,index:t,newValue:e});if(!o)return;e=o.newValue}(e=n.enhancer(e,i))!==i&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}},e}(I);k(N.prototype,(function(){return E(this.slice())})),Object.defineProperty(N.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(t){this.$mobx.setArrayLength(t)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach((function(t){var e=Array.prototype[t];oe("function"==typeof e,"Base function not defined on Array prototype: '"+t+"'"),me(N.prototype,t,(function(){return e.apply(this.peek(),arguments)}))})),function(t,e){for(var n=0;n<e.length;n++)me(t,e[n],t[e[n]])}(N.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var M=F(0);function F(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function U(t){Object.defineProperty(N.prototype,""+t,F(t))}function z(t){for(var e=R;e<t;e++)U(e);R=t}z(1e3);var B=xe("ObservableArrayAdministration",L);function V(t){return he(t)&&B(t.$mobx)}var G={},W=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableValue@"+re()),void 0===i&&(i=!0);var o=t.call(this,r)||this;return o.enhancer=n,o.hasUnreportedChange=!1,o.dehancer=void 0,o.value=n(e,void 0,r),i&&x()&&_({type:"create",object:o,newValue:o.value}),o}return f(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){var e=this.value;if((t=this.prepareNewValue(t))!==G){var n=x();n&&S({type:"update",object:this,newValue:t,oldValue:e}),this.setNewValue(t),n&&O()}},e.prototype.prepareNewValue=function(t){if(Qe(this),v(this)){var e=m(this,{object:this,type:"update",newValue:t});if(!e)return G;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.value!==t?t:G},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),g(this)&&w(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return y(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),b(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Te(this.get())},e}(h);W.prototype[Se()]=W.prototype.valueOf;var X=xe("ObservableValue",W),H={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"};function Y(t){return H[t]}function $(t,e){oe("function"==typeof e,Y("m026")),oe("string"==typeof t&&t.length>0,"actions should have valid names, got: '"+t+"'");var n=function(){return q(t,e,this,arguments)};return n.originalFn=e,n.isMobxAction=!0,n}function q(t,e,n,r){var i=function(t,e,n,r){var i=x()&&!!t,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];S({type:"action",name:t,fn:e,object:n,arguments:s})}var l=rn();return We(),{prevDerivation:l,prevAllowStateChanges:K(!0),notifySpy:i,startTime:o}}(t,e,n,r);try{return e.apply(n,r)}finally{!function(t){J(t.prevAllowStateChanges),Xe(),on(t.prevDerivation),t.notifySpy&&O({time:Date.now()-t.startTime})}(i)}}function Z(t){oe(null===ke.trackingDerivation,Y("m028")),ke.strictMode=t,ke.allowStateChanges=!t}function K(t){var e=ke.allowStateChanges;return ke.allowStateChanges=t,e}function J(t){ke.allowStateChanges=t}function Q(t,e,n,r,i){function o(o,a,s,u,l){if(void 0===l&&(l=0),oe(i||nt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){ye(o,"__mobxLazyInitializers")||me(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var c=s.value,f=s.initializer;return o.__mobxLazyInitializers.push((function(e){t(e,a,f?f.call(e):c,u,s)})),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&et(this),e.call(this,a)},set:function(t){!0!==this.__mobxDidRunLazyInitializers&&et(this),n.call(this,a,t)}}}var h={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||tt(this,a,void 0,t,u,s),e.call(this,a)},set:function(e){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,e):tt(this,a,e,t,u,s)}};return(arguments.length<3||5===arguments.length&&l<3)&&Object.defineProperty(o,a,h),h}return i?function(){if(nt(arguments))return o.apply(null,arguments);var t=arguments,e=arguments.length;return function(n,r,i){return o(n,r,i,t,e)}}:o}function tt(t,e,n,r,i,o){ye(t,"__mobxInitializedProps")||me(t,"__mobxInitializedProps",{}),t.__mobxInitializedProps[e]=!0,r(t,e,n,i,o)}function et(t){!0!==t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers&&(me(t,"__mobxDidRunLazyInitializers",!0),t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers.forEach((function(e){return e(t)})))}function nt(t){return(2===t.length||3===t.length)&&"string"==typeof t[1]}var rt=Q((function(t,e,n,r,i){var o=r&&1===r.length?r[0]:n.name||e||"<unnamed action>";me(t,e,ot(o,n))}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!0),it=Q((function(t,e,n){ut(t,e,n)}),(function(t){return this[t]}),(function(){oe(!1,Y("m001"))}),!1,!1),ot=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?$(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?$(t,e):1===arguments.length&&"string"==typeof t?at(t):at(e).apply(null,arguments)};function at(t){return function(e,n,r){if(r&&"function"==typeof r.value)return r.value=$(t,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return rt(t).apply(this,arguments)}}function st(t){return"function"==typeof t&&!0===t.isMobxAction}function ut(t,e,n){var r=function(){return q(e,n,t,arguments)};r.isMobxAction=!0,me(t,e,r)}ot.bound=function(t,e,n){if("function"==typeof t){var r=$("<not yet bound action>",t);return r.autoBind=!0,r}return it.apply(null,arguments)};var lt=Object.prototype.toString;function ct(t,e){return ft(t,e)}function ft(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&function(t,e,n,r){t=ht(t),e=ht(e);var i=lt.call(t);if(i!==lt.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!ft(t[u],e[u],n,r))return!1}else{var l,c=Object.keys(t);if(u=c.length,Object.keys(e).length!==u)return!1;for(;u--;)if(!dt(e,l=c[u])||!ft(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function ht(t){return V(t)?t.peek():te(t)?t.entries():_e(t)?function(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}(t.entries()):t}function dt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pt(t,e){return t===e}var vt={identity:pt,structural:function(t,e){return ct(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||pt(t,e)}};function yt(t,e,n){var r,i,o;"string"==typeof t?(r=t,i=e,o=n):(r=t.name||"Autorun@"+re(),i=t,o=e),oe("function"==typeof i,Y("m004")),oe(!1===st(i),Y("m005")),o&&(i=i.bind(o));var a=new ln(r,(function(){this.track(s)}));function s(){i(a)}return a.schedule(),a.getDisposer()}function mt(t,e,n){var r;arguments.length>3&&ie(Y("m007")),Wt(t)&&ie(Y("m008")),(r="object"==typeof n?n:{}).name=r.name||t.name||e.name||"Reaction@"+re(),r.fireImmediately=!0===n||!0===r.fireImmediately,r.delay=r.delay||0,r.compareStructural=r.compareStructural||r.struct||!1,e=ot(r.name,r.context?e.bind(r.context):e),r.context&&(t=t.bind(r.context));var i,o=!0,a=!1,s=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default,u=new ln(r.name,(function(){o||r.delay<1?l():a||(a=!0,setTimeout((function(){a=!1,l()}),r.delay))}));function l(){if(!u.isDisposed){var n=!1;u.track((function(){var e=t(u);n=o||!s(i,e),i=e})),o&&r.fireImmediately&&e(i,u),o||!0!==n||e(i,u),o&&(o=!1)}}return u.schedule(),u.getDisposer()}var gt=function(){function t(t,e,n,r,i){this.derivation=t,this.scope=e,this.equals=n,this.dependenciesState=Oe.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Oe.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+re(),this.value=new qe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Ae.NONE,this.name=r||"ComputedValue@"+re(),i&&(this.setter=$(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Oe.UP_TO_DATE){t.lowestObserverState=Oe.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.UP_TO_DATE&&(r.dependenciesState=Oe.POSSIBLY_STALE,r.isTracing!==Ae.NONE&&Ye(r,t),r.onBecomeStale())}}}(this)},t.prototype.onBecomeUnobserved=function(){en(this),this.value=void 0},t.prototype.get=function(){oe(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===ke.inBatch?(We(),Ke(this)&&(this.isTracing!==Ae.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),Xe()):(He(this),Ke(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState!==Oe.STALE){t.lowestObserverState=Oe.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Oe.POSSIBLY_STALE?r.dependenciesState=Oe.STALE:r.dependenciesState===Oe.UP_TO_DATE&&(t.lowestObserverState=Oe.UP_TO_DATE)}}}(this));var t=this.value;if(Ze(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Ze(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){oe(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else oe(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){x()&&_({object:this.scope,type:"compute",fn:this.derivation});var t=this.value,e=this.dependenciesState===Oe.NOT_TRACKING,n=this.value=this.computeValue(!0);return e||Ze(t)||Ze(n)||!this.equals(t,n)},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ke.computationDepth++,t)e=tn(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new qe(t)}return ke.computationDepth--,this.isComputing=!1,e},t.prototype.observe=function(t,e){var n=this,r=!0,i=void 0;return yt((function(){var o=n.get();if(!r||e){var a=rn();t({type:"update",object:n,newValue:o,oldValue:i}),on(a)}r=!1,i=o}))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Te(this.get())},t.prototype.whyRun=function(){var t=Boolean(ke.trackingDerivation),e=ce(this.isComputing?this.newObserving:this.observing).map((function(t){return t.name})),n=ce(ze(this).map((function(t){return t.name})));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(t?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Oe.NOT_TRACKING?Y("m032"):" * This computation will re-run if any of the following observables changes:\n "+fe(e)+"\n "+(this.isComputing&&t?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+Y("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+fe(n)+"\n")},t}();gt.prototype[Se()]=gt.prototype.valueOf;var bt=xe("ComputedValue",gt),wt=function(){function t(t,e){this.target=t,this.name=e,this.values={},this.changeListeners=null,this.interceptors=null}return t.prototype.observe=function(t,e){return oe(!0!==e,"`observe` doesn't support the fire immediately property for observable objects."),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();function xt(t,e){if(Ct(t)&&t.hasOwnProperty("$mobx"))return t.$mobx;oe(Object.isExtensible(t),Y("m035")),de(t)||(e=(t.constructor.name||"ObservableObject")+"@"+re()),e||(e="ObservableObject@"+re());var n=new wt(t,e);return ge(t,"$mobx",n),n}function _t(t,e,n,r){if(t.values[e]&&!bt(t.values[e]))return oe("value"in n,"The property "+e+" in "+t.name+" is already observable, cannot redefine it as computed property"),void(t.target[e]=n.value);if("value"in n)if(Wt(n.value)){var i=n.value;St(t,e,i.initialValue,i.enhancer)}else st(n.value)&&!0===n.value.autoBind?ut(t.target,e,n.value.originalFn):bt(n.value)?function(t,e,n){var r=t.name+"."+e;n.name=r,n.scope||(n.scope=t.target),t.values[e]=n,Object.defineProperty(t.target,e,Pt(e))}(t,e,n.value):St(t,e,n.value,r);else Tt(t,e,n.get,n.set,vt.default,!0)}function St(t,e,n,r){if(we(t.target,e),v(t)){var i=m(t,{object:t.target,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(t.values[e]=new W(n,r,t.name+"."+e,!1)).value,Object.defineProperty(t.target,e,function(t){return Ot[t]||(Ot[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[t].get()},set:function(e){Et(this,t,e)}})}(e)),function(t,e,n,r){var i=g(t),o=x(),a=i||o?{type:"add",object:e,name:n,newValue:r}:null;o&&S(a),i&&w(t,a),o&&O()}(t,t.target,e,n)}function Tt(t,e,n,r,i,o){o&&we(t.target,e),t.values[e]=new gt(n,t.target,i,t.name+"."+e,r),o&&Object.defineProperty(t.target,e,Pt(e))}var Ot={},At={};function Pt(t){return At[t]||(At[t]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[t].get()},set:function(e){return this.$mobx.values[t].set(e)}})}function Et(t,e,n){var r=t.$mobx,i=r.values[e];if(v(r)){if(!(s=m(r,{type:"update",object:t,name:e,newValue:n})))return;n=s.newValue}if((n=i.prepareNewValue(n))!==G){var o=g(r),a=x(),s=o||a?{type:"update",object:t,oldValue:i.value,name:e,newValue:n}:null;a&&S(s),i.setNewValue(n),o&&w(r,s),a&&O()}}var kt=xe("ObservableObjectAdministration",wt);function Ct(t){return!!he(t)&&(et(t),kt(t.$mobx))}function jt(t,e){if(null==t)return!1;if(void 0!==e){if(V(t)||te(t))throw new Error(Y("m019"));if(Ct(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return Ct(t)||!!t.$mobx||p(t)||vn(t)||bt(t)}function Dt(t){return oe(!!t,":("),Q((function(e,n,r,i,o){we(e,n),oe(!o||!o.get,Y("m022")),St(xt(e,void 0),n,r,t)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){Et(this,t,e)}),!0,!1)}function Rt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Lt(t,Ht,e)}function It(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Lt(t,$t,e)}function Lt(t,e,n){oe(arguments.length>=2,Y("m014")),oe("object"==typeof t,Y("m015")),oe(!te(t),Y("m016")),n.forEach((function(t){oe("object"==typeof t,Y("m017")),oe(!jt(t),Y("m018"))}));for(var r=xt(t),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&ye(a,s)){if(i[s]=!0,t===a&&!be(t,s))continue;_t(r,s,Object.getOwnPropertyDescriptor(a,s),e)}}return t}var Nt=Dt(Ht),Mt=Dt(Yt),Ft=Dt($t),Ut=Dt(qt),zt=Dt(Zt),Bt={box:function(t,e){return arguments.length>2&&Gt("box"),new W(t,Ht,e)},shallowBox:function(t,e){return arguments.length>2&&Gt("shallowBox"),new W(t,$t,e)},array:function(t,e){return arguments.length>2&&Gt("array"),new N(t,Ht,e)},shallowArray:function(t,e){return arguments.length>2&&Gt("shallowArray"),new N(t,$t,e)},map:function(t,e){return arguments.length>2&&Gt("map"),new Qt(t,Ht,e)},shallowMap:function(t,e){return arguments.length>2&&Gt("shallowMap"),new Qt(t,$t,e)},object:function(t,e){arguments.length>2&&Gt("object");var n={};return xt(n,e),Rt(n,t),n},shallowObject:function(t,e){arguments.length>2&&Gt("shallowObject");var n={};return xt(n,e),It(n,t),n},ref:function(){return arguments.length<2?Xt($t,arguments[0]):Ft.apply(null,arguments)},shallow:function(){return arguments.length<2?Xt(Yt,arguments[0]):Mt.apply(null,arguments)},deep:function(){return arguments.length<2?Xt(Ht,arguments[0]):Nt.apply(null,arguments)},struct:function(){return arguments.length<2?Xt(qt,arguments[0]):Ut.apply(null,arguments)}},Vt=function(t){if(void 0===t&&(t=void 0),"string"==typeof arguments[1])return Nt.apply(null,arguments);if(oe(arguments.length<=1,Y("m021")),oe(!Wt(t),Y("m020")),jt(t))return t;var e=Ht(t,0,void 0);return e!==t?e:Vt.box(t)};function Gt(t){ie("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function Wt(t){return"object"==typeof t&&null!==t&&!0===t.isMobxModifierDescriptor}function Xt(t,e){return oe(!Wt(e),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:e,enhancer:t}}function Ht(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),jt(t)?t:Array.isArray(t)?Vt.array(t,n):de(t)?Vt.object(t,n):_e(t)?Vt.map(t,n):t}function Yt(t,e,n){return Wt(t)&&ie("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),null==t||Ct(t)||V(t)||te(t)?t:Array.isArray(t)?Vt.shallowArray(t,n):de(t)?Vt.shallowObject(t,n):_e(t)?Vt.shallowMap(t,n):ie("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function $t(t){return t}function qt(t,e,n){if(ct(t,e))return e;if(jt(t))return t;if(Array.isArray(t))return new N(t,qt,n);if(_e(t))return new Qt(t,qt,n);if(de(t)){var r={};return xt(r,n),Lt(r,qt,[t]),r}return t}function Zt(t,e,n){return ct(t,e)?e:t}function Kt(t,e){void 0===e&&(e=void 0),We();try{return t.apply(e)}finally{Xe()}}Object.keys(Bt).forEach((function(t){return Vt[t]=Bt[t]})),Vt.deep.struct=Vt.struct,Vt.ref.struct=function(){return arguments.length<2?Xt(Zt,arguments[0]):zt.apply(null,arguments)};var Jt={},Qt=function(){function t(t,e,n){void 0===e&&(e=Ht),void 0===n&&(n="ObservableMap@"+re()),this.enhancer=e,this.name=n,this.$mobx=Jt,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new N(void 0,$t,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(t)}return t.prototype._has=function(t){return void 0!==this._data[t]},t.prototype.has=function(t){return!!this.isValidKey(t)&&(t=""+t,this._hasMap[t]?this._hasMap[t].get():this._updateHasMapEntry(t,!1).get())},t.prototype.set=function(t,e){this.assertValidKey(t),t=""+t;var n=this._has(t);if(v(this)){var r=m(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if(this.assertValidKey(t),t=""+t,v(this)&&!(i=m(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=x(),r=g(this),i=r||n?{type:"delete",object:this,oldValue:this._data[t].value,name:t}:null;return n&&S(i),Kt((function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data[t].setNewValue(void 0),e._data[t]=void 0})),r&&w(this,i),n&&O(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap[t];return n?n.setNewValue(e):n=this._hasMap[t]=new W(e,$t,this.name+"."+t+"?",!1),n},t.prototype._updateValue=function(t,e){var n=this._data[t];if((e=n.prepareNewValue(e))!==G){var r=x(),i=g(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&S(o),n.setNewValue(e),i&&w(this,o),r&&O()}},t.prototype._addValue=function(t,e){var n=this;Kt((function(){var r=n._data[t]=new W(e,n.enhancer,n.name+"."+t,!1);e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)}));var r=x(),i=g(this),o=i||r?{type:"add",object:this,name:t,newValue:e}:null;r&&S(o),i&&w(this,o),r&&O()},t.prototype.get=function(t){return t=""+t,this.has(t)?this.dehanceValue(this._data[t].get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return E(this._keys.slice())},t.prototype.values=function(){return E(this._keys.map(this.get,this))},t.prototype.entries=function(){var t=this;return E(this._keys.map((function(e){return[e,t.get(e)]})))},t.prototype.forEach=function(t,e){var n=this;this.keys().forEach((function(r){return t.call(e,n.get(r),r,n)}))},t.prototype.merge=function(t){var e=this;return te(t)&&(t=t.toJS()),Kt((function(){de(t)?Object.keys(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=t[0],r=t[1];return e.set(n,r)})):_e(t)?t.forEach((function(t,n){return e.set(n,t)})):null!=t&&ie("Cannot initialize map from "+t)})),this},t.prototype.clear=function(){var t=this;Kt((function(){nn((function(){t.keys().forEach(t.delete,t)}))}))},t.prototype.replace=function(t){var e=this;return Kt((function(){var n,r=de(n=t)?Object.keys(n):Array.isArray(n)?n.map((function(t){return t[0]})):_e(n)?Array.from(n.keys()):te(n)?n.keys():ie("Cannot get keys from "+n);e.keys().filter((function(t){return-1===r.indexOf(t)})).forEach((function(t){return e.delete(t)})),e.merge(t)})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toJS=function(){var t=this,e={};return this.keys().forEach((function(n){return e[n]=t.get(n)})),e},t.prototype.toJSON=function(){return this.toJS()},t.prototype.isValidKey=function(t){return null!=t&&("string"==typeof t||"number"==typeof t||"boolean"==typeof t)},t.prototype.assertValidKey=function(t){if(!this.isValidKey(t))throw new Error("[mobx.map] Invalid key: '"+t+"', only strings, numbers and booleans are accepted as key in observable maps.")},t.prototype.toString=function(){var t=this;return this.name+"[{ "+this.keys().map((function(e){return e+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return oe(!0!==e,Y("m033")),b(this,t)},t.prototype.intercept=function(t){return y(this,t)},t}();k(Qt.prototype,(function(){return this.entries()}));var te=xe("ObservableMap",Qt),ee=[];function ne(){return"undefined"!=typeof window?window:i.g}function re(){return++ke.mobxGuid}function ie(t,e){throw oe(!1,t,e),"X"}function oe(t,e,n){if(!t)throw new Error("[mobx] Invariant failed: "+e+(n?" in '"+n+"'":""))}Object.freeze(ee);var ae=[];function se(t){return-1===ae.indexOf(t)&&(ae.push(t),console.error("[mobx] Deprecated: "+t),!0)}function ue(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var le=function(){};function ce(t){var e=[];return t.forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),e}function fe(t,e,n){return void 0===e&&(e=100),void 0===n&&(n=" - "),t?t.slice(0,e).join(n)+(t.length>e?" (... and "+(t.length-e)+"more)":""):""}function he(t){return null!==t&&"object"==typeof t}function de(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function pe(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)ye(r,i)&&(t[i]=r[i])}return t}var ve=Object.prototype.hasOwnProperty;function ye(t,e){return ve.call(t,e)}function me(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function ge(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function be(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}function we(t,e){oe(be(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function xe(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return he(t)&&!0===t[n]}}function _e(t){return void 0!==ne().Map&&t instanceof ne().Map}function Se(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function Te(t){return null===t?null:"object"==typeof t?""+t:t}var Oe,Ae,Pe=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ee=function(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]},ke=new Ee,Ce=!1,je=!1,De=!1,Re=ne();function Ie(t,e){if("object"==typeof t&&null!==t){if(V(t))return oe(void 0===e,Y("m036")),t.$mobx.atom;if(te(t)){var n=t;return void 0===e?Ie(n._keys):(oe(!!(r=n._data[e]||n._hasMap[e]),"the entry '"+e+"' does not exist in the observable map '"+Ne(t)+"'"),r)}var r;if(et(t),e&&!t.$mobx&&t[e],Ct(t))return e?(oe(!!(r=t.$mobx.values[e]),"no observable property '"+e+"' found on the observable object '"+Ne(t)+"'"),r):ie("please specify a property");if(p(t)||bt(t)||vn(t))return t}else if("function"==typeof t&&vn(t.$mobx))return t.$mobx;return ie("Cannot obtain atom from "+t)}function Le(t,e){return oe(t,"Expecting some object"),void 0!==e?Le(Ie(t,e)):p(t)||bt(t)||vn(t)||te(t)?t:(et(t),t.$mobx?t.$mobx:void oe(!1,"Cannot obtain administration from "+t))}function Ne(t,e){return(void 0!==e?Ie(t,e):Ct(t)||te(t)?Le(t):Ie(t)).name}function Me(t,e){return Fe(Ie(t,e))}function Fe(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=ce(t.observing).map(Fe)),e}function Ue(t){var e={name:t.name};return function(t){return t.observers&&t.observers.length>0}(t)&&(e.observers=ze(t).map(Ue)),e}function ze(t){return t.observers}function Be(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Ve(t,e){if(1===t.observers.length)t.observers.length=0,Ge(t);else{var n=t.observers,r=t.observersIndexes,i=n.pop();if(i!==e){var o=r[e.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[e.__mapid]}}function Ge(t){t.isPendingUnobservation||(t.isPendingUnobservation=!0,ke.pendingUnobservations.push(t))}function We(){ke.inBatch++}function Xe(){if(0==--ke.inBatch){dn();for(var t=ke.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}ke.pendingUnobservations=[]}}function He(t){var e=ke.trackingDerivation;null!==e?e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t):0===t.observers.length&&Ge(t)}function Ye(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Ae.BREAK){var n=[];$e(Me(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof gt?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function $e(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return $e(t,e,n+1)})))}Re.__mobxInstanceCount?(Re.__mobxInstanceCount++,setTimeout((function(){Ce||je||De||(De=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))}),1)):Re.__mobxInstanceCount=1,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Oe||(Oe={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Ae||(Ae={}));var qe=function(t){this.cause=t};function Ze(t){return t instanceof qe}function Ke(t){switch(t.dependenciesState){case Oe.UP_TO_DATE:return!1;case Oe.NOT_TRACKING:case Oe.STALE:return!0;case Oe.POSSIBLY_STALE:for(var e=rn(),n=t.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(bt(o)){try{o.get()}catch(t){return on(e),!0}if(t.dependenciesState===Oe.STALE)return on(e),!0}}return an(t),on(e),!1}}function Je(){return null!==ke.trackingDerivation}function Qe(t){var e=t.observers.length>0;ke.computationDepth>0&&e&&ie(Y("m031")+t.name),!ke.allowStateChanges&&e&&ie(Y(ke.strictMode?"m030a":"m030b")+t.name)}function tn(t,e,n){an(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ke.runId;var r,i=ke.trackingDerivation;ke.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new qe(t)}return ke.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Oe.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++)0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState);for(n.length=i,t.newObserving=null,o=e.length;o--;)0===(s=e[o]).diffValue&&Ve(s,t),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Be(s,t))}r!==Oe.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function en(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Ve(e[n],t);t.dependenciesState=Oe.NOT_TRACKING}function nn(t){var e=rn(),n=t();return on(e),n}function rn(){var t=ke.trackingDerivation;return ke.trackingDerivation=null,t}function on(t){ke.trackingDerivation=t}function an(t){if(t.dependenciesState!==Oe.UP_TO_DATE){t.dependenciesState=Oe.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Oe.UP_TO_DATE}}function sn(t){return console.log(t),t}function un(t){switch(t.length){case 0:return ke.trackingDerivation;case 1:return Ie(t[0]);case 2:return Ie(t[0],t[1])}}var ln=function(){function t(t,e){void 0===t&&(t="Reaction@"+re()),this.name=t,this.onInvalidate=e,this.observing=[],this.newObserving=[],this.dependenciesState=Oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+re(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Ae.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ke.pendingReactions.push(this),dn())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(We(),this._isScheduled=!1,Ke(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&x()&&_({object:this,type:"scheduled-reaction"})),Xe())},t.prototype.track=function(t){We();var e,n=x();n&&(e=Date.now(),S({object:this,type:"reaction",fn:t})),this._isRunning=!0;var r=tn(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&en(this),Ze(r)&&this.reportExceptionInDerivation(r.cause),n&&O({time:Date.now()-e}),Xe()},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=Y("m037");console.error(n||r,t),x()&&_({type:"error",message:n,error:t,object:this}),ke.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(We(),en(this),Xe()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t.$mobx=this,t.onError=cn,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.whyRun=function(){var t=ce(this._isRunning?this.newObserving:this.observing).map((function(t){return t.name}));return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+fe(t)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+Y("m038")+"\n"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=un(t);if(!r)return ie("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===Ae.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Ae.BREAK:Ae.LOG}(this,t)},t}();function cn(t){oe(this&&this.$mobx&&vn(this.$mobx),"Invalid `this`"),oe(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=t}var fn=100,hn=function(t){return t()};function dn(){ke.inBatch>0||ke.isRunningReactions||hn(pn)}function pn(){ke.isRunningReactions=!0;for(var t=ke.pendingReactions,e=0;t.length>0;){++e===fn&&(console.error("Reaction doesn't converge to a stable state after "+fn+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}ke.isRunningReactions=!1}var vn=xe("Reaction",ln);function yn(t){return Q((function(e,n,r,i,o){oe(void 0!==o,Y("m009")),oe("function"==typeof o.get,Y("m010")),Tt(xt(e,""),n,o.get,o.set,t,!1)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){this.$mobx.values[t].set(e)}),!1,!1)}var mn=yn(vt.default),gn=yn(vt.structural),bn=function(t,e,n){if("string"==typeof e)return mn.apply(null,arguments);oe("function"==typeof t,Y("m011")),oe(arguments.length<3,Y("m012"));var r="object"==typeof e?e:{};r.setter="function"==typeof e?e:r.setter;var i=r.equals?r.equals:r.compareStructural||r.struct?vt.structural:vt.default;return new gt(t,r.context,i,r.name||t.name||"",r.setter)};function wn(t,e,n){function r(r){return e&&n.push([t,r]),r}if(void 0===e&&(e=!0),void 0===n&&(n=[]),jt(t)){if(e&&null===n&&(n=[]),e&&null!==t&&"object"==typeof t)for(var i=0,o=n.length;i<o;i++)if(n[i][0]===t)return n[i][1];if(V(t)){var a=r([]),s=t.map((function(t){return wn(t,e,n)}));for(a.length=s.length,i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(Ct(t)){for(var u in a=r({}),t)a[u]=wn(t[u],e,n);return a}if(te(t)){var l=r({});return t.forEach((function(t,r){return l[r]=wn(t,e,n)})),l}if(X(t))return wn(t.get(),e,n)}return t}bn.struct=gn,bn.equals=yn;var xn={allowStateChanges:function(t,e){var n,r=K(t);try{n=e()}finally{J(r)}return n},deepEqual:ct,getAtom:Ie,getDebugName:Ne,getDependencyTree:Me,getAdministration:Le,getGlobalState:function(){return ke},getObserverTree:function(t,e){return Ue(Ie(t,e))},interceptReads:function(t,e,n){var r;if(te(t)||V(t)||X(t))r=Le(t);else{if(!Ct(t))return ie("Expected observable map, object or array as first array");if("string"!=typeof e)return ie("InterceptReads can only be used with a specific property, not with an object in general");r=Le(t,e)}return void 0!==r.dehancer?ie("An intercept reader was already established"):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},isComputingDerivation:Je,isSpyEnabled:x,onReactionError:function(t){return ke.globalReactionErrorHandlers.push(t),function(){var e=ke.globalReactionErrorHandlers.indexOf(t);e>=0&&ke.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:z,resetGlobalState:function(){ke.resetId++;var t=new Ee;for(var e in t)-1===Pe.indexOf(e)&&(ke[e]=t[e]);ke.allowStateChanges=!ke.strictMode},isolateGlobalState:function(){je=!0,ne().__mobxInstanceCount--},shareGlobalState:function(){se("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),Ce=!0;var t=ne(),e=ke;if(t.__mobservableTrackingStack||t.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(t.__mobxGlobal&&t.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");t.__mobxGlobal?ke=t.__mobxGlobal:t.__mobxGlobal=e},spyReport:_,spyReportEnd:O,spyReportStart:S,setReactionScheduler:function(t){var e=hn;hn=function(n){return t((function(){return e(n)}))}}},_n={Reaction:ln,untracked:nn,Atom:d,BaseAtom:h,useStrict:Z,isStrictModeEnabled:function(){return ke.strictMode},spy:A,comparer:vt,asReference:function(t){return se("asReference is deprecated, use observable.ref instead"),Vt.ref(t)},asFlat:function(t){return se("asFlat is deprecated, use observable.shallow instead"),Vt.shallow(t)},asStructure:function(t){return se("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),Vt.struct(t)},asMap:function(t){return se("asMap is deprecated, use observable.map or observable.shallowMap instead"),Vt.map(t||{})},isModifierDescriptor:Wt,isObservableObject:Ct,isBoxedObservable:X,isObservableArray:V,ObservableMap:Qt,isObservableMap:te,map:function(t){return se("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),Vt.map(t)},transaction:Kt,observable:Vt,computed:bn,isObservable:jt,isComputed:function(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Ct(t))return!1;if(!t.$mobx.values[e])return!1;var n=Ie(t,e);return bt(n)}return bt(t)},extendObservable:Rt,extendShallowObservable:It,observe:function(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return Le(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Le(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Le(t,e).intercept(n)}(t,e,n):function(t,e){return Le(t).intercept(e)}(t,e)},autorun:yt,autorunAsync:function(t,e,n,r){var i,o,a,s;"string"==typeof t?(i=t,o=e,a=n,s=r):(i=t.name||"AutorunAsync@"+re(),o=t,a=e,s=n),oe(!1===st(o),Y("m006")),void 0===a&&(a=1),s&&(o=o.bind(s));var u=!1,l=new ln(i,(function(){u||(u=!0,setTimeout((function(){u=!1,l.isDisposed||l.track(c)}),a))}));function c(){o(l)}return l.schedule(),l.getDisposer()},when:function(t,e,n,r){var i,o,a,s;return"string"==typeof t?(i=t,o=e,a=n,s=r):(i="When@"+re(),o=t,a=e,s=n),yt(i,(function(t){if(o.call(s)){t.dispose();var e=rn();a.call(s),on(e)}}))},reaction:mt,action:ot,isAction:st,runInAction:function(t,e,n){var r="string"==typeof t?t:t.name||"<unnamed action>",i="function"==typeof t?t:e,o="function"==typeof t?e:n;return oe("function"==typeof i,Y("m002")),oe(0===i.length,Y("m003")),oe("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),q(r,i,o,void 0)},expr:function(t,e){return Je()||console.warn(Y("m013")),bn(t,{context:e}).get()},toJS:wn,createTransformer:function(t,e){oe("function"==typeof t&&t.length<2,"createTransformer expects a function that accepts one argument");var n={},r=ke.resetId,i=function(r){function i(e,n){var i=r.call(this,(function(){return t(n)}),void 0,vt.default,"Transformer-"+t.name+"-"+e,void 0)||this;return i.sourceIdentifier=e,i.sourceObject=n,i}return f(i,r),i.prototype.onBecomeUnobserved=function(){var t=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],e&&e(t,this.sourceObject)},i}(gt);return function(t){r!==ke.resetId&&(n={},r=ke.resetId);var e=function(t){if("string"==typeof t||"number"==typeof t)return t;if(null===t||"object"!=typeof t)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+t);var e=t.$transformId;return void 0===e&&me(t,"$transformId",e=re()),e}(t),o=n[e];return o?o.get():(o=n[e]=new i(e,t)).get()}},whyRun:function(t,e){return se("`whyRun` is deprecated in favor of `trace`"),(t=un(arguments))?bt(t)||vn(t)?sn(t.whyRun()):ie(Y("m025")):sn(Y("m024"))},isArrayLike:function(t){return Array.isArray(t)||V(t)},extras:xn},Sn=!1,Tn=function(t){var e=_n[t];Object.defineProperty(_n,t,{get:function(){return Sn||(Sn=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),e}})};for(var On in _n)Tn(On);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:A,extras:xn});var An=i(803),Pn=i.n(An),En={value:()=>{}};function kn(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Cn(r)}function Cn(t){this._=t}function jn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Dn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=En,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Cn.prototype=kn.prototype={constructor:Cn,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=Dn(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Dn(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=jn(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Cn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Rn=kn;var In,Ln,Nn=0,Mn=0,Fn=0,Un=1e3,zn=0,Bn=0,Vn=0,Gn="object"==typeof performance&&performance.now?performance:Date,Wn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xn(){return Bn||(Wn(Hn),Bn=Gn.now()+Vn)}function Hn(){Bn=0}function Yn(){this._call=this._time=this._next=null}function $n(t,e,n){var r=new Yn;return r.restart(t,e,n),r}function qn(){Bn=(zn=Gn.now())+Vn,Nn=Mn=0;try{!function(){Xn(),++Nn;for(var t,e=In;e;)(t=Bn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nn}()}finally{Nn=0,function(){for(var t,e,n=In,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:In=e);Ln=t,Kn(r)}(),Bn=0}}function Zn(){var t=Gn.now(),e=t-zn;e>Un&&(Vn-=e,zn=t)}function Kn(t){Nn||(Mn&&(Mn=clearTimeout(Mn)),t-Bn>24?(t<1/0&&(Mn=setTimeout(qn,t-Gn.now()-Vn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(zn=Gn.now(),Fn=setInterval(Zn,Un)),Nn=1,Wn(qn)))}Yn.prototype=$n.prototype={constructor:Yn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Xn():+n)+(null==e?0:+e),this._next||Ln===this||(Ln?Ln._next=this:In=this,Ln=this),this._call=t,this._time=n,Kn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Kn())}};const Jn=4294967296;function Qn(t){return t.x}function tr(t){return t.y}var er=Math.PI*(3-Math.sqrt(5));function nr(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,h,d=t._root,p={data:r},v=t._x0,y=t._y0,m=t._x1,g=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(v+m)/2))?v=o:m=o,(c=n>=(a=(y+g)/2))?y=a:g=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function rr(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function ir(t){return t[0]}function or(t){return t[1]}function ar(t,e,n){var r=new sr(null==e?ir:e,null==n?or:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function sr(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ur(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var lr=ar.prototype=sr.prototype;function cr(t){return function(){return t}}function fr(t){return 1e-6*(t()-.5)}function hr(){var t,e,n,r,i,o=cr(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=ar(t,Qn,tr).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/u<p)return p<s&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=fr(n))*f),0===h&&(p+=(h=fr(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:cr(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l}function dr(t){return t.x+t.vx}function pr(t){return t.y+t.vy}function vr(t){return t.index}function yr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}lr.copy=function(){var t,e,n=new sr(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ur(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=ur(e));return n},lr.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return nr(this.cover(e,n),e,n,t)},lr.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)nr(this,a[n],s[n],t[n]);return this},lr.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},lr.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},lr.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},lr.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new rr(v,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<c||(s=u.y1)<f))if(v.length){var y=(i+a)/2,m=(o+s)/2;p.push(new rr(v[3],y,m,a,s),new rr(v[2],i,m,y,s),new rr(v[1],y,o,a,m),new rr(v[0],i,o,y,m)),(l=(e>=m)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var g=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),w=g*g+b*b;if(w<n){var x=Math.sqrt(n=w);c=t-x,f=e-x,h=t+x,d=e+x,r=v.data}}return r},lr.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,h,d=this._root,p=this._x0,v=this._y0,y=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(v+m)/2))?v=u:m=u,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},lr.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},lr.root=function(){return this._root},lr.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},lr.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new rr(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new rr(n,l,c,o,a)),(n=u[2])&&s.push(new rr(n,r,c,l,a)),(n=u[1])&&s.push(new rr(n,l,i,o,c)),(n=u[0])&&s.push(new rr(n,r,i,l,c))}return this},lr.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new rr(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new rr(o,a,s,c,f)),(o=i[1])&&n.push(new rr(o,c,s,u,f)),(o=i[2])&&n.push(new rr(o,a,f,c,l)),(o=i[3])&&n.push(new rr(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},lr.x=function(t){return arguments.length?(this._x=t,this):this._x},lr.y=function(t){return arguments.length?(this._y=t,this):this._y};var mr=256,gr=4096,br=25,wr="#ededed",xr={position:"absolute",top:0,bottom:0,left:0,right:0},_r=function(){return window.devicePixelRatio||1},Sr=["NVL_basic-wrapper","NVL_interactive-wrapper"];function Tr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Or(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ar=function(t){var e=new Map;return t.forEach((function(t){var n=t.id,r=t.from,i=t.to,o=t.color,a=t.width,s=t.disabled,u=[r,i].sort(),l="".concat(u[0],".").concat(u[1]),c=e.get(l);c?c.bundledRels.push({id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}):e.set(l,{bundledRels:[{id:n,color:null!=o?o:void 0,disabled:null!=s&&s,width:null!=a?a:1}],key:l,from:r,to:i,color:null!=o?o:void 0,disabled:null!=s&&s,width:0})})),e.forEach((function(t){var e=(0,n.uniqBy)(t.bundledRels,"disabled"),r=1===e.length&&!0===e[0].disabled,i=1===e.length&&!0!==e[0].disabled;if(r)t.color=wr,t.width=1;else{var o=t.bundledRels.filter((function(t){return!0!==t.disabled})),a=(0,n.uniqBy)(o,"color");i?(t.color=a.length>1?void 0:t.bundledRels[0].color,t.bundledRels.forEach((function(e){t.width+=e.width}))):(t.color=1===a.length?a[0].color:void 0,t.disabled=!1,t.bundledRels.forEach((function(e){t.width+=!0!==e.disabled?e.width:0})))}})),Array.from(e.values())},Pr=function(){return void 0!==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t}))};function Er(t){return Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(t)}var kr=function(t){var e,n;return"number"==typeof t.source||"number"==typeof t.target||"string"==typeof t.source||"string"==typeof t.target?45*devicePixelRatio:(null!==(e=t.source.size)&&void 0!==e?e:br)+(null!==(n=t.target.size)&&void 0!==n?n:br)+90*devicePixelRatio};function Cr(t){return"object"===Er(t)}var jr=function(t){var e;return(null!==(e=t.size)&&void 0!==e?e:br)+25*devicePixelRatio},Dr=function(){return-400*Math.pow(devicePixelRatio,2)},Rr=function(){return 2*Dr()};function Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(t)}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fr(r.key),r)}}function Fr(t){var e=function(t,e){if("object"!=Ir(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ir(e)?e:String(e)}var Ur="d3ForceLayout",zr=function(t){return t?wn(t):t},Br=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.d3Nodes={},this.d3RelList={},this.computing=!0,this.center={x:0,y:0},this.nodeRelCount=[];var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Ur),a.addChannel(Ur),this.simulation=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=$n(f),l=Rn("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Jn)/Jn}();function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*er;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}().velocityDecay(.4).force("charge",hr().strength(Dr)).force("centerX",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).force("centerY",function(t){var e,n,r,i=cr(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=cr(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:cr(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),a(),o):t},o}(0).strength(.03)).alpha(1).alphaMin(.05).on("end",(function(){n.simulationStopped=!0,n.shouldUpdate=!1,n.shouldReheatNodes=!1,n.shouldCountNodeRels=!1})).stop(),this.simulationStopped=!0,this.shouldUpdate=!0,this.shouldReheatNodes=!1,this.shouldCountNodeRels=!0,this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){var t=o.channels[Ur];if(void 0!==o.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),s=Pr(i);e||r||s?(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0):n.shouldReheatNodes=!1}var u=a.channels[Ur];if(void 0!==a.version&&u){var l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;(l||c)&&(n.shouldUpdate=!0,n.shouldReheatNodes=!0,n.shouldCountNodeRels=!0)}})))}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e=this;t.forEach((function(t){void 0===e.d3Nodes[t.id]&&(e.d3Nodes[t.id]={id:t.id}),null!=t&&t.pinned?(e.d3Nodes[t.id].fx=t.x,e.d3Nodes[t.id].fy=t.y):(e.d3Nodes[t.id].x=t.x,e.d3Nodes[t.id].y=t.y),e.d3Nodes[t.id].vy=0,e.d3Nodes[t.id].vx=0})),this.shouldUpdate=!0,this.simulation.tick().alpha(.2)}},{key:"update",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||n){var r=this.state,i=r.nodes,o=r.rels,a=i.channels[Ur],s=o.channels[Ur],u=Object.values(a.adds).length>0,l=Object.values(s.adds).length>0,c=Object.values(a.removes).length>0,f=Object.values(s.removes).length>0,h=Object.values(a.updates).length>0;if(u||l||c||f||h){var d=u&&0===Object.keys(this.d3Nodes).length,p=zr(a.removes);Object.keys(p).forEach((function(t){delete e.d3Nodes[t]}));var v=zr(a.adds);if(Object.keys(v).forEach((function(t){e.d3Nodes[t]=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nr(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Fr(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},v[t])})),h&&Object.values(a.updates).forEach((function(t){!0===t.pinned?(e.d3Nodes[t.id].fx=e.d3Nodes[t.id].x,e.d3Nodes[t.id].fy=e.d3Nodes[t.id].y):!1===t.pinned&&(e.d3Nodes[t.id].fx=null,e.d3Nodes[t.id].fy=null),void 0!==t.size&&(e.d3Nodes[t.id].size=t.size)})),(l||f)&&(this.d3RelList=Ar(zr(o.items)).filter((function(t){return t.from!==t.to})).map((function(t,e){return{source:t.from,target:t.to,index:e}}))),d){var y=Object.values(this.d3Nodes);!function(t,e,n){var r=t.filter((function(t){return void 0===t.x&&void 0===t.y}));r.forEach((function(t,i){t.x=e.x+n*Math.sin(2*Math.PI*i/r.length),t.y=e.y+n*Math.cos(2*Math.PI*i/r.length)}))}(y,this.center,(t=y.length,45*t/(2*Math.PI)))}this.layout(i.items,o.items,d)}i.clearChannel(Ur),o.clearChannel(Ur),this.shouldUpdate=!1,this.simulation.alpha()>this.simulation.alphaMin()&&(this.shouldUpdate=!0,this.simulationStopped&&(this.simulation.restart(),this.simulationStopped=!1))}}},{key:"layout",value:function(t,e,r){var i=this;if(!(0,n.isEmpty)(this.d3Nodes)){if(this.simulation.stop(),this.simulation.nodes(Object.values(this.d3Nodes)).force("collide",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=ar(e,dr,pr).visitAfter(s),t=0;t<d;++t)u=e[t],f=n[u.index],h=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(v);function v(t,e,n,o,a){var s=t.data,d=t.r,p=f+d;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var v=l-s.x-s.vx,y=c-s.y-s.vy,m=v*v+y*y;m<p*p&&(0===v&&(m+=(v=fr(r))*v),0===y&&(m+=(y=fr(r))*y),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(v*=m)*(p=(d*=d)/(h+d)),u.vy+=(y*=m)*p,s.vx-=v*(p=1-p),s.vy-=y*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=cr(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:cr(+e),u(),a):t},a}().radius(jr)),this.shouldCountNodeRels&&(this.nodeRelCount=this.countNodeRels()),this.simulation.force("link",function(t){var e,n,r,i,o,a,s=vr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=cr(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,h,d,p,v,y=0;y<s;++y)l=(u=t[y]).source,h=(f=u.target).x+f.vx-l.x-l.vx||fr(a),d=f.y+f.vy-l.y-l.vy||fr(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[y])/p*r*e[y],d*=p,f.vx-=h*(v=o[y]),f.vy-=d*v,l.vx+=h*(v=1-v),l.vy+=d*v}function h(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=yr(f,u.source)),"object"!=typeof u.target&&(u.target=yr(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"==typeof t?t:cr(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:cr(+t),p(),f):l},f}(this.d3RelList).id((function(t){return t.id})).distance(kr).strength((function(t){return function(t,e){if(!Cr(t.source)||!Cr(t.target))return 1;var n=1.2/(Math.min(e[t.source.index],e[t.target.index])+(Math.max(e[t.source.index],e[t.target.index])-1)/100);return Math.max(Math.min(n,1),.06)}(t,i.nodeRelCount)}))),r){var o=0;this.simulation.force("charge",hr().strength(Rr));for(var a=performance.now();performance.now()-a<300&&o<200;)this.simulation.alpha(1),this.simulation.tick(1),o+=1;this.simulation.force("charge",hr().strength(Dr));for(var s=performance.now();performance.now()-s<100&&this.simulation.alpha()>=this.simulation.alphaMin();)this.simulation.tick(1);return this.computing=!1,void this.simulation.restart()}this.shouldReheatNodes?this.simulation.alpha(1).restart():this.simulation.restart()}}},{key:"getNodePositions",value:function(t){var e,n=[],r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.d3Nodes[i.id];if(void 0!==o){var a={id:o.id,x:o.x,y:o.y};n.push(a)}}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return this.computing}},{key:"terminateUpdate",value:function(){this.simulation.alpha(this.simulation.alphaMin()).stop(),this.simulationStopped=!0}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ur),this.state.rels.removeChannel(Ur),this.simulation.stop()}},{key:"setAlpha",value:function(t){this.simulation.alpha(t),this.simulation.restart(),this.simulation.shouldUpdate=!0}},{key:"countNodeRels",value:function(){for(var t=new Map(Object.entries(this.d3Nodes)),e=Object.values(this.d3RelList),n=new Array(t.length),r=0;r<e.length;++r){var i=e[r];i.index=r,"object"!==Ir(i.source)&&(i.source=t.get(i.source)),"object"!==Ir(i.target)&&(i.target=t.get(i.target)),n[i.source.index]=(n[i.source.index]||0)+1,n[i.target.index]=(n[i.target.index]||0)+1}return n}}],r&&Mr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vr=i(880),Gr=i.n(Vr)().getLogger("NVL");const Wr=(t=>{var e={};return i.d(e,t),e})({createCoseBilkentLayoutWorker:()=>t.createCoseBilkentLayoutWorker,createHierarchicalLayoutWorker:()=>t.createHierarchicalLayoutWorker});function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Hr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hr(Object(n),!0).forEach((function(e){Kr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return qr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function qr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}function Kr(t,e,n){return(e=Jr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jr(t){var e=function(t,e){if("object"!=Xr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:String(e)}var Qr=function(t,e,n){return t+(e-t)*function(t){return t*t*(3-2*t)}(n)},ti=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Kr(this,"positions",void 0),Kr(this,"oldPositions",void 0),Kr(this,"startTime",void 0),Kr(this,"t",void 0),Kr(this,"currentT",void 0),Kr(this,"state",void 0),Kr(this,"shouldUpdateAnimator",void 0),Kr(this,"parents",void 0),Kr(this,"animationCompleteCallback",void 0),Kr(this,"shouldUpdate",void 0);var n=e.state;this.positions={},this.oldPositions={},this.startTime=0,this.t=1,this.currentT=1,this.state=n,this.shouldUpdateAnimator=!1,this.parents={},this.animationCompleteCallback=e.animationCompleteCallback}var e,n;return e=t,n=[{key:"getPositionMapFromState",value:function(){var t,e=this.state.nodes,n=e.idToPosition,r={},i=$r(e.items);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id];void 0!==a&&(r[o.id]={id:o.id,x:a.x,y:a.y})}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"updatePositionsFromState",value:function(){this.positions=Yr({},this.getPositionMapFromState())}},{key:"updateOldPositionFromState",value:function(){this.oldPositions=Yr({},this.getPositionMapFromState())}},{key:"startAnimation",value:function(){this.updateOldPositionFromState(),this.startTime=Date.now(),this.t=0,this.currentT=0,this.shouldUpdateAnimator=!0}},{key:"update",value:function(){var t=this.shouldUpdateAnimator,e=(Date.now()-this.startTime)/400;this.t=Math.min(e,1),this.currentT<1?this.shouldUpdateAnimator=!0:(this.shouldUpdateAnimator=!1,t&&!this.shouldUpdateAnimator&&void 0!==this.animationCompleteCallback&&this.animationCompleteCallback(),this.shouldUpdateAnimator||this.updatePositionsFromState())}},{key:"updateNodes",value:function(t){var e,n=$r(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={id:r.id,x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"getNodePositions",value:function(t){var e,n=this.parents,r=this.state.nodes.idToPosition,i=function(t,e){for(var n={x:0,y:0},r=t.length,i=0,o=0;o<r;o++){var a=e[t[o].id];void 0===a||isNaN(a.x)||isNaN(a.y)||0===a.x||0===a.y||(n.x+=a.x,n.y+=a.y,i+=1)}return i>0?[n.x/i,n.y/i]:[0,0]}(t,r),o={x:i[0],y:i[1]},a=[],s=$r(t);try{for(s.s();!(e=s.n()).done;){var u=e.value,l=this.positions[u.id],c=r[u.id],f={id:u.id};if(void 0!==l){for(var h,d,p,v=u.id,y=null!==(h=this.oldPositions[u.id])&&void 0!==h?h:Yr({},o);void 0===y&&void 0!==n[v];)v=n[v],y=this.oldPositions[v];y.x=null!==(d=y.x)&&void 0!==d?d:o.x,y.y=null!==(p=y.y)&&void 0!==p?p:o.y,f.x=Qr(y.x,l.x,this.t),f.y=Qr(y.y,l.y,this.t)}else void 0!==c&&(f.x=c.x||o.x,f.y=c.y||o.y);a.push(f)}}catch(t){s.e(t)}finally{s.f()}return this.currentT=this.t,a}}],n&&Zr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ei(t){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ei(t)}function ni(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ri(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ni(Object(n),!0).forEach((function(e){vi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ii(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||ai(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oi(t){return function(t){if(Array.isArray(t))return si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ai(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ai(t,e){if(t){if("string"==typeof t)return si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yi(r.key),r)}}function li(t,e,n){return e=di(e),function(t,e){if(e&&("object"===ei(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return fi(t)}(t,ci()?Reflect.construct(e,n||[],di(t).constructor):e.apply(t,n))}function ci(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ci=function(){return!!t})()}function fi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hi(){return hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=di(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},hi.apply(this,arguments)}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(t)}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}function vi(t,e,n){return(e=yi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yi(t){var e=function(t,e){if("object"!=ei(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ei(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ei(e)?e:String(e)}var mi=function(t){return void 0!==t?wn(t):t},gi=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),vi(fi(n=li(this,e,[t])),"stateDisposers",void 0),vi(fi(n),"cytoCompleteCallback",void 0),vi(fi(n),"computing",void 0),vi(fi(n),"pendingLayoutData",void 0),vi(fi(n),"worker",void 0),n.stateDisposers=[],n.stateDisposers.push(n.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var r=n.state,i=r.nodes,o=r.rels;return n.cytoCompleteCallback=t.cytoCompleteCallback,n.shouldUpdate=!0,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createCoseBilkentLayoutWorker)(),n.worker.port.start(),n.setOptions(),n.layout(i.items,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pi(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(){this.shouldUpdate=!0}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(this.shouldUpdate||t){var i=mi(n),o=mi(r);(i.length>0||o.length>0)&&(this.updatePositionsFromState(),this.layout(i,o))}hi(di(e.prototype),"update",this).call(this),this.shouldUpdate=!1}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e){var n=this;if(t.length){var r=t.map((function(t){return{group:"nodes",data:{id:t.id}}})),i=e.map((function(t){return{group:"edges",data:{id:"rel".concat(t.id),source:t.from,target:t.to}}})),o={elements:[].concat(oi(r),oi(i)),spacingFactor:t.reduce((function(t,e){var n;return t+(null!==(n=e.size)&&void 0!==n?n:br)}),0)/t.length*4.5/50*_r()};this.computing?this.pendingLayoutData=o:(this.computing=!0,this.worker.port.onmessage=function(t){var e=t.data.positions;if(n.computing){for(var r=0,i=Object.entries(e);r<i.length;r++){var o=ii(i[r],2),a=o[0],s=o[1];n.positions[a]=ri({id:a},s)}n.cytoCompleteCallback(),n.startAnimation()}n.computing=!1,n.shouldUpdate=!0},setTimeout((function(){n.computing&&n.worker.port.postMessage(o)}),0))}}},{key:"terminateUpdate",value:function(){this.computing=!1}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.worker.port.close()}}],r&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti),bi="undefined"!=typeof Float32Array?Float32Array:Array;function wi(){var t=new bi(16);return bi!=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}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var xi=function(t,e,n,r,i,o,a){var s=1/(e-n),u=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*u,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)*u,t[14]=(a+o)*l,t[15]=1,t},_i=i(792),Si=i.n(_i);function Ti(t){return Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ti(t)}function Oi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pi(r.key),r)}}function Ai(t,e,n){return(e=Pi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pi(t){var e=function(t,e){if("object"!=Ti(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:String(e)}var Ei=function(){function t(e,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ai(this,"shaderProgram",void 0),Ai(this,"gl",void 0),Ai(this,"curTexture",void 0),Ai(this,"attributeInfo",void 0),Ai(this,"uniformInfo",void 0);var a=e.createShader(e.FRAGMENT_SHADER);if(!e.isShader(a))throw new Error("Could not create shader object");var s=Si()(i,o);e.shaderSource(a,s),e.compileShader(a),(0,n.isNil)(e.getShaderParameter(a,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(a));var u=e.createShader(e.VERTEX_SHADER);if(!e.isShader(u))throw new Error("Could not create shader object");var l=Si()(r,o);if(e.shaderSource(u,l),e.compileShader(u),(0,n.isNil)(e.getShaderParameter(u,e.COMPILE_STATUS))&&Gr.info(e.getShaderInfoLog(u)),this.shaderProgram=e.createProgram(),e.attachShader(this.shaderProgram,a),e.attachShader(this.shaderProgram,u),e.linkProgram(this.shaderProgram),(0,n.isNil)(e.getProgramParameter(this.shaderProgram,e.LINK_STATUS)))throw new Error("Could not initialise shader");this.gl=e,this.curTexture=0,this.scanUniforms(),this.scanAttributes()}var e,r;return e=t,r=[{key:"setUniform",value:function(t,e){var n=this.gl,r=this.uniformInfo[t];if(void 0===r)throw new Error("Shader.setUniform - Uniform ".concat(t," not found in shader"));switch(r.type){case n.INT:n.uniform1i(r.location,e);break;case n.INT_VEC2:n.uniform2iv(r.location,e);break;case n.INT_VEC3:n.uniform3iv(r.location,e);break;case n.INT_VEC4:n.uniform4iv(r.location,e);break;case n.SAMPLER_2D:n.activeTexture(n.TEXTURE0+r.texture),n.bindTexture(n.TEXTURE_2D,e),n.uniform1i(r.location,r.texture);break;case n.SAMPLER_CUBE:case n.FLOAT:n.uniform1f(r.location,e);break;case n.FLOAT_VEC2:n.uniform2fv(r.location,e);break;case n.FLOAT_VEC3:n.uniform3fv(r.location,e);break;case n.FLOAT_VEC4:n.uniform4fv(r.location,e);break;case n.FLOAT_MAT2:n.uniformMatrix2fv(r.location,!1,e);break;case n.FLOAT_MAT3:n.uniformMatrix3fv(r.location,!1,e);break;case n.FLOAT_MAT4:n.uniformMatrix4fv(r.location,!1,e)}}},{key:"setAttributePointer",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t],a=n*Float32Array.BYTES_PER_ELEMENT,s=r*Float32Array.BYTES_PER_ELEMENT;i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,s,a)}},{key:"setAttributePointerFloat",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,r,n)}},{key:"setAttributePointerUShort",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_SHORT,!1,r,n)}},{key:"setAttributePointerByteNorm",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!0,r,n)}},{key:"setAttributePointerByte",value:function(t,e,n,r){var i=this.gl,o=this.attributeInfo[t];i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.UNSIGNED_BYTE,!1,r,n)}},{key:"use",value:function(){this.gl.useProgram(this.shaderProgram)}},{key:"remove",value:function(){this.gl.deleteProgram(this.shaderProgram)}},{key:"scanAttributes",value:function(){var t=this.gl;this.attributeInfo={};for(var e,n,r=t.getProgramParameter(this.shaderProgram,t.ACTIVE_ATTRIBUTES),i=0;i<r;i++)e=t.getActiveAttrib(this.shaderProgram,i),n=t.getAttribLocation(this.shaderProgram,e.name),this.attributeInfo[e.name]={type:e.type,position:n}}},{key:"scanUniforms",value:function(){var t=this.gl;this.uniformInfo={};for(var e,n=t.getProgramParameter(this.shaderProgram,t.ACTIVE_UNIFORMS),r=0;r<n;r++){e=t.getActiveUniform(this.shaderProgram,r);var i=t.getUniformLocation(this.shaderProgram,e.name),o={type:e.type,location:i};e.type===t.SAMPLER_2D&&(o.texture=this.curTexture,this.curTexture+=1),this.uniformInfo[e.name]=o}}}],r&&Oi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ki(t){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ki(t)}function Ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ji(r.key),r)}}function ji(t){var e=function(t,e){if("object"!=ki(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ki(e)?e:String(e)}function Di(t){var e="function"==typeof Map?new Map:void 0;return Di=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Ri())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ii(i,n.prototype),i}(t,arguments,Li(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ii(n,t)},Di(t)}function Ri(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ri=function(){return!!t})()}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Li(t){return Li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Li(t)}var Ni=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=arguments,n=Li(n=e),function(t,e){if(e&&("object"===ki(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ri()?Reflect.construct(n,r||[],Li(t).constructor):n.apply(t,r));var t,n,r}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&Ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Di(Error));const Mi="uniform mat4 u_projection;\n\nattribute vec2 a_position;\n//attribute float a_index;\n\n//varying highp float index;\n\nvoid main() {\n// index = a_index;\n gl_Position = u_projection * vec4(a_position, 0.0, 1.0);\n}";function Fi(t){return Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(t)}function Ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zi(r.key),r)}}function zi(t){var e=function(t,e){if("object"!=Fi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:String(e)}var Bi=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=this.constructGraphObjects(e,n),this.subGraphs=[],this.sunMap={}}var e,n;return e=t,n=[{key:"constructGraphObjects",value:function(t,e){var n=new Array(t.nodes.length),r=new Array(t.rels.length),i={},o=[];return t.nodes.forEach((function(t,e){n[e]=[],r[e]=[],o.push(t)})),t.rels.forEach((function(t){var o=e[t.from],a=e[t.to];void 0!==o&&void 0!==a&&(n[o].push(a),n[a].push(o),r[o].push(t.id),r[a].push(t.id),i[t.id]=t)})),this.relIdMap=r,{nodes:o,relationships:n,idToRel:i}}},{key:"coarsenTo",value:function(t){for(var e=this.graph,n=e.nodes.length,r=0;e.nodes.length>t&&e.relationships.some((function(t){return t.length>0}));){var i=this.coarsen(e,0===r);if(0===r&&(this.nodeSortMap=i.nodeSortMap),this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,r++}return this.subGraphs.push(e),e}},{key:"coarsenBy",value:function(t){for(var e=this.graph,n=e.nodes.length,r=t;t>0;){var i=this.coarsen(e,t===r);if(this.subGraphs.push(i.sortedInput),0===(e=i.output).relationships.length||e.relationships.every((function(t){return 0===t.length}))||n===e.nodes.length)break;n=e.nodes.length,t--}return this.subGraphs.push(e),e}},{key:"coarsen",value:function(t,e){var n=this,r=t.nodes,i=t.relationships,o=r.map((function(t,e){return e})),a={},s={};r.forEach((function(t,e){a[e]=t,s[t.id]=e}));for(var u=i.map((function(t){return t.slice()})),l={suns:{},planets:{},moons:{}},c=[],f=[],h=function(){var t=o[0];o.splice(o.indexOf(t),1),i[t].forEach((function(e){var n=o.indexOf(e);n>=0&&o.splice(n,1);var r=-1,i=u[e];i.forEach((function(e,n){var i=o.indexOf(e);i>=0?o.splice(i,1):e===t&&(r=n)})),i.splice(r,1)}));var n={id:t};if(e)n.originalId=a[t].id;else{var r=a[t];n.finestIndex=r.finestIndex,n.originalId=r.originalId}c.push(n),l.suns[t]=n};o.length>0;)h();c.forEach((function(t,e){f[e]=[]})),c.forEach((function(t,n){var r={},o=[];i[t.id].forEach((function(i){if(i!==t.id&&!r[i]){var s={id:i,parent:t,sunId:n,moons:[]},u=a[i];s.size=function(){return s.moons.length+1},s.weight=u.weight||1,s.children=function(){return s.moons},e?s.originalId=u.id:(s.finestIndex=u.finestIndex,s.originalId=u.originalId),o.push(s),r[i]=!0}})),o.forEach((function(t){l.planets[t.id]=t})),t.planets=o,t.children=function(){return t.planets},t.weight=t.planets.reduce((function(t,e){return t+(e.weight||1)}),0)+(a[t.id].weight||1),t.size=function(){return t.planets.reduce((function(t,e){return t+e.size()}),0)+1}}));var d=r.filter((function(t,e){return!c.find((function(t){return t.id===e}))&&!l.planets[e]})),p=[];d.forEach((function(t){for(var n=s[t.id],r=u[n],i=null,o=-1,c=0;c<r.length;c++){var f=r[c];if(f!==n&&(i=l.planets[f])){o=c;break}}if(r.splice(o,1),i){var h={id:n,size:function(){return 0}};h.weight=a[n].weight||1,h.parent=i,h.sunId=i.sunId,e?h.originalId=t.id:(h.finestIndex=t.finestIndex,h.originalId=t.originalId),l.moons[n]=h,i.moons.push(h),i.weight+=h.weight,i.parent.weight+=h.weight;var d=u[i.id];d.splice(d.indexOf(n),1)}else p.push(t)})),u.forEach((function(t,e){if(!l.suns[e]){var n=l.planets[e]||l.moons[e];u[e].forEach((function(t){var e=l.planets[t];if(e||(e=l.moons[t]),n.sunId!==e.sunId){var r=f[n.sunId];r.includes(e.sunId)||r.push(e.sunId)}}))}}));var v=[],y=0,m={};c.forEach((function(t,i){var o=r[t.id];m[t.id]=y,t.previousIndex=i,t.id=y++,e&&(o.finestIndex=t.id,t.finestIndex=t.id),v.push(o),t.planets.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o),i.moons.forEach((function(i){var o=r[i.id];m[i.id]=y,i.id=y++,i.sunId=t.id,e&&(o.finestIndex=i.id),n.sunMap[i.originalId]=t.originalId,v.push(o)}))}))}));var g=[],b=[];return i.forEach((function(t,r){var i=m[r];g[i]=t.map((function(t){return m[t]})),e&&(b[i]=t.map((function(t,e){return n.relIdMap[r][e]})))})),b&&b.length>0&&(this.relIdMap=b),{output:{nodes:c,relationships:f},sortedInput:{nodes:v,relationships:g},nodeSortMap:m}}}],n&&Ui(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vi=function(t,e,n){for(var r=2*Math.PI/n,i=[],o=0;o<n;o++){var a=r*o;i.push({x:t.x+e*Math.cos(a),y:t.y+e*Math.sin(a)})}return i};function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Wi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$i(r.key),r)}}function Yi(t,e,n){return(e=$i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $i(t){var e=function(t,e){if("object"!=Gi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gi(e)?e:String(e)}var qi="PhysLayout",Zi=new Float32Array(4),Ki=256,Ji=function(t){for(var e={},n={},r=0;r<t.length;r++)e[t[r].id]=r,n[r]=t[r].id;return{nodeIdToIndex:e,nodeIndexToId:n}},Qi=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yi(this,"physVbo",void 0),Yi(this,"physSmallVbo",void 0),Yi(this,"physProjection",void 0),Yi(this,"physSmallProjection",void 0),Yi(this,"gl",void 0),Yi(this,"useReadpixelWorkaround",void 0),Yi(this,"averageNodeSize",void 0),Yi(this,"shouldUpdate",void 0),Yi(this,"iterationCount",void 0),Yi(this,"lastSpeedValues",void 0),Yi(this,"rollingAvgGraphSpeed",void 0),Yi(this,"nodeVariation",void 0),Yi(this,"nodeCenterPoint",void 0),Yi(this,"peakIterationMultiplier",void 0),Yi(this,"stateDisposers",void 0),Yi(this,"state",void 0),Yi(this,"dpr",void 0),Yi(this,"intelWorkaround",void 0),Yi(this,"simulationStopVelocitySquared",void 0),Yi(this,"gravity",void 0),Yi(this,"force",void 0),Yi(this,"nodeIdToIndex",void 0),Yi(this,"nodeIndexToId",void 0),Yi(this,"numNodes",void 0),Yi(this,"solarMerger",void 0),Yi(this,"subGraphs",void 0),Yi(this,"nodeSortMap",void 0),Yi(this,"firstUpdate",void 0),Yi(this,"curPhysData",void 0),Yi(this,"apprxRepForceShader",void 0),Yi(this,"levelsClusterTexture",void 0),Yi(this,"levelsFinestIndexTexture",void 0),Yi(this,"initalLevelTexture",void 0),Yi(this,"levelsData",void 0),Yi(this,"collisionDetectionMultiplier",void 0),Yi(this,"physShader",void 0),Yi(this,"physData",void 0),Yi(this,"workaroundData",void 0),Yi(this,"pinData",void 0),Yi(this,"updateData",void 0),Yi(this,"updateShader",void 0),Yi(this,"workaroundShader",void 0),Yi(this,"physPositions",void 0),Yi(this,"springTexture",void 0),Yi(this,"sizeTexture",void 0),Yi(this,"offsetTexture",void 0),Yi(this,"pinTexture",void 0),Yi(this,"addedNodes",void 0),Yi(this,"updateTexture",void 0),Yi(this,"enableVerlet",void 0);var r=e.state,i=e.webGLContext;if(Gr.info("layout - webGLContext",Boolean(i)),void 0===e.webGLContext)throw new Error("PhysLayout missing options: webGLContext - webgl context");if(void 0===e.state)throw new Error("PhysLayout missing options: state - state object");var o=i;this.checkCompatibility(o),this.printGlStats(o),this.physVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physVbo);var a=new Float32Array([0,0,mr,0,0,mr,mr,mr]);o.bufferData(o.ARRAY_BUFFER,a,o.STATIC_DRAW),this.physSmallVbo=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,this.physSmallVbo);var s=new Float32Array([0,0,Ki,0,0,Ki,Ki,Ki]);o.bufferData(o.ARRAY_BUFFER,s,o.STATIC_DRAW),this.physProjection=wi(),xi(this.physProjection,0,mr,mr,0,0,1e6),this.physSmallProjection=wi(),xi(this.physSmallProjection,0,Ki,Ki,0,0,1e6),o.disable(o.DEPTH_TEST),this.gl=o,this.useReadpixelWorkaround&&this.setupReadpixelWorkaround(),this.setupUpdates(),this.averageNodeSize=br,this.shouldUpdate=!0,this.iterationCount=0,this.lastSpeedValues=[],this.rollingAvgGraphSpeed=0,this.nodeVariation=0,this.nodeCenterPoint=[0,0],this.peakIterationMultiplier=160,this.setOptions(e,!0),this.definePhysicsArrays();var u=r.nodes,l=r.rels;u.addChannel(qi),l.addChannel(qi),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[qi];if(void 0!==u.version&&t){var e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,i=Object.values(t.updates),o=Pr(i);(e||r||o)&&(n.shouldUpdate=!0,n.checkForUpdates())}var a=l.channels[qi];if(void 0!==l.version&&a){var s=Object.values(a.adds).length>0,c=Object.values(a.removes).length>0;(s||c)&&(n.shouldUpdate=!0,n.checkForUpdates())}}))),this.setData({nodes:u.items,rels:l.items}),this.state=r,this.dpr=window.devicePixelRatio||1}var e,n;return e=t,n=[{key:"setOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t.intelWorkaround,r=t.simulationStopVelocity,i=t.gravity,o=t.enableVerlet,a=void 0!==o&&o;e&&(this.intelWorkaround=n,this.enableVerlet=a);var s=this.enableVerlet?.1:null!=r?r:100;this.simulationStopVelocitySquared=s*s,this.gravity=null!=i?i:100,this.force=0}}},{key:"setData",value:function(t){var e=Ji(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this.nodeIdToIndex=n,this.nodeIndexToId=r,this.numNodes=t.nodes.length,this.solarMerger=new Bi(t,n),this.solarMerger.coarsenTo(1),this.subGraphs=this.solarMerger.subGraphs,this.nodeSortMap=this.solarMerger.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]),this.setupPhysics(),this.firstUpdate=!0,this.curPhysData=0,this.shouldUpdate=!0,this.iterationCount=0,this.subGraphs[0]}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.gl;if(this.checkForUpdates(t),!this.shouldUpdate)return e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this.physPositions),!1;e.disable(e.BLEND);for(var n=this.nodeVariation/(this.numNodes||1)>.3,r=this.getScaleNumber(this.iterationCount),i=this.subGraphs?this.subGraphs.length:0,o=this.getPhysData(0).texture,a=i-1;a>0;a--){var s=this.subGraphs[a].nodes.length,u=a===i-1;this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_physData",o),this.apprxRepForceShader.setUniform("u_clusterData",this.levelsClusterTexture[a]),this.apprxRepForceShader.setUniform("u_finestIndexes",this.levelsFinestIndexTexture[a]),this.apprxRepForceShader.setUniform("u_prevForce",u?this.initalLevelTexture:this.levelsData[a+1].texture),this.apprxRepForceShader.setUniform("u_numNodes",s),this.apprxRepForceShader.setUniform("u_iterationMultiplier",r),this.apprxRepForceShader.setUniform("u_baseLength",this.getBaseLength(s)),this.apprxRepForceShader.setUniform("u_isTopLevel",u?1:0),e.bindBuffer(e.ARRAY_BUFFER,this.physSmallVbo),this.apprxRepForceShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.levelsData[a].frameBuffer),e.viewport(0,0,Ki,Ki),e.drawArrays(e.TRIANGLE_STRIP,0,4)}if(this.collisionDetectionMultiplier=0,this.collisionDetectionMultiplier=n?Math.min(this.iterationCount/Math.min(this.numNodes,300),1):1,this.force=i<=1?this.initalLevelTexture:this.levelsData[1].texture,this.physShader.use(),this.physShader.setUniform("u_prevForce",i<=1?this.initalLevelTexture:this.levelsData[1].texture),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_physData",o),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_iterationMultiplier",r),this.physShader.setUniform("u_curIteration",this.iterationCount),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_clusterData",this.levelsClusterTexture[0]),this.physShader.setUniform("u_collisionMultiplier",this.collisionDetectionMultiplier),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.firstUpdate=!1,e.bindBuffer(e.ARRAY_BUFFER,this.physVbo),this.physShader.setAttributePointer("a_position",2,0,2),e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(1).frameBuffer),e.viewport(0,0,mr,mr),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.useReadpixelWorkaround?this.doReadpixelWorkaround():(e.bindFramebuffer(e.FRAMEBUFFER,this.getPhysData(0).frameBuffer),e.readPixels(0,0,mr,mr,e.RGBA,e.FLOAT,this.physPositions)),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.iterationCount+=1,this.numNodes<2)this.shouldUpdate=!1,this.iterationCount=0;else if(this.iterationCount%5==0){var l=this.iterationCount<300,c=l?this.getMaxSpeedSquared():this.getMedianSpeedSquared(this.addedNodes);this.lastSpeedValues.push(c),this.rollingAvgGraphSpeed=this.lastSpeedValues.reduce((function(t,e){return t+e}),0)/this.lastSpeedValues.length;var f=l&&c>=this.rollingAvgGraphSpeed,h=this.simulationStopVelocitySquared&&this.rollingAvgGraphSpeed<this.simulationStopVelocitySquared;this.lastSpeedValues.length>20&&this.lastSpeedValues.shift(),!f&&!0===h&&this.iterationCount>2&&this.terminateUpdate()}return this.shouldUpdate}},{key:"terminateUpdate",value:function(){Gr.info("Cooling down after ".concat(this.iterationCount," iterations at graph speed of ").concat(Math.sqrt(this.rollingAvgGraphSpeed))),this.shouldUpdate=!1,this.iterationCount=0,this.rollingAvgGraphSpeed=0,this.lastSpeedValues=[],this.addedNodes=null,this.nodeVariation=0}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"getNodePositions",value:function(t){var e=[];if(this.useReadpixelWorkaround){var n,r=Wi(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.nodeIdToIndex[i.id],a=i.id,s=void 0,u=void 0;void 0!==o&&(s=this.workaroundData[0].dataFloat[o],u=this.workaroundData[1].dataFloat[o]),e.push({id:a,x:s,y:u})}}catch(t){r.e(t)}finally{r.f()}}else{var l,c=Wi(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=this.nodeIdToIndex[f.id],d=f.id,p=void 0,v=void 0;void 0!==h&&(p=this.physPositions[4*h+0],v=this.physPositions[4*h+1]),e.push({id:d,x:p,y:v})}}catch(t){c.e(t)}finally{c.f()}}return e}},{key:"reheat",value:function(t){this.setupSize(this.subGraphs[0]),this.shouldUpdate=!0,this.iterationCount=0,this.nodeVariation=t.nodes.length}},{key:"updateNodes",value:function(t){var e=this.gl,n=new Set;e.bindTexture(e.TEXTURE_2D,this.getPhysData().texture);var r,i=Wi(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.nodeIdToIndex[o.id];if(void 0!==o.x&&void 0!==o.y){Zi[0]=o.x,Zi[1]=o.y,Zi[2]=0,Zi[3]=0;var s=a%mr,u=(a-s)/mr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,Zi),this.useReadpixelWorkaround?(this.workaroundData[0].dataFloat[a]=o.x,this.workaroundData[1].dataFloat[a]=o.y):(this.physPositions[4*a+0]=o.x,this.physPositions[4*a+1]=o.y)}void 0!==o.pinned&&(this.pinData[a]=o.pinned?255:0),Object.keys(o).forEach((function(t){return n.add(t)}))}}catch(t){i.e(t)}finally{i.f()}n.has("pinned")&&(e.bindTexture(e.TEXTURE_2D,this.pinTexture),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,mr,mr,0,e.ALPHA,e.UNSIGNED_BYTE,this.pinData)),(n.has("x")||n.has("y")||n.has("size"))&&(this.shouldUpdate=!0,this.iterationCount=0)}},{key:"addRemoveData",value:function(t,e){var n=this.gl;this.numNodes=t.nodes.length,this.physShader.use(),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_baseLength",this.getBaseLength());var r=Ji(t.nodes).nodeIdToIndex,i=new Bi(t,r);i.coarsenTo(1);var o=i.subGraphs[0],a=this.subGraphs[0],s=function(t){return a.nodes.findIndex((function(e){return e.id===t}))},u=Object.values(e.adds),l=Object.values(e.removes);this.addedNodes=u.length>0?{}:null,this.nodeVariation=u.length+l.length;for(var c,f=3*Math.sqrt(t.nodes.length),h={x:0,y:0},d=o.nodes.length,p=new Uint8Array(65536),v=0;v<d;v++){var y=0,m=0,g=o.nodes[v];if(c=g.id,Boolean(e.adds[c])){if(this.addedNodes[v]=g.id,y=g.position?g.position.x:void 0,m=g.position?g.position.y:void 0,void 0===y||void 0===m){var b=i.sunMap,w=void 0;for(w=b[g.id];void 0!==w;w=b[w]){var x=s(w);if(-1!==x){var _=this.getNodePosition(x);y=_.x+10*(Math.random()-.5),m=_.y+10*(Math.random()-.5);break}}void 0===w&&(y=this.nodeCenterPoint[0]+f*(Math.random()-.5),m=this.nodeCenterPoint[1]+f*(Math.random()-.5))}this.updateData[2*v]=y,this.updateData[2*v+1]=m,p[v]=g.pinned?255:0}else{var S=s(g.id),T=this.getNodePosition(S);y=T.x,m=T.y,this.updateData[2*v]=S,this.updateData[2*v+1]=999999,p[v]=this.pinData[S]}h.x+=y||0,h.y+=m||0}this.nodeCenterPoint=d?[h.x/d,h.y/d]:[0,0],this.pinData=p,this.subGraphs=i.subGraphs,this.nodeSortMap=i.nodeSortMap,this.setupSprings(this.subGraphs[0]),this.setupSize(this.subGraphs[0]);var O=Ji(this.subGraphs[0].nodes),A=O.nodeIdToIndex,P=O.nodeIndexToId;return this.nodeIdToIndex=A,this.nodeIndexToId=P,n.bindTexture(n.TEXTURE_2D,this.updateTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.FLOAT,this.updateData),Gr.info("Setting gravity center to ",this.nodeCenterPoint),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.updateShader.use(),this.updateShader.setUniform("u_numNodesNew",o.nodes.length),this.updateShader.setUniform("u_physData",this.getPhysData(0).texture),this.updateShader.setUniform("u_updateData",this.updateTexture),n.disable(n.BLEND),n.bindBuffer(n.ARRAY_BUFFER,this.physVbo),this.updateShader.setAttributePointer("a_position",2,0,2),n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData(1).frameBuffer),n.viewport(0,0,mr,mr),n.drawArrays(n.TRIANGLE_STRIP,0,4),this.curPhysData=(this.curPhysData+1)%this.physData.length,this.useReadpixelWorkaround?this.doReadpixelWorkaround():(n.bindFramebuffer(n.FRAMEBUFFER,this.getPhysData().frameBuffer),n.readPixels(0,0,mr,mr,n.RGBA,n.FLOAT,this.physPositions)),(u.length>0||l.length>0)&&(n.bindTexture(n.TEXTURE_2D,this.pinTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,mr,mr,0,n.ALPHA,n.UNSIGNED_BYTE,this.pinData)),this.shouldUpdate=!0,this.iterationCount=0,this.setupPhysicsForCoarse(),this.subGraphs[0]}},{key:"destroy",value:function(){var t=this;this.gl.deleteBuffer(this.physVbo),this.gl.deleteBuffer(this.physSmallVbo),this.physData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsData.forEach((function(e){t.gl.deleteFramebuffer(e.frameBuffer),t.gl.deleteTexture(e.texture)})),this.levelsClusterTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.levelsFinestIndexTexture.forEach((function(e){t.gl.deleteTexture(e)})),this.gl.deleteTexture(this.initalLevelTexture),this.gl.deleteTexture(this.sizeTexture),this.gl.deleteTexture(this.offsetTexture),this.gl.deleteTexture(this.springTexture),this.gl.deleteTexture(this.pinTexture),this.gl.deleteTexture(this.updateTexture),void 0!==this.apprxRepForceShader&&this.apprxRepForceShader.remove(),void 0!==this.updateShader&&this.updateShader.remove(),void 0!==this.physShader&&this.physShader.remove(),this.physPositions=null,this.gl=null,this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(qi),this.state.rels.removeChannel(qi)}},{key:"dumpTexture",value:function(t,e,n){var r=this.gl;Gr.info("--- Dumping texture ",n),r.bindFramebuffer(r.FRAMEBUFFER,t),r.readPixels(0,0,mr,mr,r.RGBA,r.FLOAT,this.physPositions);for(var i=0;i<e;i++)Gr.info(i,": ",this.physPositions[4*i+0],this.physPositions[4*i+1],this.physPositions[4*i+2],this.physPositions[4*i+3])}},{key:"getScaleNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e,n){return n+Math.pow(10,6)*Math.pow(t-120,-1.7)};return 0===t?0:t<300?200+-1/Math.pow(10,5)*3*Math.pow(Math.abs(t-200+12),3):e(t,200,10)}},{key:"getBaseLength",value:function(t){if(void 0===t||t===this.numNodes)return 100*this.dpr;var e=Math.pow(this.averageNodeSize/2,2)*Math.PI,n=this.numNodes/t*e;return(100+Math.sqrt(n/Math.PI)/2/t)*this.dpr}},{key:"checkForUpdates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i={nodes:n.items,rels:r.items},o=Object.values(n.channels[qi].adds).length>0,a=Object.values(r.channels[qi].adds).length>0,s=Object.values(n.channels[qi].removes).length>0,u=Object.values(r.channels[qi].removes).length>0,l=Object.values(n.channels[qi].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[qi].adds,removes:n.channels[qi].removes}),t?(this.updateNodes(i.nodes),this.reheat(i)):l.length>0&&(this.updateNodes(l),Pr(l)&&this.reheat(i)),n.clearChannel(qi),r.clearChannel(qi)}},{key:"getNodePosition",value:function(t){return this.useReadpixelWorkaround?{x:this.workaroundData[0].dataFloat[t],y:this.workaroundData[1].dataFloat[t]}:{x:this.physPositions[4*t+0],y:this.physPositions[4*t+1]}}},{key:"getMaxSpeedSquared",value:function(){var t=0;if(this.useReadpixelWorkaround)for(var e=0;e<this.numNodes;e++){var n=this.workaroundData[2].dataFloat[e],r=this.workaroundData[3].dataFloat[e],i=n*n+r*r;i>t&&(t=i)}else for(var o=0;o<this.numNodes;o++){var a=this.physPositions[4*o+2],s=this.physPositions[4*o+3],u=a*a+s*s;u>t&&(t=u)}return t}},{key:"getMedianSpeedSquared",value:function(t){var e=[];if(this.useReadpixelWorkaround)for(var n=0;n<this.numNodes;n++){var r=this.workaroundData[2].dataFloat[n],i=this.workaroundData[3].dataFloat[n],o=r*r+i*i;e[n]=o}else for(var a=0;a<this.numNodes;a++)if(!t||t[a]){var s=this.physPositions[4*a+2],u=this.physPositions[4*a+3],l=s*s+u*u;e.push(l)}return e.sort((function(t,e){return t-e})),e[Math.floor(e.length/2)]}},{key:"getPhysData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.physData[(this.curPhysData+t)%this.physData.length]}},{key:"newTexture",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.FLOAT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.RGBA,o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,i,n,n,0,i,r,e),o}},{key:"newFramebuffer",value:function(t,e){var n=t.createFramebuffer();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),n}},{key:"checkCompatibility",value:function(t){function e(t){throw new Ni(t)}t||e("Could not initialize WebGL"),0===t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)&&e("Vertex shader texture access not available"),t.getExtension("OES_texture_float")||e("OES_texture_float extension not available");var n=t.getParameter(t.MAX_TEXTURE_SIZE),r=Math.max(mr,gr);n<r&&e("Need larger WebGL texture support. Avaliable: ".concat(n," needed: ").concat(r));var i=new Float32Array(4),o=this.newTexture(t,i,1),a=this.newFramebuffer(t,o);t.bindFramebuffer(t.FRAMEBUFFER,a),t.readPixels(0,0,1,1,t.RGBA,t.FLOAT,i),t.getError()!==t.NO_ERROR&&(Gr.info("gl.readPixels doesnt work for float texture, activating workaround"),this.useReadpixelWorkaround=!0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(a),t.deleteTexture(o)}},{key:"printGlStats",value:function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n="?",r="?";null!==e&&(n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),Gr.trace("Vendor: ".concat(n)),Gr.trace("Renderer: ".concat(r));var i=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);Gr.trace("Line width range: ".concat(i));var o=t.getSupportedExtensions();Gr.trace("Extentions:"),o.length>0&&o.forEach((function(t){return Gr.trace(t)}))}},{key:"adjustToGlSize",value:function(t){return t*this.dpr*2.5}},{key:"setupSize",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=new Float32Array(65536),n=t.nodes,r=n.length,i=0,o=0;o<r;o++){var a,s=parseInt(null!==(a=n[o].size)&&void 0!==a?a:br,10);e[o]=this.adjustToGlSize(s),i+=s}this.averageNodeSize=r?i/r:br;var u=this.gl;void 0===this.sizeTexture&&(this.sizeTexture=u.createTexture()),u.bindTexture(u.TEXTURE_2D,this.sizeTexture),u.texImage2D(u.TEXTURE_2D,0,u.ALPHA,mr,mr,0,u.ALPHA,u.FLOAT,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE)}},{key:"setupSprings",value:function(t){var e,n,r=this.gl,i=t.relationships,o=new Float32Array(16777216),a=new Float32Array(65536),s=0;for(e=0;e<t.nodes.length;e++)for(a[e]=s,o[s]=i[e].length,s+=1,n=0;n<i[e].length;n++)o[s]=i[e][n],s+=1;for(n=s;n<o.length;n++)o[n]=1;for(n=e;n<a.length;n++)a[n]=0;void 0===this.offsetTexture&&(this.offsetTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.offsetTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,mr,mr,0,r.ALPHA,r.FLOAT,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),void 0===this.springTexture&&(this.springTexture=r.createTexture()),r.bindTexture(r.TEXTURE_2D,this.springTexture),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,gr,gr,0,r.ALPHA,r.FLOAT,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}},{key:"setupPhysics",value:function(){this.setupPhysicsForCoarse(),this.setupPhysicsForNodes(),this.physPositions=new Float32Array(262144),this.setupPinData()}},{key:"setupPhysicsForNodes",value:function(){var t=this.gl,e=this.subGraphs.length,n=this.subGraphs[0].nodes,r=3*Math.sqrt(n.length),i=new Float32Array(262144),o=new Float32Array(262144);this.numNodes=n.length;for(var a=0;a<262144;a++)i[a]=0,o[a]=0;for(var s=function(t,e,n,r){r[4*t+0]=e,r[4*t+1]=n,r[4*t+2]=0,r[4*t+3]=0},u=e-1;u>=0;u--){var l=u===e-1?[]:this.subGraphs[u+1].nodes;0===l.length?this.subGraphs[u].nodes.forEach((function(t,e){var n=t.placement?t.placement.x:r*(Math.random()-.5),o=t.placement?t.placement.y:r*(Math.random()-.5);s(void 0===t.finestIndex?e:t.finestIndex,n,o,i)})):l.forEach((function(t){var e=t.finestIndex,n=i[4*t.finestIndex],r=i[4*t.finestIndex+1],o=Vi({x:n,y:r},10,t.planets.length+1);e++,t.planets.forEach((function(t,n){var r=o[n];s(e++,r.x,r.y,i);var a=Vi({x:r.x,y:r.y},10,t.moons.length+1);t.moons.forEach((function(t,n){var r=a[n];s(e++,r.x,r.y,i)}))}))}))}this.physData=[];for(var c=0;c<2;c++){var f=this.newTexture(t,0===c?i:o,mr),h=this.newFramebuffer(t,f);this.physData.push({texture:f,frameBuffer:h})}var d=this.enableVerlet?"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\n\nfloat DAMP = 0.6;\nfloat COOL = 0.99998;\nfloat TEMP = max(0.02, pow(COOL, u_curIteration));\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 50000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = (combinedNodeSize - dist) / (dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * fScale) / (dist);\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, myPosition.zw);\n } else {\n vec2 prevVelocity = myPosition.zw;\n vec2 currentPos = myPosition.xy;\n vec2 prevPos = currentPos - prevVelocity;\n\n vec2 newPos = currentPos + TEMP * ( DAMP * (prevVelocity) + acceleration * TIMESTEP * TIMESTEP);\n vec2 newVelocity = newPos - currentPos;\n gl_FragColor = vec4(newPos, newVelocity);\n }\n}":"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_connections;\nuniform sampler2D u_connectionOffsets;\nuniform sampler2D u_pinnedNodes;\nuniform sampler2D u_sizeTexture;\nuniform float u_baseLength;\nuniform float u_curIteration;\nuniform float u_iterationMultiplier;\nuniform vec2 u_gravityCenter;\nuniform float u_numNodes;\nuniform float u_gravity;\n\nuniform sampler2D u_clusterData;\nuniform sampler2D u_prevForce;\nuniform float u_collisionMultiplier;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\nfloat accLimitLow = 500000.0;\nfloat accLimitHigh = 750000.0;\nfloat accLimitPosHigh = 10000000.0;\n\nconst float denseNodeThreshold = 1000.0;\nconst float MIN_DISTANCE = 0.00000001;\nconst float MAX_DISTANCE = 1000000000.0;\nconst float MAX_ACCELERATION = 500000.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nbool isNan(float val) {\n return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;\n}\n\nconst float BIG_NUMBER = 999999999999999999.0;\nbool isInf(float val) {\n return val > BIG_NUMBER || val < -BIG_NUMBER;\n}\n\nvec2 getDelta(vec2 v1, vec2 v2) {\n vec2 delta = v1 - v2;\n float dist = length(delta);\n if (dist < MIN_DISTANCE || isNan(dist)) {\n return vec2(MIN_DISTANCE, MIN_DISTANCE);\n }\n if (dist > MAX_DISTANCE) {\n vec2 normDelta = delta / dist;\n return normDelta * MAX_DISTANCE;\n }\n return delta;\n}\n\nvec4 getOtherNodePosition(float i) {\n return getTextureData(u_physData, i, 256.0);\n}\n\nfloat getCombinedNodeSize(float i, float nodeSize) {\n float otherNodeSize = getTextureData(u_sizeTexture, i, 256.0).a;\n return nodeSize + otherNodeSize;\n}\n\nvec2 getSpringForce(float curConnection, float numConnections, float springFScale, vec4 myPosition, float i) {\n float curSpring = getTextureData(u_connections, curConnection + i, 4096.0).a;\n\n vec4 otherPosition = getTextureData(u_physData, curSpring, 256.0);\n float otherDataPosition = getTextureData(u_connectionOffsets, curSpring, 256.0).a;\n float avgDegree;\n#if INTEL_WORKAROUND\n avgDegree = max(numConnections, 4.0);\n#else\n float otherNumConnections = getTextureData(u_connections, otherDataPosition, 4096.0).a;\n avgDegree = max((otherNumConnections + numConnections * 3.0) / 4.0, 4.0);\n#endif\n\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n\n float F = (dist * dist * springFScale) / (u_baseLength * avgDegree);\n if (u_collisionMultiplier > 0.0) {\n F *= u_collisionMultiplier;\n }\n return (-delta / dist) * F;\n}\n\nvec2 getCollisionForce(float combinedNodeSize, float dist, float fScale, vec2 delta) {\n float collisionForce = ((combinedNodeSize - dist) / dist);\n if (u_collisionMultiplier > 0.0) {\n collisionForce *= u_collisionMultiplier;\n }\n return (delta * collisionForce * fScale * combinedNodeSize) / (combinedNodeSize + 1.0);\n}\n\nvec2 getRepulsionForce(float dist, float fScale, vec2 delta) {\n float F = (u_baseLength * u_baseLength * (fScale / 1.5)) / dist;\n return (delta / dist) * F * 0.05;\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * textureSide;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterWeight = clusterData.w;\n\n vec4 myPosition = getTextureData(u_physData, index, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n\n vec2 acceleration = previousForce.xy;\n\n float isPinned = getTextureData(u_pinnedNodes, index, 256.0).a;\n float nodeSize = getTextureData(u_sizeTexture, index, 256.0).a;\n\n if (isPinned > 0.5) {\n gl_FragColor = vec4(myPosition.xy, 0.0, 0.0);\n return;\n }\n\n float curConnection = getTextureData(u_connectionOffsets, index, 256.0).a;\n float numConnections = getTextureData(u_connections, curConnection, 4096.0).a;\n\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n float springFScale = fScale;\n\n if (numConnections > denseNodeThreshold) {\n springFScale = sqrt(fScale);\n }\n\n float numOfRels = 0.0;\n\n // Springs\n for (float i = 1.0; i <= 256.0 * 256.0; i++) {\n if (numOfRels >= numConnections) {\n break;\n }\n acceleration += getSpringForce(curConnection, numConnections, springFScale, myPosition, i);\n numOfRels += 1.0;\n }\n\n // Repulsion && collision detection\n if (u_collisionMultiplier > 0.0) {\n float number_of_collisions = 0.0;\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= u_numNodes) {\n break;\n }\n\n if (i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize) * 2.0;\n\n if (dist < combinedNodeSize && number_of_collisions < 40.0) {\n number_of_collisions++;\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n if (i >= clusterStartIndex && i < clusterStartIndex + clusterSize) {\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n } else {\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherPosition = getOtherNodePosition(i);\n vec2 delta = getDelta(myPosition.xy, otherPosition.xy);\n float dist = length(delta);\n float combinedNodeSize = getCombinedNodeSize(i, nodeSize);\n\n if (dist < combinedNodeSize) {\n acceleration += getCollisionForce(combinedNodeSize, dist, fScale, delta);\n }\n\n acceleration += getRepulsionForce(dist, fScale, delta);\n }\n }\n\n // Gravity\n vec2 delta = getDelta(u_gravityCenter, myPosition.xy);\n float dist = length(delta);\n\n vec2 grav = (delta / dist) * u_gravity * fScale;\n acceleration += grav * smoothstep(0.0, 500.0, dist);\n\n float accMagnitude = length(acceleration);\n acceleration *= min(MAX_ACCELERATION, accMagnitude) / accMagnitude;\n\n float iterationFrictionThreshold = 1000.0;\n\n if (u_curIteration > iterationFrictionThreshold) {\n float friction = 1.0 + pow((u_curIteration - iterationFrictionThreshold), 2.0) / 100.0;\n acceleration *= 1.0 / friction;\n }\n\n if (u_curIteration == 0.0) {\n gl_FragColor = vec4(myPosition.xy, acceleration * TIMESTEP * 0.5);\n } else {\n myPosition.zw = myPosition.zw * VELOCITYDECAY;\n gl_FragColor = vec4(myPosition.xy + myPosition.zw * TIMESTEP, myPosition.zw + acceleration * TIMESTEP);\n }\n}";this.physShader=new Ei(t,Mi,d,{INTEL_WORKAROUND:this.intelWorkaround?1:0}),this.physShader.use(),this.physShader.setUniform("u_projection",this.physProjection),this.physShader.setUniform("u_baseLength",this.getBaseLength()),this.physShader.setUniform("u_connections",this.springTexture),this.physShader.setUniform("u_sizeTexture",this.sizeTexture),this.physShader.setUniform("u_connectionOffsets",this.offsetTexture),this.physShader.setUniform("u_pinnedNodes",this.pinTexture),this.physShader.setUniform("u_gravityCenter",this.nodeCenterPoint),this.physShader.setUniform("u_numNodes",this.numNodes),this.physShader.setUniform("u_gravity",this.gravity)}},{key:"setupPhysicsForCoarse",value:function(){var t=this,e=this.gl;this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[];var n,r,i=this.subGraphs.length,o=function(t,e,r,i,o){n[4*t+0]=e,n[4*t+1]=r,n[4*t+2]=o.size(),n[4*t+3]=i||1};if(1===i){n=new Float32Array(262144);var a=this.subGraphs[0].nodes;a.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return a.length}})})),this.levelsClusterTexture[0]=this.newTexture(e,n,Ki)}else for(var s=function(){var i=t.subGraphs[u].nodes,a=u===t.subGraphs.length-1?[]:t.subGraphs[u+1].nodes;n=new Float32Array(262144),r=new Float32Array(65536);var s=0;if(a.length>0){var l=a.slice();l.sort((function(t,e){return t.previousIndex-e.previousIndex})),l.forEach((function(t,e){var n=s,u=a.indexOf(t);o(s,u,n,i[t.id].weight,t),r[s]=i[s].finestIndex,s++,t.planets.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++,e.moons.forEach((function(e){o(s,u,n,e.weight,t),r[s]=i[s].finestIndex,s++}))}))}))}else i.forEach((function(t,e){o(e,0,0,t.weight,{size:function(){return i.length}}),r[e]=i[e].finestIndex}));var c=t.newTexture(e,null,Ki),f=t.newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t.newTexture(e,n,Ki),t.levelsFinestIndexTexture[u]=t.newTexture(e,r,mr,e.FLOAT,e.ALPHA)},u=this.subGraphs.length-1;u>=0;u--)s();for(var l=new Float32Array(262144),c=0;c<l.length;c++)l[c]=0;this.initalLevelTexture=this.newTexture(e,l,Ki);var f=this.enableVerlet?"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat PI = 3.1415926535897932384626433832795;\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterRadius = (clusterSize * 0.5) + u_baseLength;\n float clusterArea = PI * clusterRadius * clusterRadius;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = (clusterArea * fScale) / (dist * dist);\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / sqrt(dist)) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / (dist * dist);\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}":"precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0.6;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getLogClusterWeight(float value) {\n return value / max(log(value), 1.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = ((u_baseLength * u_baseLength) * (fScale / 1.5)) / dist;\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.3;\n }\n\n acceleration += ((delta / dist) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / dist;\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}";this.apprxRepForceShader=new Ei(e,Mi,f),this.apprxRepForceShader.use(),this.apprxRepForceShader.setUniform("u_projection",this.physSmallProjection)}},{key:"setupPinData",value:function(){var t=this.gl;this.pinTexture=t.createTexture(),this.pinData=new Uint8Array(65536);for(var e=0;e<65536;e++)this.pinData[e]=0;t.bindTexture(t.TEXTURE_2D,this.pinTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.UNSIGNED_BYTE,this.pinData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}},{key:"setupUpdates",value:function(){var t=this.gl;this.updateData=new Float32Array(65536),this.updateTexture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.updateTexture),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,mr,mr,0,t.ALPHA,t.FLOAT,this.updateData),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.updateShader=new Ei(t,Mi,"precision mediump float;\n\nuniform sampler2D u_physData;\nuniform sampler2D u_updateData;\nuniform float u_numNodesNew;\n\nconst float INDEX_FLAG = 999999.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nvoid main(void) {\n float textureSide = 256.0; //#TEXTURE_SIDE#;\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5)*textureSide;\n\n if (index >= u_numNodesNew) {\n discard;\n }\n\n float firstValue = getTextureData(u_updateData, index * 2.0, 256.0).a;\n float secondValue = getTextureData(u_updateData, index * 2.0 + 1.0, 256.0).a;\n\n if (secondValue == INDEX_FLAG) {\n vec4 myPosition = getTextureData(u_physData, firstValue, 256.0);\n gl_FragColor = myPosition;\n } else {\n gl_FragColor = vec4(firstValue, secondValue, 0.0, 0.0);\n }\n}\n"),this.updateShader.use(),this.updateShader.setUniform("u_projection",this.physProjection)}},{key:"setupReadpixelWorkaround",value:function(){var t=this.gl;this.workaroundShader=new Ei(t,Mi,"precision lowp float;\n\nuniform sampler2D u_physData;\nuniform float u_index;\n\nfloat shift_right (float v, float amt) { \n v = floor(v) + 0.5; \n return floor(v / exp2(amt)); \n}\n\nfloat shift_left (float v, float amt) { \n return floor(v * exp2(amt) + 0.5); \n}\n\nfloat mask_last (float v, float bits) { \n return mod(v, shift_left(1.0, bits)); \n}\n\nfloat extract_bits (float num, float from, float to) { \n from = floor(from + 0.5); to = floor(to + 0.5); \n return mask_last(shift_right(num, from), to - from); \n}\n\n// From https://stackoverflow.com/questions/17981163/webgl-read-pixels-from-floating-point-render-target\nvec4 encode_float (float val) { \n if (val == 0.0) return vec4(0, 0, 0, 0); \n float sign = val > 0.0 ? 0.0 : 1.0; \n val = abs(val); \n float exponent = floor(log2(val)); \n float biased_exponent = exponent + 127.0; \n float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; \n float t = biased_exponent / 2.0; \n float last_bit_of_biased_exponent = fract(t) * 2.0; \n float remaining_bits_of_biased_exponent = floor(t); \n float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; \n float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; \n float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; \n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; \n return vec4(byte4, byte3, byte2, byte1); \n}\n\nvoid main(void) {\n vec4 texData = texture2D(u_physData, gl_FragCoord.xy / 255.0);\n float data;\n if (u_index == 0.0) {\n data = texData.x;\n } else if (u_index == 1.0) {\n data = texData.y;\n } else if (u_index == 2.0) {\n data = texData.z;\n } else if (u_index == 3.0) {\n data = texData.w;\n }\n\n gl_FragColor = encode_float(data);\n}\n"),this.workaroundShader.use(),this.workaroundShader.setUniform("u_projection",this.physProjection),this.workaroundData=[];for(var e=0;e<4;e++){var n=new Uint8Array(262144),r=this.newTexture(t,null,mr,t.UNSIGNED_BYTE),i=this.newFramebuffer(t,r);this.workaroundData.push({dataByte:n,dataFloat:new Float32Array(n.buffer),texture:r,frameBuffer:i})}}},{key:"doReadpixelWorkaround",value:function(){for(var t=this.gl,e=0;e<4;e++){var n=this.workaroundData[e];t.bindFramebuffer(t.FRAMEBUFFER,n.frameBuffer),t.viewport(0,0,mr,mr),this.workaroundShader.use(),this.workaroundShader.setUniform("u_index",e),this.workaroundShader.setUniform("u_physData",this.getPhysData(0).texture),t.bindBuffer(t.ARRAY_BUFFER,this.physVbo),this.workaroundShader.setAttributePointer("a_position",2,0,2),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.readPixels(0,0,mr,mr,t.RGBA,t.UNSIGNED_BYTE,n.dataByte)}}},{key:"definePhysicsArrays",value:function(){this.physData=[],this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[]}}],n&&Hi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(t){return function(t){if(Array.isArray(t))return no(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return no(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?no(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,oo(r.key),r)}}function io(t,e,n){return(e=oo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oo(t){var e=function(t,e){if("object"!=to(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=to(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==to(e)?e:String(e)}var ao="ForceCytoLayout",so="forceDirected",uo="coseBilkent",lo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),io(this,"physLayout",void 0),io(this,"coseBilkentLayout",void 0),io(this,"state",void 0),io(this,"currentLayoutType",void 0),io(this,"enableCytoscape",void 0),io(this,"currentLayout",void 0);var r=e.state,i=e.enableCytoscape;this.enableCytoscape=null==i||i,this.physLayout=new Qi(e),this.coseBilkentLayout=new gi({state:r,cytoCompleteCallback:function(){for(n.physLayout.update(!0),n.copyLayoutPositions(n.state.nodes.items,n.coseBilkentLayout,n.physLayout);n.physLayout.update(!1););n.copyLayoutPositions(n.state.nodes.items,n.physLayout,n.coseBilkentLayout)},animationCompleteCallback:function(){n.currentLayoutType===uo&&setTimeout((function(){return n.setLayout(so)}),50)}}),this.currentLayout=this.physLayout,this.currentLayoutType=so;var o=r.nodes,a=r.rels;o.addChannel(ao),a.addChannel(ao),this.state=r}var e,n;return e=t,n=[{key:"setOptions",value:function(t){void 0!==t&&(this.currentLayout.setOptions(t),this.enableCytoscape=t.enableCytoscape)}},{key:"getLayout",value:function(t){return t===uo?this.coseBilkentLayout:this.physLayout}},{key:"setLayout",value:function(t){if(t!==this.currentLayoutType){Gr.info("Switching to layout: ".concat(t," in ForceCyto"));var e=this.getLayout(t);this.currentLayout=e,this.currentLayoutType=t}}},{key:"copyLayoutPositions",value:function(t,e,n){var r=e.getNodePositions(t);n.updateNodes(r)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state,n=e.nodes,r=e.rels,i=n.channels[ao],o=r.channels[ao],a=Object.values(i.adds).length,s=Object.values(o.adds).length,u=Object.values(i.adds).map((function(t){return t.id})),l=Object.values(o.adds).map((function(t){return t.id})),c=new Set(Object.keys(i.adds)),f=new Set(Object.keys(o.adds));if(n.clearChannel(ao),r.clearChannel(ao),this.currentLayoutType===so&&this.enableCytoscape&&n.items.length<=100&&a<100&&a>0&&s>0){var h=n.items.map((function(t){return t.id})),d=new Set([].concat(eo(h),eo(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(eo(p),eo(l)));if(d.size<=100&&v.size<=300){var y=function(t,e,n,r){var i,o=new Set(t),a=Tr(new Set(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=r.idToItem[s];if(u){var l=u.from,c=u.to;o.add(l),o.add(c)}}}catch(t){a.e(t)}finally{a.f()}var f,h=function(t){var e,n={},r={},i=Tr(t);try{for(i.s();!(e=i.n()).done;){for(var o=e.value,a=o.from,s=o.to,u="".concat(a,"-").concat(s),l="".concat(s,"-").concat(a),c=0,f=[u,l];c<f.length;c++){var h=f[c];void 0!==r[h]?r[h].push(o):r[h]=[o]}n[a]||(n[a]=new Set),n[s]||(n[s]=new Set),n[a].add(s),n[s].add(a)}}catch(t){i.e(t)}finally{i.f()}return{adjNodesMap:n,relMap:r}}(r.items),d=h.adjNodesMap,p=h.relMap,v={},y={},m=function(t){var e=[];for(v[t]||e.push(t);e.length>0;){var r=e.shift();if(v[r]=n.idToItem[r],void 0!==d[r]){var i,o=Tr(d[r]);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!v[a]){e.push(a);var s=p["".concat(r,"-").concat(a)];if(s){var u,l=Tr(s);try{for(l.s();!(u=l.n()).done;){var c=u.value;y[c.id]||(y[c.id]=c)}}catch(t){l.e(t)}finally{l.f()}}}}}catch(t){o.e(t)}finally{o.f()}}}},g=Tr(o);try{for(g.s();!(f=g.n()).done;)m(f.value)}catch(t){g.e(t)}finally{g.f()}return{connectedNodes:v,connectedRels:y}}(c,f,n,r),m=y.connectedNodes,g=y.connectedRels,b=Object.values(m),w=Object.values(g),x=b.length,_=w.length;x===c.size&&_===f.size&&(f.size>0||c.size>0)?(this.setLayout(uo),this.coseBilkentLayout.update(!0,n.items,r.items)):_>0&&f.size/_>.25&&(this.setLayout(uo),this.coseBilkentLayout.update(!0,b,w))}}this.physLayout.update(t),this.coseBilkentLayout.update(t)}},{key:"getShouldUpdate",value:function(){return this.currentLayout.getShouldUpdate()}},{key:"getComputing",value:function(){return this.currentLayout.getComputing()}},{key:"updateNodes",value:function(t){this.setLayout(so),this.physLayout.updateNodes(t)}},{key:"getNodePositions",value:function(t){return this.currentLayout.getNodePositions(t)}},{key:"terminateUpdate",value:function(){this.physLayout.terminateUpdate(),this.coseBilkentLayout.terminateUpdate()}},{key:"destroy",value:function(){this.physLayout.destroy(),this.coseBilkentLayout.destroy()}}],n&&ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ho(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fo(Object(n),!0).forEach((function(e){mo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function po(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,go(r.key),r)}}function mo(t,e,n){return(e=go(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function go(t){var e=function(t,e){if("object"!=co(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==co(e)?e:String(e)}var bo="FreeLayout",wo=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mo(this,"state",void 0),mo(this,"positions",void 0),mo(this,"shouldUpdate",void 0),mo(this,"stateDisposers",void 0);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(bo),a.addChannel(bo),this.shouldUpdate=!0,this.setOptions(),this.layout(o.items,o.idToItem,o.idToPosition)}var e,r;return e=t,r=[{key:"setOptions",value:function(){}},{key:"updateNodes",value:function(t){var e,n=po(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[bo].adds).length>0,o=Object.values(r.channels[bo].adds).length>0,a=Object.values(n.channels[bo].removes).length>0,s=Object.values(r.channels[bo].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(bo),r.clearChannel(bo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r){var i,o=void 0!==(i=t)?wn(i):i;if(!(0,n.isEmpty)(o)){for(var a={},s=0;s<o.length;++s){var u,l=o[s].id,c=null!==(u=r[l])&&void 0!==u?u:{},f=c.x,h=void 0===f?0:f,d=c.y,p=void 0===d?0:d;a[l]={id:l,x:h,y:p}}this.positions=a,this.shouldUpdate=!1}}},{key:"setNodePositions",value:function(t){this.positions=t}},{key:"getNodePositions",value:function(t){var e,n=[],r=po(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=ho({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){}},{key:"destroy",value:function(){this.state.nodes.removeChannel(bo),this.state.rels.removeChannel(bo)}}],r&&yo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xo(t){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(t)}function _o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function So(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_o(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Po(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function To(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Oo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Po(r.key),r)}}function Po(t){var e=function(t,e){if("object"!=xo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xo(e)?e:String(e)}var Eo="GridLayout",ko=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.state;this.state=r,this.positions={},this.stateDisposers=[],this.stateDisposers.push(this.state.reaction((function(){return n.state.graphUpdates}),(function(){void 0!==n.state.nodes.version&&(n.shouldUpdate=!0),void 0!==n.state.rels.version&&(n.shouldUpdate=!0)})));var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Eo),a.addChannel(Eo),this.shouldUpdate=!0,this.setOptions(e),this.layout(o.items,o.idToItem,o.idToPosition,a.items)}var e,r;return e=t,r=[{key:"setOptions",value:function(t){}},{key:"updateNodes",value:function(t){var e,n=To(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==r.x&&void 0!==r.y&&(this.positions[r.id]={x:r.x,y:r.y}),this.shouldUpdate=!0}}catch(t){n.e(t)}finally{n.f()}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var e=this.state,n=e.nodes,r=e.rels,i=Object.values(n.channels[Eo].adds).length>0,o=Object.values(r.channels[Eo].adds).length>0,a=Object.values(n.channels[Eo].removes).length>0,s=Object.values(r.channels[Eo].removes).length>0;(i||o||a||s)&&(this.layout(n.items,n.idToItem,n.idToPosition,r.items),n.idToPosition=this.positions),n.clearChannel(Eo),r.clearChannel(Eo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,e,r,i){var o;if(t=(o=t)?wn(o):o,!(0,n.isEmpty)(t)){for(var a=t.length,s=Math.ceil(Math.sqrt(a)),u=new Array(a),l=0,c=0;c<s;++c){for(var f=0;f<s&&(u[l]={y:0+150*c,x:0+150*f},++l!==a);++f);if(l===a)break}for(var h=t.sort(),d={},p=0;p<a;++p){var v=h[p],y=u[p];v.x===y.x&&v.y===y.y||(d[v.id]=So({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{key:"getNodePositions",value:function(t){var e,n=[],r=To(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=So({id:i.id},o);n.push(a)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate}},{key:"getComputing",value:function(){return!1}},{key:"terminateUpdate",value:function(){this.shouldUpdate=!1}},{key:"destroy",value:function(){this.state.nodes.removeChannel(Eo),this.state.rels.removeChannel(Eo)}}],r&&Ao(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Co=i(269),jo=i.n(Co);function Do(t){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(t)}function Ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Io(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Do(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Do(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Lo=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},r=0;r<t.length;r++)n.minX>t[r].x&&(n.minX=t[r].x),n.minY>t[r].y&&(n.minY=t[r].y),n.maxX<t[r].x&&(n.maxX=t[r].x),n.maxY<t[r].y&&(n.maxY=t[r].y);var i=(n.minX+n.maxX)/2,o=(n.minY+n.maxY)/2,a=2*e,s=_r()*a;return{centerX:i,centerY:o,nodesWidth:n.maxX-n.minX+a+s,nodesHeight:n.maxY-n.minY+a+s}},No=function(t,e,n,r){var i=1/0,o=1/0;return t>1&&(i=n/t),e>1&&(o=r/e),{zoomX:i,zoomY:o}},Mo=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=Math.min(t,e);return Math.min(r,Math.max(n,i))},Fo=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},Uo=function(t,e,n,r,i,o){var a=e;return function(t,e,n){return t<e&&t<n}(i,o,e)&&t.length>1?(a=function(t,e,n){var r=function(t){var e=new Array(4).fill(t[0]);return t.forEach((function(t){e[0]=t.x<e[0].x?e[0]:Io({},t),e[1]=t.y<e[1].y?e[1]:Io({},t),e[2]=t.x<e[2].x?Io({},t):e[2],e[3]=t.y<e[3].y?Io({},t):e[3]})),e}(t),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0,n=0,r=0;r<t.length;r++)for(var i=r+1;i<t.length;i++)e=Math.hypot(Math.abs(t[r].x-t[i].x),Math.abs(t[r].y-t[i].y)),n=Math.max(n,e);return n}(r),o=2*n,a=_r()*o,s=e.height<=e.width?e.height-o-a:e.width-o-a;return i>s?.9*s/i:.9*i/s}(t,r,25),Fo(i,o,Math.min(e,a),n)):Fo(i,o,e,n)};function zo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Bo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vo(t){this.channels[t]={adds:{},updates:{},removes:{}}}function Go(t){delete this.channels[t]}function Wo(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var Xo=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function Ho(t,e){var r,i=!1,o=zo(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.id;if(void 0===this.idToItem[s]){if(a=(0,n.cloneDeep)(a),this.items.push(a),this.idToItem[s]=a,this.idToPosition[s]={id:s,x:0,y:0},"x"in a&&"y"in a){var u=a,l=u.x,c=u.y;isNaN(l)||isNaN(c)||(this.idToPosition[s].x=l,this.idToPosition[s].y=c)}var f=Xo(a);if(f instanceof HTMLElement){var h=document.createElement("div");Object.assign(h.style,{position:"absolute"}),h.appendChild(f),this.idToHtmlOverlay[s]=h}for(var d=Object.values(this.channels),p=0,v=d;p<v.length;p++){var y=v[p];void 0===y.removes[s]?y.adds[s]=a:(delete y.removes[s],y.updates[s]=a)}i=!0}}}catch(t){o.e(t)}finally{o.f()}i&&(this.version+=1,void 0!==e&&(e.added=!0))}function Yo(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.id,s=this.idToItem[a];if(void 0!==s){Object.assign(s,o);var u=Xo(o);if(u instanceof HTMLElement){var l;null===(l=this.idToHtmlOverlay[a])||void 0===l||l.remove(),delete this.idToHtmlOverlay[a];var c=document.createElement("div");Object.assign(c.style,{position:"absolute"}),c.appendChild(u),this.idToHtmlOverlay[a]=c}for(var f=Object.values(this.channels),h=0,d=f;h<d.length;h++){var p=d[h];if(void 0===p.adds[a]){var v=p.updates[a];void 0===v&&(v={id:a},p.updates[a]=v),Object.assign(v,o)}}void 0!==e&&(e.updated=!0)}r=!0}}catch(t){i.e(t)}finally{i.f()}r&&(this.version+=1)}function $o(t,e){var n,r=!1,i=zo(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=this.idToItem[o];if(void 0!==a){var s;r=!0,delete this.idToItem[a.id],delete this.idToPosition[a.id],null===(s=this.idToHtmlOverlay[a.id])||void 0===s||s.remove(),delete this.idToHtmlOverlay[a.id],this.items.splice(this.items.indexOf(a),1);for(var u=Object.values(this.channels),l=0,c=u;l<c.length;l++){var f=c[l];void 0!==f.adds[o]?delete f.adds[o]:(delete f.updates[o],f.removes[o]=a)}}}}catch(t){i.e(t)}finally{i.f()}r&&(void 0!==e&&(e.removed=!0),this.version+=1)}function qo(t){var e,n=zo(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(void 0!==this.idToPosition[r.id]){var i=this.idToPosition[r.id];Object.assign(i,r)}else this.idToPosition[r.id]={id:r.id,x:r.x,y:r.y,pinned:r.pinned}}}catch(t){n.e(t)}finally{n.f()}}function Zo(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var Ko=function(){return{idToItem:Vt.shallow({}),items:Vt.shallow([]),channels:Vt.shallow({}),idToPosition:Vt.shallow({}),idToHtmlOverlay:Vt.shallow({}),version:0,addChannel:ot(Vo),removeChannel:ot(Go),clearChannel:ot(Wo),add:ot(Ho),update:ot(Yo),remove:ot($o),updatePositions:ot(qo),updateHtmlOverlay:ot(Zo)}};function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ta(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qo(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=Jo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Jo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jo(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ea="#bbb",na="#fff",ra="#45bff8",ia={selected:{rings:[{widthFactor:.05,color:na},{widthFactor:.1,color:ra}],shadow:{width:10,opacity:1,color:ea}},default:{rings:[]}},oa={selected:{rings:[{color:na,width:2},{color:ra,width:4}],shadow:{width:18,opacity:1,color:ea}},default:{rings:[]}},aa=.75,sa=new Set(["direction","packing"]),ua="forceDirected",la="hierarchical",ca="grid",fa="free",ha="d3Force",da="webgl",pa="canvas";function va(t){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(t)}function ya(t,e,n){return e=function(t){var e=function(t,e){if("object"!=va(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ma="down",ga=ya(ya(ya(ya({},"up","BT"),ma,"TB"),"left","RL"),"right","LR"),ba="bin",wa=[ba,"stack"],xa=["html"],_a=["html"],Sa=["captionHtml"];function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(t)}function Oa(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Aa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ia(r.key),r)}}function Pa(t,e,n){return e=ja(e),function(t,e){if(e&&("object"===Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ka(t)}(t,Ea()?Reflect.construct(e,n||[],ja(t).constructor):e.apply(t,n))}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function ka(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ca(){return Ca="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ja(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ca.apply(this,arguments)}function ja(t){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ja(t)}function Da(t,e){return Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Da(t,e)}function Ra(t,e,n){return(e=Ia(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ia(t){var e=function(t,e){if("object"!=Ta(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ta(e)?e:String(e)}var La="HierarchicalLayout",Na=function(t){return void 0!==t?wn(t):t},Ma=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ra(ka(n=Pa(this,e,[t])),"direction",void 0),Ra(ka(n),"packing",void 0),Ra(ka(n),"stateDisposers",void 0),Ra(ka(n),"oldComputing",void 0),Ra(ka(n),"computing",void 0),Ra(ka(n),"pendingLayoutData",void 0),Ra(ka(n),"worker",void 0),Ra(ka(n),"directionChanged",void 0),Ra(ka(n),"packingChanged",void 0),n.direction=ma,n.packing=ba;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(La),o.addChannel(La),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[La],e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,a=Object.values(t.updates),s=Pr(a);n.shouldUpdate=n.shouldUpdate||e||r||s}if(void 0!==o.version){var u=o.channels[La],l=Object.values(u.adds).length>0,c=Object.values(u.removes).length>0;n.shouldUpdate=n.shouldUpdate||l||c}}))],n.shouldUpdate=!0,n.oldComputing=!1,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Wr.createHierarchicalLayoutWorker)(),n.worker.port.start(),n.setOptions(t),n.layout(i.items,i.idToItem,i.idToPosition,o.items),n}var n,r;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Da(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){if(void 0!==t&&function(t){return Object.keys(t).every((function(t){return sa.has(t)}))}(t)){var e=t.direction,n=void 0===e?ma:e,r=t.packing,i=void 0===r?ba:r;Object.keys(ga).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),wa.includes(i)&&(this.packingChanged=this.packing&&this.packing!==i,this.packing=i),this.shouldUpdate=this.directionChanged||this.packingChanged}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.shouldUpdate||t){var n=this.state,r=n.nodes,i=n.rels,o=this.directionChanged,a=this.packingChanged,s=Object.values(r.channels[La].adds).length>0,u=Object.values(i.channels[La].adds).length>0,l=Object.values(r.channels[La].removes).length>0,c=Object.values(i.channels[La].removes).length>0,f=Object.values(r.channels[La].updates),h=Pr(f);(t||s||u||l||c||o||a||h)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(La),i.clearChannel(La),this.directionChanged=!1,this.packingChanged=!1}Ca(ja(e.prototype),"update",this).call(this),this.shouldUpdate=!1,this.oldComputing=this.computing}},{key:"getShouldUpdate",value:function(){return this.shouldUpdate||this.shouldUpdateAnimator}},{key:"getComputing",value:function(){return this.computing}},{key:"layout",value:function(t,e,n,r){var i=this,o=Na(t).map((function(t){return t.html,Oa(t,xa)})),a=Na(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Oa(e,_a));s[t]=n}));var u=Na(r).map((function(t){return t.captionHtml,Oa(t,Sa)})),l=Na(n),c=this.direction,f=this.packing,h=window.devicePixelRatio,d={nodes:o,nodeIds:s,idToPosition:l,rels:u,direction:c,packing:f,pixelRatio:h,forcedDelay:0};this.computing?this.pendingLayoutData=d:(this.worker.port.onmessage=function(t){var e=t.data,n=e.positions,r=e.parents,o=e.waypoints;i.computing&&(i.positions=n),i.parents=r,i.state.setWaypoints(o),null!==i.pendingLayoutData?(i.worker.port.postMessage(i.pendingLayoutData),i.pendingLayoutData=null):i.computing=!1,i.shouldUpdate=!0,i.startAnimation()},this.computing=!0,this.worker.port.postMessage(d))}},{key:"terminateUpdate",value:function(){var t,e;this.computing=!1,this.shouldUpdate=!1,null===(t=this.state.nodes)||void 0===t||t.clearChannel(La),null===(e=this.state.rels)||void 0===e||e.clearChannel(La)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(La),this.state.rels.removeChannel(La),this.worker.port.close()}}],r&&Aa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(ti);function Fa(t){return Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fa(t)}function Ua(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ba(r.key),r)}}function za(t,e,n){return(e=Ba(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ba(t){var e=function(t,e){if("object"!=Fa(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fa(e)?e:String(e)}var Va=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),za(this,"elementId",void 0),za(this,"currentValue",void 0),za(this,"startValue",void 0),za(this,"currentTime",void 0),za(this,"duration",void 0),za(this,"status",void 0),za(this,"endValue",void 0),za(this,"startTime",void 0),za(this,"endTime",void 0),za(this,"hasNextAnimation",void 0),this.elementId=e,this.startValue=n,this.status=0,this.currentValue=n,this.duration=0}var e,n;return e=t,(n=[{key:"setDuration",value:function(t){this.duration=t,this.setEndTime(this.startTime+this.duration)}},{key:"getStatus",value:function(){return this.status}},{key:"advance",value:function(){if(1!==this.status)return!1;this.currentTime=(new Date).getTime();var t,e=this.endTime-this.startTime;return(t=e>0?(this.currentTime-this.startTime)/e:1)>=1?(this.currentValue=this.endValue,this.status=2):(this.currentValue=this.startValue+t*(this.endValue-this.startValue),this.hasNextAnimation=!0),this.hasNextAnimation}},{key:"setEndValue",value:function(t){this.endValue!==t&&(t-this.currentValue!=0?(this.currentTime=(new Date).getTime(),this.status=1,this.startValue=this.currentValue,this.endValue=t,this.startTime=this.currentTime,this.setEndTime(this.startTime+this.duration)):this.endValue=t)}},{key:"setEndTime",value:function(t){this.endTime=Math.max(t,this.startTime)}}])&&Ua(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ga(t){return Ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ga(t)}function Wa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wa(Object(n),!0).forEach((function(e){Ya(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ha(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$a(r.key),r)}}function Ya(t,e,n){return(e=$a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $a(t){var e=function(t,e){if("object"!=Ga(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ga(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ga(e)?e:String(e)}var qa=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ya(this,"animations",void 0),Ya(this,"durations",void 0),Ya(this,"defaultDuration",void 0),Ya(this,"hasNextAnimation",void 0),Ya(this,"ignoreAnimationsFlag",void 0),this.animations=new Map,this.durations=[],this.durations[0]=0,this.durations[1]=0,this.defaultDuration=150,this.hasNextAnimation=!1,this.ignoreAnimationsFlag=!1}var e,n;return e=t,n=[{key:"advance",value:function(){var t=this;return this.hasNextAnimation=!1,this.animations.forEach((function(e){Object.values(e).forEach((function(e){e.advance()&&(t.hasNextAnimation=!0)}))})),this.hasNextAnimation}},{key:"ignoreAnimations",value:function(t){this.ignoreAnimationsFlag=t}},{key:"setOptions",value:function(t){void 0!==t.fadeDuration&&(this.durations[0]=t.fadeDuration),void 0!==t.sizeDuration&&(this.durations[1]=t.sizeDuration)}},{key:"needsToRun",value:function(){return this.hasNextAnimation}},{key:"getValueForAnimationName",value:function(t,e,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.ignoreAnimationsFlag)return n;var a=null!==(r=this.getById(t))&&void 0!==r?r:{};if(void 0===a[e]){var s=1===o?this.createSizeAnimation(0,t,e):this.createFadeAnimation(0,t,e);s.setEndValue(n),i=s.currentValue}else{var u=a[e];if(u.currentValue===n)return n;u.setEndValue(n),i=u.currentValue}return this.hasNextAnimation=!0,i}},{key:"createAnimation",value:function(t,e,n){var r,i=new Va(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Xa(Xa({},o),{},Ya({},n,i))),i}},{key:"getById",value:function(t){return this.animations.get(t)}},{key:"createFadeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[0])&&void 0!==r?r:this.defaultDuration),i}},{key:"createSizeAnimation",value:function(t,e,n){var r,i=this.createAnimation(t,e,n);return i.setDuration(null!==(r=this.durations[1])&&void 0!==r?r:this.defaultDuration),i}}],n&&Ha(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Za(t){return Za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Za(t)}function Ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ja(r.key),r)}}function Ja(t){var e=function(t,e){if("object"!=Za(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Za(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Za(e)?e:String(e)}var Qa=64,ts=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=Ja(n="cache"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.cache={}}var e,n;return e=t,n=[{key:"getImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOrCreateEntry(t),r=e?"inverted":"image",i=n[r];return void 0===i&&(i=this.loadImage(t),n[r]=i),this.drawIfNeeded(i,e),i.canvas}},{key:"getOrCreateEntry",value:function(t){return void 0===this.cache[t]&&(this.cache[t]={}),this.cache[t]}},{key:"invertCanvas",value:function(t){for(var e=t.getImageData(0,0,Qa,Qa),n=e.data,r=0;r<4096;r++){var i=4*r;n[i]^=255,n[i+1]^=255,n[i+2]^=255}t.putImageData(e,0,0)}},{key:"loadImage",value:function(t){var e=document.createElement("canvas");e.width=Qa,e.height=Qa;var n=new Image;return n.src=t,n.crossOrigin="anonymous",{canvas:e,image:n,drawn:!1}}},{key:"drawIfNeeded",value:function(t,e){var n=t.image,r=t.canvas;if(!t.drawn&&n.complete){var i=r.getContext("2d");try{i.drawImage(n,0,0,Qa,Qa)}catch(t){Gr.error("Failed to draw image",n.src,t),i.beginPath(),i.strokeStyle="black",i.rect(0,0,Qa,Qa),i.moveTo(0,0),i.lineTo(Qa,Qa),i.moveTo(0,Qa),i.lineTo(Qa,0),i.stroke(),i.closePath()}e&&this.invertCanvas(i),t.drawn=!0}}}],n&&Ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const es=ts;function ns(t){return ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ns(t)}function rs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function is(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,as(r.key),r)}}function os(t,e,n){return(e=as(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function as(t){var e=function(t,e){if("object"!=ns(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ns(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ns(e)?e:String(e)}var ss=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),os(this,"key",void 0),os(this,"rels",void 0),os(this,"waypointPath",void 0),os(this,"selfReferring",void 0),os(this,"fromId",void 0),os(this,"toId",void 0),os(this,"angles",void 0),os(this,"labelInfo",void 0),this.key=e,this.rels=[],this.selfReferring=n===r,this.fromId=n,this.toId=r,this.labelInfo={},this.angles=[]}var e,r;return e=t,r=[{key:"insert",value:function(t){this.rels.push({rel:t})}},{key:"setLabelInfo",value:function(t,e){this.labelInfo[t]=e}},{key:"remove",value:function(t){var e=t.id,n=this.rels,r=n.findIndex((function(t){return t.rel.id===e}));if(-1!==r&&(n.splice(r,1),0===r&&n.length>0)){var i=n[0].rel,o=i.from,a=i.to;this.fromId=o,this.toId=a}}},{key:"size",value:function(){return this.rels.length}},{key:"maxFontSize",value:function(){return Math.max.apply(Math,function(t){if(Array.isArray(t))return rs(t)}(t=this.rels.map((function(t){var e=t.rel;return(0,n.isNumber)(e.captionSize)?e.captionSize:1})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return rs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rs(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var t}},{key:"relIsOppositeDirection",value:function(t){var e=t.from,n=t.to,r=this.fromId,i=this.toId;return e!==r&&n!==i||e===i&&n===r}},{key:"indexOf",value:function(t){var e=t.id;return this.rels.findIndex((function(t){return t.rel.id===e}))}},{key:"getRel",value:function(t){var e=this.rels;return t<0||t>=e.length?null:e[t].rel}},{key:"setWaypoints",value:function(t){this.waypointPath=t}},{key:"setAngles",value:function(t){this.angles=t}}],r&&is(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),us="#848484",ls=2*Math.PI/50,cs=.1*Math.PI,fs=wr;function hs(t){return hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(t)}function ds(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ps(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ps(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ps(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ms(r.key),r)}}function ys(t,e,n){return(e=ms(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ms(t){var e=function(t,e){if("object"!=hs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=hs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:String(e)}var gs=function(t){var e=[];if(0===t.length)e.push({size:2*Math.PI,start:0});else{for(var n=t.length-1;n>=0;n--){var r=void 0,i=void 0;0===n?(i=t[t.length-1],r=t[n]-t[t.length-1]+2*Math.PI):(i=t[n-1],r=t[n]-t[n-1]),e.push({size:r,start:i})}e.sort((function(t,e){return e.size-t.size}))}return e},bs=function(t,e){for(;e>t.length||t[0].size>2*t[e-1].size;)t.push({size:t[0].size/2,start:t[0].start}),t.push({size:t[0].size/2,start:t[0].start+t[0].size/2}),t.shift(),t.sort((function(t,e){return e.size-t.size}));return t},ws=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ys(this,"bundles",void 0),ys(this,"nodeToBundles",void 0),this.bundles={},this.nodeToBundles={};var r=e.reduce((function(t,e){return t[e.id]=e,t}),{});this.updateData(r,{},n)}var e,n;return e=t,n=[{key:"getBundle",value:function(t){var e=this.bundles,n=this.nodeToBundles,r=this.generatePairId(t.from,t.to),i=e[r];return void 0===i&&(i=new ss(r,t.from,t.to),e[r]=i,void 0===n[t.from]&&(n[t.from]=[]),void 0===n[t.to]&&(n[t.to]=[]),n[t.from].push(i),n[t.to].push(i)),i}},{key:"updateData",value:function(t,e,n){for(var r=this.bundles,i=this.nodeToBundles,o=function(t,e){var n=i[e].findIndex((function(e){return e===t}));-1!==n&&i[e].splice(n,1)},a=Object.values(t),s=Object.values(e),u=0,l=a;u<l.length;u++){var c=l[u];this.getBundle(c).insert(c)}for(var f=0,h=s;f<h.length;f++){var d=h[f],p=this.getBundle(d);p.remove(d),0===p.size()&&(delete r[p.key],o(p,d.from),o(p,d.to))}for(var v=0,y=Object.keys(r);v<y.length;v++){var m=r[y[v]];m.setWaypoints(n["".concat(m.fromId,"-").concat(m.toId)])}}},{key:"updatePositions",value:function(t){for(var e=this.nodeToBundles,n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],a=null!==(i=e[o])&&void 0!==i?i:[];if(0!==a.length){var s=a.find((function(t){return t.selfReferring})),u=a.filter((function(t){return!t.selfReferring}));if(void 0!==s){var l,c=[],f=ds(u);try{for(f.s();!(l=f.n()).done;)for(var h=l.value,d=t[h.fromId],p=t[h.toId],v=ls*h.size(),y=d.id===o?Math.atan2(p.y-d.y,p.x-d.x):Math.atan2(d.y-p.y,d.x-p.x),m=0;m<h.size();m++)c.push(y+v/2-m*ls)}catch(t){f.e(t)}finally{f.f()}var g=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),b=gs(g);bs(b,s.size());var w=b.map((function(t){return t.start+t.size/2})).slice(0,s.size());s.setAngles(w)}}}}},{key:"generatePairId",value:function(t,e){return[t.toString(),e.toString()].sort((function(t,e){return t.localeCompare(e)})).join("-")}}],n&&vs(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xs(t){return xs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(t)}function _s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ss(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Os(r.key),r)}}function Ts(t,e,n){return(e=Os(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Os(t){var e=function(t,e){if("object"!=xs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xs(e)?e:String(e)}var As=function(t,e){return(0,n.isFinite)(t.x)&&(0,n.isFinite)(t.y)&&(0,n.isFinite)(e.x)&&(0,n.isFinite)(e.y)},Ps=function(t,e){if(void 0===t||void 0===e||!As(t,e))return!1;var n=e.x-t.x,r=e.y-t.y,i=_r();return n*n+r*r<100*i*i},Es=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ts(this,"p1",void 0),Ts(this,"p2",void 0),Ts(this,"unit",void 0),Ts(this,"norm",void 0),Ts(this,"length",void 0),Ts(this,"vector",void 0),this.p1=e,this.p2=n,this.vector=this.getVector(),this.length=this.getLength(),this.unit=this.getUnitVector(),this.norm=this.getUnitNormalVector()}var e,n;return e=t,n=[{key:"getVector",value:function(){return{x:this.p2.x-this.p1.x,y:this.p2.y-this.p1.y}}},{key:"getLength",value:function(){var t=this.vector,e=t.x,n=t.y;return Math.sqrt(e*e+n*n)}},{key:"getUnitVector",value:function(){var t=this.vector,e=this.length;return{x:t.x/e,y:t.y/e}}},{key:"getUnitNormalVector",value:function(){return{x:this.unit.y,y:-this.unit.x}}}],n&&Ss(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ks=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o=function(t,e){var r=(t.x*e.x+t.y*e.y)/(e.x*e.x+e.y*e.y);return(0,n.clamp)(r,0,1)}({x:r.x-t.x,y:r.y-t.y},i),a=t.x+o*i.x,s=t.y+o*i.y,u=a-r.x,l=s-r.y;return Math.sqrt(u*u+l*l)},Cs=function(t,e,n,r){if(e.x===n.x&&e.y===n.y)return e;var i=e.y-t.y,o=t.x-e.x,a=i*t.x+o*t.y,s=r.y-n.y,u=n.x-r.x,l=s*n.x+u*n.y,c=i*u-s*o;return 0===c?null:{x:(u*a-o*l)/c,y:(i*l-s*a)/c}},js=function(t,e,n,r){var i,o,a,s=1e9,u=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_s(Object(n),!0).forEach((function(e){Ts(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t),l={x:0,y:0};for(o=1;o<10;o++)a=.1*o,l.x=Math.pow(1-a,2)*t.x+2*a*(1-a)*n.x+Math.pow(a,2)*e.x,l.y=Math.pow(1-a,2)*t.y+2*a*(1-a)*n.y+Math.pow(a,2)*e.y,o>0&&(s=(i=ks(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function Ds(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Rs=[[.04,1],[100,2]],Is=[[.8,1.1],[3,1.6],[8,2.5]],Ls=[[Is[0][0],1],[100,1.25]],Ns=function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba(".concat(n[0],",").concat(n[1],",").concat(n[2],",").concat(e,")")}var r=jo().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},Ms=function(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=r.headPosition,s=r.headAngle,u=r.headHeight,l=r.headChinHeight,c=r.headWidth;t.save(),t.lineWidth=e,t.strokeStyle=n,t.fillStyle=n,t.translate(a.x,a.y),t.rotate(s),function(t,e,n,r){if(t.beginPath(),e.length>0){var i=e[0];t.moveTo(i.x,i.y)}for(var o=1;o<e.length;o++){var a=e[o];t.lineTo(a.x,a.y)}t.closePath(),n&&t.fill(),r&&t.stroke()}(t,[{x:l-u,y:0},{x:-u,y:c/2},{x:0,y:0},{x:-u,y:-c/2}],i,o),t.restore()},Fs=function(t,e,n,r,i){var o=r;i.forEach((function(r){var i=r.width,a=r.color,s=o+i;t.beginPath(),t.fillStyle=a,t.arc(e,n,s,0,2*Math.PI,!1),t.arc(e,n,o,2*Math.PI,0,!0),t.fill(),t.closePath(),o=s}))},Us=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},zs=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,Us(t,e,n,i),t.fill(),t.closePath()};function Bs(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Vs=function(t,e,n,r,i,o,a,s,u){var l,c=r,f=0,h=0,d=null===(l=t.measureText("..."))||void 0===l?void 0:l.width;e.forEach((function(e){var r;t.font="normal ".concat(i,"px ").concat(o);var l,p=-(null===(r=t.measureText(e.text))||void 0===r?void 0:r.width)/2,v=e.text?function(t){if(Array.isArray(t))return Ds(t)}(l=e.text)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(l)||function(t,e){if(t){if("string"==typeof t)return Ds(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ds(t,e):void 0}}(l)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[];e.hasHyphenChar||e.hasEllipsisChar||v.push(" "),v.forEach((function(r){var a,l,v,y,m,g;null!==(a=n[h])&&void 0!==a&&a.includes("italic")&&null!==(l=n[h])&&void 0!==l&&l.includes("bold")?t.font="italic 600 ".concat(i,"px ").concat(o):null!==(v=n[h])&&void 0!==v&&v.includes("italic")?t.font="italic 400 ".concat(i,"px ").concat(o):null!==(y=n[h])&&void 0!==y&&y.includes("bold")?t.font="bold ".concat(i,"px ").concat(o):t.font="normal ".concat(i,"px ").concat(o),null!==(m=n[h])&&void 0!==m&&m.includes("underline")&&t.fillRect(s+p+f,u+c+.2,null===(g=t.measureText(r))||void 0===g?void 0:g.width,.2),e.hasEllipsisChar?t.fillText(r,s+p+f-d/2,u+c):t.fillText(r,s+p+f,u+c),f+=t.measureText(r).width,h+=1})),t.font="normal ".concat(i,"px ").concat(o),e.hasHyphenChar&&t.fillText("-",s+p+f,u+c),e.hasEllipsisChar&&t.fillText("...",s+p+f-d/2,u+c),f=0,c+=a}))},Gs=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Ws=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Xs=function(t,e){return{x:t.x*e,y:t.y*e}},Hs=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Ws(t,e))},Ys=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};function $s(t){return $s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(t)}function qs(t){return function(t){if(Array.isArray(t))return Qs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Js(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ks(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zs(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],i=function(t){var e=function(t,e){if("object"!=$s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=$s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$s(e)?e:String(e)}(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Js(t,e){if(t){if("string"==typeof t)return Qs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qs(t,e):void 0}}function Qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tu=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},eu=function(t){var e=t[t.length-1],n=t[t.length-2];return!(!e||!isNaN(Number(e))||e.toLowerCase()===e.toUpperCase())&&!(!n||!isNaN(Number(n))||n.toLowerCase()===n.toUpperCase())&&tu(e)&&!tu(n)},nu=function(t,e,n,r){for(var i,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],s=[],u=0,l=0,c=!1,f=!1,h=0;h<r;h++)a[h]=n(h,r);for(var d,p=function(){i=t.slice(u,v);var n,h,d=e(i),p=a[l];if(d>p||(h=t[v-1],"\n\r\v".includes(h))){if(!(l<r-1)){if(o)return{v:[]};for(var y=v;d>p;){for(y-=1;n=t[y-1]," \t\n\r\v".includes(n);)y-=1;if(!(y-u>1)){i="",f=!0,c=!1;break}i=t.slice(u,y),d=e(i),f=!0,c=!1}return s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},{v:s}}c=!1,f=!1;var m=function(t){var e=t.length,n=Math.min(e-1,3);if(1===e)return{hyphen:!1,cnt:0};for(var r=0;r<n;r++){var i=t[t.length-(r+1)];if(" "===i||i.toLowerCase()===i.toUpperCase())return{hyphen:!1,cnt:r+1};var o=t.slice(0,t.length-r);if(eu(o))return{hyphen:!1,cnt:r+1}}return{hyphen:!0,cnt:1}}(i),g=v-m.cnt;if(m.hyphen)for(i=t.slice(u,g),d=e(i),c=!0;d>p;){if(!(g-u>1)){i=t[u],g=u+1,d=e(i),c=!1;break}g--,i=t.slice(u,g),d=e(i),c=!0}else i=(i=t.slice(u,g)).trim();s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:c},u=g,l+=1}},v=1;v<=t.length;v++)if(d=p())return d.v;return i=t.slice(u,t.length),s[l]={text:i,hasEllipsisChar:f,hasHyphenChar:!1},s},ru=function(t,e,n,r,i,o,a,s){t.font="bold ".concat(r,"px ").concat(n).replace(/"/g,"");var u=function(e){var n;return null===(n=t.measureText(e))||void 0===n?void 0:n.width},l=2;a===Is[1][1]?l=3:a===Is[2][1]&&(l=4);for(var c=a<Is[2][1]?["",""]:[""],f=o?c.length:0,h=function(t,e){return function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top",i=.98*n,o=.89*n,a=.95*n;return 1===e?i:2===e?a:3===e&&"top"===r?0===t||2===t?o:i:4===e&&"top"===r?0===t||3===t?.78*n:a:5===e&&"top"===r?0===t||4===t?.65*n:1===t||3===t?o:a:i}(t+f,e+f,i)},d=1,p=[],v=function(){if(0===(p=function(t,e,n,r){var i,o=t.split(/\s/g).filter((function(t){return t.length>0})),a=[],s=null,u=function(t){return e(t)>n(a.length,r)},l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Js(t))){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,f=s?"".concat(s," ").concat(c):c;if(e(f)<n(a.length,r))s=f;else{if(null!==s){var h=u(s);a.push({text:s,overflowed:h})}if(s=c,a.length>r)return[]}}}catch(t){l.e(t)}finally{l.f()}if(s){var d=u(s);a.push({text:s,overflowed:d})}return a.length<=r?a:[]}(e,u,h,d)).length)p=nu(e,u,h,d,l>d);else if(p.some((function(t){return t.overflowed}))){var t=d;p=p.reduce((function(e,n){var r=l-e.length;if(0===r){var i=e[e.length-1];return i.text.endsWith("…")||(u(i.text)+u("…")>h(e.length,t)?(e[e.length-1].text=i.text.slice(0,-2),e[e.length-1].hasEllipsisChar=!0):(e[e.length-1].text=i.text,e[e.length-1].hasEllipsisChar=!0)),e}if(n.overflowed){var o=nu(n.text,u,h,r);e=e.concat(o)}else e.push({text:n.text,hasEllipsisChar:!1,hasHyphenChar:!1});return e}),[])}else p=p.map((function(t){return Ks(Ks({},t),{},{hasEllipsisChar:!1,hasHyphenChar:!1})}));d+=1};0===p.length;)v();return Array.from(p)},iu=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e,n){var r=e.value;if(r){var i="".concat(n>0&&t.length?", ":"").concat(r);return[].concat(qs(t),[Ks(Ks({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:qs(null!==(o=e.styles)&&void 0!==o?o:[]):qs(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat(qs(t),qs(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function ou(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return au(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?au(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function au(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var su=2*Math.PI,uu=Math.PI/2,lu=function(t,e,n,r,i,o){var a={x:(t.x+e.x)/2,y:(t.y+e.y)/2},s={x:t.x,y:t.y},u={x:e.x,y:e.y},l=new Es(u,s),c=function(t,e){var n=0;return t&&(n+=t),e&&(n-=e),n}(r,n);a.x+=c/2*l.unit.x,a.y+=c/2*l.unit.y;var f=o.size()/2-o.indexOf(i);return a.x+=f*l.unit.x,a.y+=f*l.unit.y,a},cu=function(t){var e=_r(),n=t.size,r=t.selected;return((null!=n?n:br)+4+(!0===r?4:0))*e},fu=function(t,e){var n=_r();t.shadowColor=e.color,t.shadowBlur=e.width*n,t.shadowOffsetX=0,t.shadowOffsetY=0},hu=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},du=function(t,e,n,r,i){var o,a,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.norm.x,r=t.norm.y;return e?{x:-n,y:-r}:t.norm},l=_r(),c=e.indexOf(t),f=(e.size()-1)/2,h=c>f,d=Math.abs(c-f),p=i?17*e.maxFontSize():8,v=(e.size()-1)*p*l,y=function(t,e,n,r,i,o,a){var s,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=_r(),c=t.size(),f=c>1,h=t.relIsOppositeDirection(o),d=h?n:e,p=h?e:n,v=t.waypointPath,y=null==v?void 0:v.points,m=null==v?void 0:v.from,g=null==v?void 0:v.to,b=Ps(d,m)&&Ps(p,g)||Ps(p,m)&&Ps(d,g),w=b?y[1]:null,x=b?y[y.length-2]:null,_=cu(d),S=cu(p),T=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},O=Math.max(Math.PI,su/(c/2)),A=f?r*O*(a?1:-1)/(null!==(s=d.size)&&void 0!==s?s:br):0,P=T(b?w:p,d),E=b?T(p,x):P,k=function(t,e,n,r){return{x:t.x+Math.cos(e)*n*(r?-1:1),y:t.y+Math.sin(e)*n*(r?-1:1)}},C=function(t,e){return k(d,P+t,e,!1)},j=function(t,e){return k(p,E-t,e,!0)},D=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},R=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))*l},I=C(A,_),L=j(A,S),N=f?C(0,_):null,M=f?j(0,S):null,F=200*l,U=[];if(b){var z=R(I,w)<F;if(f&&!z){var B=D(N,w);U.push(new Es(I,B)),U.push(new Es(B,w))}else U.push(new Es(I,w));for(var V=2;V<y.length-1;V++)U.push(new Es(y[V-1],y[V]));var G=R(L,x)<F;if(f&&!G){var W=D(M,x);U.push(new Es(x,W)),U.push(new Es(W,L))}else U.push(new Es(x,L))}else{var X=f?R(N,M):0;if(f&&X>2*(30*l+Math.min(_,S)))if(u){var H=lu(d,p,_,S,o,t);U.push(new Es(I,H)),U.push(new Es(H,L))}else{var Y=r*i,$=30+_,q=Math.sqrt($*$+Y*Y),Z=30+S,K=Math.sqrt(Z*Z+Y*Y),J=C(0,q),Q=j(0,K);U.push(new Es(I,J)),U.push(new Es(J,Q)),U.push(new Es(Q,L))}else if(X>(_+S)/2){var tt=lu(d,p,_,S,o,t);U.push(new Es(I,tt)),U.push(new Es(tt,L))}else U.push(new Es(I,L))}return U}(e,n,r,d,p,t,h,s),m=[],g=y[0],b=u(g,h);m.push({x:g.p1.x+b.x,y:g.p1.y+b.y});for(var w=1;w<y.length;w++)if(1===e.size())m.push(y[w-1].p2);else{var x=y[w-1],_=y[w],S=u(x,h),T=u(_,h),O=Gs(x.p1,Xs(S,v/2)),A=Gs(x.p2,Xs(S,v/2)),P=Gs(_.p1,Xs(T,v/2)),E=Gs(_.p2,Xs(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=Cs(O,A,P,E));var C=null!==k?Ws(k,x.p2):Xs(S,v/2);m.push(Gs(x.p2,Xs(C,d/f)))}var j=y[y.length-1],D=u(j,h);return m.push({x:j.p2.x+D.x,y:j.p2.y+D.y}),e.relIsOppositeDirection(t)?m.reverse():m},pu=function(t,e,n,r,i,o){var a,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=_r(),l=i.selected,c=i.captions,f=void 0===c?[]:c,h=i.caption,d=void 0===h?"":h,p=i.width,v=i.disabled,y=i.captionAlign,m=void 0===y?"top":y,g=i.captionSize,b=void 0===g?1:g,w=f.length>0?null===(a=iu(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==w){var x=!0===v?"#DDDDDD":"#848484",_=6*b*u,S=!0===l?"bold":"normal",T=w;t.fillStyle=x,t.font="".concat(S," ").concat(_,"px ").concat('"Open Sans", sans-serif');var O=function(e){return t.measureText(e).width},A=(null!=p?p:1)*(!0===l?1.5:1),P=O(T);if(P>r){var E=nu(T,O,(function(){return r}),1,!1)[0];T=!0===E.hasEllipsisChar?"".concat(E.text,"..."):T,P=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-uu),t.translate(2*_,0),t.rotate(-uu)):t.rotate(n);var k=(1+b)*u,C="bottom"===m?_/2+A+k:-(A+k);t.fillText(T,-P/2,C),t.restore();var j=2*C*Math.sin(n),D=2*C*Math.cos(n),R={position:{x:e.x-j,y:e.y+D},rotation:s?n-Math.PI:n,width:r/u,height:(_+k)/u};o.setLabelInfo(i.id,R)}},vu=function(t,e,n,r,i){if(t.beginPath(),t.moveTo(e[0].x,e[0].y),i&&e.length>2){for(var o=1;o<e.length-2;){var a=(e[o].x+e[o+1].x)/2,s=(e[o].y+e[o+1].y)/2;t.quadraticCurveTo(e[o].x,e[o].y,a,s),o+=1}t.quadraticCurveTo(e[o].x,e[o].y,e[o+1].x,e[o+1].y)}else for(var u=1;u<e.length;u++)t.lineTo(e[u].x,e[u].y);t.lineWidth=n,t.strokeStyle=r,t.lineCap="round",t.stroke()},yu=function(t){return t.rings[0].width*_r()*1.5},mu=function(t){return 6*t*_r()},gu=function(t,e,n){var r,i;return{widthAlign:e/2*(null!==(r=t[0])&&void 0!==r?r:0),heightAlign:n/2*(null!==(i=t[1])&&void 0!==i?i:0)}},bu=function(t,e,n){var r=Math.cos(n),i=Math.sin(n);return{xRotated:t*r+e*i,yRotated:t*i-e*r}},wu=function(t,e,n){var r,i,o=n.indexOf(t),a=null!==(r=n.angles[o])&&void 0!==r?r:0,s=a-cs/2,u=a+cs/2,l=null!==(i=t.width)&&void 0!==i?i:1,c=_r(),f=cu(e),h={x:e.x+Math.cos(s)*(f+l/2),y:e.y+Math.sin(s)*(f+l/2)},d={x:e.x+Math.cos(u)*(f+l/2),y:e.y+Math.sin(u)*(f+l/2)},p={x:e.x+Math.cos(a)*(f+35*c),y:e.y+Math.sin(a)*(f+35*c)};return{startAngle:s,endAngle:u,startPoint:h,endPoint:d,apexPoint:p,control1Point:{x:p.x+25*Math.cos(a-uu)*c/2,y:p.y+25*Math.sin(a-uu)*c/2},control2Point:{x:p.x+25*Math.cos(a+uu)*c/2,y:p.y+25*Math.sin(a+uu)*c/2}}},xu=function(t,e,n,r,i,o){t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(i.x,i.y,r.x,r.y),t.quadraticCurveTo(o.x,o.y,n.x,n.y),t.stroke()},_u=function(t,e,n,r,i,o,a,s){var u=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];As(n,r)&&(n.id===r.id?function(t,e,n,r,i,o,a){var s=e.overlayIcon,u=e.selected,l=e.width,c=e.hovered,f=e.disabled,h=e.color,d=wu(e,n,r),p=d.startPoint,v=d.endPoint,y=d.apexPoint,m=d.control1Point,g=d.control2Point,b=a.rings,w=a.shadow,x=_r(),_=b[0].color,S=b[1].color,T=b[0].width*x,O=b[1].width*x,A=40*x,P=(null!=l?l:1)*x,E=P>1?P/2:1,k=9*E,C=2*E,j=7*E,D=!0===u,R=!0===f,I=Math.atan2(v.y-g.y,v.x-g.x),L=!0===u?T*Math.sqrt(1+2*k/j*(2*k/j)):0,N={x:v.x-Math.cos(I)*(.5*k-C+L),y:v.y-Math.sin(I)*(.5*k-C+L)},M={headPosition:{x:v.x+Math.cos(I)*(.5*k-C-L),y:v.y+Math.sin(I)*(.5*k-C-L)},headAngle:I,headHeight:k,headChinHeight:C,headWidth:j};if(t.save(),t.lineCap="round",D&&(fu(t,w),t.lineWidth=P+O,t.strokeStyle=S,xu(t,p,N,y,m,g),Ms(t,O,S,M,!1,!0),hu(t),t.lineWidth=P+T,t.strokeStyle=_,xu(t,p,N,y,m,g),Ms(t,T,_,M,!1,!0)),t.lineWidth=P,!0===c&&!D&&!R){var F=w.color;fu(t,w),t.strokeStyle=F,t.fillStyle=F,xu(t,p,N,y,m,g),Ms(t,P,F,M),hu(t)}var U=R?fs:null!=h?h:us;if(t.fillStyle=U,t.strokeStyle=U,xu(t,p,N,y,m,g),Ms(t,P,U,M),o||s){var z,B=r.indexOf(e),V=null!==(z=r.angles[B])&&void 0!==z?z:0,G=y.x-Math.cos(I)*(L/4),W=y.y-Math.sin(I)*(L/4),X=(V+su)%su<Math.PI;if(o&&pu(t,{x:G,y:W},(V+uu)%su,A,e,r,X),s){var H=s.position,Y=void 0===H?[0,0]:H,$=s.url,q=s.size,Z=mu(void 0===q?1:q),K=gu(Y,A,Z),J=K.widthAlign,Q=K.heightAlign+(D?yu(a):0)*(Y[1]<0?-1:1),tt=bu(Q,J*(X?-1:1),V),et=Z/2,nt=G-et-tt.xRotated,rt=W-et-tt.yRotated;t.drawImage(i.getImage($),nt,rt,Z,Z)}}t.restore()}(t,e,n,i,o,a,s):function(t,e,n,r,i,o,a,s,u){var l=e.overlayIcon,c=e.color,f=e.disabled,h=e.selected,d=e.width,p=e.hovered,v=e.captionAlign,y=!0===h,m=!0===f,g=u.rings,b=u.shadow,w=du(e,i,n,r,a,s),x=_r(),_=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*_r()}(e),S=m?fs:null!=c?c:us,T=g[0].width*x,O=g[1].width*x,A=x*(d>1?d/2:1),P=9*A,E=2*A,k=7*A,C=Hs(w[w.length-2],w[w.length-1]),j=2*P,D=y?T*Math.sqrt(1+j/k*(j/k)):0,R=2-D,I=Math.floor(w.length/2);w.length>2&&y&&C<P+D-E&&(R+=C,D-=C/2+E,w.pop(),I=Math.floor(w.length/2));var L,N,M=w[w.length-2],F=w[w.length-1],U=(L=M,N=F,Math.atan2(N.y-L.y,N.x-L.x)),z=P/2+D,B=Math.cos(U),V=Math.sin(U);w[w.length-1]={x:F.x-B*z,y:F.y-V*z};var G,W={headPosition:{x:F.x+B*R,y:F.y+V*R},headAngle:U,headHeight:P,headChinHeight:E,headWidth:k},X=ou(w);try{for(X.s();!(G=X.n()).done;){var H=G.value;H.x=Math.round(H.x),H.y=Math.round(H.y)}}catch(t){X.e(t)}finally{X.f()}if(t.save(),y){var Y=g[0].color,$=g[1].color,q=Math.atan2(w[1].y-w[0].y,w[1].x-w[0].x),Z=Ys(q,yu(u));w[0]=Gs(w[0],Z),fu(t,b),vu(t,w,_+O,$,s),Ms(t,O,$,W,!1,!0),hu(t),vu(t,w,_+T,Y,s),Ms(t,T,Y,W,!1,!0)}if(!0===p&&!y&&!m){var K=b.color;fu(t,b),vu(t,w,_,K,s),Ms(t,_,K,W),hu(t)}if(vu(t,w,_,S,s),Ms(t,_,S,W),a||l){var J,Q,tt,et,nt,rt=n.x>r.x,it=w[I];1==(1&w.length)?(J=w[rt?I+1:I-1],Q=w[rt?I-1:I+1],s?(tt=(it.x+(J.x+Q.x)/2)/2,et=(it.y+(J.y+Q.y)/2)/2,nt=rt?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Hs(it,J)>Hs(it,Q)?Q=it:J=it,tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x))):(J=w[rt?I:I-1],Q=w[rt?I-1:I],tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x));var ot=y?Ys(nt+uu,yu(u)):{x:0,y:0},at=Hs(J,Q);if(a){var st="bottom"===v?1:-1,ut={x:tt+ot.x*st,y:et+ot.y*st};pu(t,ut,nt,at,e,i)}if(l){var lt=l.position,ct=void 0===lt?[0,0]:lt,ft=l.url,ht=l.size,dt=mu(void 0===ht?1:ht),pt=gu(ct,at,dt),vt=pt.widthAlign,yt=pt.heightAlign,mt=bu(yt,vt,nt+uu),gt=mt.xRotated,bt=mt.yRotated,wt=ct[1]<0?-1:1,xt=dt/2,_t=tt-xt+gt+ot.x*wt,St=et-xt+bt+ot.y*wt;t.drawImage(o.getImage(ft),_t,St,dt,dt)}}t.restore()}(t,e,n,r,i,o,a,u,s))},Su=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return As(n,r)?n.id===r.id?function(t,e,n){for(var r=wu(t,e,n),i={left:1/0,top:1/0,right:-1/0,bottom:-1/0},o=["startPoint","endPoint","apexPoint","control1Point","control2Point"],a=0;a<o.length;a++){var s=r[o[a]],u=s.x,l=s.y;u<i.left&&(i.left=u),u>i.right&&(i.right=u),l<i.top&&(i.top=l),l>i.bottom&&(i.bottom=l)}return i}(t,n,e):function(t,e,n,r,i,o){var a,s={left:1/0,top:1/0,right:-1/0,bottom:-1/0},u=ou(du(t,e,n,r,i,o));try{for(u.s();!(a=u.n()).done;){var l=a.value,c=l.x,f=l.y;c<s.left&&(s.left=c),c>s.right&&(s.right=c),f<s.top&&(s.top=f),f>s.bottom&&(s.bottom=f)}}catch(t){u.e(t)}finally{u.f()}return s}(t,e,n,r,i,o):null},Tu=i(4),Ou=i.n(Tu),Au=function(t){return t&&"light"===Ou()(t)?"#000":"#fff"};function Pu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Eu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eu(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ku=function(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.size,a=void 0===o?br:o;return{top:i-a,left:n-a,right:n+a,bottom:i+a}},Cu=function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=e.x,s=void 0===a?0:a,u=e.y,l=void 0===u?0:u,c=e.size,f=void 0===c?br:c,h=e.caption,d=void 0===h?"":h,p=e.captions,v=void 0===p?[]:p,y=e.captionAlign,m=void 0===y?"center":y,g=e.captionSize,b=void 0===g?1:g,w=e.disabled,x=e.activated,_=e.selected,S=e.hovered,T=e.id,O=e.icon,A=e.overlayIcon,P=i.selected,E=_r(),k=function(t,e,n){var r=t.selected?n.selected.rings:n.default.rings;if(!r.length){var i=e.getById(t.id);return void 0!==i&&Object.entries(i).forEach((function(t){var e=Pu(t,2),n=e[0],r=e[1];n.startsWith("ring-")&&r.setEndValue(0)})),[{width:0,color:""}]}return r.map((function(n,r){var i=n.widthFactor,o=n.color,a=(t.size||br)*i*_r();return{width:e.getValueForAnimationName(t.id,"ring-".concat(r),a),color:o}}))}(e,r,i),C=k.reduce((function(t,e){return t+e.width}),0),j=P.shadow.width*E,D=P.shadow.opacity,R=P.shadow.color,I=f*E,L=2*I,N=function(t,e){if(!t||!e)return{nodeInfoLevel:0,fontInfoLevel:1.25,iconInfoLevel:1};var n=_r(),r=1600*n*(1200*n),i=Math.pow(t,2)*Math.PI*Math.pow(e,2)/(r/100);return{nodeInfoLevel:Bs(i,Rs),fontInfoLevel:Bs(i,Is),iconInfoLevel:Bs(i,Ls)}}(I,o),M=N.nodeInfoLevel,F=N.fontInfoLevel,U=N.iconInfoLevel,z=e.color||"#478BFF",B=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:br)/({1:3.5,2:2.75,3:2}[arguments.length>2&&void 0!==arguments[2]?arguments[2]:1]+(arguments.length>3&&void 0!==arguments[3]&&arguments[3]?1:0))/t}(F,I,b,Boolean(O)),V=Au(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(O),$=Boolean(A);if(C>0&&(G=I+C),w)z="#EDEDED",V="#DDDDDD";else{if(x){var q=Date.now()%1e3/1e3,Z=q<.7?q/.7:0,K=Ns(z,.4-.4*Z);zs(t,s,l,K,I+.88*I*Z)}var J=_||S?j:0,Q=r.getValueForAnimationName(T,"shadowWidth",J);Q>0&&function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=i+o,u=t.createRadialGradient(e,n,i,e,n,s);u.addColorStop(0,"transparent"),u.addColorStop(.01,Ns(r,.5*a)),u.addColorStop(.05,Ns(r,.5*a)),u.addColorStop(.5,Ns(r,.12*a)),u.addColorStop(.75,Ns(r,.03*a)),u.addColorStop(1,Ns(r,0)),t.fillStyle=u,Us(t,e,n,s),t.fill()}(t,s,l,R,G,Q,D)}if(zs(t,s,l,z,I),C>0&&Fs(t,s,l,W,k),Y){var tt=M<2||!(X||H),et=M>0?1:0,nt=tt?1*I:.75*I;nt/=U;var rt=tt?.5*nt:nt*(1===U?"center"===m?1.3:"bottom"===m||tt?1.1:0:"center"===m?1.35:"bottom"===m||tt?1.1:0),it=nt/2;nt=r.getValueForAnimationName(T,"iconSize",nt),it=r.getValueForAnimationName(T,"iconXPos",it),rt=r.getValueForAnimationName(T,"iconYPos",rt),t.save();var ot=!0===w?.1:et;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",ot);var at="#fff"===V,st=n.getImage(O,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=L*(null!==(ut=A.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=A.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=A.position)||void 0===ht?void 0:ht[0])&&void 0!==ft?ft:0);t.save();var yt=!0===w?.1:1;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",yt);var mt=n.getImage(A.url);t.drawImage(mt,s-vt,l-pt,dt,dt),t.restore()}var gt=M<2?0:1,bt=r.getValueForAnimationName(T,"textOpacity",gt,0),wt=Ns(V,bt),xt='"Open Sans", sans-serif';if(X&&bt>0){var _t=ru(t,d,xt,B,.7*L,Y,F,null==e||e.captionAlign);t.fillStyle=wt,t.font="normal ".concat(B,"px ").concat(xt);var St=1+B,Tt=-(_t.length-2)*St/2,Ot=d.split("").map((function(t){return[]}));Vs(t,_t,Ot,Tt,B,xt,St,s,l)}if(H){var At=M<2?0:1,Pt=r.getValueForAnimationName(T,"textOpacity",At,0),Et=Ns(V,Pt),kt='"Open Sans", sans-serif',Ct=Boolean(O);if(Pt>0){var jt=iu(v),Dt=jt.stylesPerChar,Rt=jt.fullCaption,It="center"===m?.7*L:2*Math.sqrt(Math.pow(L/2,2)-Math.pow(L/3,2)),Lt=ru(t,Rt,kt,B,It,Ct,F,null==e||e.captionAlign);t.fillStyle=Et;var Nt,Mt=B,Ft=-(Lt.length-2)*Mt/2;Nt=m&&"center"!==m?"bottom"===m?Ft+I/Math.PI:Ft-I/Math.PI:Ft,Vs(t,Lt,Dt,Nt,B,kt,Mt,s,l)}}t.save(),t.restore()};function ju(t){return ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(t)}function Du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ru(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Du(Object(n),!0).forEach((function(e){Mu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Iu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Lu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fu(r.key),r)}}function Mu(t,e,n){return(e=Fu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fu(t){var e=function(t,e){if("object"!=ju(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ju(e)?e:String(e)}var Uu="canvasRenderer",zu=function(){function t(e,n,r){var i=this,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).relationshipThreshold,a=void 0===o?2.5:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Mu(this,"arrowBundler",void 0),Mu(this,"activeNodes",void 0),Mu(this,"canvas",void 0),Mu(this,"context",void 0),Mu(this,"state",void 0),Mu(this,"stateDisposers",void 0),Mu(this,"relationshipThreshold",void 0),Mu(this,"animationHandler",void 0),Mu(this,"imageCache",void 0),Mu(this,"needsRun",void 0),Mu(this,"nodeVersion",void 0),Mu(this,"relVersion",void 0),Mu(this,"waypointVersion",void 0),this.activeNodes=new Set,this.canvas=e,this.context=n,this.state=r,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){void 0!==r.zoom&&(i.needsRun=!0),void 0!==r.panX&&(i.needsRun=!0),void 0!==r.panY&&(i.needsRun=!0),void 0!==r.nodes.version&&(i.needsRun=!0),void 0!==r.rels.version&&(i.needsRun=!0),r.waypoints.counter>0&&(i.needsRun=!0),void 0!==r.layout&&(i.needsRun=!0)}))),r.nodes.addChannel(Uu),r.rels.addChannel(Uu),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new qa,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new ws(r.rels.items,r.waypoints.data),this.imageCache=new es,this.needsRun=!0}var e,n;return e=t,n=[{key:"needsToRun",value:function(){return this.needsRun||this.animationHandler.needsToRun()||this.activeNodes.size>0}},{key:"processUpdates",value:function(){var t=this.state,e=!1,n=t.nodes.channels[Uu],r=t.rels.channels[Uu],i=n.adds,o=n.removes,a=r.adds,s=r.removes;this.nodeVersion<t.nodes.version&&(Object.keys(i).length>0||Object.keys(o).length,this.handleChannelUpdate(n,t.nodes,!0),this.nodeVersion=t.nodes.version,t.nodes.clearChannel(Uu)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(Uu),this.relVersion=t.rels.version),(e||this.waypointVersion<t.waypoints.counter)&&(this.arrowBundler.updateData(a,s,t.waypoints.data),this.waypointVersion=t.waypoints.counter)}},{key:"render",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state,o=this.animationHandler,a=this.arrowBundler,s=i.zoom,u=i.layout,l=i.nodes.idToPosition,c=null!==(e=r.canvas)&&void 0!==e?e:this.canvas,f=null!==(n=r.context)&&void 0!==n?n:this.context,h=_r(),d=c.clientWidth*h,p=c.clientHeight*h;f.save(),void 0!==r.backgroundColor?(f.fillStyle=r.backgroundColor,f.fillRect(0,0,d,p)):f.clearRect(0,0,d,p),this.zoomAndPan(f,c),o.ignoreAnimations(Boolean(r.ignoreAnimations)),!0!==r.ignoreAnimations&&o.advance(),a.updatePositions(l);var v=this.getRelationshipsToRender(r.showCaptions,d,p);this.renderRelationships(v,f,u!==la);var y=this.getNodesToRender(t,d,p);this.renderNodes(y,f,s),f.restore(),this.needsRun=!1}},{key:"getRelationshipsToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.arrowBundler,u=this.state,l=this.relationshipThreshold,c=u.layout,f=u.zoom,h=u.rels,d=u.nodes,p=d.idToItem,v=d.idToPosition,y=Iu(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=Ru(Ru({},p[m.from]),v[m.from]),w=Ru(Ru({},p[m.to]),v[m.to]),x=t||f>l||void 0!==m.captionHtml,_=Su(m,g,b,w,x,c!==la);if(null!==_){var S,T,O,A,P,E,k=this.isBoundingBoxOffScreen(_,e,n),C=Hs({x:null!==(S=b.x)&&void 0!==S?S:0,y:null!==(T=b.y)&&void 0!==T?T:0},{x:null!==(O=w.x)&&void 0!==O?O:0,y:null!==(A=w.y)&&void 0!==A?A:0}),j=((null!==(P=b.size)&&void 0!==P?P:br)+(null!==(E=w.size)&&void 0!==E?E:br))*devicePixelRatio,D=b.id!==w.id&&j>C;k||D||(!0===m.disabled?o.push(Ru(Ru({},m),{},{fromNode:b,toNode:w,showLabel:x})):!0===m.selected?i.push(Ru(Ru({},m),{},{fromNode:b,toNode:w,showLabel:x})):a.push(Ru(Ru({},m),{},{fromNode:b,toNode:w,showLabel:x})))}}}catch(t){y.e(t)}finally{y.f()}return[].concat(o,a,i)}},{key:"getNodesToRender",value:function(t,e,n){var r,i=[],o=[],a=[],s=this.state.nodes.idToItem,u=Iu(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=ku(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(Ru({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(Ru({},f)):a.push(Ru({},f)))}}catch(t){u.e(t)}finally{u.f()}return[].concat(i,a,o)}},{key:"renderNodes",value:function(t,e,n){var r,i=this.imageCache,o=this.animationHandler,a=this.state,s=a.nodes.idToItem,u=a.nodeBorderStyles,l=Iu(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;Cu(e,Ru(Ru({},s[c.id]),c),i,o,u,n)}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderRelationships",value:function(t,e,n){var r,i=this.state.relationshipBorderStyles.selected,o=this.arrowBundler,a=this.imageCache,s=Iu(t);try{for(s.s();!(r=s.n()).done;){var u=r.value,l=o.getBundle(u),c=u.fromNode,f=u.toNode,h=u.showLabel;_u(e,u,c,f,l,a,h,i,n)}}catch(t){s.e(t)}finally{s.f()}}},{key:"getNodesAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=this.state.nodes,o=i.items,a=i.idToPosition,s=_r(),u=Iu(o);try{var l=function(){var i=e.value,o=i.id,u=i.size,l=void 0===u?br:u,c=a[o],f=c.x,h=c.y,d=Math.sqrt(Math.pow(t.x-f,2)+Math.pow(t.y-h,2));if(d<=(l+n)*s){var p=r.findIndex((function(t){return t.distance>d}));r.splice(-1!==p?p:r.length,0,{data:i,targetCoordinates:{x:f,y:h},pointerCoordinates:t,distanceVector:{x:t.x-f,y:t.y-h},insideNode:d<=l*s,distance:d})}};for(u.s();!(e=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return r}},{key:"getRelsAt",value:function(t){var e,n=[],r=this.state,i=this.arrowBundler,o=this.relationshipThreshold,a=r.zoom,s=r.rels.items,u=r.nodes.idToPosition,l=r.layout,c=a>o,f=Iu(s);try{var h=function(){var r=e.value,o=i.getBundle(r),a=u[r.from],s=u[r.to];if(void 0!==a&&void 0!==s&&-1!==o.indexOf(r)){var f=function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(!As(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=wu(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=js(o,s,u,t),f=js(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=du(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=js(s[0],s[2],s[1],t);else for(var l=1;l<s.length;l++){var c=s[l-1],f=s[l],h=ks(c,f,t);u=h<u?h:u}return u}(t,e,i,n,r,o,a);return s}(t,r,a,s,o,c,l!==la);if(f<10){var h=n.findIndex((function(t){return t.distance>f}));n.splice(-1!==h?h:n.length,0,{data:r,fromTargetCoordinates:a,toTargetCoordinates:s,pointerCoordinates:t,distance:f})}}};for(f.s();!(e=f.n()).done;)h()}catch(t){f.e(t)}finally{f.f()}return n}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Uu),this.state.rels.removeChannel(Uu)}},{key:"isBoundingBoxOffScreen",value:function(t,e,n){var r=this.state,i=r.zoom,o=e/i,a=n/i,s=r.panX-o/2,u=r.panY-a/2,l=t.right<s,c=t.bottom<u,f=t.left>s+o,h=t.top>u+a;return l||f||c||h}},{key:"handleChannelUpdate",value:function(t,e,n){for(var r=Object.keys(t.adds),i=0;i<r.length;i++){var o=r[i];t.adds[o].activated&&this.activeNodes.add(o)}for(var a=Object.keys(t.removes),s=0;s<a.length;s++){var u=a[s];this.activeNodes.delete(u)}if(n)for(var l=Object.keys(t.updates),c=0;c<l.length;c++){var f=l[c];e.idToItem[f].activated?this.activeNodes.add(f):this.activeNodes.delete(f)}}},{key:"zoomAndPan",value:function(t,e){var n=e.width,r=e.height,i=this.state,o=i.zoom,a=i.panX,s=i.panY;t.translate(-n/2*o,-r/2*o),t.translate(-a*o,-s*o),t.scale(o,o),t.translate(n/2/o,r/2/o),t.translate(n/2,r/2)}}],n&&Nu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Bu=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=function(t,e){if((0,n.isNil)(t)||(0,n.isNil)(e))return{offsetX:0,offsetY:0};var r=e.getBoundingClientRect(),i=window.devicePixelRatio||1;return{offsetX:i*(t.clientX-r.left-.5*r.width),offsetY:i*(t.clientY-r.top-.5*r.height)}}(t,e);return{x:i+a.offsetX/r,y:o+a.offsetY/r}};function Vu(t){return Vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(t)}function Gu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yu(r.key),r)}}function Xu(t,e,n){return e&&Wu(t.prototype,e),n&&Wu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hu(t,e,n){return(e=Yu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yu(t){var e=function(t,e){if("object"!=Vu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Vu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vu(e)?e:String(e)}var $u="WebGLRenderer",qu=function(){function t(e){var n=this;if(Gu(this,t),Hu(this,"mainSceneRenderer",void 0),Hu(this,"minimapRenderer",void 0),Hu(this,"needsRun",void 0),Hu(this,"minimapMouseDown",void 0),Hu(this,"stateDisposers",void 0),Hu(this,"state",void 0),void 0===e.state)throw new Error("Renderer missing options: state - state object");var r=e.state,i=e.mainSceneRenderer,o=e.minimapRenderer,a=r.nodes,s=r.rels;this.mainSceneRenderer=i,this.minimapRenderer=o,this.needsRun=!1,this.minimapMouseDown=!1,this.stateDisposers=[],this.stateDisposers.push(r.autorun((function(){n.updateMainViewport(r.zoom,r.panX,r.panY)}))),this.stateDisposers.push(r.autorun((function(){n.updateMinimapViewport(r.minimapZoom,r.minimapPanX,r.minimapPanY)}))),this.stateDisposers.push(r.autorun((function(){void 0!==r.nodes.version&&(n.needsRun=!0),void 0!==r.rels.version&&(n.needsRun=!0)}))),a.addChannel($u),s.addChannel($u),this.state=r,this.setupMinimapInteractions()}return Xu(t,[{key:"needsToRun",value:function(){return this.needsRun||Object.keys(this.mainSceneRenderer.activeNodes).length>0}},{key:"renderMainScene",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.mainSceneRenderer.render(t,n,r),this.needsRun=!1}},{key:"renderMinimap",value:function(t){var e=this.state,n=e.nodes,r=e.rels;this.checkForUpdates(n,r),this.minimapRenderer.render(t,n,r),this.minimapRenderer.renderViewbox(),this.needsRun=!1}},{key:"checkForUpdates",value:function(t,e){var n=Object.values(t.channels[$u].adds).length>0,r=Object.values(e.channels[$u].adds).length>0,i=Object.values(t.channels[$u].removes).length>0,o=Object.values(e.channels[$u].removes).length>0,a=Object.values(t.channels[$u].updates),s=Object.values(e.channels[$u].updates);n||r||i||o?(this.mainSceneRenderer.setData({nodes:t.items,rels:e.items}),this.minimapRenderer.setData({nodes:t.items,rels:e.items})):(a.length>0&&(this.mainSceneRenderer.updateNodes(a),this.minimapRenderer.updateNodes(a)),s.length>0&&(this.mainSceneRenderer.updateRelationships(e.items),this.minimapRenderer.updateRelationships(e.items))),t.clearChannel($u),e.clearChannel($u)}},{key:"onResize",value:function(){var t=this.state,e=t.zoom,n=t.panX,r=t.panY,i=t.minimapZoom,o=t.minimapPanX,a=t.minimapPanY;this.updateMainViewport(e,n,r),this.updateMinimapViewport(i,o,a)}},{key:"updateMainViewport",value:function(t,e,n){this.mainSceneRenderer.updateViewport(t,e,n);var r=this.mainSceneRenderer.canvas.clientWidth,i=this.mainSceneRenderer.canvas.clientHeight;this.minimapRenderer.updateViewportBox(t,e,n,r,i),this.needsRun=!0}},{key:"updateMinimapViewport",value:function(t,e,n){this.minimapRenderer.updateViewport(t,e,n),this.needsRun=!0}},{key:"handleMinimapDrag",value:function(t){var e=this.state,n=this.minimapRenderer,r=Bu(t,n.canvas,e.minimapZoom,e.minimapPanX,e.minimapPanY),i=r.x,o=r.y;e.setPan(i,o)}},{key:"handleMinimapWheel",value:function(t){var e=this.state,r=this.mainSceneRenderer;e.setZoom(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,n.isNil)(t)||isNaN(t.deltaY)?e:e-t.deltaY/500*Math.min(1,e)}(t,e.zoom),r.canvas),t.preventDefault()}},{key:"setupMinimapInteractions",value:function(){var t=this,e=this.minimapRenderer.canvas;e.addEventListener("mousedown",(function(e){t.handleMinimapDrag(e),t.minimapMouseDown=!0})),e.addEventListener("mousemove",(function(e){t.minimapMouseDown&&t.handleMinimapDrag(e)})),e.addEventListener("mouseup",(function(){t.minimapMouseDown=!1})),e.addEventListener("mouseleave",(function(){t.minimapMouseDown=!1})),e.addEventListener("wheel",(function(e){t.handleMinimapWheel(e)}))}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel($u),this.state.rels.removeChannel($u),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),Zu=function(){function t(){Gu(this,t),Hu(this,"mainSceneRenderer",void 0),Hu(this,"minimapRenderer",void 0),Hu(this,"needsRun",void 0),Hu(this,"minimapMouseDown",void 0),Hu(this,"stateDisposers",void 0),Hu(this,"state",void 0)}return Xu(t,[{key:"renderMainScene",value:function(t){}},{key:"renderMinimap",value:function(t){}},{key:"checkForUpdates",value:function(t,e){}},{key:"onResize",value:function(){}},{key:"updateMainViewport",value:function(t,e,n){}},{key:"updateMinimapViewport",value:function(t,e,n){}},{key:"handleMinimapDrag",value:function(t){}},{key:"handleMinimapWheel",value:function(t){}},{key:"setupMinimapInteractions",value:function(){}},{key:"destroy",value:function(){}},{key:"needsToRun",value:function(){return!1}}]),t}();function Ku(t){return Ku="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(t)}function Ju(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Qu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Qu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function tl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nl(r.key),r)}}function el(t,e,n){return(e=nl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nl(t){var e=function(t,e){if("object"!=Ku(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ku(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ku(e)?e:String(e)}var rl,il=24,ol=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=jo().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},al=function(){function t(e,n,r,i){var o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),el(this,"nodeShader",void 0),el(this,"nodeAnimShader",void 0),el(this,"relShader",void 0),el(this,"relDataBuffer",void 0),el(this,"viewportBoxShader",void 0),el(this,"defaultRelColor",void 0),el(this,"defaultNodeColor",void 0),el(this,"disableRelColor",void 0),el(this,"disableNodeColor",void 0),el(this,"gl",void 0),el(this,"activeNodes",void 0),el(this,"canvas",void 0),el(this,"projection",void 0),el(this,"idToIndex",void 0),el(this,"posBuffer",void 0),el(this,"numRels",void 0),el(this,"numNodes",void 0),el(this,"nodeDataByte",void 0),el(this,"relIdToIndex",void 0),el(this,"relData",void 0),el(this,"viewportBoxBuffer",void 0),el(this,"relBuffer",void 0),el(this,"nodeBuffer",void 0),el(this,"posTexture",void 0),void 0===(null!==(o=e.getExtension("OES_texture_float"))&&void 0!==o?o:void 0))throw new Error("Renderer needs floating point texture support");this.nodeShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp float u_drawDefaultBorder;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}","uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float ringSize = 0.43;\nmediump float ringSize2 = 0.47;\nmediump float shadowSize = 0.51;\nlowp vec3 shadowColor = vec3(0.73);\nlowp vec3 lineColor = vec3(1.0);\n\nlowp float getShadowAlpha(lowp float size, lowp float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nlowp float getCircleAlpha(lowp float ringSize, lowp float nodeSize, lowp float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float nodeSize = 1.0 / varNodeSize;\n lowp float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n lowp float ringAlpha = getCircleAlpha(ringSize, nodeSize, dist);\n lowp vec3 finalColor = color.xyz;\n lowp float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize2, dist);\n lowp float ringAlpha2 = getCircleAlpha(ringSize2, nodeSize, dist);\n\n finalColor = mix(lineColor, finalColor, nodeAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n } else if (hovered > 0.0) {\n if (drawDefaultBorder > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(ringSize, dist);\n \n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n lowp float shadowAlpha = getShadowAlpha(circleSize, dist);\n\n finalColor = mix(shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = ringAlpha;\n }\n }\n gl_FragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n"),this.nodeAnimShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_active;\n\nvarying lowp float varNodeSize;\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = a_size * u_zoom * u_glAdjust;\n nodeSize = nodeSize * (0.4 / 0.5); // Remove extra space added for shadow and selection ring\n\n gl_PointSize = a_active > 0.5\n ? nodeSize + 0.88 * nodeSize * u_animPos\n : 0.0;\n\n color = a_color;\n varNodeSize = a_size;\n}","uniform mediump float u_zoom;\nuniform lowp float u_animPos;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float varNodeSize;\nmediump float circleSize = 0.50;\n\nvoid main(void) {\n\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float alpha = 1.0 - smoothstep(circleSize - (1.0 / (varNodeSize * 2.0 * u_zoom * u_glAdjust)), circleSize, dist);\n lowp float pulseAlpha = 0.9 - 0.9 * u_animPos;\n gl_FragColor = vec4(color.xyz, 1.0) * alpha * pulseAlpha;\n }\n}\n"),this.relShader=new Ei(e,"uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nattribute vec2 a_from;\nattribute vec2 a_to;\nattribute lowp vec4 a_color;\nattribute lowp float a_triside;\nattribute float a_width;\n\nvarying lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture2D(u_positions, a_from);\n vec4 to = texture2D(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n direction = vec2(-direction.y, direction.x);\n\n float width = a_width * u_glAdjust * 0.5;\n\n if (a_triside == 0.0) {\n from.y += (width / 2.0) * direction.y;\n from.x += (width / 2.0) * direction.x;\n } else {\n from.y -= (width / 2.0) * direction.y;\n from.x -= (width / 2.0) * direction.x;\n }\n\n color = a_color;\n gl_Position = u_projection * vec4(from.xy, 0.0, 1.0);\n}\n","varying lowp vec4 color;\n\nvoid main(void) {\n gl_FragColor = vec4(color.xyz, 1.0) * color.w;\n}\n"),this.viewportBoxShader=new Ei(e,"attribute vec2 coordinates;\nuniform mat4 u_projection;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n}\n","void main(void) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n"),this.setShaderUniforms(i),e.clearColor(0,0,0,0),e.disable(e.DEPTH_TEST),this.defaultRelColor=4284900966,this.defaultNodeColor=4294937415,this.disableRelColor="#EDEDED",this.disableNodeColor="#EDEDED",e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),this.gl=e,this.activeNodes={},this.canvas=e.canvas,this.projection=wi(),this.setData({nodes:n.items,rels:r.items}),this.createPositionTexture(),this.setupViewportRendering()}var e,r;return e=t,r=[{key:"setShaderUniforms",value:function(t){var e,n,r=jo().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=jo().get.rgb(null===(n=t.nodeBorderStyles.selected)||void 0===n||null===(n=n.rings[1])||void 0===n?void 0:n.color);if(this.nodeShader.use(),null!=r&&r.length){var o=r.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_nodeBorderColor",o),this.nodeShader.setUniform("u_drawDefaultBorder",1)}else this.nodeShader.setUniform("u_drawDefaultBorder",0);var a=i.slice(0,3).map((function(t){return t/255}));this.nodeShader.setUniform("u_selectedBorderColor",a)}},{key:"setData",value:function(t){var e=Ar(t.rels);this.setupNodeRendering(t.nodes),this.setupRelationshipRendering(e)}},{key:"render",value:function(t,e,n){var r,i=this.gl,o=this.idToIndex,a=Ju(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=o[s.id];this.posBuffer[4*u+0]=s.x,this.posBuffer[4*u+1]=s.y}}catch(t){a.e(t)}finally{a.f()}i.bindTexture(i.TEXTURE_2D,this.posTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,mr,mr,0,i.RGBA,i.FLOAT,this.posBuffer),i.enable(i.BLEND),i.bindFramebuffer(i.FRAMEBUFFER,null),i.clear(i.COLOR_BUFFER_BIT),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),this.renderAnimations(this.posTexture),this.numRels>0&&(this.relShader.use(),this.relShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.relBuffer),this.relShader.setAttributePointerByteNorm("a_color",4,0,16),this.relShader.setAttributePointerByteNorm("a_from",2,4,16),this.relShader.setAttributePointerByteNorm("a_to",2,6,16),this.relShader.setAttributePointerByteNorm("a_triside",1,8,16),this.relShader.setAttributePointerFloat("a_width",1,12,16),i.drawArrays(i.TRIANGLES,0,6*this.numRels)),this.numNodes>0&&(this.nodeShader.use(),this.nodeShader.setUniform("u_positions",this.posTexture),i.bindBuffer(i.ARRAY_BUFFER,this.nodeBuffer),this.nodeShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeShader.setAttributePointerByteNorm("a_selected",1,4,12),this.nodeShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeShader.setAttributePointerByte("a_size",4,8,12),this.nodeShader.setAttributePointerByteNorm("a_hovered",1,9,12),i.drawArrays(i.POINTS,0,this.numNodes))}},{key:"renderViewbox",value:function(){var t=this.gl,e=this.projection,n=this.viewportBoxBuffer;this.viewportBoxShader.use(),this.viewportBoxShader.setUniform("u_projection",e),t.bindBuffer(t.ARRAY_BUFFER,n),this.viewportBoxShader.setAttributePointerFloat("coordinates",2,0,0),t.drawArrays(t.LINES,0,8)}},{key:"updateNodes",value:function(t){var e,r=this.gl,i=this.idToIndex,o=this.disableNodeColor,a=this.nodeBuffer,s=this.nodeDataByte,u=!1,l=Ju(t);try{for(l.s();!(e=l.n()).done;){var c=e.value,f=i[c.id];if(!(0,n.isNil)(c.color)||!0===c.disabled){var h=jo().get.rgb(!0===c.disabled?o:c.color);this.nodeDataByte[3*f*4+0]=h[0],this.nodeDataByte[3*f*4+1]=h[1],this.nodeDataByte[3*f*4+2]=h[2],this.nodeDataByte[3*f*4+3]=255*h[3],u=!0}if(void 0!==c.selected){var d=c.selected;this.nodeDataByte[3*f*4+4]=d?255:0,u=!0}if(void 0!==c.activated&&(this.nodeDataByte[3*f*4+7]=c.activated?255:0,u=!0,c.activated?this.activeNodes[c.id]=!0:delete this.activeNodes[c.id]),void 0!==c.hovered){var p=!0!==c.disabled&&c.hovered;this.nodeDataByte[3*f*4+9]=p?255:0,u=!0}if(void 0!==c.size){var v=c.size;this.nodeDataByte[3*f*4+8]=v||br,u=!0}}}catch(t){l.e(t)}finally{l.f()}u&&(r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,s,r.DYNAMIC_DRAW))}},{key:"updateRelationships",value:function(t){var e,n=Ar(t),r=this.gl,i=!1,o=Ju(n);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=a.key,u=a.width,l=a.color,c=a.disabled,f=this.relIdToIndex[s],h=void 0===l?this.defaultRelColor:ol(!0===c?this.disableRelColor:l);this.relData.positionsAndColors[f*il+0]=h,this.relData.positionsAndColors[f*il+4]=h,this.relData.positionsAndColors[f*il+8]=h,this.relData.positionsAndColors[f*il+12]=h,this.relData.positionsAndColors[f*il+16]=h,this.relData.positionsAndColors[f*il+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*il+3]=u,this.relData.widths[f*il+7]=u,this.relData.widths[f*il+11]=u,this.relData.widths[f*il+15]=u,this.relData.widths[f*il+19]=u,this.relData.widths[f*il+23]=u,i=!0)}}catch(t){o.e(t)}finally{o.f()}i&&(r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,this.relDataBuffer,r.DYNAMIC_DRAW))}},{key:"createPositionTexture",value:function(){var t=this.gl,e=t.createTexture(),n=new Float32Array(262144);t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,mr,mr,0,t.RGBA,t.FLOAT,n),this.posTexture=e,this.posBuffer=n}},{key:"updateViewportBox",value:function(t,e,n,r,i){var o=this.gl,a=_r(),s=r*a,u=i*a,l=(.5*s+e*t)/t,c=(.5*u+n*t)/t,f=(.5*-s+e*t)/t,h=(.5*-u+n*t)/t,d=[l,c,f,c,f,c,f,h,f,h,l,h,l,h,l,c];o.bindBuffer(o.ARRAY_BUFFER,this.viewportBoxBuffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array(d),o.DYNAMIC_DRAW)}},{key:"updateViewport",value:function(t,e,n){var r=this.gl,i=1/t,o=e-r.drawingBufferWidth*i*.5,a=n-r.drawingBufferHeight*i*.5,s=r.drawingBufferWidth*i,u=r.drawingBufferHeight*i,l=wi(),c=2.6315789473684212*_r();xi(l,o,o+s,a+u,a,0,1e6),this.nodeShader.use(),this.nodeShader.setUniform("u_zoom",t),this.nodeShader.setUniform("u_glAdjust",c),this.nodeShader.setUniform("u_projection",l),this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_zoom",t),this.nodeAnimShader.setUniform("u_glAdjust",c),this.nodeAnimShader.setUniform("u_projection",l),this.relShader.use(),this.relShader.setUniform("u_glAdjust",c),this.relShader.setUniform("u_projection",l),this.projection=l}},{key:"setupViewportRendering",value:function(){this.viewportBoxBuffer=this.gl.createBuffer()}},{key:"setupNodeRendering",value:function(t){var e=this.gl,r=new ArrayBuffer(8),i=new Uint32Array(r),o=new Uint8Array(r);void 0===this.nodeBuffer&&(this.nodeBuffer=e.createBuffer()),this.numNodes=t.length;var a=new ArrayBuffer(3*t.length*8),s=new Uint32Array(a),u={};this.activeNodes={};for(var l=0;l<t.length;l++){var c=t[l],f=c.selected,h=c.hovered,d=c.color,p=c.activated,v=c.size,y=c.id,m=c.disabled,g=(0,n.isNil)(d)?this.defaultNodeColor:ol(d);s[3*l+0]=!0===m?ol(this.disableNodeColor):g,o[0]=!0===f?255:0,o[1]=l%mr,o[2]=Math.floor(l/mr),o[3]=!0===p?255:0,o[4]=!1===m&&!0===h?255:0,!0===p&&(this.activeNodes[y]=!0),s[3*l+1]=i[0],s[3*l+2]=null!=v?v:br,s[3*l+3]=i[1],u[y]=l}e.bindBuffer(e.ARRAY_BUFFER,this.nodeBuffer),e.bufferData(e.ARRAY_BUFFER,s,e.DYNAMIC_DRAW),this.numNodes=t.length,this.nodeDataByte=new Uint8Array(a),this.idToIndex=u}},{key:"setupRelationshipRendering",value:function(t){var e=this,r=this.gl,i=new ArrayBuffer(4),o=new Uint32Array(i),a=new Uint8Array(i),s={};void 0===this.relBuffer&&(this.relBuffer=r.createBuffer());for(var u=new ArrayBuffer(t.length*il*4),l=new Uint32Array(u),c=new Float32Array(u),f=function(r){var i=t[r],u=i.from,f=i.to,h=i.color,d=i.width,p=i.key,v=i.disabled,y=e.idToIndex[u],m=e.idToIndex[f],g=y%mr,b=Math.floor(y/mr),w=m%mr,x=Math.floor(m/mr),_=[g,b,w,x],S=[w,x,g,b],T=(0,n.isNil)(h)?e.defaultRelColor:ol(h),O=!0===v?ol(e.disableRelColor):T,A=null!=d?d:1;s[p]=r;var P=0,E=function(t,e,n,i){l[r*il+P]=t,P+=1;for(var s=0;s<e.length;s++)a[s]=e[s];l[r*il+P]=o[0],P+=1,a[0]=n,l[r*il+P]=o[0],c[r*il+(P+=1)]=i,P+=1};E(O,_,255,A),E(O,S,0,A),E(O,_,0,A),E(O,S,0,A),E(O,_,0,A),E(O,S,255,A)},h=0;h<t.length;h++)f(h);r.bindBuffer(r.ARRAY_BUFFER,this.relBuffer),r.bufferData(r.ARRAY_BUFFER,u,r.DYNAMIC_DRAW),this.numRels=t.length,this.relDataBuffer=u,this.relData={positionsAndColors:l,widths:c},this.relIdToIndex=s}},{key:"renderAnimations",value:function(t){var e=this.gl,n=this.nodeBuffer,r=this.numNodes,i=Date.now()%1e3/1e3,o=i<.7?i/.7:0;this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_positions",t),this.nodeAnimShader.setUniform("u_animPos",o),e.bindBuffer(e.ARRAY_BUFFER,n),this.nodeAnimShader.setAttributePointerByteNorm("a_color",4,0,12),this.nodeAnimShader.setAttributePointerByteNorm("a_active",1,7,12),this.nodeAnimShader.setAttributePointerByteNorm("a_index",2,5,12),this.nodeAnimShader.setAttributePointerByte("a_size",4,8,12),e.drawArrays(e.POINTS,0,r)}},{key:"destroy",value:function(){this.gl.deleteBuffer(this.nodeBuffer),this.gl.deleteBuffer(this.relBuffer),this.nodeShader.remove(),this.nodeAnimShader.remove(),this.relShader.remove()}}],r&&tl(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),sl=function(t,e,n){var r=_r();t.width=e*r,t.height=n*r,t.style.width="".concat(e,"px"),t.style.height="".concat(n,"px")},ul=function(t){Gr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==rl&&rl(t)},ll=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;sl(t,n,r)},cl=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),sl(n,t,e),n},fl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,xr),void 0!==t&&(t.appendChild(n),ll(n)),function(t,e){rl=e,t.addEventListener("webglcontextlost",ul)}(n,e),n},hl=function(t){t.width=0,t.height=0,t.remove()},dl=function(t){return t.getContext("2d")},pl=function(t){var e={antialias:!0},n=t.getContext("webgl",e);return null===n&&(n=t.getContext("experimental-webgl",e)),function(t){return t instanceof WebGLRenderingContext}(n)?n:null},vl=function(t){t.canvas.removeEventListener("webglcontextlost",ul);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function yl(t){return function(t){if(Array.isArray(t))return bl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||gl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ml(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=gl(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function gl(t,e){if(t){if("string"==typeof t)return bl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bl(t,e):void 0}}function bl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var wl=br*_r();function xl(t){return xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xl(t)}function _l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Sl(r.key),r)}}function Sl(t){var e=function(t,e){if("object"!=xl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xl(e)?e:String(e)}var Tl=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(n=Sl(n="callbacks"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.callbacks={}}var e,n;return e=t,n=[{key:"register",value:function(t,e){this.isCallbackRegistered(t)||(this.callbacks[t]=[]),this.callbacks[t].push(e)}},{key:"isCallbackRegistered",value:function(t){return void 0!==this.callbacks[t]}},{key:"callIfRegistered",value:function(){var t,e=arguments,n=Array.prototype.slice.call(arguments)[0];t=n,u.includes(t)&&this.isCallbackRegistered(n)&&this.callbacks[n].slice(0).forEach((function(t){return t.apply(null,Array.prototype.slice.call(e,1))}))}}],n&&_l(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ol=i(481),Al=i.n(Ol);function Pl(t){return Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(t)}function El(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cl(r.key),r)}}function kl(t,e,n){return(e=Cl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cl(t){var e=function(t,e){if("object"!=Pl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Pl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pl(e)?e:String(e)}var jl=5e-5,Dl=function(){function t(e){var n,r=this,i=e.state,o=e.getNodePositions,a=e.canvas,s=e.defaultZoomLevel;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),kl(this,"xCtrl",void 0),kl(this,"yCtrl",void 0),kl(this,"zoomCtrl",void 0),kl(this,"getNodePositions",void 0),kl(this,"firstUpdate",void 0),kl(this,"state",void 0),kl(this,"canvas",void 0),kl(this,"defaultZoomLevel",void 0),kl(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(Al())(.35,jl,.05,1),this.yCtrl=new(Al())(.35,jl,.05,1),this.zoomCtrl=new(Al())(.3,1e-5,.01,1),this.defaultZoomLevel=s,this.stateDisposers=[],this.stateDisposers.push(i.autorun((function(){null===i.fitNodeIds&&(r.xCtrl.reset(),r.yCtrl.reset(),r.zoomCtrl.reset())}))),this.stateDisposers.push(i.autorun((function(){n!==i.fitNodeIds&&(n=i.fitNodeIds,r.firstUpdate=!0)}))),this.stateDisposers.push(i.autorun((function(){i.resetZoom&&(r.firstUpdate=!0)})))}var e,n;return e=t,n=[{key:"needsToRun",value:function(){var t=this.state,e=t.fitNodeIds,n=t.resetZoom;return e.length>0||n}},{key:"update",value:function(t){var e=this.state,n=e.fitNodeIds,r=e.resetZoom;n.length>0?this.fitNodes(n,t):r&&this.reset(t)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){return t()}))}},{key:"recalculateTarget",value:function(t,e,n,r){for(var i=this.xCtrl,o=this.yCtrl,a=this.zoomCtrl,s=this.state,u=this.defaultZoomLevel,l=[],c=0;c<t.length;c++)l.push({id:t[c]});var f=s.zoom,h=s.panX,d=s.panY,p=s.maxNodeRadius,v=s.nodes,y=this.getNodePositions(l);v.updatePositions(y);var m=Lo(y,p),g=m.centerX,b=m.centerY,w=m.nodesWidth,x=m.nodesHeight;if(isNaN(g)||isNaN(b))return Gr.info("fit() function couldn't calculate center point, not updating viewport"),!1;i.setTarget(!0===e.noPan?h:g),o.setTarget(!0===e.noPan?d:b);var _=No(w,x,n,r),S=_.zoomX,T=_.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var O=Mo(S,T,e.minZoom,e.maxZoom);!0===e.outOnly&&f<O?a.setTarget(f):a.setTarget(O)}return!0}},{key:"allNodesAreVisible",value:function(t,e,n){var r=No(e,n,this.canvas.width,this.canvas.height),i=r.zoomX,o=r.zoomY;return t<i&&t<o}},{key:"reset",value:function(t){var e=this.state,n=e.zoom,r=e.panX,i=e.panY,o=e.nodes,a=e.maxNodeRadius,s=e.defaultZoomLevel;if(this.firstUpdate||t){this.zoomCtrl.setTarget(s);var u=Lo(Object.values(o.idToPosition),a),l=u.centerX,c=u.centerY,f=u.nodesWidth,h=u.nodesHeight;this.allNodesAreVisible(n,f,h)?(this.xCtrl.setTarget(l),this.yCtrl.setTarget(c)):(this.xCtrl.setTarget(r),this.yCtrl.setTarget(i)),this.firstUpdate=!1}var d=n+this.zoomCtrl.update(n),p=r+this.xCtrl.update(r),v=i+this.yCtrl.update(i);this.state.updateZoomToFit(d,p,v,this.canvas),Math.abs(this.zoomCtrl.target-d)<.01&&(this.state.updateZoomToFit(s,p,v,this.canvas),this.state.clearReset())}},{key:"fitNodes",value:function(t,e){var n=this.state,r=n.zoomOptions,i=void 0===r?{}:r,o=n.zoom,a=n.panX,s=n.panY,u=!0;if(this.firstUpdate||e){var l=this.canvas,c=l.width,f=l.height;u=this.recalculateTarget(t,i,c,f),this.firstUpdate=!1}if(u){var h=a+this.xCtrl.update(a),d=s+this.yCtrl.update(s),p=o+this.zoomCtrl.update(o);this.state.updateZoomToFit(p,h,d,this.canvas);var v=Math.max(5,10/this.zoomCtrl.target),y=Math.min(.01,.01*this.zoomCtrl.target);!e&&Math.abs(this.zoomCtrl.target-p)<y&&Math.abs(this.xCtrl.target-h)<v&&Math.abs(this.yCtrl.target-d)<v&&(this.state.setZoom(this.zoomCtrl.target,this.canvas),this.state.clearFit())}}}],n&&El(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Rl(t){return Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(t)}function Il(){Il=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:A(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Rl(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function j(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Rl(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=j,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:j(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function Ll(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Nl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Fl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ml(Object(n),!0).forEach((function(e){zl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ul(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bl(r.key),r)}}function zl(t,e,n){return(e=Bl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bl(t){var e=function(t,e){if("object"!=Rl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Rl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:String(e)}var Vl="NvlController",Gl={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},Wl="onError",Xl="onLayoutDone",Hl={},Yl=function(){var t;return null!==(t=Hl[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Hl).pop()},$l=function(){function t(e,n){var r,i,o,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),zl(this,"destroyed",void 0),zl(this,"state",void 0),zl(this,"callbacks",void 0),zl(this,"instanceId",void 0),zl(this,"glController",void 0),zl(this,"webGLContext",void 0),zl(this,"webGLMinimapContext",void 0),zl(this,"htmlOverlay",void 0),zl(this,"hasResized",void 0),zl(this,"hierarchicalLayout",void 0),zl(this,"gridLayout",void 0),zl(this,"freeLayout",void 0),zl(this,"d3ForceLayout",void 0),zl(this,"forceLayout",void 0),zl(this,"canvasRenderer",void 0),zl(this,"glCanvas",void 0),zl(this,"canvasRect",void 0),zl(this,"glMinimapCanvas",void 0),zl(this,"c2dCanvas",void 0),zl(this,"isInRenderSwitchAnimation",void 0),zl(this,"justSwitchedRenderer",void 0),zl(this,"justSwitchedLayout",void 0),zl(this,"layoutUpdating",void 0),zl(this,"layoutComputing",void 0),zl(this,"isRenderingDisabled",void 0),zl(this,"setRenderSwitchAnimation",void 0),zl(this,"stateDisposers",void 0),zl(this,"zoomTransitionHandler",void 0),zl(this,"currentLayout",void 0),zl(this,"layoutTimeLimit",void 0),zl(this,"pixelRatio",void 0),zl(this,"removeResizeListener",void 0),zl(this,"removeMinimapResizeListener",void 0),zl(this,"pendingZoomOperation",void 0),zl(this,"layoutRunner",void 0),zl(this,"animationRequestId",void 0),zl(this,"layoutDoneCallback",void 0),zl(this,"layoutComputingCallback",void 0),zl(this,"currentLayoutType",void 0),this.destroyed=!1;var s=n.frame,u=n.minimapContainer,l=void 0===u?document.createElement("span"):u,c=n.layoutOptions,f=n.layout,h=n.instanceId,d=void 0===h?"default":h,p=e.nodes,v=e.rels,y=e.webGLVisible,m=e.disableWebGL;this.state=e,this.callbacks=new Tl,this.instanceId=d;var g=s;g.setAttribute("instanceId",d),g.setAttribute("data-testid","nvl-parent"),null!==(r=g.style.height)&&void 0!==r&&r.length||Object.assign(g.style,{height:"100%"}),null!==(i=g.style.outline)&&void 0!==i&&i.length||Object.assign(g.style,{outline:"none"});var b=fl(g,this.onWebGLContextLost.bind(this)),w=fl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new Zu;else{var x=pl(b),_=pl(w);this.glController=new qu({mainSceneRenderer:new al(x,p,v,this.state),minimapRenderer:new al(_,p,v,this.state),state:e}),this.webGLContext=x,this.webGLMinimapContext=_}var S=fl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),O=document.createElement("div");Object.assign(O.style,Fl(Fl({},xr),{},{overflow:"hidden"})),g.appendChild(O),this.htmlOverlay=O,this.hasResized=!0,this.hierarchicalLayout=new Ma(Fl(Fl({},c),{},{state:this.state})),this.gridLayout=new ko({state:this.state}),this.freeLayout=new wo({state:this.state}),this.d3ForceLayout=new Br({state:this.state}),this.forceLayout=m?this.d3ForceLayout:new lo(Fl(Fl({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var A=new zu(S,T,e,n);this.canvasRenderer=A,this.glCanvas=b,this.canvasRect=b.getBoundingClientRect(),this.glMinimapCanvas=w,this.c2dCanvas=S,this.glCanvas.style.opacity=y?"1":"0",this.c2dCanvas.style.opacity=y?"0":"1",this.isInRenderSwitchAnimation=!1,this.justSwitchedRenderer=!1,this.justSwitchedLayout=!1,this.hasResized=!1,this.layoutUpdating=!1,this.layoutComputing=!1,this.isRenderingDisabled=!1,p.addChannel(Vl),v.addChannel(Vl),this.setRenderSwitchAnimation=function(){a.isInRenderSwitchAnimation=!1},this.stateDisposers=[],this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("zoom",e.zoom)}))),this.stateDisposers.push(e.autorun((function(){a.callIfRegistered("pan",{panX:e.panX,panY:e.panY})}))),this.stateDisposers.push(e.autorun((function(){a.setLayout(e.layout)}))),this.stateDisposers.push(e.autorun((function(){a.setLayoutOptions(e.layoutOptions)}))),this.stateDisposers.push(e.autorun((function(){var t=e.webGLVisible?"1":"0";t!==a.glCanvas.style.opacity&&(a.justSwitchedRenderer=!0,a.glCanvas.style.opacity=t,a.c2dCanvas.style.opacity=e.webGLVisible?"0":"1")}))),this.startMainLoop(),this.zoomTransitionHandler=new Dl({state:e,getNodePositions:function(t){return a.currentLayout.getNodePositions(t)},canvas:b,defaultZoomLevel:aa}),this.layoutTimeLimit=null!==(o=n.layoutTimeLimit)&&void 0!==o?o:16,this.pixelRatio=_r(),this.removeResizeListener=Pn()(g,(function(){ll(b),ll(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=Pn()(l,(function(){ll(w)})),Hl[d]=this,window.__Nvl_dumpNodes=function(t){var e;return null===(e=Yl(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Yl(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Yl(e))||void 0===n?void 0:n.on(Xl,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Yl(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Yl(t))||void 0===e?void 0:e.getScale()},this.pendingZoomOperation=null}var e,n,r,i;return e=t,n=[{key:"onWebGLContextLost",value:function(t){this.callIfRegistered("onWebGLContextLost",t)}},{key:"updateMinimapZoom",value:function(){var t=this.state,e=t.nodes,n=t.maxNodeRadius,r=t.maxMinimapZoom,i=t.minMinimapZoom,o=Lo(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=No(u,l,this.glMinimapCanvas.width,this.glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=Mo(f,h,i,r);this.state.updateMinimapZoomToFit(d,a,s)}},{key:"startMainLoop",value:function(){var t=this,e=this.state,n=e.nodes,r=e.rels;this.currentLayout.update();var i=this.currentLayout.getNodePositions(n.items);n.updatePositions(i),this.isRenderingDisabled||(this.glController.renderMainScene(i),this.glController.renderMinimap(i),this.canvasRenderer.processUpdates(),this.canvasRenderer.render(i)),this.layoutRunner=setInterval((function(){try{!function(){var e=t.currentLayout.getShouldUpdate(),n=e||t.justSwitchedLayout,r=n&&!t.layoutUpdating&&!t.justSwitchedLayout;if(n)for(var i=window.performance.now(),o=r?0:50,a=0;a<o;a++){t.currentLayout.update(t.justSwitchedLayout),t.justSwitchedLayout=!1;var s=window.performance.now();if(!e||s-i>t.layoutTimeLimit)break}}()}catch(e){if(!t.callbacks.isCallbackRegistered(Wl))throw e;t.callIfRegistered(Wl,e)}}),13),this.animationRequestId=window.requestAnimationFrame((function e(){try{!function(e){if(t.destroyed)Gr.info("STEP IN A DESTROYED STRIP");else{var i=_r();if(i!==t.pixelRatio)return t.pixelRatio=i,void t.callIfRegistered("restart");var o=t.currentLayout.getShouldUpdate(),a=o||t.justSwitchedLayout,s=t.currentLayout.getComputing(),u=t.zoomTransitionHandler.needsToRun(),l=a&&!t.layoutUpdating&&!t.justSwitchedLayout,c=t.layoutComputing&&!s,f=t.state.webGLVisible&&t.glController.needsToRun(),h=!t.state.webGLVisible&&t.canvasRenderer.needsToRun(),d=t.isInRenderSwitchAnimation||t.justSwitchedRenderer,p=t.hasResized,v=null!==t.pendingZoomOperation,y=t.glController.minimapMouseDown;if(n.clearChannel(Vl),r.clearChannel(Vl),u||a||c||d||f||h||y||p||v){!t.pendingZoomOperation||l||t.currentLayout.getComputing()||(t.pendingZoomOperation(),t.pendingZoomOperation=null),t.zoomTransitionHandler.update(o||s||c),p&&t.glController.onResize();var m=t.currentLayout.getNodePositions(n.items);if(n.updatePositions(m),t.callIfRegistered("onLayoutStep",t.dumpNodes()),t.updateMinimapZoom(),t.glController.renderMinimap(m),!t.isRenderingDisabled){if((t.state.webGLVisible||d)&&t.glController.renderMainScene(m),!t.state.webGLVisible||d){t.canvasRenderer.processUpdates(),t.canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b=r.items[g].id,w=t.canvasRenderer.arrowBundler.getBundle(r.items[g]),x=r.idToHtmlOverlay[b],_=w.labelInfo[b];if(x&&_){var S=_.rotation,T=_.position,O=_.width,A=_.height,P=t.mapCanvasSpaceToRelativePosition(T.x,T.y),E=P.x,k=P.y,C=O>5&&!t.state.webGLVisible;Object.assign(x.style,{top:"".concat(k,"px"),left:"".concat(E,"px"),width:"".concat(O,"px"),height:"".concat(A,"px"),display:C?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),") rotate(").concat(S,"rad")})}}}for(var j=0;j<n.items.length;j++){var D=n.items[j],R=D.id,I=D.size,L=n.idToHtmlOverlay[R];if(L){var N=t.state.nodes.idToPosition[R],M=t.mapCanvasSpaceToRelativePosition(N.x,N.y),F=M.x,U=M.y,z="".concat(2*(null!=I?I:br),"px");Object.assign(L.style,{top:"".concat(U,"px"),left:"".concat(F,"px"),width:z,height:z,transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),")")})}}}}var B=!a&&t.layoutUpdating,V=s!==t.layoutComputing;t.layoutComputing=s,t.layoutUpdating=a,B&&t.callIfRegistered(Xl),V&&t.callIfRegistered("onLayoutComputing",s),t.justSwitchedRenderer=!1,t.hasResized=!1,void 0!==e&&e()}}((function(){t.animationRequestId=window.requestAnimationFrame(e)}))}catch(e){if(!t.callbacks.isCallbackRegistered(Wl))throw e;t.callIfRegistered(Wl,e)}}))}},{key:"updateHtmlOverlay",value:function(){this.state.nodes.updateHtmlOverlay(this.htmlOverlay),this.state.rels.updateHtmlOverlay(this.htmlOverlay)}},{key:"dumpNodes",value:function(){var t,e=this.state.nodes.items,n=this.state.nodes.idToPosition,r=[],i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=n[o.id],s=this.mapCanvasSpaceToRelativePosition(a.x,a.y);r.push(Fl(Fl({},o),{},{x:s.x,y:s.y}))}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"dumpRelationships",value:function(){return wn(this.state.rels.items)}},{key:"mapCanvasSpaceToRelativePosition",value:function(t,e){var n=this.canvasRect,r=window.devicePixelRatio||1,i=(t-this.state.panX)*this.state.zoom/r,o=(e-this.state.panY)*this.state.zoom/r;return{x:i+.5*n.width,y:o+.5*n.height}}},{key:"mapRelativePositionToCanvasSpace",value:function(t,e){var n=this.glCanvas.getBoundingClientRect(),r=window.devicePixelRatio||1,i=r*(t-.5*n.width),o=r*(e-.5*n.height);return{x:this.state.panX+i/this.state.zoom,y:this.state.panY+o/this.state.zoom}}},{key:"getNodePositions",value:function(){return Object.values(wn(this.state.nodes.idToPosition))}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state.nodes.updatePositions(t),this.currentLayout.updateNodes(t),e||this.currentLayout.terminateUpdate(),this.hasResized=!0,0===this.getNodesOnScreen().nodes.length&&this.state.setPan(0,0),this.state.clearFit()}},{key:"isLayoutMoving",value:function(){return this.layoutUpdating}},{key:"getNodesOnScreen",value:function(){var t=this.glCanvas.getBoundingClientRect(),e=this.mapRelativePositionToCanvasSpace(0,0),n=e.x,r=e.y,i=this.mapRelativePositionToCanvasSpace(t.width,t.height);return function(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:["node"],a=i.nodes,s=i.rels,u=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),h=[],d=[];if(o.includes("node"))for(var p=0,v=Object.values(a.idToPosition);p<v.length;p++){var y=v[p],m=y.x,g=y.y;void 0!==m&&void 0!==g&&m>u&&m<l&&g>c&&g<f&&h.push(y)}if(o.includes("relationship")){var b,w=ml(s.items);try{for(w.s();!(b=w.n()).done;){var x=b.value,_=x.from,S=x.to,T=a.idToPosition[_],O=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==O.x&&void 0!==O.y){var A=T.x>u&&T.x<l&&T.y>c&&T.y<f,P=O.x>u&&O.x<l&&O.y>c&&O.y<f;A&&P&&d.push(x)}}}catch(t){w.e(t)}finally{w.f()}}return{nodes:h,rels:d}}(n,r,i.x,i.y,this.state,["node"])}},{key:"registerDoneCallback",value:function(t){this.layoutDoneCallback=t}},{key:"registerComputingCallback",value:function(t){this.layoutComputingCallback=t}},{key:"getPosition",value:function(t){return this.currentLayout.getNodePositions([{id:t}])[0]}},{key:"getScale",value:function(){return this.state.zoom}},{key:"getPan",value:function(){return{x:this.state.panX,y:this.state.panY}}},{key:"setZoomLevel",value:function(t){var e=this;this.pendingZoomOperation=function(){return e.state.setZoom(t,e.glCanvas)}}},{key:"setPanCoordinates",value:function(t,e){this.state.setPan(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){var r=this;this.pendingZoomOperation=function(){return r.state.setZoomPan(t,e,n,r.glCanvas)}}},{key:"fit",value:function(t,e){var n=this;this.pendingZoomOperation=function(){return n.state.fitNodes(t,e)}}},{key:"resetZoom",value:function(){var t=this;this.pendingZoomOperation=function(){return t.state.setZoomReset()}}},{key:"setRenderer",value:function(t){this.state.setRenderer(t)}},{key:"on",value:function(t,e){this.callbacks.register(t,e)}},{key:"isDestroyed",value:function(){return this.destroyed}},{key:"destroy",value:function(){var t;this.destroyed||(this.animationRequestId&&window.cancelAnimationFrame(this.animationRequestId),void 0!==this.layoutRunner&&window.clearInterval(this.layoutRunner),this.glController.destroy(),this.glCanvas.removeEventListener("transitionend",this.setRenderSwitchAnimation),void 0!==this.webGLContext&&vl(this.webGLContext),void 0!==this.webGLMinimapContext&&vl(this.webGLMinimapContext),hl(this.glCanvas),hl(this.glMinimapCanvas),this.canvasRenderer.destroy(),hl(this.c2dCanvas),this.removeResizeListener(),this.removeMinimapResizeListener(),this.forceLayout.destroy(),this.hierarchicalLayout.destroy(),this.gridLayout.destroy(),this.freeLayout.destroy(),this.htmlOverlay.remove(),this.zoomTransitionHandler.destroy(),this.stateDisposers.forEach((function(t){t()})),t=this.instanceId,delete Hl[t],this.destroyed=!0)}},{key:"callIfRegistered",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks.callIfRegistered.apply(this.callbacks,arguments)}},{key:"getCanvasRelsAt",value:function(t){return this.canvasRenderer.getRelsAt(t)}},{key:"getCanvasNodesAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.canvasRenderer.getNodesAt(t,e)}},{key:"getLayout",value:function(t){return t===la?this.hierarchicalLayout:t===ua?this.forceLayout:t===ca?this.gridLayout:t===fa?this.freeLayout:t===ha?this.d3ForceLayout:this.forceLayout}},{key:"setLayout",value:function(t){Gr.info("Switching to layout: ".concat(t));var e=this.currentLayoutType,n=this.getLayout(t);"free"===t&&n.setNodePositions(this.state.nodes.idToPosition),this.currentLayout=n,this.currentLayoutType=t,e&&e!==this.currentLayoutType&&(this.justSwitchedLayout=!0)}},{key:"setLayoutOptions",value:function(t){this.getLayout(this.state.layout).setOptions(t)}},{key:"createDownloadLink",value:function(t,e){var n=document.createElement("a");n.style.display="none",n.setAttribute("download",t);var r=e.toDataURL("image/png").replace(/^data:image\/png/,"data:application/octet-stream");return n.setAttribute("href",r),n}},{key:"saveToFile",value:function(t){var e=Fl(Fl({},Gl),t),n=e.filename,r=e.backgroundColor,i=this.state.nodes.items;this.currentLayout.update(this.justSwitchedLayout),this.justSwitchedLayout=!1;var o=this.currentLayout.getNodePositions(i);this.state.nodes.updatePositions(o);var a=cl(this.c2dCanvas.width,this.c2dCanvas.height),s=dl(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),hl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=Fl(Fl({},Gl),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Lo(a,100),u=s.nodesWidth,l=s.nodesHeight,c=s.centerX,f=s.centerY,h=Math.max(Math.min(u+100,15e3),5e3),d=Math.max(Math.min(l+100,15e3),5e3);return this.isRenderingDisabled=!0,new Promise((function(t,n){try{e.setPanCoordinates(c,f);var r=Math.max(h/u-.02,e.state.minZoom),s=Math.max(d/l-.02,e.state.minZoom);e.setZoomLevel(Math.min(r,s))}catch(t){return Gr.error("An error occurred while downloading the file"),void n(t)}setTimeout((function(){try{e.currentLayout.update(e.justSwitchedLayout),e.justSwitchedLayout=!1,e.state.nodes.updatePositions(a);var r=cl(h,d),s=dl(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),hl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=Il().mark((function t(e){var n,r,i,o;return Il().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Fl(Fl({},Gl),e),r=this.state.zoom,i=this.state.panX,o=this.state.panY,t.prev=4,t.next=7,this.prepareLargeFileForDownload(n);case 7:t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(4),Gr.error("An error occurred while downloading the image"),!this.callbacks.isCallbackRegistered(Wl)){t.next=16;break}this.callIfRegistered(Wl,t.t0),t.next=17;break;case 16:throw t.t0;case 17:return t.prev=17,this.isRenderingDisabled=!1,this.setZoomLevel(r),this.setPanCoordinates(i,o),t.finish(17);case 22:case"end":return t.stop()}}),t,this,[[4,9,17,22]])})),i=function(){var t=this,e=arguments;return new Promise((function(n,i){var o=r.apply(t,e);function a(t){Ll(o,n,i,a,s,"next",t)}function s(t){Ll(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&Ul(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ql(t){return ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ql(t)}function Zl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ql(r.key),r)}}function Jl(t,e,n){return e&&Kl(t.prototype,e),n&&Kl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ql(t){var e=function(t,e){if("object"!=ql(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ql(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ql(e)?e:String(e)}var tc=function(){function t(e,n){if(Zl(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Jl(t,[{key:"addChild",value:function(t){this.children.push(t)}},{key:"isRoot",value:function(){return null===this.parent}},{key:"print",value:function(){var t=this.data.name;this.isRoot()||(t=t+"\t\t"+function(t){for(var e=(Math.round(1e3*t)/1e3).toFixed(3);e.length<6;)e=" "+e;return e}(this.data._timeSpent())+" ms",this.parent.isRoot()||(t=t+"\t"+this._percentageOfParentSpent()+"%"));var e=this.noOfChildren()>0;for(var n in e?(t=t+"\t Children: "+this.noOfChildren(),console.groupCollapsed(t)):console.log(t),this.children)this.children[n].print();e&&console.groupEnd()}},{key:"noOfChildren",value:function(){return this.children.length}},{key:"_percentageOfParentSpent",value:function(){return Math.round(this.data._timeSpent()/this.parent.data._timeSpent()*100)}}]),t}(),ec=function(){function t(e){Zl(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Jl(t,[{key:"close",value:function(){this.endTime=performance.now()}},{key:"_timeSpent",value:function(){if(null===this.startTime||null===this.endTime)throw new Error("You have an error in your performance measurements that makes the whole tree unreliable. You probably forgot to call performanceTestEnd on "+this.name);return this.endTime-this.startTime}}]),t}(),nc=function(){function t(){Zl(this,t),this.root=new tc(new ec("Performance Tree"),null),this.current=this.root}return Jl(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new tc(t,this.current);this.current.addChild(e),this.current=e}else{if(this.root)throw new Error("Performance tree is screwed up");this.root=new tc(t,null),this.current=this.root}}},{key:"close",value:function(){if(this.current.isRoot())throw new Error("Tried to close performance tree root. You probably have one too many Performance.endTest() in your code.");this.current.data.close(),this.current=this.current.parent}},{key:"getCurrentData",value:function(){return this.current.data}},{key:"print",value:function(){this.root.noOfChildren()>0&&this.root.print()}}]),t}(),rc=function(){function t(){Zl(this,t),window.performance?(this.disabled=!1,this.tree=new nc):(this.disabled=!0,this.tree=null)}return Jl(t,[{key:"startTest",value:function(t){if(!this.disabled){var e;t||(1,t="at"===(e=(new Error).stack.split("\n")[3].trim()).split(" ")[0]?e.split(" ")[1]:e.split("@")[0]);var n=new ec(t);this.tree.add(n)}}},{key:"endTest",value:function(){this.disabled||this.tree.close()}},{key:"reset",value:function(){this.disabled||this.tree.clear()}},{key:"print",value:function(){this.disabled||this.tree.print()}}]),t}(),ic=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};const oc=(t=>{var e={};return i.d(e,t),e})({AnalyticsBrowser:()=>e.AnalyticsBrowser});var ac,sc=new Uint8Array(16);function uc(){if(!ac&&!(ac="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ac(sc)}const lc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var cc=[],fc=0;fc<256;++fc)cc.push((fc+256).toString(16).substr(1));const hc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(cc[t[e+0]]+cc[t[e+1]]+cc[t[e+2]]+cc[t[e+3]]+"-"+cc[t[e+4]]+cc[t[e+5]]+"-"+cc[t[e+6]]+cc[t[e+7]]+"-"+cc[t[e+8]]+cc[t[e+9]]+"-"+cc[t[e+10]]+cc[t[e+11]]+cc[t[e+12]]+cc[t[e+13]]+cc[t[e+14]]+cc[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&lc.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n};var dc,pc,vc=0,yc=0;const mc=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||dc,a=void 0!==t.clockseq?t.clockseq:pc;if(null==o||null==a){var s=t.random||(t.rng||uc)();null==o&&(o=dc=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=pc=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:yc+1,c=u-vc+(l-yc)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||u>vc)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");vc=u,yc=l,pc=a;var f=(1e4*(268435455&(u+=122192928e5))+l)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=255&f;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var d=0;d<6;++d)i[r+d]=o[d];return e||hc(i)};function gc(t){return gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(t)}function bc(){bc=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:A(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",y={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=m.prototype=Object.create(w);function T(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==gc(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function j(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(gc(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=j,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:j(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function wc(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function xc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_c(r.key),r)}}function _c(t){var e=function(t,e){if("object"!=gc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=gc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gc(e)?e:String(e)}var Sc=window.localStorage,Tc="neo4j.nvl.sTid",Oc=!1,Ac=function(){function t(){var e,n,r;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),e=this,r=void 0,(n=_c(n="analytics"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r;var i=new oc.AnalyticsBrowser;this.analytics=i}var e,n,r,i,o;return r=t,i=[{key:"init",value:function(t){this.analytics.load({writeKey:t}),this.analytics.addSourceMiddleware((function(t){var e=t.payload,n=t.next,r=e.obj.context.page;void 0!==r&&(r.url="",r.title="",r.search="",r.referrer="",r.path=""),n(e)}))}},{key:"trackEvent",value:(e=bc().mark((function t(e){var n;return bc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.ready();case 2:n="".concat(e.eventPrefix?e.eventPrefix:"NVL_core","-").concat(e.event),this.analytics.track(n,e.properties).catch((function(t){Gr.warn("TRACKING: Event tracking is failed. err: ".concat(t))}));case 4:case"end":return t.stop()}}),t,this)})),n=function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){wc(o,r,i,a,s,"next",t)}function s(t){wc(o,r,i,a,s,"throw",t)}a(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"identify",value:function(){if(!Oc){var t=this.getSegmentTrackingId();this.analytics.identify(t).catch((function(t){Gr.debug("TRACKING: Identifying user for Segment tracking failed. err: ".concat(t))})),Oc=!0}}},{key:"loadSavedSegmentId",value:function(){try{var t=Sc.getItem(Tc);return"string"==typeof t?t:null}catch(t){return Gr.debug("TRACKING: Retrieving tracking Id failed. err: ".concat(t)),null}}},{key:"getSegmentTrackingId",value:function(){var t=this.loadSavedSegmentId(),e=null!=t?t:mc();return this.saveTrackingId(e),e}},{key:"saveTrackingId",value:function(t){Sc.setItem(Tc,t)}},{key:"ready",value:function(){return this.analytics.ready().catch((function(t){Gr.debug("TRACKING: segment track instance not ready. err: ".concat(t))}))}}],i&&xc(r.prototype,i),o&&xc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function Pc(t){return Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(t)}function Ec(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||Cc(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Cc(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Cc(t,e){if(t){if("string"==typeof t)return jc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jc(t,e):void 0}}function jc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Dc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dc(Object(n),!0).forEach((function(e){Lc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ic(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nc(r.key),r)}}function Lc(t,e,n){return(e=Nc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nc(t){var e=function(t,e){if("object"!=Pc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Pc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pc(e)?e:String(e)}var Mc=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Lc(this,"externalCallbackHandler",void 0),Lc(this,"performance",void 0),Lc(this,"visState",void 0),Lc(this,"nvlController",void 0),Lc(this,"options",void 0),Lc(this,"segmentTrack",void 0),!0!==i.disableTelemetry&&(this.segmentTrack=new Ac,this.segmentTrack.init("4SGwdwzuDm5WkFvQtz7D6ATQlo14yjmW"),this.segmentTrack.identify()),this.setupLogging(i),this.externalCallbackHandler=new l(o),this.performance=new rc,this.options=i,this.options.frame=e,this.checkWebGLCompatibility(),this.initialise(n,r,i)}var e,r;return e=t,r=[{key:"restart",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getNodePositions(),r=this.visState,i=r.zoom,o=r.layout,a=r.layoutOptions,s=r.nodes,u=r.rels;this.nvlController.destroy(),Object.assign(this.options,t),this.initialise(s.items,u.items,this.options),this.setZoom(i),this.setLayout(o),this.setLayoutOptions(a),this.addAndUpdateElementsInGraph(s.items,u.items),e&&this.setNodePositions(n)}},{key:"addAndUpdateElementsInGraph",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.update(t,Rc({},n)),this.visState.rels.update(e,Rc({},n)),this.visState.nodes.add(t,Rc({},n)),this.visState.rels.add(e,Rc({},n)),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}},{key:"getSelectedNodes",value:function(){var t=this;return this.visState.nodes.items.filter((function(t){return t.selected})).map((function(e){return Rc(Rc({},e),t.visState.nodes.idToPosition[e.id])}))}},{key:"getSelectedRelationships",value:function(){return this.visState.rels.items.filter((function(t){return t.selected}))}},{key:"updateElementsInGraph",value:function(t,e){var n={added:!1,updated:!1};this.validateNodes(t),this.validateRelationships(e,t),this.visState.nodes.update(t,Rc({},n)),this.visState.rels.update(e,Rc({},n)),this.nvlController.updateHtmlOverlay()}},{key:"addElementsToGraph",value:function(t,e){this.validateNodes(t),this.validateRelationships(e,t);var n={added:!1,updated:!1};this.visState.nodes.add(t,Rc({},n)),this.visState.rels.add(e,Rc({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,n.isEmpty)(t)){var e,r={},i=kc(t);try{for(i.s();!(e=i.n()).done;)r[e.value]=!0}catch(t){i.e(t)}finally{i.f()}var o,a=[],s=kc(this.visState.rels.items);try{for(s.s();!(o=s.n()).done;){var u=o.value;!0!==r[u.from]&&!0!==r[u.to]||a.push(u.id)}}catch(t){s.e(t)}finally{s.f()}a.length>0&&this.edgeRemoval(a),this.nodeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay()}}},{key:"removeRelationshipsWithIds",value:function(t){Array.isArray(t)&&!(0,n.isEmpty)(t)&&(this.edgeRemoval(t),this.visState.setGraphUpdated(),this.nvlController.updateHtmlOverlay())}},{key:"getNodes",value:function(){return this.nvlController.dumpNodes()}},{key:"getRelationships",value:function(){return this.nvlController.dumpRelationships()}},{key:"getNodeById",value:function(t){return this.visState.nodes.idToItem[t]}},{key:"getRelationshipById",value:function(t){return this.visState.rels.idToItem[t]}},{key:"getPositionById",value:function(t){return this.visState.nodes.idToPosition[t]}},{key:"getCurrentOptions",value:function(){return this.options}},{key:"destroy",value:function(){this.nvlController.destroy()}},{key:"deselectAll",value:function(){this.updateElementsInGraph(this.visState.nodes.items.map((function(t){return Rc(Rc({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return Rc(Rc({},t),{},{selected:!1})})))}},{key:"fit",value:function(t,e){this.nvlController.fit(t,e)}},{key:"resetZoom",value:function(){this.nvlController.resetZoom()}},{key:"setUseWebGLRenderer",value:function(t){this.nvlController.setRenderer(t?da:pa)}},{key:"setRenderer",value:function(t){this.nvlController.setRenderer(t)}},{key:"setDisableWebGL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.options.disableWebGL!==t&&(this.options.disableWebGL=t,this.restart())}},{key:"pinNode",value:function(t){this.visState.nodes.update([{id:t,pinned:!0}],{})}},{key:"unPinNode",value:function(t){this.visState.nodes.update(t.map((function(t){return{id:t,pinned:!1}})),{})}},{key:"setLayout",value:function(t){this.visState.setLayout(t)}},{key:"setLayoutOptions",value:function(t){this.visState.setLayoutOptions(t)}},{key:"getNodesOnScreen",value:function(){return this.nvlController.getNodesOnScreen()}},{key:"getNodePositions",value:function(){return this.nvlController.getNodePositions()}},{key:"setNodePositions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.nvlController.setNodePositions(t,e)}},{key:"isLayoutMoving",value:function(){return this.nvlController.isLayoutMoving()}},{key:"saveToFile",value:function(t){this.nvlController.saveToFile(t)}},{key:"saveFullGraphToLargeFile",value:function(t){this.nvlController.saveFullGraphToLargeFile(t)}},{key:"setZoom",value:function(t){this.nvlController.setZoomLevel(t)}},{key:"setPan",value:function(t,e){this.nvlController.setPanCoordinates(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){this.nvlController.setZoomAndPan(t,e,n)}},{key:"getScale",value:function(){return this.nvlController.getScale()}},{key:"getPan",value:function(){return this.nvlController.getPan()}},{key:"getHits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["node","relationship"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{hitNodeMarginWidth:0},r=this.options,i=this.visState,o=this.nvlController,a=i.zoom,s=i.panX,u=i.panY,l=i.webGLVisible,c=Bu(t,r.frame,a,s,u),f=c.x,h=c.y,d=l?function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[],s=n.nodes,u=n.rels;return r.includes("node")&&o.push.apply(o,yl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=[],a=ml(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a,s=n.value,u=r[s.id];if(void 0===(null==u?void 0:u.x)||void 0===u.y)return 1;var l=(null!==(a=s.size)&&void 0!==a?a:br)*_r(),c={x:u.x-t,y:u.y-e},f=Math.pow(l,2),h=Math.pow(l+i,2),d=Math.pow(c.x,2)+Math.pow(c.y,2),p=Math.sqrt(d);if(d<h){var v=o.findIndex((function(t){return t.distance>p}));o.splice(-1!==v?v:o.length,0,{data:s,targetCoordinates:{x:u.x,y:u.y},pointerCoordinates:{x:t,y:e},distanceVector:c,distance:p,insideNode:d<f})}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return o}(t,e,s.items,s.idToPosition,i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,yl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=ml(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a=n.value,s=a.from,u=a.to;if(void 0===o["".concat(s,".").concat(u)]){var l=r[s],c=r[u];if(void 0===(null==l?void 0:l.x)||void 0===l.y)return 0;if(void 0===(null==c?void 0:c.x)||void 0===c.y)return 0;var f=ks({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=wl){var h=i.findIndex((function(t){return t.distance>f}));i.splice(-1!==h?h:i.length,0,{data:a,fromTargetCoordinates:{x:l.x,y:l.y},toTargetCoordinates:{x:c.x,y:c.y},pointerCoordinates:{x:t,y:e},distance:f})}o["".concat(s,".").concat(u)]=1,o["".concat(u,".").concat(s)]=1}};for(a.s();!(n=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}return i}(t,e,u.items,s.idToPosition))),{nodes:o,relationships:a}}(f,h,i,e,n):function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["node","relationship"],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=[],a=[];return r.includes("node")&&o.push.apply(o,yl(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,yl(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return Rc(Rc({},t),{},{nvlTargets:d})}},{key:"getContainer",value:function(){return this.options.frame}},{key:"initialise",value:function(){var t,e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.visState=function(t){var e=t.minZoom,r=t.maxZoom,i=t.allowDynamicMinZoom,o=void 0===i||i,a=t.layout,s=t.layoutOptions,u=t.nodeDefaultBorderColor,l=t.selectedBorderColor,c=t.panX,f=void 0===c?0:c,h=t.panY,d=void 0===h?0:h,p=t.initialZoom,v=t.renderer,y=void 0===v?!1===t.useWebGL?pa:da:v,m=t.disableWebGL,g=void 0!==m&&m,b=t.disableTelemetry,w=void 0!==b&&b;Z(!0),xn.isolateGlobalState();var x=void 0!==e?e:.075,_=void 0!==r?r:10,S=ta({},ia.default);void 0!==u&&("string"==typeof u&&null!==jo().get.rgb(u)?S.rings=[{color:u,widthFactor:.05}]:Gr.warn("Invalid color string for nodeDefaultBorderColor:",u));var T=ta({},ia.selected),O=ta({},oa.selected);return void 0!==l&&("string"==typeof u&&null!==jo().get.rgb(l)?(T.rings[1].color=l,O.rings[1].color=l):Gr.warn("Invalid color string for selectedBorderColor:",l)),Vt({zoom:p||aa,minimapZoom:aa,defaultZoomLevel:aa,panX:f,panY:d,minimapPanX:0,minimapPanY:0,fitNodeIds:[],resetZoom:!1,zoomOptions:{},forceWebGL:!1,renderer:y,disableWebGL:g,disableTelemetry:w,fitMovement:0,layout:a,layoutOptions:s,maxDistance:0,maxNodeRadius:50,nodeBorderStyles:{default:S,selected:T},relationshipBorderStyles:{default:oa.default,selected:O},get minZoom(){return x},get maxZoom(){return _},get minMinimapZoom(){return 0},get maxMinimapZoom(){return.2},get webGLVisible(){var t=this.fitMovement>50;return this.renderer===da||t},nodes:Ko(),rels:Ko(),graphUpdates:0,waypoints:{data:Vt.shallow({}),counter:0},setGraphUpdated:ot((function(){this.graphUpdates++})),setRenderer:ot((function(t){ot((function(){this.graphUpdates++})),this.renderer=t})),setWaypoints:ot((function(t){this.waypoints.data=t,this.waypoints.counter+=1})),setZoomPan:ot((function(t,e,n,r){if(o){var i=Object.values(this.nodes.idToPosition),a=Uo(i,x,_,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=Fo(t,this.zoom,x,_);s!==this.zoom&&(this.zoom=s,this.panX=e,this.panY=n)}this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setZoom:ot((function(t,e){if(o){var n=Object.values(this.nodes.idToPosition);this.zoom=Uo(n,x,_,e,t,this.zoom)}else this.zoom=Fo(t,this.zoom,x,_);this.fitNodeIds=[],this.fitMovement=0,this.resetZoom=!1,this.forceWebGL=!1})),setPan:ot((function(t,e){this.panX=t,this.panY=e,this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setLayout:ot((function(t){this.layout=t})),setLayoutOptions:ot((function(t){this.layoutOptions=t})),fitNodes:ot((function(t,e){this.fitNodeIds=(0,n.intersection)(t,(0,n.map)(this.nodes.items,"id")),this.zoomOptions=null!=e?e:{}})),setZoomReset:ot((function(){this.resetZoom=!0})),clearFit:ot((function(){this.fitNodeIds=[],this.forceWebGL=!1,this.fitMovement=0})),clearReset:ot((function(){this.resetZoom=!1,this.fitMovement=0})),updateZoomToFit:ot((function(t,e,n,r){var i;if(this.fitMovement=Math.abs(t-this.zoom)+Math.abs(e-this.panX)+Math.abs(n-this.panY),o){var a=Object.values(this.nodes.idToPosition);i=Uo(a,x,_,r,t,this.zoom)}else i=Fo(t,this.zoom,x,_);this.zoom=i,this.panX=e,this.panY=n})),updateMinimapZoomToFit:ot((function(t,e,n){this.minimapZoom=t,this.minimapPanX=e,this.minimapPanY=n})),autorun:yt,reaction:mt})}(o),o.minimapContainer instanceof HTMLElement||delete o.minimapContainer,this.nvlController=new $l(this.visState,o),this.addAndUpdateElementsInGraph(r,i),this.nvlController.on("restart",this.restart.bind(this));var a,s,u=kc((a=this.externalCallbackHandler.callbacks,Object.entries(a)));try{for(u.s();!(s=u.n()).done;){var l=Ec(s.value,2),c=l[0];void 0!==l[1]&&this.nvlController.on(c,this.externalCallbackHandler[c].bind(this.externalCallbackHandler))}}catch(t){u.e(t)}finally{u.f()}var f=null===(t=this.options.frame)||void 0===t?void 0:t.getAttribute("id");!0!==this.options.disableTelemetry&&setTimeout((function(){e.nvlController.isDestroyed()||e.segmentTrack.trackEvent({eventPrefix:Sr.includes(f)?f:null,event:"instantiated",properties:{}})}),200)}},{key:"setupLogging",value:function(t){var e,n=t.logging;void 0!==(null==n?void 0:n.level)&&(e=n.level,Gr.setLevel(e),function(t,e){var n=t.methodFactory;t.methodFactory=function(t,r,i){var o=n(t,r,i);return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];"function"==typeof e.logger?e.logger.apply(e,[t].concat(r)):o.apply(void 0,r)}},t.setLevel(t.getLevel())}(Gr,n))}},{key:"nodeRemoval",value:function(t){var e=Array.isArray(t)?t:[t],n=this.visState,r=n.nodes,i=n.fitNodeIds,o=n.zoomOptions;r.remove(e,{removed:!1}),i.length&&void 0!==e.find((function(t){return i.includes(t)}))&&this.visState.fitNodes(i.filter((function(t){return!e.includes(t)})),o)}},{key:"edgeRemoval",value:function(t){var e=Array.isArray(t)?t:[t];this.visState.rels.remove(e,{removed:!1})}},{key:"update",value:function(t,e){this.visState[e].update(t,{added:!1,updated:!1})}},{key:"validateNodes",value:function(t){var e=t.find((function(t){return!function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0}(t)}));if(e){var n="";throw/^\d+$/.test(e.id)||(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported."),new TypeError("Invalid node provided: ".concat(JSON.stringify(e),".").concat(n))}}},{key:"validateRelationships",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n="",r=null,i=this.visState,o=i.nodes,a=i.rels,s={},u=0;u<e.length;u++){var l=e[u];s[l.id]=l}for(var c=Rc(Rc({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!ic(d)){r=d,/^\d+$/.test(d.id)&&(n=" Node ids need to be numeric strings. Strings that contain anything other than numbers are not yet supported.");break}if(void 0===f[d.id]){var p=c[d.from],v=c[d.to];if(void 0===p){n=' Node with id "'.concat(d.from,'" does not exist.'),r=d;break}if(void 0===v){n=' Node with id "'.concat(d.to,'" does not exist.'),r=d;break}}}if(null!==r)throw new TypeError("Invalid relationship provided: ".concat(JSON.stringify(r),".").concat(n))}},{key:"checkWebGLCompatibility",value:function(){if(void 0===this.options.disableWebGL||!this.options.disableWebGL){var t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.createElement("canvas");try{return Boolean(void 0!==window.WebGLRenderingContext&&(null!==t.getContext("webgl")||null!==t.getContext("experimental-webgl")))}catch(t){return!1}}();if(!t){if(void 0!==this.options.disableWebGL)throw new Ni("Could not initialize WebGL");this.options.renderer=pa,console.warn("GPU acceleration is not available on your browser. Falling back to CPU layout and rendering. You can disable this warning by setting the disableWebGL option to true.")}void 0===this.options.disableWebGL&&(this.options.disableWebGL=!t)}}}],r&&Ic(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Fc={textColorForBackground:Au};const Uc=Mc})();var a=o.RL,s=o.wK,u=o.x_,l=o.lv,c=o.YQ,f=o.BP,h=o.GZ,d=o.Vw,p=o.Ay,v=o._G;export{a as CompatibilityError,s as ForceDirectedLayoutType,u as FreeLayoutType,l as GridLayoutType,c as HierarchicalLayoutType,f as NVL,h as colorMapperFunctions,d as d3ForceLayoutType,p as default,v as drawCircleBand};
|