@neo4j-nvl/base 0.3.1 → 0.3.2-ea823910

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +6 -4
  2. package/dist/base.mjs +1 -1
  3. package/dist/types/index.d.ts +21 -15
  4. package/dist/types/layouts/animatedlayout/AnimatedLayout.test.d.ts +1 -0
  5. package/dist/types/layouts/animatedlayout/animationUtils.test.d.ts +1 -0
  6. package/dist/types/layouts/d3forcelayout/constants.d.ts +2 -1
  7. package/dist/types/layouts/d3forcelayout/d3ForceLayout.d.ts +4 -0
  8. package/dist/types/layouts/forcedirectedlayout/ForceCytoLayout.d.ts +12 -14
  9. package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +1 -1
  10. package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +103 -113
  11. package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.test.d.ts +1 -0
  12. package/dist/types/layouts/forcedirectedlayout/physlayout/glwrapper.d.ts +2 -2
  13. package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-fragment-verlet.d.ts +2 -0
  14. package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-repulsive-fragment-verlet.d.ts +2 -0
  15. package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/SolarMerger.test.d.ts +1 -0
  16. package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/solar-placer.d.ts +2 -4
  17. package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/solar-placer.test.d.ts +1 -0
  18. package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +2 -2
  19. package/dist/types/modules/CallbackHelper.d.ts +6 -6
  20. package/dist/types/modules/ExternalCallbackHandler.d.ts +2 -0
  21. package/dist/types/modules/NvlController.d.ts +89 -93
  22. package/dist/types/modules/Shader.d.ts +14 -14
  23. package/dist/types/modules/ZoomTransitionHandler.d.ts +1 -1
  24. package/dist/types/modules/ZoomTransitionHandler.test.d.ts +1 -0
  25. package/dist/types/modules/dataset.test.d.ts +1 -0
  26. package/dist/types/modules/logging.d.ts +7 -4
  27. package/dist/types/modules/state.d.ts +38 -11
  28. package/dist/types/modules/state.test.d.ts +1 -0
  29. package/dist/types/renderers/canvasrenderer/Animation.test.d.ts +1 -0
  30. package/dist/types/renderers/canvasrenderer/CanvasRenderer.test.d.ts +1 -0
  31. package/dist/types/renderers/canvasrenderer/ImageCache.d.ts +6 -6
  32. package/dist/types/renderers/canvasrenderer/ImageCache.test.d.ts +1 -0
  33. package/dist/types/renderers/canvasrenderer/arrows/ArrowBundle.test.d.ts +1 -0
  34. package/dist/types/renderers/canvasrenderer/arrows/ArrowBundler.test.d.ts +1 -0
  35. package/dist/types/renderers/canvasrenderer/arrows/arrows.d.ts +5 -3
  36. package/dist/types/renderers/canvasrenderer/arrows/arrows.test.d.ts +1 -0
  37. package/dist/types/renderers/canvasrenderer/arrows/constants.d.ts +0 -13
  38. package/dist/types/renderers/canvasrenderer/nodes/nodes.d.ts +4 -4
  39. package/dist/types/renderers/canvasrenderer/nodes/nodes.test.d.ts +1 -0
  40. package/dist/types/renderers/canvasrenderer/util.test.d.ts +1 -0
  41. package/dist/types/renderers/canvasrenderer/wordwrap.test.d.ts +1 -0
  42. package/dist/types/renderers/webglrenderer/Controller.d.ts +2 -2
  43. package/dist/types/renderers/webglrenderer/Controller.test.d.ts +1 -0
  44. package/dist/types/renderers/webglrenderer/Renderer.d.ts +3 -7
  45. package/dist/types/types/graph-element.d.ts +35 -3
  46. package/dist/types/types/nvl-window-functions.d.ts +16 -0
  47. package/dist/types/types/utils.d.ts +1 -0
  48. package/dist/types/utils/canvasManagement.d.ts +1 -1
  49. package/dist/types/utils/canvasManagement.test.d.ts +1 -0
  50. package/dist/types/utils/constants.d.ts +2 -0
  51. package/dist/types/utils/errors.test.d.ts +1 -0
  52. package/dist/types/utils/geometry.d.ts +3 -3
  53. package/dist/types/utils/geometry.test.d.ts +1 -0
  54. package/dist/types/utils/graphObjectUtils.d.ts +21 -7
  55. package/dist/types/utils/graphObjectUtils.test.d.ts +1 -0
  56. package/dist/types/utils/hittest.test.d.ts +1 -0
  57. package/dist/types/utils/mouseUtils.test.d.ts +1 -0
  58. package/dist/types/utils/segmentAnalytics.d.ts +51 -0
  59. package/dist/types/utils/zoomFunctions.d.ts +3 -3
  60. package/dist/types/utils/zoomFunctions.test.d.ts +1 -0
  61. package/package.json +25 -6
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";var e={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,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 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 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),E}(t):(P.length&&F(P.join("")),A=_,F("(eof)"),E)};function F(t){t.length&&E.push({type:x[A],data:t,position:C,line:k,column:j})}function z(){return P=P.length?[]:P,"/"===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(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):(F(P.join("")),A=u,T)}function G(){return"/"===e&&"*"===n?(P.push(e),F(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 F(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 F(n),C+=n.length,(P=P.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(F(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=w,P.push(e),n=e,T+1):/[^\d]/.test(e)?(F(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)?(F(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=U[t]?g:N[t]?m:y,F(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,_=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]",P="[object Set]",E="[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",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="["+wt+"]",kt="["+Pt+"]",jt="["+xt+"]",Ct="\\d+",Rt="["+St+"]",Dt="["+Tt+"]",It="[^"+wt+Pt+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,Et].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[P]=ie[E]=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[P]=oe[E]=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 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)&&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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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,Pt=e.TypeError,Et=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=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,Me=e.isFinite,We=Et.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,_n=St.random,wn=Et.reverse,xn=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={},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&&Pi(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 Pi(t,co(t),e)}(t,function(t,e){return t&&Pi(e,Cs(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 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 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,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 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=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__=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 Dt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return Pn?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]=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=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 Ee(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 Pr(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 Er(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 E:return t==e+"";case x: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(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=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 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 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 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 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 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)&&Po(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==P?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 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)_=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:Po)(_,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=En?function(t){return En.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),Ee(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)!=P||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 P;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 Po=Co(Kr),Eo=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]?Pr(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]?Pr(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]?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,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=Ee(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(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=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=Ei((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=Ei((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):Er(t,e,n)})),a})),wa=Ei((function(t,e,n){rr(t,n,e)}));function xa(t,e){return(Ga(t)?Ce:Mr)(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 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 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 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 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(Da.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)}}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)==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=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==P?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 Pi(t,Cs(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(wo(e)||Xa(e))Pi(e,js(e),t);else for(var n in e)Dt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Pi(e,Cs(e),t)})),_s=ki((function(t,e,n,r){Pi(e,Cs(e),t,r)})),ws=ki((function(t,e,n,r){Pi(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 Ps=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=n}),Qs(nu)),Es=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(Er);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})),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 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,Ea(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 Er(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Er(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(Pe),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 Pt(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=Pa,Un.bind=Ea,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 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)}}))},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)?Ee: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=Ps,Un.invertBy=Es,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 Pa(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)?Ee: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 Pt(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 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&&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 Pt(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)?Pe: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==P)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==P?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 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=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=Et[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))}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};(()=>{r.d(i,{RL:()=>Ei,wK:()=>ma,x_:()=>_a,lv:()=>ba,YQ:()=>ga,BP:()=>Zl,GZ:()=>Kl,Vw:()=>wa,Ay:()=>Jl,_G:()=>Ps});var e=r(250);function n(t){return n="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},n(t)}function o(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 a(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:String(e)}var s=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=a(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&&o(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),u=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 l(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var c=function(){function t(t){void 0===t&&(t="Atom@"+ee()),this.name=t,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Se.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){We(this)},t.prototype.reportChanged=function(){Ve(),function(t){if(t.lowestObserverState!==Se.STALE){t.lowestObserverState=Se.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Se.UP_TO_DATE&&(r.isTracing!==Te.NONE&&Xe(r,t),r.onBecomeStale()),r.dependenciesState=Se.STALE}}}(this),Ge()},t.prototype.toString=function(){return this.name},t}(),f=function(t){function e(e,n,r){void 0===e&&(e="Atom@"+ee()),void 0===n&&(n=se),void 0===r&&(r=se);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 l(e,t),e.prototype.reportObserved=function(){return Ve(),t.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),Ge(),!!Pe.trackingDerivation},e.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},e}(c),h=be("Atom",c);function d(t){return t.interceptors&&t.interceptors.length>0}function p(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),ae((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function v(t,e){var n=en();try{var r=t.interceptors;if(r)for(var i=0,o=r.length;i<o&&(re(!(e=r[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{nn(n)}}function y(t){return t.changeListeners&&t.changeListeners.length>0}function m(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),ae((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function g(t,e){var n=en(),r=t.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i<o;i++)r[i](e);nn(n)}}function b(){return!!Pe.spyListeners.length}function _(t){if(Pe.spyListeners.length)for(var e=Pe.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function w(t){_(he({},t,{spyReportStart:!0}))}var x={spyReportEnd:!0};function S(t){_(t?he({},t,x):x)}function T(t){return Pe.spyListeners.push(t),ae((function(){var e=Pe.spyListeners.indexOf(t);-1!==e&&Pe.spyListeners.splice(e,1)}))}var O="__$$iterating";function A(t){re(!0!==t[O],"Illegal state: cannot recycle array as iterator"),ye(t,O,!0);var e=-1;return ye(t,"next",(function(){return{done:++e>=this.length,value:e<this.length?this[e]:void 0}})),t}function P(t,e){ye(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var E,k,j=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,!1===t}(),C=0,R=function(){};E=R,k=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(E.prototype,k):void 0!==E.prototype.__proto__?E.prototype.__proto__=k:E.prototype=k,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(t){Object.defineProperty(R.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})}));var D=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 c(t||"ObservableArray@"+ee()),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 p(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}),m(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>C&&U(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Ke(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=[]),d(this)){var o=v(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!o)return Qt;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&&b(),i=y(this),o=i||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&w(o),this.atom.reportChanged(),i&&g(this,o),r&&S()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&b(),i=y(this),o=i||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&w(o),this.atom.reportChanged(),i&&g(this,o),r&&S()},t}(),I=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableArray@"+ee()),void 0===i&&(i=!1);var o=t.call(this)||this,a=new D(r,n,o,i);return ye(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),j&&Object.defineProperty(a.array,"0",L),o}return l(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 z(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){Ke(n.atom);var i=r[t];if(d(n)){var o=v(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}(R);P(I.prototype,(function(){return A(this.slice())})),Object.defineProperty(I.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];re("function"==typeof e,"Base function not defined on Array prototype: '"+t+"'"),ve(I.prototype,t,(function(){return e.apply(this.peek(),arguments)}))})),function(t,e){for(var n=0;n<e.length;n++)ve(t,e[n],t[e[n]])}(I.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 L=M(0);function M(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function N(t){Object.defineProperty(I.prototype,""+t,M(t))}function U(t){for(var e=C;e<t;e++)N(e);C=t}U(1e3);var F=be("ObservableArrayAdministration",D);function z(t){return ce(t)&&F(t.$mobx)}var B={},V=function(t){function e(e,n,r,i){void 0===r&&(r="ObservableValue@"+ee()),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&&b()&&_({type:"create",object:o,newValue:o.value}),o}return l(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))!==B){var n=b();n&&w({type:"update",object:this,newValue:t,oldValue:e}),this.setNewValue(t),n&&S()}},e.prototype.prepareNewValue=function(t){if(Ke(this),d(this)){var e=v(this,{object:this,type:"update",newValue:t});if(!e)return B;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.value!==t?t:B},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),y(this)&&g(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 p(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),m(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return xe(this.get())},e}(c);V.prototype[we()]=V.prototype.valueOf;var G=be("ObservableValue",V),W={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 X(t){return W[t]}function H(t,e){re("function"==typeof e,X("m026")),re("string"==typeof t&&t.length>0,"actions should have valid names, got: '"+t+"'");var n=function(){return Y(t,e,this,arguments)};return n.originalFn=e,n.isMobxAction=!0,n}function Y(t,e,n,r){var i=function(t,e,n,r){var i=b()&&!!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];w({type:"action",name:t,fn:e,object:n,arguments:s})}var l=en();return Ve(),{prevDerivation:l,prevAllowStateChanges:q(!0),notifySpy:i,startTime:o}}(t,e,n,r);try{return e.apply(n,r)}finally{!function(t){Z(t.prevAllowStateChanges),Ge(),nn(t.prevDerivation),t.notifySpy&&S({time:Date.now()-t.startTime})}(i)}}function $(t){re(null===Pe.trackingDerivation,X("m028")),Pe.strictMode=t,Pe.allowStateChanges=!t}function q(t){var e=Pe.allowStateChanges;return Pe.allowStateChanges=t,e}function Z(t){Pe.allowStateChanges=t}function K(t,e,n,r,i){function o(o,a,s,u,l){if(void 0===l&&(l=0),re(i||tt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){pe(o,"__mobxLazyInitializers")||ve(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&&Q(this),e.call(this,a)},set:function(t){!0!==this.__mobxDidRunLazyInitializers&&Q(this),n.call(this,a,t)}}}var h={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||J(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):J(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(tt(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 J(t,e,n,r,i,o){pe(t,"__mobxInitializedProps")||ve(t,"__mobxInitializedProps",{}),t.__mobxInitializedProps[e]=!0,r(t,e,n,i,o)}function Q(t){!0!==t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers&&(ve(t,"__mobxDidRunLazyInitializers",!0),t.__mobxDidRunLazyInitializers&&t.__mobxLazyInitializers.forEach((function(e){return e(t)})))}function tt(t){return(2===t.length||3===t.length)&&"string"==typeof t[1]}var et=K((function(t,e,n,r,i){var o=r&&1===r.length?r[0]:n.name||e||"<unnamed action>";ve(t,e,rt(o,n))}),(function(t){return this[t]}),(function(){re(!1,X("m001"))}),!1,!0),nt=K((function(t,e,n){at(t,e,n)}),(function(t){return this[t]}),(function(){re(!1,X("m001"))}),!1,!1),rt=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?H(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?H(t,e):1===arguments.length&&"string"==typeof t?it(t):it(e).apply(null,arguments)};function it(t){return function(e,n,r){if(r&&"function"==typeof r.value)return r.value=H(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 et(t).apply(this,arguments)}}function ot(t){return"function"==typeof t&&!0===t.isMobxAction}function at(t,e,n){var r=function(){return Y(e,n,t,arguments)};r.isMobxAction=!0,ve(t,e,r)}rt.bound=function(t,e,n){if("function"==typeof t){var r=H("<not yet bound action>",t);return r.autoBind=!0,r}return nt.apply(null,arguments)};var st=Object.prototype.toString;function ut(t,e){return lt(t,e)}function lt(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=ct(t),e=ct(e);var i=st.call(t);if(i!==st.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(!lt(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(!ft(e,l=c[u])||!lt(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function ct(t){return z(t)?t.peek():Jt(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 ft(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ht(t,e){return t===e}var dt={identity:ht,structural:function(t,e){return ut(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||ht(t,e)}};function pt(t,e,n){var r,i,o;"string"==typeof t?(r=t,i=e,o=n):(r=t.name||"Autorun@"+ee(),i=t,o=e),re("function"==typeof i,X("m004")),re(!1===ot(i),X("m005")),o&&(i=i.bind(o));var a=new sn(r,(function(){this.track(s)}));function s(){i(a)}return a.schedule(),a.getDisposer()}function vt(t,e,n){var r;arguments.length>3&&ne(X("m007")),Vt(t)&&ne(X("m008")),(r="object"==typeof n?n:{}).name=r.name||t.name||e.name||"Reaction@"+ee(),r.fireImmediately=!0===n||!0===r.fireImmediately,r.delay=r.delay||0,r.compareStructural=r.compareStructural||r.struct||!1,e=rt(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?dt.structural:dt.default,u=new sn(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 yt=function(){function t(t,e,n,r,i){this.derivation=t,this.scope=e,this.equals=n,this.dependenciesState=Se.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=Se.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+ee(),this.value=new Ye(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Te.NONE,this.name=r||"ComputedValue@"+ee(),i&&(this.setter=H(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Se.UP_TO_DATE){t.lowestObserverState=Se.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Se.UP_TO_DATE&&(r.dependenciesState=Se.POSSIBLY_STALE,r.isTracing!==Te.NONE&&Xe(r,t),r.onBecomeStale())}}}(this)},t.prototype.onBecomeUnobserved=function(){Qe(this),this.value=void 0},t.prototype.get=function(){re(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===Pe.inBatch?(Ve(),qe(this)&&(this.isTracing!==Te.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),Ge()):(We(this),qe(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState!==Se.STALE){t.lowestObserverState=Se.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Se.POSSIBLY_STALE?r.dependenciesState=Se.STALE:r.dependenciesState===Se.UP_TO_DATE&&(t.lowestObserverState=Se.UP_TO_DATE)}}}(this));var t=this.value;if($e(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if($e(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){re(!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 re(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){b()&&_({object:this.scope,type:"compute",fn:this.derivation});var t=this.value,e=this.dependenciesState===Se.NOT_TRACKING,n=this.value=this.computeValue(!0);return e||$e(t)||$e(n)||!this.equals(t,n)},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,Pe.computationDepth++,t)e=Je(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Ye(t)}return Pe.computationDepth--,this.isComputing=!1,e},t.prototype.observe=function(t,e){var n=this,r=!0,i=void 0;return pt((function(){var o=n.get();if(!r||e){var a=en();t({type:"update",object:n,newValue:o,oldValue:i}),nn(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 xe(this.get())},t.prototype.whyRun=function(){var t=Boolean(Pe.trackingDerivation),e=ue(this.isComputing?this.newObserving:this.observing).map((function(t){return t.name})),n=ue(Ue(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===Se.NOT_TRACKING?X("m032"):" * This computation will re-run if any of the following observables changes:\n "+le(e)+"\n "+(this.isComputing&&t?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+X("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+le(n)+"\n")},t}();yt.prototype[we()]=yt.prototype.valueOf;var mt=be("ComputedValue",yt),gt=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 re(!0!==e,"`observe` doesn't support the fire immediately property for observable objects."),m(this,t)},t.prototype.intercept=function(t){return p(this,t)},t}();function bt(t,e){if(Et(t)&&t.hasOwnProperty("$mobx"))return t.$mobx;re(Object.isExtensible(t),X("m035")),fe(t)||(e=(t.constructor.name||"ObservableObject")+"@"+ee()),e||(e="ObservableObject@"+ee());var n=new gt(t,e);return ye(t,"$mobx",n),n}function _t(t,e,n,r){if(t.values[e]&&!mt(t.values[e]))return re("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(Vt(n.value)){var i=n.value;wt(t,e,i.initialValue,i.enhancer)}else ot(n.value)&&!0===n.value.autoBind?at(t.target,e,n.value.originalFn):mt(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,Ot(e))}(t,e,n.value):wt(t,e,n.value,r);else xt(t,e,n.get,n.set,dt.default,!0)}function wt(t,e,n,r){if(ge(t.target,e),d(t)){var i=v(t,{object:t.target,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(t.values[e]=new V(n,r,t.name+"."+e,!1)).value,Object.defineProperty(t.target,e,function(t){return St[t]||(St[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[t].get()},set:function(e){At(this,t,e)}})}(e)),function(t,e,n,r){var i=y(t),o=b(),a=i||o?{type:"add",object:e,name:n,newValue:r}:null;o&&w(a),i&&g(t,a),o&&S()}(t,t.target,e,n)}function xt(t,e,n,r,i,o){o&&ge(t.target,e),t.values[e]=new yt(n,t.target,i,t.name+"."+e,r),o&&Object.defineProperty(t.target,e,Ot(e))}var St={},Tt={};function Ot(t){return Tt[t]||(Tt[t]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[t].get()},set:function(e){return this.$mobx.values[t].set(e)}})}function At(t,e,n){var r=t.$mobx,i=r.values[e];if(d(r)){if(!(s=v(r,{type:"update",object:t,name:e,newValue:n})))return;n=s.newValue}if((n=i.prepareNewValue(n))!==B){var o=y(r),a=b(),s=o||a?{type:"update",object:t,oldValue:i.value,name:e,newValue:n}:null;a&&w(s),i.setNewValue(n),o&&g(r,s),a&&S()}}var Pt=be("ObservableObjectAdministration",gt);function Et(t){return!!ce(t)&&(Q(t),Pt(t.$mobx))}function kt(t,e){if(null==t)return!1;if(void 0!==e){if(z(t)||Jt(t))throw new Error(X("m019"));if(Et(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return Et(t)||!!t.$mobx||h(t)||dn(t)||mt(t)}function jt(t){return re(!!t,":("),K((function(e,n,r,i,o){ge(e,n),re(!o||!o.get,X("m022")),wt(bt(e,void 0),n,r,t)}),(function(t){var e=this.$mobx.values[t];if(void 0!==e)return e.get()}),(function(t,e){At(this,t,e)}),!0,!1)}function Ct(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(t,Wt,e)}function Rt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Dt(t,Ht,e)}function Dt(t,e,n){re(arguments.length>=2,X("m014")),re("object"==typeof t,X("m015")),re(!Jt(t),X("m016")),n.forEach((function(t){re("object"==typeof t,X("m017")),re(!kt(t),X("m018"))}));for(var r=bt(t),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&pe(a,s)){if(i[s]=!0,t===a&&!me(t,s))continue;_t(r,s,Object.getOwnPropertyDescriptor(a,s),e)}}return t}var It=jt(Wt),Lt=jt(Xt),Mt=jt(Ht),Nt=jt(Yt),Ut=jt($t),Ft={box:function(t,e){return arguments.length>2&&Bt("box"),new V(t,Wt,e)},shallowBox:function(t,e){return arguments.length>2&&Bt("shallowBox"),new V(t,Ht,e)},array:function(t,e){return arguments.length>2&&Bt("array"),new I(t,Wt,e)},shallowArray:function(t,e){return arguments.length>2&&Bt("shallowArray"),new I(t,Ht,e)},map:function(t,e){return arguments.length>2&&Bt("map"),new Kt(t,Wt,e)},shallowMap:function(t,e){return arguments.length>2&&Bt("shallowMap"),new Kt(t,Ht,e)},object:function(t,e){arguments.length>2&&Bt("object");var n={};return bt(n,e),Ct(n,t),n},shallowObject:function(t,e){arguments.length>2&&Bt("shallowObject");var n={};return bt(n,e),Rt(n,t),n},ref:function(){return arguments.length<2?Gt(Ht,arguments[0]):Mt.apply(null,arguments)},shallow:function(){return arguments.length<2?Gt(Xt,arguments[0]):Lt.apply(null,arguments)},deep:function(){return arguments.length<2?Gt(Wt,arguments[0]):It.apply(null,arguments)},struct:function(){return arguments.length<2?Gt(Yt,arguments[0]):Nt.apply(null,arguments)}},zt=function(t){if(void 0===t&&(t=void 0),"string"==typeof arguments[1])return It.apply(null,arguments);if(re(arguments.length<=1,X("m021")),re(!Vt(t),X("m020")),kt(t))return t;var e=Wt(t,0,void 0);return e!==t?e:zt.box(t)};function Bt(t){ne("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function Vt(t){return"object"==typeof t&&null!==t&&!0===t.isMobxModifierDescriptor}function Gt(t,e){return re(!Vt(e),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:e,enhancer:t}}function Wt(t,e,n){return Vt(t)&&ne("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),kt(t)?t:Array.isArray(t)?zt.array(t,n):fe(t)?zt.object(t,n):_e(t)?zt.map(t,n):t}function Xt(t,e,n){return Vt(t)&&ne("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),null==t||Et(t)||z(t)||Jt(t)?t:Array.isArray(t)?zt.shallowArray(t,n):fe(t)?zt.shallowObject(t,n):_e(t)?zt.shallowMap(t,n):ne("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function Ht(t){return t}function Yt(t,e,n){if(ut(t,e))return e;if(kt(t))return t;if(Array.isArray(t))return new I(t,Yt,n);if(_e(t))return new Kt(t,Yt,n);if(fe(t)){var r={};return bt(r,n),Dt(r,Yt,[t]),r}return t}function $t(t,e,n){return ut(t,e)?e:t}function qt(t,e){void 0===e&&(e=void 0),Ve();try{return t.apply(e)}finally{Ge()}}Object.keys(Ft).forEach((function(t){return zt[t]=Ft[t]})),zt.deep.struct=zt.struct,zt.ref.struct=function(){return arguments.length<2?Gt($t,arguments[0]):Ut.apply(null,arguments)};var Zt={},Kt=function(){function t(t,e,n){void 0===e&&(e=Wt),void 0===n&&(n="ObservableMap@"+ee()),this.enhancer=e,this.name=n,this.$mobx=Zt,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new I(void 0,Ht,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(d(this)){var r=v(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,d(this)&&!(i=v(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=b(),r=y(this),i=r||n?{type:"delete",object:this,oldValue:this._data[t].value,name:t}:null;return n&&w(i),qt((function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data[t].setNewValue(void 0),e._data[t]=void 0})),r&&g(this,i),n&&S(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap[t];return n?n.setNewValue(e):n=this._hasMap[t]=new V(e,Ht,this.name+"."+t+"?",!1),n},t.prototype._updateValue=function(t,e){var n=this._data[t];if((e=n.prepareNewValue(e))!==B){var r=b(),i=y(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&w(o),n.setNewValue(e),i&&g(this,o),r&&S()}},t.prototype._addValue=function(t,e){var n=this;qt((function(){var r=n._data[t]=new V(e,n.enhancer,n.name+"."+t,!1);e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)}));var r=b(),i=y(this),o=i||r?{type:"add",object:this,name:t,newValue:e}:null;r&&w(o),i&&g(this,o),r&&S()},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 A(this._keys.slice())},t.prototype.values=function(){return A(this._keys.map(this.get,this))},t.prototype.entries=function(){var t=this;return A(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 Jt(t)&&(t=t.toJS()),qt((function(){fe(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&&ne("Cannot initialize map from "+t)})),this},t.prototype.clear=function(){var t=this;qt((function(){tn((function(){t.keys().forEach(t.delete,t)}))}))},t.prototype.replace=function(t){var e=this;return qt((function(){var n,r=fe(n=t)?Object.keys(n):Array.isArray(n)?n.map((function(t){return t[0]})):_e(n)?Array.from(n.keys()):Jt(n)?n.keys():ne("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 re(!0!==e,X("m033")),m(this,t)},t.prototype.intercept=function(t){return p(this,t)},t}();P(Kt.prototype,(function(){return this.entries()}));var Jt=be("ObservableMap",Kt),Qt=[];function te(){return"undefined"!=typeof window?window:r.g}function ee(){return++Pe.mobxGuid}function ne(t,e){throw re(!1,t,e),"X"}function re(t,e,n){if(!t)throw new Error("[mobx] Invariant failed: "+e+(n?" in '"+n+"'":""))}Object.freeze(Qt);var ie=[];function oe(t){return-1===ie.indexOf(t)&&(ie.push(t),console.error("[mobx] Deprecated: "+t),!0)}function ae(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var se=function(){};function ue(t){var e=[];return t.forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),e}function le(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 ce(t){return null!==t&&"object"==typeof t}function fe(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function he(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)pe(r,i)&&(t[i]=r[i])}return t}var de=Object.prototype.hasOwnProperty;function pe(t,e){return de.call(t,e)}function ve(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function ye(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function me(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}function ge(t,e){re(me(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function be(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return ce(t)&&!0===t[n]}}function _e(t){return void 0!==te().Map&&t instanceof te().Map}function we(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function xe(t){return null===t?null:"object"==typeof t?""+t:t}var Se,Te,Oe=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ae=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=[]},Pe=new Ae,Ee=!1,ke=!1,je=!1,Ce=te();function Re(t,e){if("object"==typeof t&&null!==t){if(z(t))return re(void 0===e,X("m036")),t.$mobx.atom;if(Jt(t)){var n=t;return void 0===e?Re(n._keys):(re(!!(r=n._data[e]||n._hasMap[e]),"the entry '"+e+"' does not exist in the observable map '"+Ie(t)+"'"),r)}var r;if(Q(t),e&&!t.$mobx&&t[e],Et(t))return e?(re(!!(r=t.$mobx.values[e]),"no observable property '"+e+"' found on the observable object '"+Ie(t)+"'"),r):ne("please specify a property");if(h(t)||mt(t)||dn(t))return t}else if("function"==typeof t&&dn(t.$mobx))return t.$mobx;return ne("Cannot obtain atom from "+t)}function De(t,e){return re(t,"Expecting some object"),void 0!==e?De(Re(t,e)):h(t)||mt(t)||dn(t)||Jt(t)?t:(Q(t),t.$mobx?t.$mobx:void re(!1,"Cannot obtain administration from "+t))}function Ie(t,e){return(void 0!==e?Re(t,e):Et(t)||Jt(t)?De(t):Re(t)).name}function Le(t,e){return Me(Re(t,e))}function Me(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=ue(t.observing).map(Me)),e}function Ne(t){var e={name:t.name};return function(t){return t.observers&&t.observers.length>0}(t)&&(e.observers=Ue(t).map(Ne)),e}function Ue(t){return t.observers}function Fe(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 ze(t,e){if(1===t.observers.length)t.observers.length=0,Be(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 Be(t){t.isPendingUnobservation||(t.isPendingUnobservation=!0,Pe.pendingUnobservations.push(t))}function Ve(){Pe.inBatch++}function Ge(){if(0==--Pe.inBatch){fn();for(var t=Pe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Pe.pendingUnobservations=[]}}function We(t){var e=Pe.trackingDerivation;null!==e?e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t):0===t.observers.length&&Be(t)}function Xe(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Te.BREAK){var n=[];He(Le(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 yt?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function He(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 He(t,e,n+1)})))}Ce.__mobxInstanceCount?(Ce.__mobxInstanceCount++,setTimeout((function(){Ee||ke||je||(je=!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)):Ce.__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"}(Se||(Se={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Te||(Te={}));var Ye=function(t){this.cause=t};function $e(t){return t instanceof Ye}function qe(t){switch(t.dependenciesState){case Se.UP_TO_DATE:return!1;case Se.NOT_TRACKING:case Se.STALE:return!0;case Se.POSSIBLY_STALE:for(var e=en(),n=t.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(mt(o)){try{o.get()}catch(t){return nn(e),!0}if(t.dependenciesState===Se.STALE)return nn(e),!0}}return rn(t),nn(e),!1}}function Ze(){return null!==Pe.trackingDerivation}function Ke(t){var e=t.observers.length>0;Pe.computationDepth>0&&e&&ne(X("m031")+t.name),!Pe.allowStateChanges&&e&&ne(X(Pe.strictMode?"m030a":"m030b")+t.name)}function Je(t,e,n){rn(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Pe.runId;var r,i=Pe.trackingDerivation;Pe.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new Ye(t)}return Pe.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Se.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&&ze(s,t),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Fe(s,t))}r!==Se.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function Qe(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)ze(e[n],t);t.dependenciesState=Se.NOT_TRACKING}function tn(t){var e=en(),n=t();return nn(e),n}function en(){var t=Pe.trackingDerivation;return Pe.trackingDerivation=null,t}function nn(t){Pe.trackingDerivation=t}function rn(t){if(t.dependenciesState!==Se.UP_TO_DATE){t.dependenciesState=Se.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Se.UP_TO_DATE}}function on(t){return console.log(t),t}function an(t){switch(t.length){case 0:return Pe.trackingDerivation;case 1:return Re(t[0]);case 2:return Re(t[0],t[1])}}var sn=function(){function t(t,e){void 0===t&&(t="Reaction@"+ee()),this.name=t,this.onInvalidate=e,this.observing=[],this.newObserving=[],this.dependenciesState=Se.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+ee(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Te.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Pe.pendingReactions.push(this),fn())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(Ve(),this._isScheduled=!1,qe(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&b()&&_({object:this,type:"scheduled-reaction"})),Ge())},t.prototype.track=function(t){Ve();var e,n=b();n&&(e=Date.now(),w({object:this,type:"reaction",fn:t})),this._isRunning=!0;var r=Je(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Qe(this),$e(r)&&this.reportExceptionInDerivation(r.cause),n&&S({time:Date.now()-e}),Ge()},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=X("m037");console.error(n||r,t),b()&&_({type:"error",message:n,error:t,object:this}),Pe.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ve(),Qe(this),Ge()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t.$mobx=this,t.onError=un,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.whyRun=function(){var t=ue(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 "+le(t)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+X("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=an(t);if(!r)return ne("'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===Te.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Te.BREAK:Te.LOG}(this,t)},t}();function un(t){re(this&&this.$mobx&&dn(this.$mobx),"Invalid `this`"),re(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=t}var ln=100,cn=function(t){return t()};function fn(){Pe.inBatch>0||Pe.isRunningReactions||cn(hn)}function hn(){Pe.isRunningReactions=!0;for(var t=Pe.pendingReactions,e=0;t.length>0;){++e===ln&&(console.error("Reaction doesn't converge to a stable state after "+ln+" 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()}Pe.isRunningReactions=!1}var dn=be("Reaction",sn);function pn(t){return K((function(e,n,r,i,o){re(void 0!==o,X("m009")),re("function"==typeof o.get,X("m010")),xt(bt(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 vn=pn(dt.default),yn=pn(dt.structural),mn=function(t,e,n){if("string"==typeof e)return vn.apply(null,arguments);re("function"==typeof t,X("m011")),re(arguments.length<3,X("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?dt.structural:dt.default;return new yt(t,r.context,i,r.name||t.name||"",r.setter)};function gn(t,e,n){function r(r){return e&&n.push([t,r]),r}if(void 0===e&&(e=!0),void 0===n&&(n=[]),kt(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(z(t)){var a=r([]),s=t.map((function(t){return gn(t,e,n)}));for(a.length=s.length,i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(Et(t)){for(var u in a=r({}),t)a[u]=gn(t[u],e,n);return a}if(Jt(t)){var l=r({});return t.forEach((function(t,r){return l[r]=gn(t,e,n)})),l}if(G(t))return gn(t.get(),e,n)}return t}mn.struct=yn,mn.equals=pn;var bn={allowStateChanges:function(t,e){var n,r=q(t);try{n=e()}finally{Z(r)}return n},deepEqual:ut,getAtom:Re,getDebugName:Ie,getDependencyTree:Le,getAdministration:De,getGlobalState:function(){return Pe},getObserverTree:function(t,e){return Ne(Re(t,e))},interceptReads:function(t,e,n){var r;if(Jt(t)||z(t)||G(t))r=De(t);else{if(!Et(t))return ne("Expected observable map, object or array as first array");if("string"!=typeof e)return ne("InterceptReads can only be used with a specific property, not with an object in general");r=De(t,e)}return void 0!==r.dehancer?ne("An intercept reader was already established"):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},isComputingDerivation:Ze,isSpyEnabled:b,onReactionError:function(t){return Pe.globalReactionErrorHandlers.push(t),function(){var e=Pe.globalReactionErrorHandlers.indexOf(t);e>=0&&Pe.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:U,resetGlobalState:function(){Pe.resetId++;var t=new Ae;for(var e in t)-1===Oe.indexOf(e)&&(Pe[e]=t[e]);Pe.allowStateChanges=!Pe.strictMode},isolateGlobalState:function(){ke=!0,te().__mobxInstanceCount--},shareGlobalState:function(){oe("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),Ee=!0;var t=te(),e=Pe;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?Pe=t.__mobxGlobal:t.__mobxGlobal=e},spyReport:_,spyReportEnd:S,spyReportStart:w,setReactionScheduler:function(t){var e=cn;cn=function(n){return t((function(){return e(n)}))}}},_n={Reaction:sn,untracked:tn,Atom:f,BaseAtom:c,useStrict:$,isStrictModeEnabled:function(){return Pe.strictMode},spy:T,comparer:dt,asReference:function(t){return oe("asReference is deprecated, use observable.ref instead"),zt.ref(t)},asFlat:function(t){return oe("asFlat is deprecated, use observable.shallow instead"),zt.shallow(t)},asStructure:function(t){return oe("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),zt.struct(t)},asMap:function(t){return oe("asMap is deprecated, use observable.map or observable.shallowMap instead"),zt.map(t||{})},isModifierDescriptor:Vt,isObservableObject:Et,isBoxedObservable:G,isObservableArray:z,ObservableMap:Kt,isObservableMap:Jt,map:function(t){return oe("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),zt.map(t)},transaction:qt,observable:zt,computed:mn,isObservable:kt,isComputed:function(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Et(t))return!1;if(!t.$mobx.values[e])return!1;var n=Re(t,e);return mt(n)}return mt(t)},extendObservable:Ct,extendShallowObservable:Rt,observe:function(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return De(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return De(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return De(t,e).intercept(n)}(t,e,n):function(t,e){return De(t).intercept(e)}(t,e)},autorun:pt,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@"+ee(),o=t,a=e,s=n),re(!1===ot(o),X("m006")),void 0===a&&(a=1),s&&(o=o.bind(s));var u=!1,l=new sn(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@"+ee(),o=t,a=e,s=n),pt(i,(function(t){if(o.call(s)){t.dispose();var e=en();a.call(s),nn(e)}}))},reaction:vt,action:rt,isAction:ot,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 re("function"==typeof i,X("m002")),re(0===i.length,X("m003")),re("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),Y(r,i,o,void 0)},expr:function(t,e){return Ze()||console.warn(X("m013")),mn(t,{context:e}).get()},toJS:gn,createTransformer:function(t,e){re("function"==typeof t&&t.length<2,"createTransformer expects a function that accepts one argument");var n={},r=Pe.resetId,i=function(r){function i(e,n){var i=r.call(this,(function(){return t(n)}),void 0,dt.default,"Transformer-"+t.name+"-"+e,void 0)||this;return i.sourceIdentifier=e,i.sourceObject=n,i}return l(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}(yt);return function(t){r!==Pe.resetId&&(n={},r=Pe.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&&ve(t,"$transformId",e=ee()),e}(t),o=n[e];return o?o.get():(o=n[e]=new i(e,t)).get()}},whyRun:function(t,e){return oe("`whyRun` is deprecated in favor of `trace`"),(t=an(arguments))?mt(t)||dn(t)?on(t.whyRun()):ne(X("m025")):on(X("m024"))},isArrayLike:function(t){return Array.isArray(t)||z(t)},extras:bn},wn=!1,xn=function(t){var e=_n[t];Object.defineProperty(_n,t,{get:function(){return wn||(wn=!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 Sn in _n)xn(Sn);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:T,extras:bn});var Tn=r(803),On=r.n(Tn),An={value:()=>{}};function Pn(){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 En(r)}function En(t){this._=t}function kn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function jn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=An,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}En.prototype=Pn.prototype={constructor:En,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]=jn(i[n],t.name,e);else if(null==e)for(n in i)i[n]=jn(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=kn(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new En(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 Cn=Pn;var Rn,Dn,In=0,Ln=0,Mn=0,Nn=1e3,Un=0,Fn=0,zn=0,Bn="object"==typeof performance&&performance.now?performance:Date,Vn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Gn(){return Fn||(Vn(Wn),Fn=Bn.now()+zn)}function Wn(){Fn=0}function Xn(){this._call=this._time=this._next=null}function Hn(t,e,n){var r=new Xn;return r.restart(t,e,n),r}function Yn(){Fn=(Un=Bn.now())+zn,In=Ln=0;try{!function(){Gn(),++In;for(var t,e=Rn;e;)(t=Fn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--In}()}finally{In=0,function(){for(var t,e,n=Rn,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:Rn=e);Dn=t,qn(r)}(),Fn=0}}function $n(){var t=Bn.now(),e=t-Un;e>Nn&&(zn-=e,Un=t)}function qn(t){In||(Ln&&(Ln=clearTimeout(Ln)),t-Fn>24?(t<1/0&&(Ln=setTimeout(Yn,t-Bn.now()-zn)),Mn&&(Mn=clearInterval(Mn))):(Mn||(Un=Bn.now(),Mn=setInterval($n,Nn)),In=1,Vn(Yn)))}Xn.prototype=Hn.prototype={constructor:Xn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Gn():+n)+(null==e?0:+e),this._next||Dn===this||(Dn?Dn._next=this:Rn=this,Dn=this),this._call=t,this._time=n,qn()},stop:function(){this._call&&(this._call=null,this._time=1/0,qn())}};const Zn=4294967296;function Kn(t){return t.x}function Jn(t){return t.y}var Qn=Math.PI*(3-Math.sqrt(5));function tr(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 er(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function nr(t){return t[0]}function rr(t){return t[1]}function ir(t,e,n){var r=new or(null==e?nr:e,null==n?rr:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function or(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 ar(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var sr=ir.prototype=or.prototype;function ur(t){return function(){return t}}function lr(t){return 1e-6*(t()-.5)}function cr(){var t,e,n,r,i,o=ur(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=ir(t,Kn,Jn).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=lr(n))*f),0===h&&(p+=(h=lr(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=lr(n))*f),0===h&&(p+=(h=lr(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:ur(+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 fr(t){return t.x+t.vx}function hr(t){return t.y+t.vy}function dr(t){return t.index}function pr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}sr.copy=function(){var t,e,n=new or(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=ar(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]=ar(e));return n},sr.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return tr(this.cover(e,n),e,n,t)},sr.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)tr(this,a[n],s[n],t[n]);return this},sr.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},sr.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},sr.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]]},sr.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 er(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 er(v[3],y,m,a,s),new er(v[2],i,m,y,s),new er(v[1],y,o,a,m),new er(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},sr.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)},sr.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},sr.root=function(){return this._root},sr.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},sr.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new er(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 er(n,l,c,o,a)),(n=u[2])&&s.push(new er(n,r,c,l,a)),(n=u[1])&&s.push(new er(n,l,i,o,c)),(n=u[0])&&s.push(new er(n,r,i,l,c))}return this},sr.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new er(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 er(o,a,s,c,f)),(o=i[1])&&n.push(new er(o,c,s,u,f)),(o=i[2])&&n.push(new er(o,a,f,c,l)),(o=i[3])&&n.push(new er(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},sr.x=function(t){return arguments.length?(this._x=t,this):this._x},sr.y=function(t){return arguments.length?(this._y=t,this):this._y};var vr=256,yr=4096,mr=25,gr="#ededed",br={position:"absolute",top:0,bottom:0,left:0,right:0},_r=function(){return window.devicePixelRatio||1};function wr(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 xr(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)?xr(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 xr(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 Sr=function(t){var n=new Map;return t.forEach((function(t){var e=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=n.get(l);c?c&&c.bundledRels.push({id:e,color:o||void 0,disabled:s||!1,width:a||1}):n.set(l,{bundledRels:[{id:e,color:o||void 0,disabled:s||!1,width:a||1}],key:l,from:r,to:i,color:o||void 0,disabled:s||!1,width:0})})),n.forEach((function(t){var n=(0,e.uniqBy)(t.bundledRels,"disabled"),r=1===n.length&&n[0].disabled,i=1===n.length&&!n[0].disabled;if(r)t.color=gr,t.width=1;else{var o=t.bundledRels.filter((function(t){return!t.disabled})),a=(0,e.uniqBy)(o,"color");i?(t.color=a.length>1?void 0:t.bundledRels[0].color,t.bundledRels.map((function(e){t.width+=e.width}))):(t.color=1===a.length?a[0].color:void 0,t.disabled=!1,t.bundledRels.map((function(e){t.width+=e.disabled?0:e.width})))}})),Array.from(n.values())},Tr=function(t){return"number"==typeof t.source||"number"==typeof t.target||"string"==typeof t.source||"string"==typeof t.target?45*devicePixelRatio:(t.source.size||mr)+(t.target.size||mr)+90*devicePixelRatio},Or=function(t){return(t.size?t.size:mr)+25*devicePixelRatio},Ar=function(){return-400*Math.pow(devicePixelRatio,2)},Pr=function(){return 2*Ar()};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)}function kr(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 jr(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 Cr(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,Rr(r.key),r)}}function Rr(t){var e=function(t,e){if("object"!=Er(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Er(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Er(e)?e:String(e)}var Dr="d3ForceLayout",Ir=function(t){return t?gn(t):t},Lr=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};var i=this.state,o=i.nodes,a=i.rels;o.addChannel(Dr),a.addChannel(Dr),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=Hn(f),l=Cn("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Zn)/Zn}();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*Qn;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",cr().strength(Ar)).force("centerX",function(t){var e,n,r,i=ur(.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=ur(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),a(),o):t},o}(0).strength(.03)).force("centerY",function(t){var e,n,r,i=ur(.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=ur(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),a(),o):t},o}(0).strength(.03)).alpha(1).alphaMin(.05).on("end",(function(){n.simulationStopped=!0,n.shouldUpdate=!1})).stop(),this.simulationStopped=!0,this.shouldUpdate=!0,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 n,r;return n=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[Dr],s=o.channels[Dr],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=Ir(a.removes);Object.keys(p).forEach((function(t){delete e.d3Nodes[t]}));var v=Ir(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?jr(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Rr(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)):jr(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=Sr(Ir(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(Dr),o.clearChannel(Dr),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,n,r){if(!(0,e.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=ir(e,fr,hr).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=lr(r))*v),0===y&&(m+=(y=lr(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=ur(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:ur(+e),u(),a):t},a}().radius(Or)),this.simulation.force("link",function(t){var e,n,r,i,o,a,s=dr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=ur(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||lr(a),d=f.y+f.vy-l.y-l.vy||lr(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=pr(f,u.source)),"object"!=typeof u.target&&(u.target=pr(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:ur(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:ur(+t),p(),f):l},f}(this.d3RelList).id((function(t){return t.id})).distance(Tr)),r){var i=0;this.simulation.force("charge",cr().strength(Pr));for(var o=performance.now();performance.now()-o<300&&i<200;)this.simulation.alpha(1),this.simulation.tick(1),i+=1;this.simulation.force("charge",cr().strength(Ar));for(var a=performance.now();performance.now()-a<100&&this.simulation.alpha()>=this.simulation.alphaMin();)this.simulation.tick(1);return this.computing=!1,void this.simulation.restart()}this.simulation.alpha(1).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 kr(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)?kr(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(Dr),this.state.rels.removeChannel(Dr),this.simulation.stop()}},{key:"setAlpha",value:function(t){this.simulation.alpha(t),this.simulation.restart(),this.simulation.shouldUpdate=!0}}],r&&Cr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Mr=r(880),Nr=r.n(Mr)().getLogger("NVL");const Ur=(t=>{var e={};return r.d(e,t),e})({createCoseBilkentLayoutWorker:()=>t.createCoseBilkentLayoutWorker,createHierarchicalLayoutWorker:()=>t.createHierarchicalLayoutWorker});function Fr(t){return Fr="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},Fr(t)}function zr(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 Br(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zr(Object(n),!0).forEach((function(e){Xr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Vr(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 Gr(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)?Gr(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 Gr(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 Wr(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,Hr(r.key),r)}}function Xr(t,e,n){return(e=Hr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hr(t){var e=function(t,e){if("object"!=Fr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:String(e)}var Yr=function(t,e,n){return t+(e-t)*function(t){return t*t*(3-2*t)}(n)},$r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Xr(this,"positions",void 0),Xr(this,"oldPositions",void 0),Xr(this,"startTime",void 0),Xr(this,"t",void 0),Xr(this,"currentT",void 0),Xr(this,"state",void 0),Xr(this,"shouldUpdateAnimator",void 0),Xr(this,"parents",void 0),Xr(this,"animationCompleteCallback",void 0),Xr(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=Vr(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=Br({},this.getPositionMapFromState())}},{key:"updateOldPositionFromState",value:function(){this.oldPositions=Br({},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=Vr(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];Boolean(a)&&a.x&&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=Vr(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=u.id,p=null!==(h=this.oldPositions[u.id])&&void 0!==h?h:Br({},o);void 0===p&&void 0!==n[d];)d=n[d],p=this.oldPositions[d];p.x=p.x||o.x,p.y=p.y||o.y,f.x=Yr(p.x,l.x,this.t),f.y=Yr(p.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}}])&&Wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qr(t){return qr="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},qr(t)}function Zr(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 Kr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zr(Object(n),!0).forEach((function(e){ui(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Jr(t){return function(t){if(Array.isArray(t))return ti(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Qr(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 Qr(t,e){if(t){if("string"==typeof t)return ti(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)?ti(t,e):void 0}}function ti(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 ei(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,li(r.key),r)}}function ni(t,e,n){return e=ai(e),function(t,e){if(e&&("object"===qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ii(t)}(t,ri()?Reflect.construct(e,n||[],ai(t).constructor):e.apply(t,n))}function ri(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ri=function(){return!!t})()}function ii(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oi(){return oi="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=ai(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}},oi.apply(this,arguments)}function ai(t){return ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ai(t)}function si(t,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},si(t,e)}function ui(t,e,n){return(e=li(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function li(t){var e=function(t,e){if("object"!=qr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qr(e)?e:String(e)}var ci=function(t){return void 0!==t?gn(t):t},fi=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),ui(ii(n=ni(this,e,[t])),"stateDisposers",void 0),ui(ii(n),"cytoCompleteCallback",void 0),ui(ii(n),"computing",void 0),ui(ii(n),"pendingLayoutData",void 0),ui(ii(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,Ur.createCoseBilkentLayoutWorker)(),n.worker.port.start(),n.setOptions(t),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&&si(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){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=ci(n),o=ci(r);(i.length>0||o.length>0)&&(this.updatePositionsFromState(),this.layout(i,o))}oi(ai(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(Jr(r),Jr(i)),spacingFactor:t.reduce((function(t,e){return t+(e.size||mr)}),0)/t.length*4.5/50*_r()};this.computing?this.pendingLayoutData=o:(this.computing=!0,this.worker.port.onmessage=function(t){var e,r,i=t.data.positions;if(n.computing){for(var o=0,a=Object.entries(i);o<a.length;o++){var s=(e=a[o],r=2,function(t){if(Array.isArray(t))return t}(e)||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}}(e,r)||Qr(e,r)||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.")}()),u=s[0],l=s[1];n.positions[u]=Kr({id:u},l)}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&&ei(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}($r),hi="undefined"!=typeof Float32Array?Float32Array:Array;function di(){var t=new hi(16);return hi!=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 pi=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},vi=r(792),yi=r.n(vi);function mi(t){return mi="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},mi(t)}function gi(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,bi(r.key),r)}}function bi(t){var e=function(t,e){if("object"!=mi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=mi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mi(e)?e:String(e)}var _i=function(){function t(e,n,r){var i=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);var o=e.createShader(e.FRAGMENT_SHADER);if(!e.isShader(o))throw new Error("Could not create shader object");var a=yi()(r,i);e.shaderSource(o,a),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)||Nr.info(e.getShaderInfoLog(o));var s=e.createShader(e.VERTEX_SHADER);if(!e.isShader(s))throw new Error("Could not create shader object");var u=yi()(n,i);if(e.shaderSource(s,u),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS)||Nr.info(e.getShaderInfoLog(s)),this._shaderProgram=e.createProgram(),e.attachShader(this._shaderProgram,o),e.attachShader(this._shaderProgram,s),e.linkProgram(this._shaderProgram),!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,n;return e=t,(n=[{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++),this._uniformInfo[e.name]=o}}},{key:"setUniform",value:function(t,e){var n=this._gl,r=this._uniformInfo[t];if(!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];n*=Float32Array.BYTES_PER_ELEMENT,r*=Float32Array.BYTES_PER_ELEMENT,i.enableVertexAttribArray(o.position),i.vertexAttribPointer(o.position,e,i.FLOAT,!1,r,n)}},{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)}}])&&gi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wi(t){return wi="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},wi(t)}function xi(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,Si(r.key),r)}}function Si(t){var e=function(t,e){if("object"!=wi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wi(e)?e:String(e)}function Ti(t){var e="function"==typeof Map?new Map:void 0;return Ti=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(Oi())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ai(i,n.prototype),i}(t,arguments,Pi(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ai(n,t)},Ti(t)}function Oi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Oi=function(){return!!t})()}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}function Pi(t){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(t)}var Ei=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=Pi(n=e),function(t,e){if(e&&("object"===wi(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,Oi()?Reflect.construct(n,r||[],Pi(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&&Ai(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&xi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Ti(Error));const ki="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 ji(t){return ji="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},ji(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,Ri(r.key),r)}}function Ri(t){var e=function(t,e){if("object"!=ji(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ji(e)?e:String(e)}var Di=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&&Ci(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ii=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 Li(t){return Li="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},Li(t)}function Mi(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 Ni(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)?Ni(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 Ni(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,Fi(r.key),r)}}function Fi(t){var e=function(t,e){if("object"!=Li(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Li(e)?e:String(e)}var zi="PhysLayout",Bi=new Float32Array(4),Vi=256,Gi=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}},Wi=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(Nr.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,vr,0,0,vr,vr,vr]);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,Vi,0,0,Vi,Vi,Vi]);o.bufferData(o.ARRAY_BUFFER,s,o.STATIC_DRAW),this._physProjection=di(),pi(this._physProjection,0,vr,vr,0,0,1e6),this._physSmallProjection=di(),pi(this._physSmallProjection,0,Vi,Vi,0,0,1e6),o.disable(o.DEPTH_TEST),this._gl=o,this._useReadpixelWorkaround&&this._setupReadpixelWorkaround(),this._setupUpdates(),this._averageNodeSize=mr,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(zi),l.addChannel(zi),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[zi];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=n._hasSizeChanged(i);(e||r||o)&&(n.shouldUpdate=!0,n._checkForUpdates())}var a=l.channels[zi];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=Gi(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this._nodeIdToIndex=n,this._nodeIndexToId=r,this._numNodes=t.nodes.length,this.solarMerger=new Di(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,vr,vr,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,Vi,Vi),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,vr,vr),e.drawArrays(e.TRIANGLE_STRIP,0,4),this._useReadpixelWorkaround?this._doReadpixelWorkaround():(e.bindFramebuffer(e.FRAMEBUFFER,this._getPhysData(0).frameBuffer),e.readPixels(0,0,vr,vr,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(){Nr.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=Mi(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=Mi(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=Mi(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){Bi[0]=o.x,Bi[1]=o.y,Bi[2]=0,Bi[3]=0;var s=a%vr,u=(a-s)/vr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,Bi),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,vr,vr,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=Gi(t.nodes).nodeIdToIndex,i=new Di(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=Gi(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,vr,vr,0,n.ALPHA,n.FLOAT,this._updateData),Nr.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,vr,vr),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,vr,vr,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,vr,vr,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(zi),this._state.rels.removeChannel(zi)}},{key:"_dumpTexture",value:function(t,e,n){var r=this._gl;Nr.info("--- Dumping texture ",n),r.bindFramebuffer(r.FRAMEBUFFER,t),r.readPixels(0,0,vr,vr,r.RGBA,r.FLOAT,this._physPositions);for(var i=0;i<e;i++)Nr.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:"_hasSizeChanged",value:function(){return Boolean((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t})))}},{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[zi].adds).length>0,a=Object.values(r.channels[zi].adds).length>0,s=Object.values(n.channels[zi].removes).length>0,u=Object.values(r.channels[zi].removes).length>0,l=Object.values(n.channels[zi].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[zi].adds,removes:n.channels[zi].removes}),t?(this.updateNodes(i.nodes),this.reheat(i,this.solarMerger)):l.length>0&&(this.updateNodes(l),this._hasSizeChanged(l)&&this.reheat(i,this.solarMerger)),n.clearChannel(zi),r.clearChannel(zi)}},{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 Ei(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(vr,yr);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&&(Nr.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)),Nr.trace("Vendor: ".concat(n)),Nr.trace("Renderer: ".concat(r));var i=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);Nr.trace("Line width range: ".concat(i));var o=t.getSupportedExtensions();Nr.trace("Extentions:"),o.length>0&&o.forEach((function(t){return Nr.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||mr);e[o]=this._adjustToGlSize(a),i+=a}this._averageNodeSize=r?i/r:mr;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,vr,vr,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,vr,vr,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,yr,yr,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=Ii({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=Ii({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,vr),h=this._newFramebuffer(t,f);this._physData.push({texture:f,frameBuffer:h})}this._physShader=new _i(t,ki,"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,Vi)}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,Vi),f=t._newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t._newTexture(e,n,Vi),t.levelsFinestIndexTexture[u]=t._newTexture(e,r,vr,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,Vi),this._apprxRepForceShader=new _i(e,ki,"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,vr,vr,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,vr,vr,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 _i(t,ki,"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 _i(t,ki,"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,vr,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,vr,vr),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,vr,vr,t.RGBA,t.UNSIGNED_BYTE,n.dataByte)}}},{key:"_definePhysicsArrays",value:function(){this._physData=[],this.levelsData=[],this.levelsClusterTexture=[],this.levelsFinestIndexTexture=[]}}],n&&Ui(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Xi(t){return Xi="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},Xi(t)}function Hi(t){return function(t){if(Array.isArray(t))return Yi(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 Yi(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)?Yi(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 Yi(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 $i(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,qi(r.key),r)}}function qi(t){var e=function(t,e){if("object"!=Xi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xi(e)?e:String(e)}var Zi="ForceCytoLayout",Ki="forceDirected",Ji="coseBilkent",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);var r=e.state,i=e.isCytoscapeEnabled;this.isCytoscapeEnabled=null==i||i,this._physLayout=new Wi(e),this._coseBilkentLayout=new fi({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===Ji&&setTimeout((function(){return n._setLayout(Ki,!1)}),50)}}),this._currentLayout=this._physLayout,this._currentLayoutType=Ki;var o=r.nodes,a=r.rels;o.addChannel(Zi),a.addChannel(Zi),this._state=r}var e,n;return e=t,n=[{key:"setOptions",value:function(t){t&&(this._currentLayout.setOptions(t),this.isCytoscapeEnabled=t.isCytoscapeEnabled)}},{key:"_getLayout",value:function(t){return t===Ji?this._coseBilkentLayout:this._physLayout}},{key:"_setLayout",value:function(t){if(t!==this._currentLayoutType){Nr.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[Zi],o=r.channels[Zi],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(Zi),r.clearChannel(Zi),this._currentLayoutType===Ki&&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(Hi(h),Hi(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(Hi(p),Hi(l)));if(d.size<=100&&v.size<=300){var y=function(t,e,n,r){var i,o=new Set(t),a=wr(new Set(e));try{for(a.s();!(i=a.n()).done;){var s=i.value,u=r.idToItem[s],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=wr(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];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],d[r]){var i,o=wr(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=wr(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=wr(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(Ji),this._currentLayout.update(!0,n.items,r.items)):x>0&&f.size/x>.25&&(this._setLayout(Ji),this._currentLayout.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(Ki),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&&$i(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,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 no(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(n),!0).forEach((function(e){ao(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ro(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 io(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)?io(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 io(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,so(r.key),r)}}function ao(t,e,n){return(e=so(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function so(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 uo="FreeLayout",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),ao(this,"state",void 0),ao(this,"positions",void 0),ao(this,"shouldUpdate",void 0),ao(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(uo),a.addChannel(uo),this.shouldUpdate=!0,this.setOptions(),this.layout(o.items,o.idToItem,o.idToPosition)}var n,r;return n=t,r=[{key:"setOptions",value:function(){}},{key:"updateNodes",value:function(t){var e,n=ro(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[uo].adds).length>0,o=Object.values(r.channels[uo].adds).length>0,a=Object.values(n.channels[uo].removes).length>0,s=Object.values(r.channels[uo].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(uo),r.clearChannel(uo)}this.shouldUpdate=!1}},{key:"layout",value:function(t,n,r){var i,o=void 0!==(i=t)?gn(i):i;if(!(0,e.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=ro(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=no({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(uo),this.state.rels.removeChannel(uo)}}],r&&oo(n.prototype,r),Object.defineProperty(n,"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){var r,i,o;r=t,i=e,o=n[e],(i=mo(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)):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,mo(r.key),r)}}function mo(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 go="GridLayout",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);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(e),this.layout(o.items,o.idToItem,o.idToPosition,a.items)}var n,r;return n=t,r=[{key:"setOptions",value:function(t){}},{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[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,r.items),n.idToPosition=this.positions),n.clearChannel(go),r.clearChannel(go)}this.shouldUpdate=!1}},{key:"layout",value:function(t,n,r,i){var o;if(t=(o=t)?gn(o):o,!(0,e.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]=ho({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{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(){this.shouldUpdate=!1}},{key:"destroy",value:function(){this.state.nodes.removeChannel(go),this.state.rels.removeChannel(go)}}],r&&yo(n.prototype,r),Object.defineProperty(n,"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,n){var r;return r=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)}(e),(e="symbol"==_o(r)?r:String(r))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xo="down",So=wo(wo(wo(wo({},"up","BT"),xo,"TB"),"left","RL"),"right","LR"),To="bin",Oo=[To,"stack"],Ao=["html"],Po=["html"],Eo=["captionHtml"];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){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 Co(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,Fo(r.key),r)}}function Ro(t,e,n){return e=Mo(e),function(t,e){if(e&&("object"===ko(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Io(t)}(t,Do()?Reflect.construct(e,n||[],Mo(t).constructor):e.apply(t,n))}function Do(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Do=function(){return!!t})()}function Io(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Lo(){return Lo="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=Mo(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}},Lo.apply(this,arguments)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}function No(t,e){return No=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},No(t,e)}function Uo(t,e,n){return(e=Fo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fo(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)}var zo="HierarchicalLayout",Bo=function(t){return void 0!==t?gn(t):t},Vo=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),Uo(Io(n=Ro(this,e,[t])),"direction",void 0),Uo(Io(n),"packing",void 0),Uo(Io(n),"stateDisposers",void 0),Uo(Io(n),"oldComputing",void 0),Uo(Io(n),"computing",void 0),Uo(Io(n),"pendingLayoutData",void 0),Uo(Io(n),"worker",void 0),Uo(Io(n),"directionChanged",void 0),Uo(Io(n),"packingChanged",void 0),n.direction=xo,n.packing=To;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(zo),o.addChannel(zo),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[zo],e=Object.values(t.adds).length>0,r=Object.values(t.removes).length>0,a=function(){return Boolean((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t})))}(Object.values(t.updates));n.shouldUpdate=n.shouldUpdate||e||r||a}if(void 0!==o.version){var s=o.channels[zo],u=Object.values(s.adds).length>0,l=Object.values(s.removes).length>0;n.shouldUpdate=n.shouldUpdate||u||l}}))],n.shouldUpdate=!0,n.oldComputing=!1,n.computing=!1,n.pendingLayoutData=null,n.worker=(0,Ur.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&&No(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){if(void 0!==t){var e=t.direction,n=void 0===e?xo:e,r=t.packing,i=void 0===r?To:r;Object.keys(So).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),Oo.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[zo].adds).length>0,u=Object.values(i.channels[zo].adds).length>0,l=Object.values(r.channels[zo].removes).length>0,c=Object.values(i.channels[zo].removes).length>0,f=function(){return Boolean((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((function(t){return"size"in t})))}(Object.values(r.channels[zo].updates));(t||s||u||l||c||o||a||f)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(zo),i.clearChannel(zo),this.directionChanged=!1,this.packingChanged=!1}Lo(Mo(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=Bo(t).map((function(t){return t.html,jo(t,Ao)})),a=Bo(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,jo(e,Po));s[t]=n}));var u=Bo(r).map((function(t){return t.captionHtml,jo(t,Eo)})),l=Bo(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(zo),null===(e=this.state.rels)||void 0===e||e.clearChannel(zo)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(zo),this.state.rels.removeChannel(zo),this.worker.port.close()}}],r&&Co(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}($r),Go=r(269),Wo=r.n(Go);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 Ho(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 Yo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ho(Object(n),!0).forEach((function(e){var r,i,o,a;r=t,i=e,o=n[e],a=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)}(i),(i="symbol"==Xo(a)?a:String(a))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)):Ho(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $o=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=2*e;return{centerX:(n.minX+n.maxX)/2,centerY:(n.minY+n.maxY)/2,nodesWidth:n.maxX-n.minX+i,nodesHeight:n.maxY-n.minY+i}},qo=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}},Zo=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=.9*Math.min(t,e);return Math.min(r,Math.max(n,i))},Ko=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},Jo=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]:Yo({},t),e[1]=t.y<e[1].y?e[1]:Yo({},t),e[2]=t.x<e[2].x?Yo({},t):e[2],e[3]=t.y<e[3].y?Yo({},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=e.height<=e.width?e.height-o:e.width-o;return i>a?.9*a/i:.9*i/a}(t,r,25),Ko(i,o,Math.min(e,a),n)):Ko(i,o,e,n)};function Qo(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 ta(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)?ta(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 ta(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 ea(t){this.channels[t]={adds:{},updates:{},removes:{}}}function na(t){delete this.channels[t]}function ra(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var ia=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function oa(t,n){var r,i=!1,o=Qo(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,e.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=ia(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!==n&&(n.added=!0))}function aa(t,e){var n,r=!1,i=Qo(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=ia(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 sa(t,e){var n,r=!1,i=Qo(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 ua(t){var e,n=Qo(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 la(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var ca=function(){return{idToItem:zt.shallow({}),items:zt.shallow([]),channels:zt.shallow({}),idToPosition:zt.shallow({}),idToHtmlOverlay:zt.shallow({}),version:0,addChannel:rt(ea),removeChannel:rt(na),clearChannel:rt(ra),add:rt(oa),update:rt(aa),remove:rt(sa),updatePositions:rt(ua),updateHtmlOverlay:rt(la)}};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 ha(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 da(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ha(Object(n),!0).forEach((function(e){var r,i,o,a;r=t,i=e,o=n[e],a=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)}(i),(i="symbol"==fa(a)?a:String(a))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)):ha(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var pa={rings:[{widthFactor:.05,color:"#fff"},{widthFactor:.1,color:"#45bff8"}],shadow:{width:10,opacity:1,color:"#bbb"}},va={rings:[]},ya=.75,ma="forceDirected",ga="hierarchical",ba="grid",_a="free",wa="d3Force",xa="webgl",Sa="canvas";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){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,Pa(r.key),r)}}function Aa(t,e,n){return(e=Pa(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pa(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 Ea=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Aa(this,"elementId",void 0),Aa(this,"currentValue",void 0),Aa(this,"startValue",void 0),Aa(this,"currentTime",void 0),Aa(this,"duration",void 0),Aa(this,"status",void 0),Aa(this,"endValue",void 0),Aa(this,"startTime",void 0),Aa(this,"endTime",void 0),Aa(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)}}])&&Oa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ka(t){return ka="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},ka(t)}function ja(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 Ca(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ja(Object(n),!0).forEach((function(e){Da(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ja(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ra(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 Da(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"!=ka(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ka(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ka(e)?e:String(e)}var La=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Da(this,"animations",void 0),Da(this,"durations",void 0),Da(this,"defaultDuration",void 0),Da(this,"hasNextAnimation",void 0),Da(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 Ea(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Ca(Ca({},o),{},Da({},n,i))),i}},{key:"getById",value:function(t){return this.animations.get(t)}},{key:"createFadeAnimation",value:function(t,e,n){var r=this.createAnimation(t,e,n);return r.setDuration(this.durations[0]||this.defaultDuration),r}},{key:"createSizeAnimation",value:function(t,e,n){var r=this.createAnimation(t,e,n);return r.setDuration(this.durations[1]||this.defaultDuration),r}}],n&&Ra(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ma(t){return Ma="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},Ma(t)}function Na(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,Ua(r.key),r)}}function Ua(t){var e=function(t,e){if("object"!=Ma(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ma(e)?e:String(e)}var Fa=64,za=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=Ua(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:"getOrCreateEntry",value:function(t){var e=this.cache[t];return void 0===e&&(e={},this.cache[t]=e),e}},{key:"invertCanvas",value:function(t){for(var e=t.getImageData(0,0,Fa,Fa),n=e.data,r=0;r<4096;r++)n[4*r+0]=255-n[4*r+0],n[4*r+1]=255-n[4*r+1],n[4*r+2]=255-n[4*r+2],n[4*r+3]=n[4*r+3];t.putImageData(e,0,0)}},{key:"loadImage",value:function(t){var e=document.createElement("canvas");e.width=Fa,e.height=Fa;var n=document.createElement("img");return n.src=t,{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");i.drawImage(n,0,0,Fa,Fa),e&&this.invertCanvas(i),t.drawn=!0}}},{key:"getImage",value:function(t,e){var 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}}],n&&Na(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const Ba=za;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){(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 Wa(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,Ha(r.key),r)}}function Xa(t,e,n){return(e=Ha(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ha(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 Ya=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),Xa(this,"key",void 0),Xa(this,"rels",void 0),Xa(this,"waypointPath",void 0),Xa(this,"selfReferring",void 0),Xa(this,"fromId",void 0),Xa(this,"toId",void 0),Xa(this,"angles",void 0),Xa(this,"labelInfo",void 0),this.key=e,this.rels=[],this.selfReferring=n===r,this.fromId=n,this.toId=r,this.labelInfo={},this.angles=[]}var n,r;return n=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 Ga(t)}(t=this.rels.map((function(t){var n=t.rel;return(0,e.isNumber)(n.captionSize)?n.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 Ga(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)?Ga(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&&Wa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),$a="#848484",qa=2*Math.PI/50,Za=.1*Math.PI,Ka="white",Ja="#45bff8",Qa="#bbb",ts=gr;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){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 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))||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 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"!=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 ss=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},us=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},ls=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),os(this,"bundles",void 0),os(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 Ya(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=ns(u);try{for(f.s();!(l=f.n()).done;)for(var h=l.value,d=t[h.fromId],p=t[h.toId],v=qa*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*qa)}catch(t){f.e(t)}finally{f.f()}var g=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),b=ss(g);us(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&&is(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function cs(t){return cs="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},cs(t)}function fs(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 hs(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,ps(r.key),r)}}function ds(t,e,n){return(e=ps(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ps(t){var e=function(t,e){if("object"!=cs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=cs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cs(e)?e:String(e)}var vs=function(t,n){return(0,e.isFinite)(t.x)&&(0,e.isFinite)(t.y)&&(0,e.isFinite)(n.x)&&(0,e.isFinite)(n.y)},ys=function(t,e){if(!t||!e||!vs(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},ms=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ds(this,"p1",void 0),ds(this,"p2",void 0),ds(this,"unit",void 0),ds(this,"norm",void 0),ds(this,"length",void 0),ds(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&&hs(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),gs=function(t,n,r){var i={x:n.x-t.x,y:n.y-t.y},o=function(t,n){var r=(t.x*n.x+t.y*n.y)/(n.x*n.x+n.y*n.y);return(0,e.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)},bs=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}},_s=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?fs(Object(n),!0).forEach((function(e){ds(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fs(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=gs(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function ws(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 xs=[[.04,1],[100,2]],Ss=[[.8,1.1],[3,1.6],[8,2.5]],Ts=[[Ss[0][0],1],[100,1.25]],Os=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=Wo().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},As=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()},Ps=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}))},Es=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},ks=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,Es(t,e,n,i),t.fill(),t.closePath()};function js(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Cs=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 ws(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 ws(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)?ws(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}))},Rs=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Ds=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Is=function(t,e){return{x:t.x*e,y:t.y*e}},Ls=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Ds(t,e))},Ms=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};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 Us(t){return function(t){if(Array.isArray(t))return Vs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bs(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 Fs(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?Fs(Object(n),!0).forEach((function(e){var r,i,o,a;r=t,i=e,o=n[e],a=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)}(i),(i="symbol"==Ns(a)?a:String(a))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)):Fs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bs(t,e){if(t){if("string"==typeof t)return Vs(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)?Vs(t,e):void 0}}function Vs(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 Gs=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},Ws=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())&&Gs(e)&&!Gs(n)},Xs=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(Ws(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},Hs=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===Ss[1][1]?l=3:a===Ss[2][1]&&(l=4);for(var c=a<Ss[2][1]?["",""]:[""],f=o?c.length:0,h=function(t,e){return function(t,e,n,r){var i=.98*n,o=.89*n,a=.95*n;return 1===e?i:2===e?a:3!==e?4!==e?5!==e?i:0===t||4===t?.65*n:1===t||3===t?o:a:0===t||3===t?.78*n:a:0===t||2===t?o: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=Bs(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=Xs(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=Xs(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)},Ys=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(Us(t),[zs(zs({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:Us(null!==(o=e.styles)&&void 0!==o?o:[]):Us(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat(Us(t),Us(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function $s(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 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}}(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 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 Zs=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 ms(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},Ks=function(t){var e=_r(),n=t.selected?4:0;return((t.size||mr)+4+n)*e},Js=function(t){var e=_r();t.shadowColor=Qa,t.shadowBlur=18*e,t.shadowOffsetX=0*e,t.shadowOffsetY=0*e},Qs=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},tu=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=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=_r(),l=t.size(),c=l>1,f=t.relIsOppositeDirection(o),h=f?n:e,d=f?e:n,p=t.waypointPath,v=null==p?void 0:p.points,y=null==p?void 0:p.from,m=null==p?void 0:p.to,g=ys(h,y)&&ys(d,m)||ys(d,y)&&ys(h,m),b=g?v[1]:null,_=g?v[v.length-2]:null,w=Ks(h),x=Ks(d),S=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},T=Math.max(Math.PI,2*Math.PI/(l/2)),O=c?r*T*(a?1:-1)/(h.size||mr):0,A=S(g?b:d,h),P=g?S(d,_):A,E=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)}},k=function(t,e){return E(h,A+t,e,!1)},j=function(t,e){return E(d,P-t,e,!0)},C=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))*u},D=k(O,w),I=j(O,x),L=c?k(0,w):null,M=c?j(0,x):null,N=200*u,U=[];if(g){var F=R(D,b)<N;if(c&&!F){var z=C(L,b);U.push(new ms(D,z)),U.push(new ms(z,b))}else U.push(new ms(D,b));for(var B=2;B<v.length-1;B++)U.push(new ms(v[B-1],v[B]));var V=R(I,_)<N;if(c&&!V){var G=C(M,_);U.push(new ms(_,G)),U.push(new ms(G,I))}else U.push(new ms(_,I))}else{var W=c?R(L,M):0;if(c&&W>2*(30*u+Math.min(w,x)))if(s){var X=Zs(h,d,w,x,o,t);U.push(new ms(D,X)),U.push(new ms(X,I))}else{var H=r*i,Y=30+w,$=Math.sqrt(Y*Y+H*H),q=30+x,Z=Math.sqrt(q*q+H*H),K=k(0,$),J=j(0,Z);U.push(new ms(D,K)),U.push(new ms(K,J)),U.push(new ms(J,I))}else if(W>(w+x)/2){var Q=Zs(h,d,w,x,o,t);U.push(new ms(D,Q)),U.push(new ms(Q,I))}else U.push(new ms(D,I))}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 _=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=Rs(w.p1,Is(S,v/2)),A=Rs(w.p2,Is(S,v/2)),P=Rs(x.p1,Is(T,v/2)),E=Rs(x.p2,Is(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=bs(O,A,P,E));var j=null!==k?Ds(k,w.p2):Is(S,v/2);m.push(Rs(w.p2,Is(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},eu=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,_=f.length>0?null===(a=Ys(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==_){var w=v?"#DDDDDD":"#848484",x=6*b*u,S=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=(p||1)*(l?1.5:1),P=O(T);if(P>r){var E=Xs(T,O,(function(){return r}),1,!1)[0];T=E.hasEllipsisChar?"".concat(E.text,"..."):T,P=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-Math.PI/2),t.translate(2*x,0),t.rotate(-Math.PI/2)):t.rotate(n);var k=(1+b)*u,j="bottom"===m?x/2+A+k:-(A+k);t.fillText(T,-P/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)}},nu=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()},ru=function(t,e,n){var r,i=n.indexOf(t),o=null!==(r=n.angles[i])&&void 0!==r?r:0,a=o-Za/2,s=o+Za/2,u=t.width||1,l=_r(),c=Ks(e),f={x:e.x+Math.cos(a)*(c+u/2),y:e.y+Math.sin(a)*(c+u/2)},h={x:e.x+Math.cos(s)*(c+u/2),y:e.y+Math.sin(s)*(c+u/2)},d={x:e.x+Math.cos(o)*(c+35*l),y:e.y+Math.sin(o)*(c+35*l)};return{startAngle:a,endAngle:s,startPoint:f,endPoint:h,apexPoint:d,control1Point:{x:d.x+25*Math.cos(o-Math.PI/2)*l/2,y:d.y+25*Math.sin(o-Math.PI/2)*l/2},control2Point:{x:d.x+25*Math.cos(o+Math.PI/2)*l/2,y:d.y+25*Math.sin(o+Math.PI/2)*l/2}}},iu=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()},ou=function(t,e,n,r,i,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];vs(n,r)&&(n.id===r.id?function(t,e,n,r,i){var o=ru(e,n,r),a=o.startPoint,s=o.endPoint,u=o.apexPoint,l=o.control1Point,c=o.control2Point,f=_r(),h=(e.width||1)*f,d=h>1?h/2:1,p=2*f,v=9*d,y=2*d,m=7*d,g=Math.atan2(s.y-c.y,s.x-c.x),b=e.selected?p*Math.sqrt(1+2*v/m*(2*v/m)):0,_={x:s.x-Math.cos(g)*(.5*v-y+b),y:s.y-Math.sin(g)*(.5*v-y+b)},w={headPosition:{x:s.x+Math.cos(g)*(.5*v-y-b),y:s.y+Math.sin(g)*(.5*v-y-b)},headAngle:g,headHeight:v,headChinHeight:y,headWidth:m};t.save(),t.lineCap="round",e.selected&&(Js(t),t.lineWidth=h+2*p,t.strokeStyle=Ja,iu(t,a,_,u,l,c),As(t,2*p,Ja,w,!1,!0),Qs(t),t.lineWidth=h+p,t.strokeStyle=Ka,iu(t,a,_,u,l,c),As(t,p,Ka,w,!1,!0)),t.lineWidth=h,e.hovered&&!e.selected&&!e.disabled&&(Js(t),t.strokeStyle=Qa,t.fillStyle=Qa,iu(t,a,_,u,l,c),As(t,h,Qa,w),Qs(t));var x=e.disabled?ts:e.color||$a;if(t.fillStyle=x,t.strokeStyle=x,iu(t,a,_,u,l,c),As(t,h,x,w),i){var S,T=r.indexOf(e),O=null!==(S=r.angles[T])&&void 0!==S?S:0,A=(O+Math.PI/2)%(2*Math.PI),P=(O+2*Math.PI)%(2*Math.PI)<Math.PI,E=u.x-Math.cos(g)*(b/4),k=u.y-Math.sin(g)*(b/4);eu(t,{x:E,y:k},A,40*f,e,r,P)}t.restore()}(t,e,n,i,o):function(t,e,n,r,i,o,a){var s=tu(e,i,n,r,o,a),u=_r(),l=function(t){var e=t.selected?1.5:1;return(t.width||1)*e*_r()}(e),c=e.disabled?ts:e.color||$a,f=2*u,h=u*(e.width>1?e.width/2:1),d=9*h,p=2*h,v=7*h,y=Ls(s[s.length-2],s[s.length-1]),m=e.selected?f*Math.sqrt(1+2*d/v*(2*d/v)):0,g=2-m,b=Math.floor(s.length/2);s.length>2&&e.selected&&y<d+m-p&&(g+=y,m-=y/2+p,s.pop(),b=Math.floor(s.length/2));var _,w,x=s[s.length-2],S=s[s.length-1],T=(_=x,w=S,Math.atan2(w.y-_.y,w.x-_.x));s[s.length-1]={x:S.x-Math.cos(T)*(d/2+m),y:S.y-Math.sin(T)*(d/2+m)};var O,A={headPosition:{x:S.x+Math.cos(T)*g,y:S.y+Math.sin(T)*g},headAngle:T,headHeight:d,headChinHeight:p,headWidth:v},P=$s(s);try{for(P.s();!(O=P.n()).done;){var E=O.value;E.x=Math.round(E.x),E.y=Math.round(E.y)}}catch(t){P.e(t)}finally{P.f()}if(t.save(),e.selected){var k=Math.atan2(s[1].y-s[0].y,s[1].x-s[0].x),j=Ms(k,1.5*f);s[0]=Rs(s[0],j),Js(t);var C=2*f;nu(t,s,l+C,Ja,a),As(t,C,Ja,A,!1,!0),Qs(t),nu(t,s,l+f,Ka,a),As(t,f,Ka,A,!1,!0)}if(e.hovered&&!e.selected&&!e.disabled&&(Js(t),nu(t,s,l,Qa,a),As(t,l,Qa,A),Qs(t)),nu(t,s,l,c,a),As(t,l,c,A),o){var R,D,I,L,M,N=n.x>r.x,U=s[b];1==(1&s.length)?(L=s[N?b+1:b-1],M=s[N?b-1:b+1],a?(R=(U.x+(L.x+M.x)/2)/2,D=(U.y+(L.y+M.y)/2)/2,I=N?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Ls(U,L)>Ls(U,M)?M=U:L=U,R=(L.x+M.x)/2,D=(L.y+M.y)/2,I=Math.atan2(M.y-L.y,M.x-L.x))):(L=s[N?b:b-1],M=s[N?b-1:b],R=(L.x+M.x)/2,D=(L.y+M.y)/2,I=Math.atan2(M.y-L.y,M.x-L.x));var F=Ls(L,M);if(e.selected){var z=Ms(I+Math.PI/2,1.5*f),B="bottom"===e.captionAlign?1:-1;R+=B*z.x,D+=B*z.y}eu(t,{x:R,y:D},I,F,e,i)}t.restore()}(t,e,n,r,i,o,a))},au=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 vs(n,r)?n.id===r.id?function(t,e,n){for(var r=ru(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=$s(tu(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=r(4),uu=r.n(su),lu=function(t){return t&&"light"===uu()(t)?"#000":"#fff"};function cu(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 fu(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)?fu(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 fu(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 hu=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?mr:o;return{top:i-a,left:n-a,right:n+a,bottom:i+a}},du=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?mr: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=i.selected,P=_r(),E=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=cu(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||mr)*i*_r();return{width:e.getValueForAnimationName(t.id,"ring-".concat(r),a),color:o}}))}(e,r,i),k=E.reduce((function(t,e){return t+e.width}),0),j=A.shadow.width*P,C=A.shadow.opacity,R=A.shadow.color,D=f*P,I=2*D,L=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:js(i,xs),fontInfoLevel:js(i,Ss),iconInfoLevel:js(i,Ts)}}(D,o),M=L.nodeInfoLevel,N=L.fontInfoLevel,U=L.iconInfoLevel,F=e.color||"#478BFF",z=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:mr)/({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}(N,D,b,Boolean(O)),B=lu(F),V=D,G=V,W=Boolean(d.length),X=Boolean(v.length),H=Boolean(O);if(k>0&&(V=D+k),_)F="#EDEDED",B="#DDDDDD";else{if(w){var Y=Date.now()%1e3/1e3,$=Y<.7?Y/.7:0,q=Os(F,.4-.4*$);ks(t,s,l,q,D+.88*D*$)}var Z=x||S?j:0,K=r.getValueForAnimationName(T,"shadowWidth",Z);K>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,Os(r,.5*a)),u.addColorStop(.05,Os(r,.5*a)),u.addColorStop(.5,Os(r,.12*a)),u.addColorStop(.75,Os(r,.03*a)),u.addColorStop(1,Os(r,0)),t.fillStyle=u,Es(t,e,n,s),t.fill()}(t,s,l,R,V,K,C)}if(ks(t,s,l,F,D),H){var J=M<2||!(W||X),Q=M>0?1:0,tt=J?1*D:.75*D;tt/=U;var et=J?.5*tt:tt*(1===U?"center"===m?1.3:"bottom"===m||J?1.1:0:"center"===m?1.35:"bottom"===m||J?1.1:0),nt=tt/2;tt=r.getValueForAnimationName(T,"iconSize",tt),nt=r.getValueForAnimationName(T,"iconXPos",nt),et=r.getValueForAnimationName(T,"iconYPos",et),t.save();var rt=_?.1:Q;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",rt);var it="#fff"===B,ot=n.getImage(O,it);t.drawImage(ot,s-nt,l-et,Math.floor(tt),Math.floor(tt)),t.restore()}var at=M<2?0:1,st=r.getValueForAnimationName(T,"textOpacity",at,0),ut=Os(B,st),lt='"Open Sans", sans-serif';if(W&&st>0){var ct=Hs(t,d,lt,z,.7*I,H,N,null==e||e.captionAlign);t.fillStyle=ut,t.font="normal ".concat(z,"px ").concat(lt);var ft=1+z,ht=-(ct.length-2)*ft/2,dt=d.split("").map((function(t){return[]}));Cs(t,ct,dt,ht,z,lt,ft,s,l)}if(X){var pt=M<2?0:1,vt=r.getValueForAnimationName(T,"textOpacity",pt,0),yt=Os(B,vt),mt='"Open Sans", sans-serif',gt=Boolean(O);if(vt>0){var bt=Ys(v),_t=bt.stylesPerChar,wt=bt.fullCaption,xt="center"===m?.7*I:2*Math.sqrt(Math.pow(I/2,2)-Math.pow(I/3,2)),St=Hs(t,wt,mt,z,xt,gt,N,null==e||e.captionAlign);t.fillStyle=yt;var Tt,Ot=z,At=-(St.length-2)*Ot/2;Tt=m&&"center"!==m?"bottom"===m?At+D/Math.PI:At-D/Math.PI:At,Cs(t,St,_t,Tt,z,mt,Ot,s,l)}}k>0&&Ps(t,s,l,G,E),t.save(),t.restore()};function pu(t){return pu="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},pu(t)}function vu(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 yu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vu(Object(n),!0).forEach((function(e){_u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mu(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 gu(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)?gu(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 gu(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 bu(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,wu(r.key),r)}}function _u(t,e,n){return(e=wu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wu(t){var e=function(t,e){if("object"!=pu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pu(e)?e:String(e)}var xu="canvasRenderer",Su=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),_u(this,"arrowBundler",void 0),_u(this,"activeNodes",void 0),_u(this,"canvas",void 0),_u(this,"context",void 0),_u(this,"state",void 0),_u(this,"stateDisposers",void 0),_u(this,"relationshipThreshold",void 0),_u(this,"animationHandler",void 0),_u(this,"imageCache",void 0),_u(this,"needsRun",void 0),_u(this,"nodeVersion",void 0),_u(this,"relVersion",void 0),_u(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(xu),r.rels.addChannel(xu),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new La,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new ls(r.rels.items,r.waypoints.data),this.imageCache=new Ba,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[xu],r=t.rels.channels[xu],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(xu)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(xu),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!==ga);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=mu(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=yu(yu({},p[m.from]),v[m.from]),_=yu(yu({},p[m.to]),v[m.to]),w=t||f>l||void 0!==m.captionHtml,x=au(m,g,b,_,w,c!==ga);if(null!==x){var S,T,O,A,P,E,k=this.isBoundingBoxOffScreen(x,e,n),j=Ls({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!==(P=b.size)&&void 0!==P?P:mr)+(null!==(E=_.size)&&void 0!==E?E:mr))*devicePixelRatio,R=b.id!==_.id&&C>j;k||R||(!0===m.disabled?o.push(yu(yu({},m),{},{fromNode:b,toNode:_,showLabel:w})):!0===m.selected?i.push(yu(yu({},m),{},{fromNode:b,toNode:_,showLabel:w})):a.push(yu(yu({},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=mu(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=hu(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(yu({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(yu({},f)):a.push(yu({},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=mu(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;du(e,yu(yu({},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=mu(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.arrowBundler.getBundle(o),s=o.fromNode,u=o.toNode,l=o.showLabel;ou(e,o,s,u,a,l,n)}}catch(t){i.e(t)}finally{i.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=mu(o);try{var l=function(){var i=e.value,o=i.id,u=i.size,l=void 0===u?mr: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=mu(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(!vs(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=ru(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=_s(o,s,u,t),f=_s(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=tu(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=_s(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=gs(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!==ga);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(xu),this.state.rels.removeChannel(xu)}},{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&&bu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Tu=function(t,n){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,n){if((0,e.isNil)(t)||(0,e.isNil)(n))return{offsetX:0,offsetY:0};var r=n.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,n);return{x:i+a.offsetX/r,y:o+a.offsetY/r}};function Ou(t){return Ou="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},Ou(t)}function Au(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pu(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,ju(r.key),r)}}function Eu(t,e,n){return e&&Pu(t.prototype,e),n&&Pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ku(t,e,n){return(e=ju(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ju(t){var e=function(t,e){if("object"!=Ou(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ou(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ou(e)?e:String(e)}var Cu="WebGLRenderer",Ru=function(){function t(e){var n=this;if(Au(this,t),ku(this,"mainSceneRenderer",void 0),ku(this,"minimapRenderer",void 0),ku(this,"needsRun",void 0),ku(this,"minimapMouseDown",void 0),ku(this,"stateDisposers",void 0),ku(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(Cu),s.addChannel(Cu),this.state=r,this.setupMinimapInteractions()}return Eu(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[Cu].adds).length>0,r=Object.values(e.channels[Cu].adds).length>0,i=Object.values(t.channels[Cu].removes).length>0,o=Object.values(e.channels[Cu].removes).length>0,a=Object.values(t.channels[Cu].updates),s=Object.values(e.channels[Cu].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(Cu),e.clearChannel(Cu)}},{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=Tu(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 n=this.state,r=this.mainSceneRenderer;n.setZoom(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,e.isNil)(t)||isNaN(t.deltaY)?n:n-t.deltaY/500*Math.min(1,n)}(t,n.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(Cu),this.state.rels.removeChannel(Cu),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),Du=function(){function t(){Au(this,t),ku(this,"mainSceneRenderer",void 0),ku(this,"minimapRenderer",void 0),ku(this,"needsRun",void 0),ku(this,"minimapMouseDown",void 0),ku(this,"stateDisposers",void 0),ku(this,"state",void 0)}return Eu(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 Iu(t){return Iu="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},Iu(t)}function Lu(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 Mu(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)?Mu(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 Mu(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 Uu(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"!=Iu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Iu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Iu(e)?e:String(e)}var zu,Bu=24,Vu=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=Wo().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},Gu=function(){function t(e,n,r,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Uu(this,"nodeShader",void 0),Uu(this,"nodeAnimShader",void 0),Uu(this,"relShader",void 0),Uu(this,"relDataBuffer",void 0),Uu(this,"viewportBoxShader",void 0),Uu(this,"defaultRelColor",void 0),Uu(this,"defaultNodeColor",void 0),Uu(this,"disableRelColor",void 0),Uu(this,"disableNodeColor",void 0),Uu(this,"gl",void 0),Uu(this,"activeNodes",void 0),Uu(this,"canvas",void 0),Uu(this,"projection",void 0),Uu(this,"idToIndex",void 0),Uu(this,"posBuffer",void 0),Uu(this,"numRels",void 0),Uu(this,"numNodes",void 0),Uu(this,"nodeDataByte",void 0),Uu(this,"relIdToIndex",void 0),Uu(this,"relData",void 0),Uu(this,"containerWidth",void 0),Uu(this,"containerHeight",void 0),Uu(this,"nodeDataInt",void 0),Uu(this,"viewportBoxBuffer",void 0),Uu(this,"relBuffer",void 0),Uu(this,"nodeBuffer",void 0),Uu(this,"posTexture",void 0),void 0===e.getExtension("OES_texture_float"))throw new Error("Renderer needs floating point texture support");this.nodeShader=new _i(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 _i(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 _i(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 _i(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=di(),this.setData({nodes:n.items,rels:r.items}),this.createPositionTexture(),this.setupViewportRendering()}var e,n;return e=t,n=[{key:"setShaderUniforms",value:function(t){var e,n,r=Wo().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=Wo().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=Sr(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=Lu(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,vr,vr,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,n=this.gl,r=this.idToIndex,i=this.disableNodeColor,o=this.nodeBuffer,a=this.nodeDataByte,s=!1,u=Lu(t);try{for(u.s();!(e=u.n()).done;){var l=e.value,c=r[l.id];if(l.color||l.disabled){var f=Wo().get.rgb(l.disabled?i:l.color);this.nodeDataByte[3*c*4+0]=f[0],this.nodeDataByte[3*c*4+1]=f[1],this.nodeDataByte[3*c*4+2]=f[2],this.nodeDataByte[3*c*4+3]=255*f[3],s=!0}if(void 0!==l.selected){var h=l.selected;this.nodeDataByte[3*c*4+4]=h?255:0,s=!0}if(void 0!==l.activated&&(this.nodeDataByte[3*c*4+7]=l.activated?255:0,s=!0,l.activated?this.activeNodes[l.id]=!0:delete this.activeNodes[l.id]),void 0!==l.hovered){var d=!l.disabled&&l.hovered;this.nodeDataByte[3*c*4+9]=d?255:0,s=!0}if(void 0!==l.size){var p=l.size;this.nodeDataByte[3*c*4+8]=p||mr,s=!0}}}catch(t){u.e(t)}finally{u.f()}s&&(n.bindBuffer(n.ARRAY_BUFFER,o),n.bufferData(n.ARRAY_BUFFER,a,n.DYNAMIC_DRAW))}},{key:"updateRelationships",value:function(t){var e,n=Sr(t),r=this.gl,i=!1,o=Lu(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:Vu(c?this.disableRelColor:l);this.relData.positionsAndColors[f*Bu+0]=h,this.relData.positionsAndColors[f*Bu+4]=h,this.relData.positionsAndColors[f*Bu+8]=h,this.relData.positionsAndColors[f*Bu+12]=h,this.relData.positionsAndColors[f*Bu+16]=h,this.relData.positionsAndColors[f*Bu+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*Bu+3]=u,this.relData.widths[f*Bu+7]=u,this.relData.widths[f*Bu+11]=u,this.relData.widths[f*Bu+15]=u,this.relData.widths[f*Bu+19]=u,this.relData.widths[f*Bu+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,vr,vr,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=this.canvas,o=this.projection;this.containerWidth=i.clientWidth,this.containerHeight=i.clientHeight;var a=1/t,s=e-r.drawingBufferWidth*a*.5,u=n-r.drawingBufferHeight*a*.5,l=r.drawingBufferWidth*a,c=r.drawingBufferHeight*a;this.projection=di(),pi(o,s,s+l,u+c,u,0,1e6);var f=2.6315789473684212*(window.devicePixelRatio||1);this.nodeShader.use(),this.nodeShader.setUniform("u_zoom",t),this.nodeShader.setUniform("u_glAdjust",f),this.nodeShader.setUniform("u_projection",o),this.nodeAnimShader.use(),this.nodeAnimShader.setUniform("u_zoom",t),this.nodeAnimShader.setUniform("u_glAdjust",f),this.nodeAnimShader.setUniform("u_projection",o),this.relShader.use(),this.relShader.setUniform("u_glAdjust",f),this.relShader.setUniform("u_projection",o)}},{key:"setupViewportRendering",value:function(){this.viewportBoxBuffer=this.gl.createBuffer()}},{key:"setupNodeRendering",value:function(t){var e=this.gl,n=new ArrayBuffer(8),r=new Uint32Array(n),i=new Uint8Array(n);void 0===this.nodeBuffer&&(this.nodeBuffer=e.createBuffer()),this.numNodes=t.length;var o=new ArrayBuffer(3*t.length*8),a=new Uint32Array(o),s={};this.activeNodes={};for(var u=0;u<t.length;u++){var l=t[u],c=l.selected,f=l.hovered,h=l.color,d=l.activated,p=l.size,v=l.id,y=l.disabled,m=h?Vu(h):this.defaultNodeColor;a[3*u+0]=y?Vu(this.disableNodeColor):m,i[0]=c?255:0,i[1]=u%vr,i[2]=Math.floor(u/vr),i[3]=d?255:0,i[4]=!y&&f?255:0,d&&(this.activeNodes[v]=!0),a[3*u+1]=r[0],a[3*u+2]=p||mr,a[3*u+3]=r[1],s[v]=u}e.bindBuffer(e.ARRAY_BUFFER,this.nodeBuffer),e.bufferData(e.ARRAY_BUFFER,a,e.DYNAMIC_DRAW),this.numNodes=t.length,this.nodeDataInt=a,this.nodeDataByte=new Uint8Array(o),this.idToIndex=s}},{key:"setupRelationshipRendering",value:function(t){var e=this,n=this.gl,r=new ArrayBuffer(4),i=new Uint32Array(r),o=new Uint8Array(r),a={};void 0===this.relBuffer&&(this.relBuffer=n.createBuffer());for(var s=new ArrayBuffer(t.length*Bu*4),u=new Uint32Array(s),l=new Float32Array(s),c=function(n){var r=t[n],s=r.from,c=r.to,f=r.color,h=r.width,d=r.key,p=r.disabled,v=e.idToIndex[s],y=e.idToIndex[c],m=v%vr,g=Math.floor(v/vr),b=y%vr,_=Math.floor(y/vr),w=[m,g,b,_],x=[b,_,m,g],S=f?Vu(f):e.defaultRelColor,T=p?Vu(e.disableRelColor):S,O=h||1;a[d]=n;var A=0,P=function(t,e,r,a){u[n*Bu+A]=t,A++;for(var s=0;s<e.length;s++)o[s]=e[s];u[n*Bu+A]=i[0],A++,o[0]=r,u[n*Bu+A]=i[0],A++,l[n*Bu+A]=a,A++};P(T,w,255,O),P(T,x,0,O),P(T,w,0,O),P(T,x,0,O),P(T,w,0,O),P(T,x,255,O)},f=0;f<t.length;f++)c(f);n.bindBuffer(n.ARRAY_BUFFER,this.relBuffer),n.bufferData(n.ARRAY_BUFFER,s,n.DYNAMIC_DRAW),this.numRels=t.length,this.relDataBuffer=s,this.relData={positionsAndColors:u,widths:l},this.relIdToIndex=a}},{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()}}],n&&Nu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Wu=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")},Xu=function(t){Nr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==zu&&zu(t)},Hu=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;Wu(t,n,r)},Yu=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),Wu(n,t,e),n},$u=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,br),void 0!==t&&(t.appendChild(n),Hu(n)),function(t,e){zu=e,t.addEventListener("webglcontextlost",Xu)}(n,e),n},qu=function(t){t.width=0,t.height=0,t.remove()},Zu=function(t){return t.getContext("2d")},Ku=function(t){var e={antialias:!0},n=t.getContext("webgl",e);return void 0===n&&(n=t.getContext("experimental-webgl",e)),n},Ju=function(t){t.canvas.removeEventListener("webglcontextlost",Xu);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function Qu(t){return function(t){if(Array.isArray(t))return nl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||el(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 tl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=el(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 el(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}}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}var rl=mr*_r();function il(t){return il="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},il(t)}function ol(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,al(r.key),r)}}function al(t){var e=function(t,e){if("object"!=il(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=il(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==il(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=al(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=arguments,e=arguments[0];this.isCallbackRegistered(e)&&this.callbacks[e].slice(0).forEach((function(e){return e.apply(null,Array.prototype.slice.call(t,1))}))}}],n&&ol(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ul=r(481),ll=r.n(ul);function cl(t){return cl="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},cl(t)}function fl(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,dl(r.key),r)}}function hl(t,e,n){return(e=dl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dl(t){var e=function(t,e){if("object"!=cl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=cl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cl(e)?e:String(e)}var pl=5e-5,vl=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),hl(this,"xCtrl",void 0),hl(this,"yCtrl",void 0),hl(this,"zoomCtrl",void 0),hl(this,"getNodePositions",void 0),hl(this,"firstUpdate",void 0),hl(this,"state",void 0),hl(this,"canvas",void 0),hl(this,"defaultZoomLevel",void 0),hl(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(ll())(.35,pl,.05,1),this.yCtrl=new(ll())(.35,pl,.05,1),this.zoomCtrl=new(ll())(.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=$o(y,p),g=m.centerX,b=m.centerY,_=m.nodesWidth,w=m.nodesHeight;if(isNaN(g)||isNaN(b))return Nr.info("fit() function couldn't calculate center point, not updating viewport"),!1;i.setTarget(e.noPan?h:g),o.setTarget(e.noPan?d:b);var x=qo(_,w,n,r),S=x.zoomX,T=x.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var O=Zo(S,T,e.minZoom,e.maxZoom);e.outOnly&&f<O?a.setTarget(f):a.setTarget(O)}return!0}},{key:"allNodesAreVisible",value:function(t,e,n){var r=qo(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=$o(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);!e&&Math.abs(this.zoomCtrl.target-p)<.01&&Math.abs(this.xCtrl.target-h)<v&&Math.abs(this.yCtrl.target-d)<v&&this.state.clearFit()}}}])&&fl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yl(t){return yl="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},yl(t)}function ml(){ml=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"==yl(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 j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,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(yl(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 gl(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 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}function _l(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 wl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_l(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=Sl(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)):_l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xl(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"!=yl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=yl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yl(e)?e:String(e)}var Tl="NvlController",Ol={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},Al="onError",Pl="onLayoutDone",El={},kl=function(){var t;return null!==(t=El[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(El).pop()};window.__Nvl_dumpNodes=function(t){var e;return null===(e=kl(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=kl(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=kl(e))||void 0===n?void 0:n.on(Pl,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=kl(t))||void 0===e?void 0:e.getNodesOnScreen()};var jl=function(){function t(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.destroyed=!1;var a=o.frame,s=o.minimapContainer,u=void 0===s?document.createElement("span"):s,l=o.layoutOptions,c=o.layout,f=o.instanceId,h=void 0===f?"default":f,d=e.nodes,p=e.rels,v=e.webGLVisible,y=e.disableWebGL;this._state=e,this._callbacks=new sl,this.instanceId=h;var m=a;m.setAttribute("instanceId",h),m.setAttribute("data-testid","nvl-parent"),null!==(n=m.style.height)&&void 0!==n&&n.length||Object.assign(m.style,{height:"100%"}),null!==(r=m.style.outline)&&void 0!==r&&r.length||Object.assign(m.style,{outline:"none"});var g=$u(m,this._onWebGLContextLost.bind(this)),b=$u(u,this._onWebGLContextLost.bind(this));if(g.setAttribute("data-testid","nvl-gl-canvas"),y)this._glController=new Du;else{var _=Ku(g),w=Ku(b);this._glController=new Ru({mainSceneRenderer:new Gu(_,d,p,this._state),minimapRenderer:new Gu(w,d,p,this._state),state:e}),this._webGLContext=_,this._webGLMinimapContext=w}var x=$u(m,this._onWebGLContextLost.bind(this));x.setAttribute("data-testid","nvl-c2d-canvas");var S=x.getContext("2d"),T=document.createElement("div");Object.assign(T.style,wl(wl({},br),{},{overflow:"hidden"})),m.appendChild(T),this._htmlOverlay=T,this._hasResized=!0,this._hierLayout=new Vo(wl(wl({},l),{},{state:this._state})),this._gridLayout=new bo({state:this._state}),this._freeLayout=new lo({state:this._state}),this._d3ForceLayout=new Lr({state:this._state}),this._forceLayout=y?this._d3ForceLayout:new Qi(wl(wl({},l),{},{webGLContext:this._webGLContext,state:this._state})),this._state.setLayout(c),this._state.setLayoutOptions(l);var O=new Su(x,S,e,o);this._canvasRenderer=O,this._c2dContext=S,this._glCanvas=g,this._canvasRect=g.getBoundingClientRect(),this._glMinimapCanvas=b,this._c2dCanvas=x,this._glCanvas.style.opacity=v?1:0,this._c2dCanvas.style.opacity=v?0:1,this._isInRenderSwitchAnimation=!1,this._justSwitchedRenderer=!1,this._justSwitchedLayout=!1,this._hasResized=!1,this._layoutUpdating=!1,this._layoutComputing=!1,this.isRenderingDisabled=!1,d.addChannel(Tl),p.addChannel(Tl),this.setRenderSwitchAnimation=function(){i._isInRenderSwitchAnimation=!1},this.stateDisposers=[],this.stateDisposers.push(e.autorun((function(){i.callIfRegistered("zoom",e.zoom)}))),this.stateDisposers.push(e.autorun((function(){i.callIfRegistered("pan",{panX:e.panX,panY:e.panY})}))),this.stateDisposers.push(e.autorun((function(){i.setLayout(e.layout)}))),this.stateDisposers.push(e.autorun((function(){i.setLayoutOptions(e.layoutOptions)}))),this.stateDisposers.push(e.autorun((function(){var t=e.webGLVisible?1:0;t!==i._glCanvas.style.opacity&&(i._justSwitchedRenderer=!0,i._glCanvas.style.opacity=t,i._c2dCanvas.style.opacity=e.webGLVisible?0:1)}))),this._startMainloop(),this._zoomTransitionHandler=new vl({state:e,getNodePositions:function(t){return i._currentLayout.getNodePositions(t)},canvas:g,minimapCanvas:b,defaultZoomLevel:ya}),this.layoutTimeLimit=o.layoutTimeLimit||16,this.forceWebGLThreshold=o.forceWebGLThreshold||100,this.pixelRatio=_r(),this.removeResizeListener=On()(m,(function(){Hu(g),Hu(x),i._canvasRect=g.getBoundingClientRect(),i._hasResized=!0})),this.removeMinimapResizeListener=On()(u,(function(){Hu(b)})),function(t,e){El[e]=t}(this,h),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=$o(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=qo(u,l,this._glMinimapCanvas.width,this._glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=Zo(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(Al))throw e;t.callIfRegistered(Al,e)}}),13),this.animationRequestId=window.requestAnimationFrame((function e(){try{!function(e){if(t.destroyed)Nr.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(Tl),r.clearChannel(Tl),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(d),t._canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b,_=r.items[g].id,w=null!==(b=t._canvasRenderer.arrowBundler.getBundle(r.items[g]))&&void 0!==b?b:{},x=r.idToHtmlOverlay[_],S=w.labelInfo[_];if(x&&S){var T=S.rotation,O=S.position,A=S.width,P=S.height,E=t.mapCanvasSpaceToRelativePosition(O.x,O.y),k=E.x,j=E.y,C=A>5&&!t._state.webGLVisible;Object.assign(x.style,{top:"".concat(j,"px"),left:"".concat(k,"px"),width:"".concat(A,"px"),height:"".concat(P,"px"),display:C?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t._state.zoom),") rotate(").concat(T,"rad")})}}}for(var R=0;R<n.items.length;R++){var D=n.items[R],I=D.id,L=D.size,M=n.idToHtmlOverlay[I];if(M){var N=t._state.nodes.idToPosition[I],U=t.mapCanvasSpaceToRelativePosition(N.x,N.y),F=U.x,z=U.y,B="".concat(2*(null!=L?L:mr),"px");Object.assign(M.style,{top:"".concat(z,"px"),left:"".concat(F,"px"),width:B,height:B,transform:"translate(-50%, -50%) scale(".concat(Number(t._state.zoom),")")})}}}}var V=!a&&t._layoutUpdating,G=s!==t._layoutComputing;t._layoutComputing=s,t._layoutUpdating=a,V&&t.callIfRegistered(Pl),G&&t.callIfRegistered("onLayoutComputing",s),t._justSwitchedRenderer=!1,t._hasResized=!1,e&&e()}}((function(){t.animationRequestId=window.requestAnimationFrame(e)}))}catch(e){if(!t._callbacks.isCallbackRegistered(Al))throw e;t.callIfRegistered(Al,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 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}}(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(wl(wl({},o),{},{x:s.x,y:s.y}))}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"dumpRelationships",value:function(){return gn(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(gn(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,_=tl(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,P=O.x>u&&O.x<l&&O.y>c&&O.y<f;A&&P&&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._layout.getNodePositions([{id:t}])[0]}},{key:"addCanvasOptions",value:function(t){this._canvasRenderer.addOptions(t)}},{key:"setNodeInformationLevel",value:function(t){this._canvasRenderer.setNodeInformationLevel(t)}},{key:"setEdgeInformationLevel",value:function(t){this._canvasRenderer.setEdgeInformationLevel(t)}},{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:"destroy",value:function(){var t;this.destroyed||(this.animationRequestId&&window.cancelAnimationFrame(this.animationRequestId),this._layoutRunner&&window.clearInterval(this._layoutRunner),this._glController.destroy(),this._glCanvas.removeEventListener("transitionend",this.setRenderSwitchAnimation),this._webGLContext&&Ju(this._webGLContext),this._webGLMinimapContext&&Ju(this._webGLMinimapContext),qu(this._glCanvas),qu(this._glMinimapCanvas),this._canvasRenderer.destroy(),qu(this._c2dCanvas),this.removeResizeListener(),this.removeMinimapResizeListener(),this._forceLayout.destroy(),this._hierLayout.destroy(),this._gridLayout.destroy(),this._freeLayout.destroy(),this._htmlOverlay.remove(),this._zoomTransitionHandler.destroy(),this.stateDisposers.forEach((function(t){t()})),t=this.instanceId,delete El[t],this.destroyed=!0)}},{key:"callIfRegistered",value:function(){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){var e=this._forceLayout;return t===ga?e=this._hierLayout:t===ma?e=this._forceLayout:t===ba?e=this._gridLayout:t===_a?e=this._freeLayout:t===wa&&(e=this._d3ForceLayout),e}},{key:"setLayout",value:function(t){Nr.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=wl(wl({},Ol),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=Yu(this._c2dCanvas.width,this._c2dCanvas.height),s=Zu(a);this._canvasRenderer.processUpdates(),this._canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),qu(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=this._state.nodes.items,r=t.filename,i=t.backgroundColor,o=this._currentLayout.getNodePositions(n),a=$o(o,100),s=a.nodesWidth,u=a.nodesHeight,l=a.centerX,c=a.centerY,f=Math.max(Math.min(s+100,15e3),5e3),h=Math.max(Math.min(u+100,15e3),5e3);return this.isRenderingDisabled=!0,new Promise((function(t,n){try{e.setPanCoordinates(l,c);var a=Math.max((f/s).toFixed(2)-.02,e._zoomTransitionHandler._minZoom),d=Math.max((h/u).toFixed(2)-.02,e._zoomTransitionHandler._minZoom);e.setZoomLevel(Math.min(a,d))}catch(t){return console.error("An error occured while downloading the file"),void n(t)}setTimeout((function(){try{e._currentLayout.update(e._justSwitchedLayout),e._justSwitchedLayout=!1,e._state.nodes.updatePositions(o);var a=Yu(f,h),s=Zu(a);e._canvasRenderer.processUpdates(),e._canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:i,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(r,a).click(),qu(a),a=null,s=null,t()}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=ml().mark((function t(e){var n,r,i,o;return ml().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=wl(wl({},Ol),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),console.error("An error occured while downloading the image"),!this._callbacks.isCallbackRegistered(Al)){t.next=16;break}this.callIfRegistered(Al,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){gl(o,n,i,a,s,"next",t)}function s(t){gl(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&xl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Cl(t){return Cl="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},Cl(t)}function Rl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dl(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,Ll(r.key),r)}}function Il(t,e,n){return e&&Dl(t.prototype,e),n&&Dl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ll(t){var e=function(t,e){if("object"!=Cl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Cl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cl(e)?e:String(e)}var Ml=function(){function t(e,n){if(Rl(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Il(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}(),Nl=function(){function t(e){Rl(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Il(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}(),Ul=function(){function t(){Rl(this,t),this.root=new Ml(new Nl("Performance Tree"),null),this.current=this.root}return Il(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Ml(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 Ml(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}(),Fl=function(){function t(){Rl(this,t),window.performance?(this.disabled=!1,this.tree=new Ul):(this.disabled=!0,this.tree=null)}return Il(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 Nl(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}(),zl=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};function Bl(t){return Bl="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},Bl(t)}function Vl(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 Wl(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)?Wl(t,e):void 0}}function Wl(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 Xl(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 Hl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xl(Object(n),!0).forEach((function(e){$l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Yl(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 $l(t,e,n){return(e=ql(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ql(t){var e=function(t,e){if("object"!=Bl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Bl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bl(e)?e:String(e)}var Zl=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),$l(this,"externalCallbackHandler",void 0),$l(this,"performance",void 0),$l(this,"visState",void 0),$l(this,"nvlController",void 0),$l(this,"options",void 0),this.setupLogging(i),this.externalCallbackHandler=new s(o),this.performance=new Fl,this.options=i,this.options.frame=e,this.checkWebGLCompatibility(),this.initialise(n,r,i)}var n,r;return n=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,Hl({},n)),this.visState.rels.update(e,Hl({},n)),this.visState.nodes.add(t,Hl({},n)),this.visState.rels.add(e,Hl({},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 Hl(Hl({},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,Hl({},n)),this.visState.rels.update(e,Hl({},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,Hl({},n)),this.visState.rels.add(e,Hl({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,e.isEmpty)(t)){var n,r={},i=Vl(t);try{for(i.s();!(n=i.n()).done;)r[n.value]=!0}catch(t){i.e(t)}finally{i.f()}var o,a=[],s=Vl(this.visState.rels.items);try{for(s.s();!(o=s.n()).done;){var u=o.value;(r[u.from]||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,e.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 Hl(Hl({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return Hl(Hl({},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?xa:Sa)}},{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?arguments[2]:void 0,r=this.options,i=this.visState,o=this.nvlController,a=i.zoom,s=i.panX,u=i.panY,l=i.webGLVisible,c=Tu(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,Qu(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=tl(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);try{var s=function(){var a=n.value,s=r[a.id];if(void 0===(null==s?void 0:s.x)||void 0===s.y)return 1;var u=(a.size||mr)*_r(),l={x:s.x-t,y:s.y-e},c=Math.pow(u,2),f=Math.pow(u+i,2),h=Math.pow(l.x,2)+Math.pow(l.y,2),d=Math.sqrt(h);if(h<f){var p=o.findIndex((function(t){return t.distance>d}));o.splice(-1!==p?p:o.length,0,{data:a,targetCoordinates:{x:s.x,y:s.y},pointerCoordinates:{x:t,y:e},distanceVector:l,distance:d,insideNode:h<c})}};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,Qu(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=tl(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=gs({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=rl){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,Qu(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,Qu(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return Hl(Hl({},t),{},{nvlTargets:d})}},{key:"getContainer",value:function(){return this.options.frame}},{key:"initialise",value:function(){var t,n,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 n=t.minZoom,r=t.maxZoom,i=t.allowDynamicMinZoom,o=void 0===i||i,a=t.layout,s=t.layoutOptions,u=t.nodeDefaultBorderColor,l=t.nodeSelectedBorderColor,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?Sa:xa:v,m=t.disableWebGL,g=void 0!==m&&m;$(!0),bn.isolateGlobalState();var b=void 0!==n?n:.075,_=void 0!==r?r:10,w=da({},va);void 0!==u&&("string"==typeof u&&null!==Wo().get.rgb(u)?w.rings=[{color:u,widthFactor:.05}]:Nr.warn("Invalid color string for nodeDefaultBorderColor:",u));var x=da({},pa);return void 0!==l&&("string"==typeof u&&null!==Wo().get.rgb(l)?x.rings[1].color=l:Nr.warn("Invalid color string for nodeSelectedBorderColor:",l)),zt({zoom:p||ya,minimapZoom:ya,defaultZoomLevel:ya,panX:f,panY:d,minimapPanX:0,minimapPanY:0,fitNodeIds:[],resetZoom:!1,zoomOptions:{},forceWebGL:!1,renderer:y,disableWebGL:g,fitMovement:0,layout:a,layoutOptions:s,maxDistance:0,maxNodeRadius:50,nodeBorderStyles:{default:w,selected:x},get minZoom(){return b},get maxZoom(){return _},get minMinimapZoom(){return 0},get maxMinimapZoom(){return.2},get webGLVisible(){var t=this.fitMovement>50;return this.renderer===xa||t},nodes:ca(),rels:ca(),graphUpdates:0,waypoints:{data:zt.shallow({}),counter:0},setGraphUpdated:rt((function(){this.graphUpdates++})),setRenderer:rt((function(t){rt((function(){this.graphUpdates++})),this.renderer=t})),setWaypoints:rt((function(t){this.waypoints.data=t,this.waypoints.counter+=1})),setZoomPan:rt((function(t,e,n,r){if(o){var i=Object.values(this.nodes.idToPosition),a=Jo(i,b,_,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=Ko(t,this.zoom,b,_);s!==this.zoom&&(this.zoom=s,this.panX=e,this.panY=n)}this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setZoom:rt((function(t,e){if(o){var n=Object.values(this.nodes.idToPosition);this.zoom=Jo(n,b,_,e,t,this.zoom)}else this.zoom=Ko(t,this.zoom,b,_);this.fitNodeIds=[],this.fitMovement=0,this.resetZoom=!1,this.forceWebGL=!1})),setPan:rt((function(t,e){this.panX=t,this.panY=e,this.fitNodeIds=[],this.resetZoom=!1,this.forceWebGL=!1})),setLayout:rt((function(t){this.layout=t})),setLayoutOptions:rt((function(t){this.layoutOptions=t})),fitNodes:rt((function(t,n){this.fitNodeIds=(0,e.intersection)(t,(0,e.map)(this.nodes.items,"id")),this.zoomOptions=null!=n?n:{}})),setZoomReset:rt((function(){this.resetZoom=!0})),clearFit:rt((function(){this.fitNodeIds=[],this.forceWebGL=!1,this.fitMovement=0})),clearReset:rt((function(){this.resetZoom=!1,this.fitMovement=0})),updateZoomToFit:rt((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=Jo(a,b,_,r,t,this.zoom)}else i=Ko(t,this.zoom,b,_);this.zoom=i,this.panX=e,this.panY=n})),updateMinimapZoomToFit:rt((function(t,e,n){this.minimapZoom=t,this.minimapPanX=e,this.minimapPanY=n})),autorun:pt,reaction:vt})}(o),this.nvlController=new jl(this.visState,o),this.addAndUpdateElementsInGraph(r,i),this.nvlController.on("restart",this.restart.bind(this));for(var a=0,s=Object.entries(this.externalCallbackHandler.callbacks);a<s.length;a++){var u=(t=s[a],n=2,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,n)||Gl(t,n)||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.")}()),l=u[0];void 0!==u[1]&&this.nvlController.on(l,this.externalCallbackHandler[l].bind(this.externalCallbackHandler))}}},{key:"setupLogging",value:function(t){var e,n=t.logging||{};n.level&&(e=n.level)&&Nr.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];e&&"function"==typeof e.logger?e.logger.apply(e,[t].concat(r)):o.apply(void 0,r)}},t.setLevel(t.getLevel())}(Nr,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&&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=Hl(Hl({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!zl(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 Ei("Could not initialize WebGL");this.options.renderer=Sa,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&&Yl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Kl={textColorForBackground:lu};const Jl=Zl})();var o=i.RL,a=i.wK,s=i.x_,u=i.lv,l=i.YQ,c=i.BP,f=i.GZ,h=i.Vw,d=i.Ay,p=i._G;export{o as CompatibilityError,a as ForceDirectedLayoutType,s as FreeLayoutType,u as GridLayoutType,l as HierarchicalLayoutType,c as NVL,f as colorMapperFunctions,h as d3ForceLayoutType,d as default,p 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)]}},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,A=0,O=u,P=[],E=[],k=1,C=0,j=0,D=!1,R=!1,I="",M=o,L=r;"300 es"===(t=t||{}).version&&(M=s,L=a);var N={},F={};for(T=0;T<M.length;T++)N[M[T]]=!0;for(T=0;T<L.length;T++)F[L[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,O){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 A+=T,I=I.slice(T),E}(t):(P.length&&U(P.join("")),O=w,U("(eof)"),E)};function U(t){t.length&&E.push({type:_[O],data:t,position:j,line:k,column:C})}function z(){return P=P.length?[]:P,"/"===n&&"*"===e?(j=A+T-1,O=c,n=e,T+1):"/"===n&&"/"===e?(j=A+T-1,O=f,n=e,T+1):"#"===e?(O=h,j=A+T,T):/\s/.test(e)?(O=b,j=A+T,T):(D=/\d/.test(e),R=/[^\w_]/.test(e),j=A+T,O=D?p:R?d:l,T)}function B(){return/[^\s]/g.test(e)?(U(P.join("")),O=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("")),O=u,T)}function G(){return"/"===e&&"*"===n?(P.push(e),U(P.join("")),O=u,T+1):(P.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return O=v,T;if("/"===n&&"*"===e)return O=c,T;if("/"===n&&"/"===e)return O=f,T;if("."===e&&P.length){for(;X(P););return O=v,T}if(";"===e||")"===e||"("===e){if(P.length)for(;X(P););return U(e),O=u,T+1}var t=2===P.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(P););return O=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("")),O=u,T):(P.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(P.push(e),O=v,n=e,T+1):"x"===e&&1===P.length&&"0"===P[0]?(O=x,P.push(e),n=e,T+1):/[^\d]/.test(e)?(U(P.join("")),O=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("")),O=u,T):(P.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=P.join("");return O=F[t]?g:N[t]?m:y,U(P.join("")),O=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))}},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]",A="[object Promise]",O="[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]",M="[object Int8Array]",L="[object Int16Array]",N="[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",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\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+At+"]",Mt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+xt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",Ut="["+At+"]",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+"|"+Mt+")?",Ht="["+Ot+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Lt,Nt,Ft].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Dt,Nt,Ft].join("|")+")"+Yt,qt="(?:"+[Lt+Ct+"?",Ct,Nt,Ft,Et].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(Ct,"g"),Jt=RegExp(Mt+"(?="+Mt+")|"+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+Ot+"]"),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[M]=ie[L]=ie[N]=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[O]=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[M]=oe[L]=oe[N]=oe[_]=oe[S]=oe[T]=oe[O]=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 Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(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 Me(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 Le=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 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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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):Le(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({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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,At=e.RegExp,Ot=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,Mt=(n=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Lt=Ct.toString,Nt=Dt.call(Tt),Ft=fe._,Ut=At("^"+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,Le=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"),An=uo(e,"Set"),On=uo(e,"WeakMap"),Pn=uo(Tt,"create"),En=On&&new On,kn={},Cn=No(_n),jn=No(Sn),Dn=No(Tn),Rn=No(An),In=No(On),Mn=Bt?Bt.prototype:i,Ln=Mn?Mn.valueOf:i,Nn=Mn?Mn.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,Ot):[],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(Oi(t),or(e,0,t.length))}function Kn(t){return Do(Oi(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:As(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 Oi(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 M:case L:case N: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 O: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,Ln?Tt(Ln.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 Ae(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[Lo(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=Lt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Lt.call(t)}(t)}function Tr(t,e){return t>e}function Ar(t,e){return null!=t&&Rt.call(t,e)}function Or(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=Ao(t,e=yi(e,t)))?t:t[Lo(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 O: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(Ln)return Ln.call(t)==Ln.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,A=w?e.value():e;return a||(a=new Yn),o(x,A,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,Mt&&Mt in e))&&(Za(t)?Ut:vt).test(No(t));var e}function Rr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Fr(t[0],t[1]):Nr(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 Mr(t,e){return t<e}function Lr(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||jr(n,t,e)}}function Fr(t,e){return go(t)&&_o(e)?So(Lo(t),e):function(n){var r=As(n,t);return r===i&&r===e?Os(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=Oo(t,n),l=Oo(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=Oi(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(Oo(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=Lr(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=Oi(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=Lo(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 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=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=Ao(t,e=yi(e,t)))||delete t[Lo(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]:Mo(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 Ai(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 Oi(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 Mi(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 Li(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 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,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=Ai(w,s,u,y)),b-=S,y&&b<h){var T=sn(w,_);return Wi(t,e,Ni,l.placeholder,n,w,T,c,f,h-b)}var A=p?n:this,O=v?A[t]:t;return b=w.length,c?w=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Oi(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&&(O=g||Ii(O)),O.apply(A,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))&&Le(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=An&&1/un(new An([,-0]))[1]==c?function(t){return new An(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?Ai(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,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 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(!Me(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=Lo(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())!=A||An&&fo(new An)!=P||On&&fo(new On)!=C)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?No(n):"";if(r)switch(r){case Cn:return D;case jn:return _;case Dn:return A;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 Ao(t,e){return e.length<2?t:xr(t,ti(e,0,-1))}function Oo(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 Ae(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,Mo=(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 Lo(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 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__=Oi(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=Mi(Vo),ya=Mi(Go);function ma(t,e){return(Ga(t)?Ae:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Oe: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:Lr)(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),[])})),Aa=le||function(){return fe.Date.now()};function Oa(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=Aa();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=Aa(),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(Aa())},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 Ma=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)}))})),La=Yr((function(t,e){var n=sn(e,io(La));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)})),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)==Nt}var is=we?qe(we):function(t){return ts(t)&&Sr(t)==O},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(Mr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Oi(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 As(t,e,n){var r=null==t?i:xr(t,e);return r===i?n:r}function Os(t,e){return null!=t&&ho(t,e,Or)}var Ps=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),Qs(nu)),Es=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.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})),Ms=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return Os(t,n)}))}(t,e)}));function Ls(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 Ns=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 Ae(e,(function(e){e=Lo(e),rr(t,e,Ea(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Li(),eu=Li(!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 Ae(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__=Oi(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(Me);function fu(t){return go(t)?Ge(Lo(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=Oa,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)?Oi(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 Nr(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 Ls(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=Ma,Fn.overEvery=lu,Fn.overSome=cu,Fn.partial=La,Fn.partialRight=Na,Fn.partition=Sa,Fn.pick=Ms,Fn.pickBy=Ls,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=Ns,Fn.toPairsIn=Fs,Fn.toPath=function(t){return Ga(t)?je(t,Lo):ss(t)?[t]:Oi(Mo(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?Ae:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Oa(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 La(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=Ns,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 Ne(t,oo(e,3),gr)},Fn.findLast=ya,Fn.findLastIndex=Go,Fn.findLastKey=function(t,e){return Ne(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=As,Fn.gt=za,Fn.gte=Ba,Fn.has=function(t,e){return null!=t&&ho(t,e,Ar)},Fn.hasIn=Os,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&&Le(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,Mr):i},Fn.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Mr):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=Aa,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[Lo(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)?Me: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=At((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=At(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",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),Ae(["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()}})),Ae(["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}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["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)})})),Ae(["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[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Oi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Oi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Oi(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:()=>Li,wK:()=>ua,x_:()=>fa,lv:()=>ca,YQ:()=>la,BP:()=>yf,GZ:()=>mf,Vw:()=>ha,Ay:()=>gf,_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=Ae.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.reportObserved=function(){He(this)},t.prototype.reportChanged=function(){We(),function(t){if(t.lowestObserverState!==Ae.STALE){t.lowestObserverState=Ae.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.UP_TO_DATE&&(r.isTracing!==Oe.NONE&&Ye(r,t),r.onBecomeStale()),r.dependenciesState=Ae.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 A(t){_(t?pe({},t,T):T)}function O(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 M=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&&A()},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&&A()},t}(),L=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 M(r,n,o,i);return ge(o,"$mobx",a),e&&e.length&&o.spliceWithArray(0,0,e),D&&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(L.prototype,(function(){return E(this.slice())})),Object.defineProperty(L.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(L.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]])}(L.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=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(L.prototype,""+t,F(t))}function z(t){for(var e=R;e<t;e++)U(e);R=t}z(1e3);var B=xe("ObservableArrayAdministration",M);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&&A()}},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&&A({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=Ae.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=Ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+re(),this.value=new qe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Oe.NONE,this.name=r||"ComputedValue@"+re(),i&&(this.setter=$(r+"-setter",i))}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState===Ae.UP_TO_DATE){t.lowestObserverState=Ae.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.UP_TO_DATE&&(r.dependenciesState=Ae.POSSIBLY_STALE,r.isTracing!==Oe.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!==Oe.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!==Ae.STALE){t.lowestObserverState=Ae.STALE;for(var e=t.observers,n=e.length;n--;){var r=e[n];r.dependenciesState===Ae.POSSIBLY_STALE?r.dependenciesState=Ae.STALE:r.dependenciesState===Ae.UP_TO_DATE&&(t.lowestObserverState=Ae.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===Ae.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===Ae.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 At[t]||(At[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&&A()}(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 At={},Ot={};function Pt(t){return Ot[t]||(Ot[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&&A()}}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 Mt(t,Ht,e)}function It(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Mt(t,$t,e)}function Mt(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 Lt=Dt(Ht),Nt=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 L(t,Ht,e)},shallowArray:function(t,e){return arguments.length>2&&Gt("shallowArray"),new L(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]):Nt.apply(null,arguments)},deep:function(){return arguments.length<2?Xt(Ht,arguments[0]):Lt.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 Lt.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 L(t,qt,n);if(_e(t))return new Qt(t,qt,n);if(de(t)){var r={};return xt(r,n),Mt(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 L(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&&A(),!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&&A()}},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&&A()},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 Ae,Oe,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 '"+Le(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 '"+Le(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 Me(t,e){return oe(t,"Expecting some object"),void 0!==e?Me(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 Le(t,e){return(void 0!==e?Ie(t,e):Ct(t)||te(t)?Me(t):Ie(t)).name}function Ne(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===Oe.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)})))}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"}(Ae||(Ae={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Oe||(Oe={}));var qe=function(t){this.cause=t};function Ze(t){return t instanceof qe}function Ke(t){switch(t.dependenciesState){case Ae.UP_TO_DATE:return!1;case Ae.NOT_TRACKING:case Ae.STALE:return!0;case Ae.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===Ae.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=Ae.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!==Ae.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=Ae.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!==Ae.UP_TO_DATE){t.dependenciesState=Ae.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Ae.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=Ae.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=Oe.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&&A({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===Oe.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Oe.BREAK:Oe.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:Le,getDependencyTree:Ne,getAdministration:Me,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=Me(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=Me(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:A,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:O,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 Me(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Me(t).observe(e,n)}(t,e,n)},intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Me(t,e).intercept(n)}(t,e,n):function(t,e){return Me(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 An in _n)Tn(An);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:O,extras:xn});var On=i(803),Pn=i.n(On),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,Mn,Ln=0,Nn=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,Ln=Nn=0;try{!function(){Xn(),++Ln;for(var t,e=In;e;)(t=Bn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ln}()}finally{Ln=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);Mn=t,Kn(r)}(),Bn=0}}function Zn(){var t=Gn.now(),e=t-zn;e>Un&&(Vn-=e,zn=t)}function Kn(t){Ln||(Nn&&(Nn=clearTimeout(Nn)),t-Bn>24?(t<1/0&&(Nn=setTimeout(qn,t-Gn.now()-Vn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(zn=Gn.now(),Fn=setInterval(Zn,Un)),Ln=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||Mn===this||(Mn?Mn._next=this:In=this,Mn=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 Ar(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)?Ar(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 Ar(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 Or=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 Mr(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 Lr(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,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?Lr(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)):Lr(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=Or(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 Mr(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)?Mr(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&&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?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 Ai(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 Oi(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),Oi(this,"shaderProgram",void 0),Oi(this,"gl",void 0),Oi(this,"curTexture",void 0),Oi(this,"attributeInfo",void 0),Oi(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&&Ai(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,Mi(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 Mi(t){return Mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mi(t)}var Li=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=Mi(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||[],Mi(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 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 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 A=Ji(this.subGraphs[0].nodes),O=A.nodeIdToIndex,P=A.nodeIndexToId;return this.nodeIdToIndex=O,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 Li(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,Ni,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,Ni,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,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 Ei(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,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 Ao(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)?Ao(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 Ao(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,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&&Oo(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 Mo=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}},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}},No=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 Aa(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,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 Ma="HierarchicalLayout",La=function(t){return void 0!==t?wn(t):t},Na=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(Ma),o.addChannel(Ma),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[Ma],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[Ma],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[Ma].adds).length>0,u=Object.values(i.channels[Ma].adds).length>0,l=Object.values(r.channels[Ma].removes).length>0,c=Object.values(i.channels[Ma].removes).length>0,f=Object.values(r.channels[Ma].updates),h=Pr(f);(t||s||u||l||c||o||a||h)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(Ma),i.clearChannel(Ma),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=La(t).map((function(t){return t.html,Aa(t,xa)})),a=La(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Aa(e,_a));s[t]=n}));var u=La(r).map((function(t){return t.captionHtml,Aa(t,Sa)})),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(Ma),null===(e=this.state.rels)||void 0===e||e.clearChannel(Ma)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Ma),this.state.rels.removeChannel(Ma),this.worker.port.close()}}],r&&Oa(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,As(r.key),r)}}function Ts(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"!=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 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)},Ps=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=_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]],Ms=[[Is[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,")")},Ns=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)},A=Math.max(Math.PI,su/(c/2)),O=f?r*A*(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(O,_),M=j(O,S),L=f?C(0,_):null,N=f?j(0,S):null,F=200*l,U=[];if(b){var z=R(I,w)<F;if(f&&!z){var B=D(L,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(M,x)<F;if(f&&!G){var W=D(N,x);U.push(new Es(x,W)),U.push(new Es(W,M))}else U.push(new Es(x,M))}else{var X=f?R(L,N):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,M))}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,M))}else if(X>(_+S)/2){var tt=lu(d,p,_,S,o,t);U.push(new Es(I,tt)),U.push(new Es(tt,M))}else U.push(new Es(I,M))}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),A=Gs(x.p1,Xs(S,v/2)),O=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(A,O,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 A=function(e){return t.measureText(e).width},O=(null!=p?p:1)*(!0===l?1.5:1),P=A(T);if(P>r){var E=nu(T,A,(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+O+k:-(O+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,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}}},wu=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()},xu=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,w=a.shadow,x=_r(),_=b[0].color,S=b[1].color,T=b[0].width*x,A=b[1].width*x,O=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=void 0!==s,M=Math.atan2(v.y-g.y,v.x-g.x),L=D?T*Math.sqrt(1+2*k/j*(2*k/j)):0,N={x:v.x-Math.cos(M)*(.5*k-C+L),y:v.y-Math.sin(M)*(.5*k-C+L)},F={headPosition:{x:v.x+Math.cos(M)*(.5*k-C-L),y:v.y+Math.sin(M)*(.5*k-C-L)},headAngle:M,headHeight:k,headChinHeight:C,headWidth:j};if(t.save(),t.lineCap="round",D&&(fu(t,w),t.lineWidth=P+A,t.strokeStyle=S,wu(t,p,N,y,m,g),Ns(t,A,S,F,!1,!0),hu(t),t.lineWidth=P+T,t.strokeStyle=_,wu(t,p,N,y,m,g),Ns(t,T,_,F,!1,!0)),t.lineWidth=P,!0===c&&!D&&!R){var U=w.color;fu(t,w),t.strokeStyle=U,t.fillStyle=U,wu(t,p,N,y,m,g),Ns(t,P,U,F),hu(t)}var z=R?fs:null!=h?h:us;if(t.fillStyle=z,t.strokeStyle=z,wu(t,p,N,y,m,g),Ns(t,P,z,F),o||I){var B,V=r.indexOf(e),G=null!==(B=r.angles[V])&&void 0!==B?B:0,W=y.x-Math.cos(M)*(L/4),X=y.y-Math.sin(M)*(L/4),H=(G+uu)%su,Y=(G+su)%su<Math.PI;if(o&&pu(t,{x:W,y:X},H,O,e,r,Y),I){var $=s.position,q=void 0===$?[0,0]:$,Z=s.url,K=s.size,J=mu(void 0===K?1:K),Q=gu(q,O,J),tt=Q.widthAlign,et=Q.heightAlign+(D?yu(a):0)*(q[1]<0?-1:1),nt=tt*(Y?-1:1),rt=J/2;t.save(),t.translate(W,X),t.rotate(H);var it=-rt+nt,ot=-rt+et;t.drawImage(i.getImage(Z),it,ot,J,J),t.restore()}}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=void 0!==l,b=u.rings,w=u.shadow,x=du(e,i,n,r,a,s),_=_r(),S=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*_r()}(e),T=m?fs:null!=c?c:us,A=b[0].width*_,O=b[1].width*_,P=_*(d>1?d/2:1),E=9*P,k=2*P,C=7*P,j=Hs(x[x.length-2],x[x.length-1]),D=2*E,R=y?A*Math.sqrt(1+D/C*(D/C)):0,I=2-R,M=Math.floor(x.length/2);x.length>2&&y&&j<E+R-k&&(I+=j,R-=j/2+k,x.pop(),M=Math.floor(x.length/2));var L,N,F=x[x.length-2],U=x[x.length-1],z=(L=F,N=U,Math.atan2(N.y-L.y,N.x-L.x)),B=E/2+R,V=Math.cos(z),G=Math.sin(z);x[x.length-1]={x:U.x-V*B,y:U.y-G*B};var W,X={headPosition:{x:U.x+V*I,y:U.y+G*I},headAngle:z,headHeight:E,headChinHeight:k,headWidth:C},H=ou(x);try{for(H.s();!(W=H.n()).done;){var Y=W.value;Y.x=Math.round(Y.x),Y.y=Math.round(Y.y)}}catch(t){H.e(t)}finally{H.f()}if(t.save(),y){var $=b[0].color,q=b[1].color,Z=Math.atan2(x[1].y-x[0].y,x[1].x-x[0].x),K=Ys(Z,yu(u));x[0]=Gs(x[0],K),fu(t,w),vu(t,x,S+O,q,s),Ns(t,O,q,X,!1,!0),hu(t),vu(t,x,S+A,$,s),Ns(t,A,$,X,!1,!0)}if(!0===p&&!y&&!m){var J=w.color;fu(t,w),vu(t,x,S,J,s),Ns(t,S,J,X),hu(t)}if(vu(t,x,S,T,s),Ns(t,S,T,X),a||g){var Q,tt,et,nt,rt,it=n.x>r.x,ot=x[M];1==(1&x.length)?(Q=x[it?M+1:M-1],tt=x[it?M-1:M+1],s?(et=(ot.x+(Q.x+tt.x)/2)/2,nt=(ot.y+(Q.y+tt.y)/2)/2,rt=it?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Hs(ot,Q)>Hs(ot,tt)?tt=ot:Q=ot,et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x))):(Q=x[it?M:M-1],tt=x[it?M-1:M],et=(Q.x+tt.x)/2,nt=(Q.y+tt.y)/2,rt=Math.atan2(tt.y-Q.y,tt.x-Q.x));var at=y?Ys(rt+uu,yu(u)):{x:0,y:0},st=Hs(Q,tt);if(a){var ut="bottom"===v?1:-1,lt={x:et+at.x*ut,y:nt+at.y*ut};pu(t,lt,rt,st,e,i)}if(g){var ct=l.position,ft=void 0===ct?[0,0]:ct,ht=l.url,dt=l.size,pt=mu(void 0===dt?1:dt),vt=gu(ft,st,pt),yt=vt.widthAlign,mt=vt.heightAlign,gt=ft[1]<0?-1:1,bt=at.x*gt,wt=at.y*gt,xt=pt/2;t.save(),t.translate(et,nt),t.rotate(rt);var _t=-xt+bt+yt,St=-xt+wt+mt;t.drawImage(o.getImage(ht),_t,St,pt,pt),t.restore()}}t.restore()}(t,e,n,r,i,o,a,u,s))},_u=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=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};function Su(t){return Su="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},Su(t)}var Tu=/^\s+/,Au=/\s+$/;function Ou(t,e){if(e=e||{},(t=t||"")instanceof Ou)return t;if(!(this instanceof Ou))return new Ou(t,e);var n=function(t){var e,n,r,i={r:0,g:0,b:0},o=1,a=null,s=null,u=null,l=!1,c=!1;return"string"==typeof t&&(t=function(t){t=t.replace(Tu,"").replace(Au,"").toLowerCase();var e,n=!1;if(Gu[t])t=Gu[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=nl.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=nl.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=nl.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=nl.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=nl.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=nl.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=nl.hex8.exec(t))?{r:$u(e[1]),g:$u(e[2]),b:$u(e[3]),a:Ju(e[4]),format:n?"name":"hex8"}:(e=nl.hex6.exec(t))?{r:$u(e[1]),g:$u(e[2]),b:$u(e[3]),format:n?"name":"hex"}:(e=nl.hex4.exec(t))?{r:$u(e[1]+""+e[1]),g:$u(e[2]+""+e[2]),b:$u(e[3]+""+e[3]),a:Ju(e[4]+""+e[4]),format:n?"name":"hex8"}:!!(e=nl.hex3.exec(t))&&{r:$u(e[1]+""+e[1]),g:$u(e[2]+""+e[2]),b:$u(e[3]+""+e[3]),format:n?"name":"hex"}}(t)),"object"==Su(t)&&(rl(t.r)&&rl(t.g)&&rl(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*Hu(e,255),g:255*Hu(n,255),b:255*Hu(r,255)},l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):rl(t.h)&&rl(t.s)&&rl(t.v)?(a=Zu(t.s),s=Zu(t.v),i=function(t,e,n){t=6*Hu(t,360),e=Hu(e,100),n=Hu(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),u=r%6;return{r:255*[n,a,o,o,s,n][u],g:255*[s,n,n,a,o,o][u],b:255*[o,o,s,n,n,a][u]}}(t.h,a,s),l=!0,c="hsv"):rl(t.h)&&rl(t.s)&&rl(t.l)&&(a=Zu(t.s),u=Zu(t.l),i=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Hu(t,360),e=Hu(e,100),n=Hu(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,a,u),l=!0,c="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=Xu(o),{ok:l,format:t.format||c,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Pu(t,e,n){t=Hu(t,255),e=Hu(e,255),n=Hu(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function Eu(t,e,n){t=Hu(t,255),e=Hu(e,255),n=Hu(n,255);var r,i,o=Math.max(t,e,n),a=Math.min(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function ku(t,e,n,r){var i=[qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Cu(t,e,n,r){return[qu(Ku(r)),qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16))].join("")}function ju(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.s-=e/100,n.s=Yu(n.s),Ou(n)}function Du(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.s+=e/100,n.s=Yu(n.s),Ou(n)}function Ru(t){return Ou(t).desaturate(100)}function Iu(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.l+=e/100,n.l=Yu(n.l),Ou(n)}function Mu(t,e){e=0===e?0:e||10;var n=Ou(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Ou(n)}function Lu(t,e){e=0===e?0:e||10;var n=Ou(t).toHsl();return n.l-=e/100,n.l=Yu(n.l),Ou(n)}function Nu(t,e){var n=Ou(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Ou(n)}function Fu(t){var e=Ou(t).toHsl();return e.h=(e.h+180)%360,Ou(e)}function Uu(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ou(t).toHsl(),r=[Ou(t)],i=360/e,o=1;o<e;o++)r.push(Ou({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function zu(t){var e=Ou(t).toHsl(),n=e.h;return[Ou(t),Ou({h:(n+72)%360,s:e.s,l:e.l}),Ou({h:(n+216)%360,s:e.s,l:e.l})]}function Bu(t,e,n){e=e||6,n=n||30;var r=Ou(t).toHsl(),i=360/n,o=[Ou(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Ou(r));return o}function Vu(t,e){e=e||6;for(var n=Ou(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(Ou({h:r,s:i,v:o})),o=(o+s)%1;return a}Ou.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=Xu(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Eu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Eu(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Pu(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Pu(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return ku(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[qu(Math.round(t).toString(16)),qu(Math.round(e).toString(16)),qu(Math.round(n).toString(16)),qu(Ku(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Hu(this._r,255))+"%",g:Math.round(100*Hu(this._g,255))+"%",b:Math.round(100*Hu(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Hu(this._r,255))+"%, "+Math.round(100*Hu(this._g,255))+"%, "+Math.round(100*Hu(this._b,255))+"%)":"rgba("+Math.round(100*Hu(this._r,255))+"%, "+Math.round(100*Hu(this._g,255))+"%, "+Math.round(100*Hu(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Wu[ku(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Cu(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Ou(t);n="#"+Cu(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ou(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Iu,arguments)},brighten:function(){return this._applyModification(Mu,arguments)},darken:function(){return this._applyModification(Lu,arguments)},desaturate:function(){return this._applyModification(ju,arguments)},saturate:function(){return this._applyModification(Du,arguments)},greyscale:function(){return this._applyModification(Ru,arguments)},spin:function(){return this._applyModification(Nu,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Bu,arguments)},complement:function(){return this._applyCombination(Fu,arguments)},monochromatic:function(){return this._applyCombination(Vu,arguments)},splitcomplement:function(){return this._applyCombination(zu,arguments)},triad:function(){return this._applyCombination(Uu,[3])},tetrad:function(){return this._applyCombination(Uu,[4])}},Ou.fromRatio=function(t,e){if("object"==Su(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Zu(t[r]));t=n}return Ou(t,e)},Ou.equals=function(t,e){return!(!t||!e)&&Ou(t).toRgbString()==Ou(e).toRgbString()},Ou.random=function(){return Ou.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ou.mix=function(t,e,n){n=0===n?0:n||50;var r=Ou(t).toRgb(),i=Ou(e).toRgb(),o=n/100;return Ou({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},Ou.readability=function(t,e){var n=Ou(t),r=Ou(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Ou.isReadable=function(t,e,n){var r,i,o,a,s,u=Ou.readability(t,e);switch(i=!1,"AA"!==(a=((o=(o=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(s=(o.size||"small").toLowerCase())&&"large"!==s&&(s="small"),(r={level:a,size:s}).level+r.size){case"AAsmall":case"AAAlarge":i=u>=4.5;break;case"AAlarge":i=u>=3;break;case"AAAsmall":i=u>=7}return i},Ou.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var l=0;l<e.length;l++)(r=Ou.readability(t,e[l]))>u&&(u=r,s=Ou(e[l]));return Ou.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,Ou.mostReadable(t,["#fff","#000"],n))};var Gu=Ou.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Wu=Ou.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Gu);function Xu(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Hu(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Yu(t){return Math.min(1,Math.max(0,t))}function $u(t){return parseInt(t,16)}function qu(t){return 1==t.length?"0"+t:""+t}function Zu(t){return t<=1&&(t=100*t+"%"),t}function Ku(t){return Math.round(255*parseFloat(t)).toString(16)}function Ju(t){return $u(t)/255}var Qu,tl,el,nl=(tl="[\\s|\\(]+("+(Qu="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")\\s*\\)?",el="[\\s|\\(]+("+Qu+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")[,|\\s]+("+Qu+")\\s*\\)?",{CSS_UNIT:new RegExp(Qu),rgb:new RegExp("rgb"+tl),rgba:new RegExp("rgba"+el),hsl:new RegExp("hsl"+tl),hsla:new RegExp("hsla"+el),hsv:new RegExp("hsv"+tl),hsva:new RegExp("hsva"+el),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function rl(t){return!!nl.CSS_UNIT.exec(t)}var il=function(t){return Ou.mostReadable(t,["#1A1B1D","#FFFFFF"]).toString()};function ol(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 al(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)?al(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 al(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 sl=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}},ul=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,A=e.icon,O=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=ol(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,M=2*I,L=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,Ms)}}(I,o),N=L.nodeInfoLevel,F=L.fontInfoLevel,U=L.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(A)),V=il(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(A),$=Boolean(O);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=Ls(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,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,R,G,Q,D)}if(zs(t,s,l,z,I),C>0&&Fs(t,s,l,W,k),Y){var tt=N<2||!(X||H),et=N>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(A,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=M*(null!==(ut=O.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=O.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=O.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(O.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),wt=Ls(V,bt),xt='"Open Sans", sans-serif';if(X&&bt>0){var _t=ru(t,d,xt,B,.7*M,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,At=d.split("").map((function(t){return[]}));Vs(t,_t,At,Tt,B,xt,St,s,l)}if(H){var Ot=N<2?0:1,Pt=r.getValueForAnimationName(T,"textOpacity",Ot,0),Et=Ls(V,Pt),kt='"Open Sans", sans-serif',Ct=Boolean(A);if(Pt>0){var jt=iu(v),Dt=jt.stylesPerChar,Rt=jt.fullCaption,It="center"===m?.7*M:2*Math.sqrt(Math.pow(M/2,2)-Math.pow(M/3,2)),Mt=ru(t,Rt,kt,B,It,Ct,F,null==e||e.captionAlign);t.fillStyle=Et;var Lt,Nt=B,Ft=-(Mt.length-2)*Nt/2;Lt=m&&"center"!==m?"bottom"===m?Ft+I/Math.PI:Ft-I/Math.PI:Ft,Vs(t,Mt,Dt,Lt,B,kt,Nt,s,l)}}t.save(),t.restore()};function ll(t){return ll="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},ll(t)}function cl(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?cl(Object(n),!0).forEach((function(e){vl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function hl(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 dl(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)?dl(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 dl(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 pl(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,yl(r.key),r)}}function vl(t,e,n){return(e=yl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yl(t){var e=function(t,e){if("object"!=ll(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ll(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ll(e)?e:String(e)}var ml="canvasRenderer",gl=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),vl(this,"arrowBundler",void 0),vl(this,"activeNodes",void 0),vl(this,"canvas",void 0),vl(this,"context",void 0),vl(this,"state",void 0),vl(this,"stateDisposers",void 0),vl(this,"relationshipThreshold",void 0),vl(this,"animationHandler",void 0),vl(this,"imageCache",void 0),vl(this,"needsRun",void 0),vl(this,"nodeVersion",void 0),vl(this,"relVersion",void 0),vl(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(ml),r.rels.addChannel(ml),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[ml],r=t.rels.channels[ml],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(ml)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(ml),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=hl(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=fl(fl({},p[m.from]),v[m.from]),w=fl(fl({},p[m.to]),v[m.to]),x=t||f>l||void 0!==m.captionHtml,_=_u(m,g,b,w,x,c!==la);if(null!==_){var S,T,A,O,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!==(A=w.x)&&void 0!==A?A:0,y:null!==(O=w.y)&&void 0!==O?O: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(fl(fl({},m),{},{fromNode:b,toNode:w,showLabel:x})):!0===m.selected?i.push(fl(fl({},m),{},{fromNode:b,toNode:w,showLabel:x})):a.push(fl(fl({},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=hl(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=sl(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(fl({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(fl({},f)):a.push(fl({},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=hl(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;ul(e,fl(fl({},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=hl(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;xu(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=hl(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=hl(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=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(ml),this.state.rels.removeChannel(ml)}},{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&&pl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),bl=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 wl(t){return wl="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},wl(t)}function xl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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,Al(r.key),r)}}function Sl(t,e,n){return e&&_l(t.prototype,e),n&&_l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tl(t,e,n){return(e=Al(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Al(t){var e=function(t,e){if("object"!=wl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=wl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wl(e)?e:String(e)}var Ol="WebGLRenderer",Pl=function(){function t(e){var n=this;if(xl(this,t),Tl(this,"mainSceneRenderer",void 0),Tl(this,"minimapRenderer",void 0),Tl(this,"needsRun",void 0),Tl(this,"minimapMouseDown",void 0),Tl(this,"stateDisposers",void 0),Tl(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(Ol),s.addChannel(Ol),this.state=r,this.setupMinimapInteractions()}return Sl(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[Ol].adds).length>0,r=Object.values(e.channels[Ol].adds).length>0,i=Object.values(t.channels[Ol].removes).length>0,o=Object.values(e.channels[Ol].removes).length>0,a=Object.values(t.channels[Ol].updates),s=Object.values(e.channels[Ol].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(Ol),e.clearChannel(Ol)}},{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=bl(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(Ol),this.state.rels.removeChannel(Ol),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),El=function(){function t(){xl(this,t),Tl(this,"mainSceneRenderer",void 0),Tl(this,"minimapRenderer",void 0),Tl(this,"needsRun",void 0),Tl(this,"minimapMouseDown",void 0),Tl(this,"stateDisposers",void 0),Tl(this,"state",void 0)}return Sl(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 kl(t){return kl="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},kl(t)}function Cl(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 jl(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)?jl(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 jl(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 Dl(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,Il(r.key),r)}}function Rl(t,e,n){return(e=Il(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Il(t){var e=function(t,e){if("object"!=kl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=kl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kl(e)?e:String(e)}var Ml,Ll=24,Nl=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]},Fl=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),Rl(this,"nodeShader",void 0),Rl(this,"nodeAnimShader",void 0),Rl(this,"relShader",void 0),Rl(this,"relDataBuffer",void 0),Rl(this,"viewportBoxShader",void 0),Rl(this,"defaultRelColor",void 0),Rl(this,"defaultNodeColor",void 0),Rl(this,"disableRelColor",void 0),Rl(this,"disableNodeColor",void 0),Rl(this,"gl",void 0),Rl(this,"activeNodes",void 0),Rl(this,"canvas",void 0),Rl(this,"projection",void 0),Rl(this,"idToIndex",void 0),Rl(this,"posBuffer",void 0),Rl(this,"numRels",void 0),Rl(this,"numNodes",void 0),Rl(this,"nodeDataByte",void 0),Rl(this,"relIdToIndex",void 0),Rl(this,"relData",void 0),Rl(this,"viewportBoxBuffer",void 0),Rl(this,"relBuffer",void 0),Rl(this,"nodeBuffer",void 0),Rl(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=Or(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=Cl(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=Cl(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=Or(t),r=this.gl,i=!1,o=Cl(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:Nl(!0===c?this.disableRelColor:l);this.relData.positionsAndColors[f*Ll+0]=h,this.relData.positionsAndColors[f*Ll+4]=h,this.relData.positionsAndColors[f*Ll+8]=h,this.relData.positionsAndColors[f*Ll+12]=h,this.relData.positionsAndColors[f*Ll+16]=h,this.relData.positionsAndColors[f*Ll+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*Ll+3]=u,this.relData.widths[f*Ll+7]=u,this.relData.widths[f*Ll+11]=u,this.relData.widths[f*Ll+15]=u,this.relData.widths[f*Ll+19]=u,this.relData.widths[f*Ll+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:Nl(d);s[3*l+0]=!0===m?Nl(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*Ll*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:Nl(h),A=!0===v?Nl(e.disableRelColor):T,O=null!=d?d:1;s[p]=r;var P=0,E=function(t,e,n,i){l[r*Ll+P]=t,P+=1;for(var s=0;s<e.length;s++)a[s]=e[s];l[r*Ll+P]=o[0],P+=1,a[0]=n,l[r*Ll+P]=o[0],c[r*Ll+(P+=1)]=i,P+=1};E(A,_,255,O),E(A,S,0,O),E(A,_,0,O),E(A,S,0,O),E(A,_,0,O),E(A,S,255,O)},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&&Dl(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ul=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")},zl=function(t){Gr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==Ml&&Ml(t)},Bl=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;Ul(t,n,r)},Vl=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),Ul(n,t,e),n},Gl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,xr),void 0!==t&&(t.appendChild(n),Bl(n)),function(t,e){Ml=e,t.addEventListener("webglcontextlost",zl)}(n,e),n},Wl=function(t){t.width=0,t.height=0,t.remove()},Xl=function(t){return t.getContext("2d")},Hl=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},Yl=function(t){t.canvas.removeEventListener("webglcontextlost",zl);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function $l(t){return function(t){if(Array.isArray(t))return Kl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Zl(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 ql(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Zl(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 Zl(t,e){if(t){if("string"==typeof t)return Kl(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)?Kl(t,e):void 0}}function Kl(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 Jl=br*_r();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 tc(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,ec(r.key),r)}}function ec(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 nc=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=ec(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&&tc(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),rc=i(481),ic=i.n(rc);function oc(t){return oc="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},oc(t)}function ac(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,uc(r.key),r)}}function sc(t,e,n){return(e=uc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uc(t){var e=function(t,e){if("object"!=oc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=oc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oc(e)?e:String(e)}var lc=5e-5,cc=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),sc(this,"xCtrl",void 0),sc(this,"yCtrl",void 0),sc(this,"zoomCtrl",void 0),sc(this,"getNodePositions",void 0),sc(this,"firstUpdate",void 0),sc(this,"state",void 0),sc(this,"canvas",void 0),sc(this,"defaultZoomLevel",void 0),sc(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(ic())(.35,lc,.05,1),this.yCtrl=new(ic())(.35,lc,.05,1),this.zoomCtrl=new(ic())(.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=Mo(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 _=Lo(w,x,n,r),S=_.zoomX,T=_.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var A=No(S,T,e.minZoom,e.maxZoom);!0===e.outOnly&&f<A?a.setTarget(f):a.setTarget(A)}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=Mo(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&&ac(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fc(t){return fc="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},fc(t)}function hc(){hc=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:O(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 A(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"==fc(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 O(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(fc(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(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(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 dc(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 pc(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 vc(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 yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vc(Object(n),!0).forEach((function(e){gc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mc(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,bc(r.key),r)}}function gc(t,e,n){return(e=bc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bc(t){var e=function(t,e){if("object"!=fc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=fc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fc(e)?e:String(e)}var wc="NvlController",xc={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},_c="onError",Sc="onLayoutDone",Tc={},Ac=function(){var t;return null!==(t=Tc[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Tc).pop()},Oc=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),gc(this,"destroyed",void 0),gc(this,"state",void 0),gc(this,"callbacks",void 0),gc(this,"instanceId",void 0),gc(this,"glController",void 0),gc(this,"webGLContext",void 0),gc(this,"webGLMinimapContext",void 0),gc(this,"htmlOverlay",void 0),gc(this,"hasResized",void 0),gc(this,"hierarchicalLayout",void 0),gc(this,"gridLayout",void 0),gc(this,"freeLayout",void 0),gc(this,"d3ForceLayout",void 0),gc(this,"forceLayout",void 0),gc(this,"canvasRenderer",void 0),gc(this,"glCanvas",void 0),gc(this,"canvasRect",void 0),gc(this,"glMinimapCanvas",void 0),gc(this,"c2dCanvas",void 0),gc(this,"isInRenderSwitchAnimation",void 0),gc(this,"justSwitchedRenderer",void 0),gc(this,"justSwitchedLayout",void 0),gc(this,"layoutUpdating",void 0),gc(this,"layoutComputing",void 0),gc(this,"isRenderingDisabled",void 0),gc(this,"setRenderSwitchAnimation",void 0),gc(this,"stateDisposers",void 0),gc(this,"zoomTransitionHandler",void 0),gc(this,"currentLayout",void 0),gc(this,"layoutTimeLimit",void 0),gc(this,"pixelRatio",void 0),gc(this,"removeResizeListener",void 0),gc(this,"removeMinimapResizeListener",void 0),gc(this,"pendingZoomOperation",void 0),gc(this,"layoutRunner",void 0),gc(this,"animationRequestId",void 0),gc(this,"layoutDoneCallback",void 0),gc(this,"layoutComputingCallback",void 0),gc(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 nc,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=Gl(g,this.onWebGLContextLost.bind(this)),w=Gl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new El;else{var x=Hl(b),_=Hl(w);this.glController=new Pl({mainSceneRenderer:new Fl(x,p,v,this.state),minimapRenderer:new Fl(_,p,v,this.state),state:e}),this.webGLContext=x,this.webGLMinimapContext=_}var S=Gl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),A=document.createElement("div");Object.assign(A.style,yc(yc({},xr),{},{overflow:"hidden"})),g.appendChild(A),this.htmlOverlay=A,this.hasResized=!0,this.hierarchicalLayout=new Na(yc(yc({},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(yc(yc({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var O=new gl(S,T,e,n);this.canvasRenderer=O,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(wc),v.addChannel(wc),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 cc({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(){Bl(b),Bl(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=Pn()(l,(function(){Bl(w)})),Tc[d]=this,window.__Nvl_dumpNodes=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Ac(e))||void 0===n?void 0:n.on(Sc,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Ac(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Ac(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=Mo(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=No(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(_c))throw e;t.callIfRegistered(_c,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(wc),r.clearChannel(wc),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,A=_.width,O=_.height,P=t.mapCanvasSpaceToRelativePosition(T.x,T.y),E=P.x,k=P.y,C=A>5&&!t.state.webGLVisible;Object.assign(x.style,{top:"".concat(k,"px"),left:"".concat(E,"px"),width:"".concat(A,"px"),height:"".concat(O,"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,M=n.idToHtmlOverlay[R];if(M){var L=t.state.nodes.idToPosition[R],N=t.mapCanvasSpaceToRelativePosition(L.x,L.y),F=N.x,U=N.y,z="".concat(2*(null!=I?I:br),"px");Object.assign(M.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(Sc),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(_c))throw e;t.callIfRegistered(_c,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 pc(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)?pc(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(yc(yc({},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=ql(s.items);try{for(w.s();!(b=w.n()).done;){var x=b.value,_=x.from,S=x.to,T=a.idToPosition[_],A=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==A.x&&void 0!==A.y){var O=T.x>u&&T.x<l&&T.y>c&&T.y<f,P=A.x>u&&A.x<l&&A.y>c&&A.y<f;O&&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&&Yl(this.webGLContext),void 0!==this.webGLMinimapContext&&Yl(this.webGLMinimapContext),Wl(this.glCanvas),Wl(this.glMinimapCanvas),this.canvasRenderer.destroy(),Wl(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 Tc[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=yc(yc({},xc),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=Vl(this.c2dCanvas.width,this.c2dCanvas.height),s=Xl(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),Wl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=yc(yc({},xc),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Mo(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=Vl(h,d),s=Xl(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),Wl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=hc().mark((function t(e){var n,r,i,o;return hc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=yc(yc({},xc),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(_c)){t.next=16;break}this.callIfRegistered(_c,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){dc(o,n,i,a,s,"next",t)}function s(t){dc(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&mc(e.prototype,n),Object.defineProperty(e,"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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kc(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,jc(r.key),r)}}function Cc(t,e,n){return e&&kc(t.prototype,e),n&&kc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function jc(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 Dc=function(){function t(e,n){if(Ec(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Cc(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}(),Rc=function(){function t(e){Ec(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Cc(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}(),Ic=function(){function t(){Ec(this,t),this.root=new Dc(new Rc("Performance Tree"),null),this.current=this.root}return Cc(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Dc(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 Dc(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}(),Mc=function(){function t(){Ec(this,t),window.performance?(this.disabled=!1,this.tree=new Ic):(this.disabled=!0,this.tree=null)}return Cc(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 Rc(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}(),Lc=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};const Nc=(t=>{var e={};return i.d(e,t),e})({AnalyticsBrowser:()=>e.AnalyticsBrowser});var Fc,Uc=new Uint8Array(16);function zc(){if(!Fc&&!(Fc="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 Fc(Uc)}const Bc=/^(?:[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 Vc=[],Gc=0;Gc<256;++Gc)Vc.push((Gc+256).toString(16).substr(1));const Wc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Vc[t[e+0]]+Vc[t[e+1]]+Vc[t[e+2]]+Vc[t[e+3]]+"-"+Vc[t[e+4]]+Vc[t[e+5]]+"-"+Vc[t[e+6]]+Vc[t[e+7]]+"-"+Vc[t[e+8]]+Vc[t[e+9]]+"-"+Vc[t[e+10]]+Vc[t[e+11]]+Vc[t[e+12]]+Vc[t[e+13]]+Vc[t[e+14]]+Vc[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&Bc.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n};var Xc,Hc,Yc=0,$c=0;const qc=function(t,e,n){var r=e&&n||0,i=e||new Array(16),o=(t=t||{}).node||Xc,a=void 0!==t.clockseq?t.clockseq:Hc;if(null==o||null==a){var s=t.random||(t.rng||zc)();null==o&&(o=Xc=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=Hc=16383&(s[6]<<8|s[7]))}var u=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:$c+1,c=u-Yc+(l-$c)/1e4;if(c<0&&void 0===t.clockseq&&(a=a+1&16383),(c<0||u>Yc)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yc=u,$c=l,Hc=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||Wc(i)};function Zc(t){return Zc="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},Zc(t)}function Kc(){Kc=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:O(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 A(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"==Zc(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 O(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(Zc(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(A.prototype),l(A.prototype,s,(function(){return this})),e.AsyncIterator=A,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new A(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 Jc(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 Qc(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,tf(r.key),r)}}function tf(t){var e=function(t,e){if("object"!=Zc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zc(e)?e:String(e)}var ef=window.localStorage,nf="neo4j.nvl.sTid",rf=!1,of=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=tf(n="analytics"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r;var i=new Nc.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=Kc().mark((function t(e){var n;return Kc().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){Jc(o,r,i,a,s,"next",t)}function s(t){Jc(o,r,i,a,s,"throw",t)}a(void 0)}))},function(t){return n.apply(this,arguments)})},{key:"identify",value:function(){if(!rf){var t=this.getSegmentTrackingId();this.analytics.identify(t).catch((function(t){Gr.debug("TRACKING: Identifying user for Segment tracking failed. err: ".concat(t))})),rf=!0}}},{key:"loadSavedSegmentId",value:function(){try{var t=ef.getItem(nf);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:qc();return this.saveTrackingId(e),e}},{key:"saveTrackingId",value:function(t){ef.setItem(nf,t)}},{key:"ready",value:function(){return this.analytics.ready().catch((function(t){Gr.debug("TRACKING: segment track instance not ready. err: ".concat(t))}))}}],i&&Qc(r.prototype,i),o&&Qc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function af(t){return af="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},af(t)}function sf(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)||lf(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 uf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=lf(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 lf(t,e){if(t){if("string"==typeof t)return cf(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)?cf(t,e):void 0}}function cf(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 ff(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 hf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ff(Object(n),!0).forEach((function(e){pf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function df(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,vf(r.key),r)}}function pf(t,e,n){return(e=vf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vf(t){var e=function(t,e){if("object"!=af(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=af(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==af(e)?e:String(e)}var yf=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),pf(this,"externalCallbackHandler",void 0),pf(this,"performance",void 0),pf(this,"visState",void 0),pf(this,"nvlController",void 0),pf(this,"options",void 0),pf(this,"segmentTrack",void 0),!0!==i.disableTelemetry&&(this.segmentTrack=new of,this.segmentTrack.init("4SGwdwzuDm5WkFvQtz7D6ATQlo14yjmW"),this.segmentTrack.identify()),this.setupLogging(i),this.externalCallbackHandler=new l(o),this.performance=new Mc,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,hf({},n)),this.visState.rels.update(e,hf({},n)),this.visState.nodes.add(t,hf({},n)),this.visState.rels.add(e,hf({},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 hf(hf({},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,hf({},n)),this.visState.rels.update(e,hf({},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,hf({},n)),this.visState.rels.add(e,hf({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,n.isEmpty)(t)){var e,r={},i=uf(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=uf(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 hf(hf({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return hf(hf({},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=bl(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,$l(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=ql(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,$l(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=ql(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<=Jl){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,$l(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,$l(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return hf(hf({},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),A=ta({},oa.selected);return void 0!==l&&("string"==typeof u&&null!==jo().get.rgb(l)?(T.rings[1].color=l,A.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:A},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 Oc(this.visState,o),this.addAndUpdateElementsInGraph(r,i),this.nvlController.on("restart",this.restart.bind(this));var a,s,u=uf((a=this.externalCallbackHandler.callbacks,Object.entries(a)));try{for(u.s();!(s=u.n()).done;){var l=sf(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=hf(hf({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!Lc(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 Li("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&&df(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),mf={textColorForBackground:il};const gf=yf})();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};