@neo4j-nvl/base 0.3.1-016e1c20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +49 -0
- package/README.md +43 -0
- package/dist/base.mjs +2 -0
- package/dist/base.mjs.LICENSE.txt +10 -0
- package/dist/types/index.d.ts +379 -0
- package/dist/types/layouts/animatedlayout/AnimatedLayout.d.ts +25 -0
- package/dist/types/layouts/animatedlayout/animationUtils.d.ts +9 -0
- package/dist/types/layouts/d3forcelayout/circularLayout.d.ts +5 -0
- package/dist/types/layouts/d3forcelayout/constants.d.ts +18 -0
- package/dist/types/layouts/d3forcelayout/d3ForceLayout.d.ts +29 -0
- package/dist/types/layouts/d3forcelayout/types.d.ts +9 -0
- package/dist/types/layouts/forcedirectedlayout/ForceCytoLayout.d.ts +22 -0
- package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +32 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +167 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/glwrapper.d.ts +4 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-fragment.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-repulsive-fragment.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-update-fragment.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/sim-vertex.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/workaround-fragment.d.ts +2 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/SolarMerger.d.ts +43 -0
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/solar-placer.d.ts +2 -0
- package/dist/types/layouts/freeLayout/FreeLayout.d.ts +26 -0
- package/dist/types/layouts/gridLayout/GridLayout.d.ts +16 -0
- package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +26 -0
- package/dist/types/layouts/hierarchicallayout/constants.d.ts +11 -0
- package/dist/types/modules/CallbackHelper.d.ts +38 -0
- package/dist/types/modules/ExternalCallbackHandler.d.ts +26 -0
- package/dist/types/modules/NvlController.d.ts +114 -0
- package/dist/types/modules/Shader.d.ts +18 -0
- package/dist/types/modules/ZoomTransitionHandler.d.ts +27 -0
- package/dist/types/modules/dataset.d.ts +37 -0
- package/dist/types/modules/logging.d.ts +8 -0
- package/dist/types/modules/performance.d.ts +93 -0
- package/dist/types/modules/state.d.ts +242 -0
- package/dist/types/renderers/canvasrenderer/Animation.d.ts +64 -0
- package/dist/types/renderers/canvasrenderer/AnimationHandler.d.ts +72 -0
- package/dist/types/renderers/canvasrenderer/CanvasRenderer.d.ts +92 -0
- package/dist/types/renderers/canvasrenderer/ImageCache.d.ts +11 -0
- package/dist/types/renderers/canvasrenderer/arrows/ArrowBundle.d.ts +79 -0
- package/dist/types/renderers/canvasrenderer/arrows/ArrowBundler.d.ts +33 -0
- package/dist/types/renderers/canvasrenderer/arrows/arrows.d.ts +52 -0
- package/dist/types/renderers/canvasrenderer/arrows/constants.d.ts +41 -0
- package/dist/types/renderers/canvasrenderer/nodes/nodes.d.ts +58 -0
- package/dist/types/renderers/canvasrenderer/types.d.ts +47 -0
- package/dist/types/renderers/canvasrenderer/util.d.ts +69 -0
- package/dist/types/renderers/canvasrenderer/vectorUtils.d.ts +21 -0
- package/dist/types/renderers/canvasrenderer/wordwrap.d.ts +42 -0
- package/dist/types/renderers/webglrenderer/Controller.d.ts +66 -0
- package/dist/types/renderers/webglrenderer/Renderer.d.ts +51 -0
- package/dist/types/renderers/webglrenderer/node-animation-fragment.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/node-animation-vertex.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/node-fragment-point.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/node-vertex-point.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/rel-fragment-line.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/rel-vertex-line.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/viewport-box-fragment.d.ts +2 -0
- package/dist/types/renderers/webglrenderer/viewport-box-vertex.d.ts +2 -0
- package/dist/types/types/graph-element.d.ts +117 -0
- package/dist/types/types/nvl-window-functions.d.ts +15 -0
- package/dist/types/types/utils.d.ts +1 -0
- package/dist/types/utils/canvasManagement.d.ts +15 -0
- package/dist/types/utils/colorMapperFunctions.d.ts +6 -0
- package/dist/types/utils/constants.d.ts +30 -0
- package/dist/types/utils/errors.d.ts +11 -0
- package/dist/types/utils/geometry.d.ts +122 -0
- package/dist/types/utils/graphObjectUtils.d.ts +9 -0
- package/dist/types/utils/hittest.d.ts +56 -0
- package/dist/types/utils/mouseUtils.d.ts +9 -0
- package/dist/types/utils/zoomFunctions.d.ts +20 -0
- package/package.json +65 -0
package/dist/base.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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,E=[],P=[],k=1,j=0,C=0,R=!1,D=!1,I="",L=o,M=r;"300 es"===(t=t||{}).version&&(L=s,M=a);var N={},U={};for(T=0;T<L.length;T++)N[L[T]]=!0;for(T=0;T<M.length;T++)U[M[T]]=!0;return function(t){return P=[],null!==t?function(t){var n;for(T=0,t.toString&&(t=t.toString()),I+=t.replace(/\r\n/g,"\n"),S=I.length;e=I[T],T<S;){switch(n=T,A){case c:T=G();break;case f:case h:T=V();break;case d:T=W();break;case p:T=Y();break;case w:T=H();break;case v:T=$();break;case l:T=q();break;case b:T=B();break;case u:T=z()}n!==T&&("\n"===I[n]?(j=0,++k):++j)}return O+=T,I=I.slice(T),P}(t):(E.length&&F(E.join("")),A=_,F("(eof)"),P)};function F(t){t.length&&P.push({type:x[A],data:t,position:C,line:k,column:j})}function z(){return E=E.length?[]:E,"/"===n&&"*"===e?(C=O+T-1,A=c,n=e,T+1):"/"===n&&"/"===e?(C=O+T-1,A=f,n=e,T+1):"#"===e?(A=h,C=O+T,T):/\s/.test(e)?(A=b,C=O+T,T):(R=/\d/.test(e),D=/[^\w_]/.test(e),C=O+T,A=R?p:D?d:l,T)}function B(){return/[^\s]/g.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function V(){return"\r"!==e&&"\n"!==e||"\\"===n?(E.push(e),n=e,T+1):(F(E.join("")),A=u,T)}function G(){return"/"===e&&"*"===n?(E.push(e),F(E.join("")),A=u,T+1):(E.push(e),n=e,T+1)}function W(){if("."===n&&/\d/.test(e))return A=v,T;if("/"===n&&"*"===e)return A=c,T;if("/"===n&&"/"===e)return A=f,T;if("."===e&&E.length){for(;X(E););return A=v,T}if(";"===e||")"===e||"("===e){if(E.length)for(;X(E););return F(e),A=u,T+1}var t=2===E.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;X(E););return A=u,T}return E.push(e),n=e,T+1}function X(t){for(var e,n,r=0;;){if(e=i.indexOf(t.slice(0,t.length+r).join("")),n=i[e],-1===e){if(r--+t.length>0)continue;n=t.slice(0,1).join("")}return F(n),C+=n.length,(E=E.slice(n.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function Y(){return"."===e||/[eE]/.test(e)?(E.push(e),A=v,n=e,T+1):"x"===e&&1===E.length&&"0"===E[0]?(A=w,E.push(e),n=e,T+1):/[^\d]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function $(){return"f"===e&&(E.push(e),n=e,T+=1),/[eE]/.test(e)?(E.push(e),n=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(n))&&/[^\d]/.test(e)?(F(E.join("")),A=u,T):(E.push(e),n=e,T+1)}function q(){if(/[^\d\w_]/.test(e)){var t=E.join("");return A=U[t]?g:N[t]?m:y,F(E.join("")),A=u,T}return E.push(e),n=e,T+1}};var r=n(704),i=n(63),o=n(192),a=n(784),s=n(592),u=999,l=9999,c=0,f=1,h=2,d=3,p=4,v=5,y=6,m=7,g=8,b=9,_=10,w=11,x=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},592:(t,e,n)=>{var r=n(192);r=r.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=r.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},192:t=>{t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},784:(t,e,n)=>{var r=n(704);t.exports=r.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},704:t=>{t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},63:t=>{t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},45:(t,e,n)=>{var r=n(206);t.exports=function(t,e){var n=r(e),i=[];return(i=i.concat(n(t))).concat(n(null))}},861:t=>{t.exports=function(t){t.charAt&&"#"===t.charAt(0)&&(t=function(t){var e=t.split("");return e.shift(),e.join("")}(t)),3===t.length&&(t=function(t){return t.split("").reduce((function(t,e){return t.concat([e,e])}),[]).join("")}(t));var e=parseInt(t,16);return[e>>16&255,e>>8&255,255&e]}},250:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],v="[object Arguments]",y="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",S="[object Number]",T="[object Object]",O="[object Promise]",A="[object RegExp]",E="[object Set]",P="[object String]",k="[object Symbol]",j="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",I="[object Float64Array]",L="[object Int8Array]",M="[object Int16Array]",N="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Y=RegExp(X.source),$=RegExp(H.source),q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",Ot="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pt="["+wt+"]",kt="["+Et+"]",jt="["+xt+"]",Ct="\\d+",Rt="["+St+"]",Dt="["+Tt+"]",It="[^"+wt+Et+Ct+St+Tt+Ot+"]",Lt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+wt+"]",Nt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ut="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Ot+"]",zt="\\u200d",Bt="(?:"+Dt+"|"+It+")",Vt="(?:"+Ft+"|"+It+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+jt+"|"+Lt+")?",Ht="["+At+"]?",Yt=Ht+Xt+"(?:"+zt+"(?:"+[Mt,Nt,Ut].join("|")+")"+Ht+Xt+")*",$t="(?:"+[Rt,Nt,Ut].join("|")+")"+Yt,qt="(?:"+[Mt+jt+"?",jt,Nt,Ut,Pt].join("|")+")",Zt=RegExp("['’]","g"),Kt=RegExp(jt,"g"),Jt=RegExp(Lt+"(?="+Lt+")|"+qt+Yt,"g"),Qt=RegExp([Ft+"?"+Dt+"+"+Gt+"(?="+[kt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[kt,Ft+Bt,"$"].join("|")+")",Ft+"?"+Bt+"+"+Gt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,$t].join("|"),"g"),te=RegExp("["+zt+wt+xt+At+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,ie={};ie[D]=ie[I]=ie[L]=ie[M]=ie[N]=ie[U]=ie[F]=ie[z]=ie[B]=!0,ie[v]=ie[y]=ie[C]=ie[m]=ie[R]=ie[g]=ie[b]=ie[_]=ie[x]=ie[S]=ie[T]=ie[A]=ie[E]=ie[P]=ie[j]=!1;var oe={};oe[v]=oe[y]=oe[C]=oe[R]=oe[m]=oe[g]=oe[D]=oe[I]=oe[L]=oe[M]=oe[N]=oe[x]=oe[S]=oe[T]=oe[A]=oe[E]=oe[P]=oe[k]=oe[U]=oe[F]=oe[z]=oe[B]=!0,oe[b]=oe[_]=oe[j]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,ue=parseInt,le="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ve=pe&&le.process,ye=function(){try{return de&&de.require&&de.require("util").types||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),me=ye&&ye.isArrayBuffer,ge=ye&&ye.isDate,be=ye&&ye.isMap,_e=ye&&ye.isRegExp,we=ye&&ye.isSet,xe=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ee(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Pe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ke(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function je(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ce(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Re(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function De(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ie(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Me=Ge("length");function Ne(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ue(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ue(t,Be,n)}function ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?He(t,e)/n:h}function Ge(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function He(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function $e(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function qe(t){return function(e){return t(e)}}function Ze(t,e){return Ce(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}var tn=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==s||(t[n]=s,o[i++]=n)}return o}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Me(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var dn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,it=e.Date,wt=e.Error,xt=e.Function,St=e.Math,Tt=e.Object,Ot=e.RegExp,At=e.String,Et=e.TypeError,Pt=r.prototype,kt=xt.prototype,jt=Tt.prototype,Ct=e["__core-js_shared__"],Rt=kt.toString,Dt=jt.hasOwnProperty,It=0,Lt=(n=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Mt=jt.toString,Nt=Rt.call(Tt),Ut=fe._,Ft=Ot("^"+Rt.call(Dt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=pe?e.Buffer:i,Bt=e.Symbol,Vt=e.Uint8Array,Gt=zt?zt.allocUnsafe:i,Wt=an(Tt.getPrototypeOf,Tt),Xt=Tt.create,Ht=jt.propertyIsEnumerable,Yt=Pt.splice,$t=Bt?Bt.isConcatSpreadable:i,qt=Bt?Bt.iterator:i,Jt=Bt?Bt.toStringTag:i,te=function(){try{var t=uo(Tt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=it&&it.now!==fe.Date.now&&it.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=St.ceil,de=St.floor,ve=Tt.getOwnPropertySymbols,ye=zt?zt.isBuffer:i,Me=e.isFinite,We=Pt.join,vn=an(Tt.keys,Tt),yn=St.max,mn=St.min,gn=it.now,bn=e.parseInt,_n=St.random,wn=Pt.reverse,xn=uo(e,"DataView"),Sn=uo(e,"Map"),Tn=uo(e,"Promise"),On=uo(e,"Set"),An=uo(e,"WeakMap"),En=uo(Tt,"create"),Pn=An&&new An,kn={},jn=No(xn),Cn=No(Sn),Rn=No(Tn),Dn=No(On),In=No(An),Ln=Bt?Bt.prototype:i,Mn=Ln?Ln.valueOf:i,Nn=Ln?Ln.toString:i;function Un(t){if(ts(t)&&!Ga(t)&&!(t instanceof Vn)){if(t instanceof Bn)return t;if(Dt.call(t,"__wrapped__"))return Uo(t)}return new Bn(t)}var Fn=function(){function t(){}return function(e){if(!Qa(e))return{};if(Xt)return Xt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Bn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Wn(t);this.size=e.size}function $n(t,e){var n=Ga(t),r=!n&&Va(t),i=!n&&!r&&Ya(t),o=!n&&!r&&!i&&us(t),a=n||r||i||o,s=a?Ye(t.length,At):[],u=s.length;for(var l in t)!e&&!Dt.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yo(l,u))||s.push(l);return s}function qn(t){var e=t.length;return e?t[Xr(0,e-1)]:i}function Zn(t,e){return Ro(Ai(t),or(e,0,t.length))}function Kn(t){return Ro(Ai(t))}function Jn(t,e,n){(n!==i&&!Fa(t[e],n)||n===i&&!(e in t))&&rr(t,e,n)}function Qn(t,e,n){var r=t[e];Dt.call(t,e)&&Fa(r,n)&&(n!==i||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Fa(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function nr(t,e){return t&&Ei(e,js(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ir(t,e){for(var n=-1,o=e.length,a=r(o),s=null==t;++n<o;)a[n]=s?i:Os(t,e[n]);return a}function or(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ar(t,e,n,r,o,a){var s,u=1&e,l=2&e,c=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!Qa(t))return t;var f=Ga(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Dt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ai(t,s)}else{var h=fo(t),d=h==_||h==w;if(Ya(t))return _i(t,u);if(h==T||h==v||d&&!o){if(s=l||d?{}:po(t),!u)return l?function(t,e){return Ei(t,co(t),e)}(t,function(t,e){return t&&Ei(e,Cs(e),t)}(s,t)):function(t,e){return Ei(t,lo(t),e)}(t,nr(s,t))}else{if(!oe[h])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case C:return wi(t);case m:case g:return new i(+t);case R:return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case D:case I:case L:case M:case N:case U:case F:case z:case B:return xi(t,n);case x:return new i;case S:case P:return new i(t);case A:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case E:return new i;case k:return r=t,Mn?Tt(Mn.call(r)):{}}}(t,h,u)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,s),os(t)?t.forEach((function(r){s.add(ar(r,e,n,r,t,a))})):es(t)&&t.forEach((function(r,i){s.set(i,ar(r,e,n,i,t,a))}));var y=f?i:(c?l?eo:to:l?Cs:js)(t);return Oe(y||t,(function(r,i){y&&(r=t[i=r]),Qn(s,i,ar(r,e,n,i,t,a))})),s}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function ur(t,e,n){if("function"!=typeof t)throw new Et(o);return Po((function(){t.apply(i,n)}),e)}function lr(t,e,n,r){var i=-1,o=ke,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Ce(e,qe(n))),r?(o=je,a=!1):e.length>=200&&(o=Ke,a=!1,e=new Hn(e));t:for(;++i<s;){var c=t[i],f=null==n?c:n(c);if(c=r||0!==c?c:0,a&&f==f){for(var h=l;h--;)if(e[h]===f)continue t;u.push(c)}else o(e,f,r)||u.push(c)}return u}Un.templateSettings={escape:q,evaluate:Z,interpolate:K,variable:"",imports:{_:Un}},Un.prototype=zn.prototype,Un.prototype.constructor=Un,Bn.prototype=Fn(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Fn(zn.prototype),Vn.prototype.constructor=Vn,Gn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(En){var n=e[t];return n===a?i:n}return Dt.call(e,t)?e[t]:i},Gn.prototype.has=function(t){var e=this.__data__;return En?e[t]!==i:Dt.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=En&&e===i?a:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?i:e[n][1]},Wn.prototype.has=function(t){return tr(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(Sn||Wn),string:new Gn}},Xn.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return ao(this,t).get(t)},Xn.prototype.has=function(t){return ao(this,t).has(t)},Xn.prototype.set=function(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,a),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var cr=ji(gr),fr=ji(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function dr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=e(a);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,l=a}return l}function pr(t,e){var n=[];return cr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=vo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?vr(s,e-1,n,r,i):Re(i,s):r||(i[i.length]=s)}return i}var yr=Ci(),mr=Ci(!0);function gr(t,e){return t&&yr(t,e,js)}function br(t,e){return t&&mr(t,e,js)}function _r(t,e){return Pe(e,(function(e){return Za(t[e])}))}function wr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Mo(e[n++])];return n&&n==r?t:i}function xr(t,e,n){var r=e(t);return Ga(t)?r:Re(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Tt(t)?function(t){var e=Dt.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(t){}var o=Mt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),o}(t):function(t){return Mt.call(t)}(t)}function Tr(t,e){return t>e}function Or(t,e){return null!=t&&Dt.call(t,e)}function Ar(t,e){return null!=t&&e in Tt(t)}function Er(t,e,n){for(var o=n?je:ke,a=t[0].length,s=t.length,u=s,l=r(s),c=1/0,f=[];u--;){var h=t[u];u&&e&&(h=Ce(h,qe(e))),c=mn(h.length,c),l[u]=!n&&(e||a>=120&&h.length>=120)?new Hn(u&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&f.length<c;){var v=h[d],y=e?e(v):v;if(v=n||0!==v?v:0,!(p?Ke(p,y):o(f,y,n))){for(u=s;--u;){var m=l[u];if(!(m?Ke(m,y):o(t[u],y,n)))continue t}p&&p.push(y),f.push(v)}}return f}function Pr(t,e,n){var r=null==(t=Oo(t,e=yi(e,t)))?t:t[Mo(qo(e))];return null==r?i:Se(r,t,n)}function kr(t){return ts(t)&&Sr(t)==v}function jr(t,e,n,r,o){return t===e||(null==t||null==e||!ts(t)&&!ts(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var s=Ga(t),u=Ga(e),l=s?y:fo(t),c=u?y:fo(e),f=(l=l==v?T:l)==T,h=(c=c==v?T:c)==T,d=l==c;if(d&&Ya(t)){if(!Ya(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Yn),s||us(t)?Ji(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case C:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case m:case g:case S:return Fa(+t,+e);case b:return t.name==e.name&&t.message==e.message;case A:case P:return t==e+"";case x:var s=on;case E:var u=1&r;if(s||(s=un),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=2,a.set(t,e);var c=Ji(s(t),s(e),r,i,o,a);return a.delete(t),c;case k:if(Mn)return Mn.call(t)==Mn.call(e)}return!1}(t,e,l,n,r,o,a);if(!(1&n)){var p=f&&Dt.call(t,"__wrapped__"),_=h&&Dt.call(e,"__wrapped__");if(p||_){var w=p?t.value():t,O=_?e.value():e;return a||(a=new Yn),o(w,O,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var s=1&n,u=to(t),l=u.length;if(l!=to(e).length&&!s)return!1;for(var c=l;c--;){var f=u[c];if(!(s?f in e:Dt.call(e,f)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=s;++c<l;){var y=t[f=u[c]],m=e[f];if(r)var g=s?r(m,y,f,e,t,a):r(y,m,f,t,e,a);if(!(g===i?y===m||o(y,m,n,r,a):g)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,jr,o))}function Cr(t,e,n,r){var o=n.length,a=o,s=!r;if(null==t)return!a;for(t=Tt(t);o--;){var u=n[o];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var l=(u=n[o])[0],c=t[l],f=u[1];if(s&&u[2]){if(c===i&&!(l in t))return!1}else{var h=new Yn;if(r)var d=r(c,f,l,t,e,h);if(!(d===i?jr(f,c,3,r,h):d))return!1}}return!0}function Rr(t){return!(!Qa(t)||(e=t,Lt&&Lt in e))&&(Za(t)?Ft:vt).test(No(t));var e}function Dr(t){return"function"==typeof t?t:null==t?nu:"object"==typeof t?Ga(t)?Ur(t[0],t[1]):Nr(t):fu(t)}function Ir(t){if(!wo(t))return vn(t);var e=[];for(var n in Tt(t))Dt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t,e){return t<e}function Mr(t,e){var n=-1,i=Xa(t)?r(t.length):[];return cr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Nr(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Cr(n,t,e)}}function Ur(t,e){return go(t)&&xo(e)?So(Mo(t),e):function(n){var r=Os(n,t);return r===i&&r===e?As(n,t):jr(e,r,3)}}function Fr(t,e,n,r,o){t!==e&&yr(e,(function(a,s){if(o||(o=new Yn),Qa(a))!function(t,e,n,r,o,a,s){var u=Ao(t,n),l=Ao(e,n),c=s.get(l);if(c)Jn(t,n,c);else{var f=a?a(u,l,n+"",t,e,s):i,h=f===i;if(h){var d=Ga(l),p=!d&&Ya(l),v=!d&&!p&&us(l);f=l,d||p||v?Ga(u)?f=u:Ha(u)?f=Ai(u):p?(h=!1,f=_i(l,!0)):v?(h=!1,f=xi(l,!0)):f=[]:rs(l)||Va(l)?(f=u,Va(u)?f=ys(u):Qa(u)&&!Za(u)||(f=po(l))):h=!1}h&&(s.set(l,f),o(f,l,r,a,s),s.delete(l)),Jn(t,n,f)}}(t,e,s,n,Fr,r,o);else{var u=r?r(Ao(t,s),a,s+"",t,e,o):i;u===i&&(u=a),Jn(t,s,u)}}),Cs)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function Br(t,e,n){e=e.length?Ce(e,(function(t){return Ga(t)?function(e){return wr(e,1===t.length?t[0]:t)}:t})):[nu];var r=-1;e=Ce(e,qe(oo()));var i=Mr(t,(function(t,n,i){var o=Ce(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=Si(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=wr(t,a);n(s,a)&&Zr(o,yi(a,t),s)}return o}function Gr(t,e,n,r){var i=r?ze:Fe,o=-1,a=e.length,s=t;for(t===e&&(e=Ai(e)),n&&(s=Ce(t,qe(n)));++o<a;)for(var u=0,l=e[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==t&&Yt.call(s,u,1),Yt.call(t,u,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Yt.call(t,i,1):ui(t,i)}}return t}function Xr(t,e){return t+de(_n()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(To(t,e,nu),t+"")}function $r(t){return qn(Fs(t))}function qr(t,e){var n=Fs(t);return Ro(n,or(e,0,n.length))}function Zr(t,e,n,r){if(!Qa(t))return t;for(var o=-1,a=(e=yi(e,t)).length,s=a-1,u=t;null!=u&&++o<a;){var l=Mo(e[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var f=u[l];(c=r?r(f,l,u):i)===i&&(c=Qa(f)?f:yo(e[o+1])?[]:{})}Qn(u,l,c),u=u[l]}return t}var Kr=Pn?function(t,e){return Pn.set(t,e),t}:nu,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Qs(e),writable:!0})}:nu;function Qr(t){return Ro(Fs(t))}function ti(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ei(t,e){var n;return cr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ni(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ri(t,e,nu,n)}function ri(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=n(e))!=e,u=null===e,l=ss(e),c=e===i;o<a;){var f=de((o+a)/2),h=n(t[f]),d=h!==i,p=null===h,v=h==h,y=ss(h);if(s)var m=r||v;else m=c?v&&(r||d):u?v&&d&&(r||!p):l?v&&d&&!p&&(r||!y):!p&&!y&&(r?h<=e:h<e);m?o=f+1:a=f}return mn(a,4294967294)}function ii(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Fa(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function oi(t){return"number"==typeof t?t:ss(t)?h:+t}function ai(t){if("string"==typeof t)return t;if(Ga(t))return Ce(t,ai)+"";if(ss(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=ke,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=je;else if(o>=200){var l=e?null:Hi(t);if(l)return un(l);a=!1,i=Ke,u=new Hn}else u=e?[]:s;t:for(;++r<o;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,a&&f==f){for(var h=u.length;h--;)if(u[h]===f)continue t;e&&u.push(f),s.push(c)}else i(u,f,n)||(u!==s&&u.push(f),s.push(c))}return s}function ui(t,e){return null==(t=Oo(t,e=yi(e,t)))||delete t[Mo(qo(e))]}function li(t,e,n,r){return Zr(t,e,n(wr(t,e)),r)}function ci(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ti(t,r?0:o,r?o+1:i):ti(t,r?o+1:0,r?i:o)}function fi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),De(e,(function(t,e){return e.func.apply(e.thisArg,Re([t],e.args))}),n)}function hi(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],u=-1;++u<i;)u!=o&&(a[o]=lr(a[o]||s,t[u],e,n));return si(vr(a,1),e,n)}function di(t,e,n){for(var r=-1,o=t.length,a=e.length,s={};++r<o;){var u=r<a?e[r]:i;n(s,t[r],u)}return s}function pi(t){return Ha(t)?t:[]}function vi(t){return"function"==typeof t?t:nu}function yi(t,e){return Ga(t)?t:go(t,e)?[t]:Lo(ms(t))}var mi=Yr;function gi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ti(t,e,n)}var bi=ae||function(t){return fe.clearTimeout(t)};function _i(t,e){if(e)return t.slice();var n=t.length,r=Gt?Gt(n):new t.constructor(n);return t.copy(r),r}function wi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function xi(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=ss(t),s=e!==i,u=null===e,l=e==e,c=ss(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!c&&t<e||c&&n&&o&&!r&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}function Ti(t,e,n,i){for(var o=-1,a=t.length,s=n.length,u=-1,l=e.length,c=yn(a-s,0),f=r(l+c),h=!i;++u<l;)f[u]=e[u];for(;++o<s;)(h||o<a)&&(f[n[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f}function Oi(t,e,n,i){for(var o=-1,a=t.length,s=-1,u=n.length,l=-1,c=e.length,f=yn(a-u,0),h=r(f+c),d=!i;++o<f;)h[o]=t[o];for(var p=o;++l<c;)h[p+l]=e[l];for(;++s<u;)(d||o<a)&&(h[p+n[s]]=t[o++]);return h}function Ai(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ei(t,e,n,r){var o=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],l=r?r(n[u],t[u],u,n,t):i;l===i&&(l=t[u]),o?rr(n,u,l):Qn(n,u,l)}return n}function Pi(t,e){return function(n,r){var i=Ga(n)?Te:er,o=e?e():{};return i(n,t,oo(r,2),o)}}function ki(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&mo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=Tt(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}function ji(t,e){return function(n,r){if(null==n)return n;if(!Xa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Tt(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ci(t){return function(e,n,r){for(var i=-1,o=Tt(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}function Ri(t){return function(e){var n=rn(e=ms(e))?fn(e):i,r=n?n[0]:e.charAt(0),o=n?gi(n,1).join(""):e.slice(1);return r[t]()+o}}function Di(t){return function(e){return De(Zs(Vs(e).replace(Zt,"")),t,"")}}function Ii(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Fn(t.prototype),r=t.apply(n,e);return Qa(r)?r:n}}function Li(t){return function(e,n,r){var o=Tt(e);if(!Xa(e)){var a=oo(n,3);e=js(e),n=function(t){return a(o[t],t,o)}}var s=t(e,n,r);return s>-1?o[a?e[s]:s]:i}}function Mi(t){return Qi((function(e){var n=e.length,r=n,a=Bn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Et(o);if(a&&!u&&"wrapper"==ro(s))var u=new Bn([],!0)}for(r=u?r:n;++r<n;){var l=ro(s=e[r]),c="wrapper"==l?no(s):i;u=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[ro(c[0])].apply(u,c[3]):1==s.length&&bo(s)?u[l]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ga(r))return u.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ni(t,e,n,o,a,s,u,c,f,h){var d=e&l,p=1&e,v=2&e,y=24&e,m=512&e,g=v?i:Ii(t);return function l(){for(var b=arguments.length,_=r(b),w=b;w--;)_[w]=arguments[w];if(y)var x=io(l),S=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,x);if(o&&(_=Ti(_,o,a,y)),s&&(_=Oi(_,s,u,y)),b-=S,y&&b<h){var T=sn(_,x);return Wi(t,e,Ni,l.placeholder,n,_,T,c,f,h-b)}var O=p?n:this,A=v?O[t]:t;return b=_.length,c?_=function(t,e){for(var n=t.length,r=mn(e.length,n),o=Ai(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}(_,c):m&&b>1&&_.reverse(),d&&f<b&&(_.length=f),this&&this!==fe&&this instanceof l&&(A=g||Ii(A)),A.apply(O,_)}}function Ui(t,e){return function(n,r){return function(t,e,n,r){return gr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Fi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ai(n),r=ai(r)):(n=oi(n),r=oi(r)),o=t(n,r)}return o}}function zi(t){return Qi((function(e){return e=Ce(e,qe(oo())),Yr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Bi(t,e){var n=(e=e===i?" ":ai(e)).length;if(n<2)return n?Hr(e,t):e;var r=Hr(e,he(t/cn(e)));return rn(e)?gi(fn(r),0,t).join(""):r.slice(0,t)}function Vi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n,i){for(var o=-1,a=yn(he((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,o=o===i?e<n?1:-1:hs(o),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vs(e),n=vs(n)),t(e,n)}}function Wi(t,e,n,r,o,a,s,l,c,f){var h=8&e;e|=h?u:64,4&(e&=~(h?64:u))||(e&=-4);var d=[t,e,o,h?a:i,h?s:i,h?i:a,h?i:s,l,c,f],p=n.apply(i,d);return bo(t)&&Eo(p,d),p.placeholder=r,jo(p,t,e)}function Xi(t){var e=St[t];return function(t,n){if(t=vs(t),(n=null==n?0:mn(ds(n),292))&&Me(t)){var r=(ms(t)+"e").split("e");return+((r=(ms(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Hi=On&&1/un(new On([,-0]))[1]==c?function(t){return new On(t)}:su;function Yi(t){return function(e){var n=fo(e);return n==x?on(e):n==E?ln(e):function(t,e){return Ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function $i(t,e,n,a,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Et(o);var v=a?a.length:0;if(v||(e&=-97,a=c=i),h=h===i?h:yn(ds(h),0),d=d===i?d:ds(d),v-=c?c.length:0,64&e){var y=a,m=c;a=c=i}var g=p?i:no(t),b=[t,e,n,a,c,y,m,f,h,d];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?Ti(c,u,e[4]):u,t[4]=c?sn(t[3],s):e[4]}(u=e[5])&&(c=t[5],t[5]=c?Oi(c,u,e[6]):u,t[6]=c?sn(t[5],s):e[6]),(u=e[7])&&(t[7]=u),r&l&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,g),t=b[0],e=b[1],n=b[2],a=b[3],c=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,n){var o=Ii(t);return function a(){for(var s=arguments.length,u=r(s),l=s,c=io(a);l--;)u[l]=arguments[l];var f=s<3&&u[0]!==c&&u[s-1]!==c?[]:sn(u,c);return(s-=f.length)<n?Wi(t,e,Ni,a.placeholder,i,u,f,i,i,n-s):Se(this&&this!==fe&&this instanceof a?o:t,this,u)}}(t,e,d):e!=u&&33!=e||c.length?Ni.apply(i,b):function(t,e,n,i){var o=1&e,a=Ii(t);return function e(){for(var s=-1,u=arguments.length,l=-1,c=i.length,f=r(c+u),h=this&&this!==fe&&this instanceof e?a:t;++l<c;)f[l]=i[l];for(;u--;)f[l++]=arguments[++s];return Se(h,o?n:this,f)}}(t,e,n,a);else var _=function(t,e,n){var r=1&e,i=Ii(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return jo((g?Kr:Eo)(_,b),t,e)}function qi(t,e,n,r){return t===i||Fa(t,jt[n])&&!Dt.call(r,n)?e:t}function Zi(t,e,n,r,o,a){return Qa(t)&&Qa(e)&&(a.set(e,t),Fr(t,e,i,Zi,a),a.delete(e)),t}function Ki(t){return rs(t)?i:t}function Ji(t,e,n,r,o,a){var s=1&n,u=t.length,l=e.length;if(u!=l&&!(s&&l>u))return!1;var c=a.get(t),f=a.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Hn:i;for(a.set(t,e),a.set(e,t);++h<u;){var v=t[h],y=e[h];if(r)var m=s?r(y,v,h,e,t,a):r(v,y,h,t,e,a);if(m!==i){if(m)continue;d=!1;break}if(p){if(!Le(e,(function(t,e){if(!Ke(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==y&&!o(v,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Qi(t){return ko(To(t,i,Wo),t+"")}function to(t){return xr(t,js,lo)}function eo(t){return xr(t,Cs,co)}var no=Pn?function(t){return Pn.get(t)}:su;function ro(t){for(var e=t.name+"",n=kn[e],r=Dt.call(kn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function io(t){return(Dt.call(Un,"placeholder")?Un:t).placeholder}function oo(){var t=Un.iteratee||ru;return t=t===ru?Dr:t,arguments.length?t(arguments[0],arguments[1]):t}function ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=js(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,xo(i)]}return e}function uo(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Rr(n)?n:i}var lo=ve?function(t){return null==t?[]:(t=Tt(t),Pe(ve(t),(function(e){return Ht.call(t,e)})))}:pu,co=ve?function(t){for(var e=[];t;)Re(e,lo(t)),t=Wt(t);return e}:pu,fo=Sr;function ho(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Mo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ja(i)&&yo(a,i)&&(Ga(t)||Va(t))}function po(t){return"function"!=typeof t.constructor||wo(t)?{}:Fn(Wt(t))}function vo(t){return Ga(t)||Va(t)||!!($t&&t&&t[$t])}function yo(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!Qa(n))return!1;var r=typeof e;return!!("number"==r?Xa(n)&&yo(e,n.length):"string"==r&&e in n)&&Fa(n[e],t)}function go(t,e){if(Ga(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ss(t))||Q.test(t)||!J.test(t)||null!=e&&t in Tt(e)}function bo(t){var e=ro(t),n=Un[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=no(n);return!!r&&t===r[0]}(xn&&fo(new xn(new ArrayBuffer(1)))!=R||Sn&&fo(new Sn)!=x||Tn&&fo(Tn.resolve())!=O||On&&fo(new On)!=E||An&&fo(new An)!=j)&&(fo=function(t){var e=Sr(t),n=e==T?t.constructor:i,r=n?No(n):"";if(r)switch(r){case jn:return R;case Cn:return x;case Rn:return O;case Dn:return E;case In:return j}return e});var _o=Ct?Za:vu;function wo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||jt)}function xo(t){return t==t&&!Qa(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Tt(n))}}function To(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var u=r(e+1);++o<e;)u[o]=i[o];return u[e]=n(s),Se(t,this,u)}}function Oo(t,e){return e.length<2?t:wr(t,ti(e,0,-1))}function Ao(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Eo=Co(Kr),Po=ce||function(t,e){return fe.setTimeout(t,e)},ko=Co(Jr);function jo(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(p,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(r),n)))}function Co(t){var e=0,n=0;return function(){var r=gn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Ro(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Xr(n,o),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var Do,Io,Lo=(Do=Da((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Io.size&&Io.clear(),t})),Io=Do.cache,Do);function Mo(t){if("string"==typeof t||ss(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function No(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Uo(t){if(t instanceof Vn)return t.clone();var e=new Bn(t.__wrapped__,t.__chain__);return e.__actions__=Ai(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fo=Yr((function(t,e){return Ha(t)?lr(t,vr(e,1,Ha,!0)):[]})),zo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),oo(n,2)):[]})),Bo=Yr((function(t,e){var n=qo(e);return Ha(n)&&(n=i),Ha(t)?lr(t,vr(e,1,Ha,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Ue(t,oo(e,3),i)}function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ds(n),o=n<0?yn(r+o,0):mn(o,r-1)),Ue(t,oo(e,3),o,!0)}function Wo(t){return null!=t&&t.length?vr(t,1):[]}function Xo(t){return t&&t.length?t[0]:i}var Ho=Yr((function(t){var e=Ce(t,pi);return e.length&&e[0]===t[0]?Er(e):[]})),Yo=Yr((function(t){var e=qo(t),n=Ce(t,pi);return e===qo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Er(n,oo(e,2)):[]})),$o=Yr((function(t){var e=qo(t),n=Ce(t,pi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Er(n,i,e):[]}));function qo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Zo=Yr(Ko);function Ko(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Jo=Qi((function(t,e){var n=null==t?0:t.length,r=ir(t,e);return Wr(t,Ce(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function Qo(t){return null==t?t:wn.call(t)}var ta=Yr((function(t){return si(vr(t,1,Ha,!0))})),ea=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),si(vr(t,1,Ha,!0),oo(e,2))})),na=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,si(vr(t,1,Ha,!0),i,e)}));function ra(t){if(!t||!t.length)return[];var e=0;return t=Pe(t,(function(t){if(Ha(t))return e=yn(t.length,e),!0})),Ye(e,(function(e){return Ce(t,Ge(e))}))}function ia(t,e){if(!t||!t.length)return[];var n=ra(t);return null==e?n:Ce(n,(function(t){return Se(e,i,t)}))}var oa=Yr((function(t,e){return Ha(t)?lr(t,e):[]})),aa=Yr((function(t){return hi(Pe(t,Ha))})),sa=Yr((function(t){var e=qo(t);return Ha(e)&&(e=i),hi(Pe(t,Ha),oo(e,2))})),ua=Yr((function(t){var e=qo(t);return e="function"==typeof e?e:i,hi(Pe(t,Ha),i,e)})),la=Yr(ra),ca=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ia(t,n)}));function fa(t){var e=Un(t);return e.__chain__=!0,e}function ha(t,e){return e(t)}var da=Qi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Bn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),pa=Pi((function(t,e,n){Dt.call(t,n)?++t[n]:rr(t,n,1)})),va=Li(Vo),ya=Li(Go);function ma(t,e){return(Ga(t)?Oe:cr)(t,oo(e,3))}function ga(t,e){return(Ga(t)?Ae:fr)(t,oo(e,3))}var ba=Pi((function(t,e,n){Dt.call(t,n)?t[n].push(e):rr(t,n,[e])})),_a=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=Xa(t)?r(t.length):[];return cr(t,(function(t){a[++i]=o?Se(e,t,n):Pr(t,e,n)})),a})),wa=Pi((function(t,e,n){rr(t,n,e)}));function xa(t,e){return(Ga(t)?Ce:Mr)(t,oo(e,3))}var Sa=Pi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,vr(e,1),[])})),Oa=le||function(){return fe.Date.now()};function Aa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,$i(t,l,i,i,i,i,e)}function Ea(t,e){var n;if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Pa=Yr((function(t,e,n){var r=1;if(n.length){var i=sn(n,io(Pa));r|=u}return $i(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=sn(n,io(ka));r|=u}return $i(e,r,t,n,i)}));function ja(t,e,n){var r,a,s,u,l,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Et(o);function v(e){var n=r,o=a;return r=a=i,f=e,u=t.apply(o,n)}function y(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=s}function m(){var t=Oa();if(y(t))return g(t);l=Po(m,function(t){var n=e-(t-c);return d?mn(n,s-(t-f)):n}(t))}function g(t){return l=i,p&&r?v(t):(r=a=i,u)}function b(){var t=Oa(),n=y(t);if(r=arguments,a=this,c=t,n){if(l===i)return function(t){return f=t,l=Po(m,e),h?v(t):u}(c);if(d)return bi(l),l=Po(m,e),v(c)}return l===i&&(l=Po(m,e)),u}return e=vs(e)||0,Qa(n)&&(h=!!n.leading,s=(d="maxWait"in n)?yn(vs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){l!==i&&bi(l),f=0,r=c=a=l=i},b.flush=function(){return l===i?u:g(Oa())},b}var Ca=Yr((function(t,e){return ur(t,1,e)})),Ra=Yr((function(t,e,n){return ur(t,vs(e)||0,n)}));function Da(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Et(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Da.Cache||Xn),n}function Ia(t){if("function"!=typeof t)throw new Et(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Da.Cache=Xn;var La=mi((function(t,e){var n=(e=1==e.length&&Ga(e[0])?Ce(e[0],qe(oo())):Ce(vr(e,1),qe(oo()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Ma=Yr((function(t,e){var n=sn(e,io(Ma));return $i(t,u,i,e,n)})),Na=Yr((function(t,e){var n=sn(e,io(Na));return $i(t,64,i,e,n)})),Ua=Qi((function(t,e){return $i(t,256,i,i,i,e)}));function Fa(t,e){return t===e||t!=t&&e!=e}var za=Gi(Tr),Ba=Gi((function(t,e){return t>=e})),Va=kr(function(){return arguments}())?kr:function(t){return ts(t)&&Dt.call(t,"callee")&&!Ht.call(t,"callee")},Ga=r.isArray,Wa=me?qe(me):function(t){return ts(t)&&Sr(t)==C};function Xa(t){return null!=t&&Ja(t.length)&&!Za(t)}function Ha(t){return ts(t)&&Xa(t)}var Ya=ye||vu,$a=ge?qe(ge):function(t){return ts(t)&&Sr(t)==g};function qa(t){if(!ts(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!rs(t)}function Za(t){if(!Qa(t))return!1;var e=Sr(t);return e==_||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==ds(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=be?qe(be):function(t){return ts(t)&&fo(t)==x};function ns(t){return"number"==typeof t||ts(t)&&Sr(t)==S}function rs(t){if(!ts(t)||Sr(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var n=Dt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Nt}var is=_e?qe(_e):function(t){return ts(t)&&Sr(t)==A},os=we?qe(we):function(t){return ts(t)&&fo(t)==E};function as(t){return"string"==typeof t||!Ga(t)&&ts(t)&&Sr(t)==P}function ss(t){return"symbol"==typeof t||ts(t)&&Sr(t)==k}var us=xe?qe(xe):function(t){return ts(t)&&Ja(t.length)&&!!ie[Sr(t)]},ls=Gi(Lr),cs=Gi((function(t,e){return t<=e}));function fs(t){if(!t)return[];if(Xa(t))return as(t)?fn(t):Ai(t);if(qt&&t[qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qt]());var e=fo(t);return(e==x?on:e==E?un:Fs)(t)}function hs(t){return t?(t=vs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ds(t){var e=hs(t),n=e%1;return e==e?n?e-n:e:0}function ps(t){return t?or(ds(t),0,d):0}function vs(t){if("number"==typeof t)return t;if(ss(t))return h;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var n=pt.test(t);return n||yt.test(t)?ue(t.slice(2),n?2:8):dt.test(t)?h:+t}function ys(t){return Ei(t,Cs(t))}function ms(t){return null==t?"":ai(t)}var gs=ki((function(t,e){if(wo(e)||Xa(e))Ei(e,js(e),t);else for(var n in e)Dt.call(e,n)&&Qn(t,n,e[n])})),bs=ki((function(t,e){Ei(e,Cs(e),t)})),_s=ki((function(t,e,n,r){Ei(e,Cs(e),t,r)})),ws=ki((function(t,e,n,r){Ei(e,js(e),t,r)})),xs=Qi(ir),Ss=Yr((function(t,e){t=Tt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],s=Cs(a),u=-1,l=s.length;++u<l;){var c=s[u],f=t[c];(f===i||Fa(f,jt[c])&&!Dt.call(t,c))&&(t[c]=a[c])}return t})),Ts=Yr((function(t){return t.push(i,Zi),Se(Ds,i,t)}));function Os(t,e,n){var r=null==t?i:wr(t,e);return r===i?n:r}function As(t,e){return null!=t&&ho(t,e,Ar)}var Es=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=n}),Qs(nu)),Ps=Ui((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),Dt.call(t,e)?t[e].push(n):t[e]=[n]}),oo),ks=Yr(Pr);function js(t){return Xa(t)?$n(t):Ir(t)}function Cs(t){return Xa(t)?$n(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=wo(t),n=[];for(var r in t)("constructor"!=r||!e&&Dt.call(t,r))&&n.push(r);return n}(t)}var Rs=ki((function(t,e,n){Fr(t,e,n)})),Ds=ki((function(t,e,n,r){Fr(t,e,n,r)})),Is=Qi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ce(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ei(t,eo(t),n),r&&(n=ar(n,7,Ki));for(var i=e.length;i--;)ui(n,e[i]);return n})),Ls=Qi((function(t,e){return null==t?{}:function(t,e){return Vr(t,e,(function(e,n){return As(t,n)}))}(t,e)}));function Ms(t,e){if(null==t)return{};var n=Ce(eo(t),(function(t){return[t]}));return e=oo(e),Vr(t,n,(function(t,n){return e(t,n[0])}))}var Ns=Yi(js),Us=Yi(Cs);function Fs(t){return null==t?[]:Ze(t,js(t))}var zs=Di((function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)}));function Bs(t){return qs(ms(t).toLowerCase())}function Vs(t){return(t=ms(t))&&t.replace(gt,tn).replace(Kt,"")}var Gs=Di((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Di((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Ri("toLowerCase"),Hs=Di((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Di((function(t,e,n){return t+(n?" ":"")+qs(e)})),$s=Di((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),qs=Ri("toUpperCase");function Zs(t,e,n){return t=ms(t),(e=n?i:e)===i?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ks=Yr((function(t,e){try{return Se(t,i,e)}catch(t){return qa(t)?t:new wt(t)}})),Js=Qi((function(t,e){return Oe(e,(function(e){e=Mo(e),rr(t,e,Pa(t[e],t))})),t}));function Qs(t){return function(){return t}}var tu=Mi(),eu=Mi(!0);function nu(t){return t}function ru(t){return Dr("function"==typeof t?t:ar(t,1))}var iu=Yr((function(t,e){return function(n){return Pr(n,t,e)}})),ou=Yr((function(t,e){return function(n){return Pr(t,n,e)}}));function au(t,e,n){var r=js(e),i=_r(e,r);null!=n||Qa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,js(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=Za(t);return Oe(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Re([this.value()],arguments))})})),t}function su(){}var uu=zi(Ce),lu=zi(Ee),cu=zi(Le);function fu(t){return go(t)?Ge(Mo(t)):function(t){return function(e){return wr(e,t)}}(t)}var hu=Vi(),du=Vi(!0);function pu(){return[]}function vu(){return!1}var yu,mu=Fi((function(t,e){return t+e}),0),gu=Xi("ceil"),bu=Fi((function(t,e){return t/e}),1),_u=Xi("floor"),wu=Fi((function(t,e){return t*e}),1),xu=Xi("round"),Su=Fi((function(t,e){return t-e}),0);return Un.after=function(t,e){if("function"!=typeof e)throw new Et(o);return t=ds(t),function(){if(--t<1)return e.apply(this,arguments)}},Un.ary=Aa,Un.assign=gs,Un.assignIn=bs,Un.assignInWith=_s,Un.assignWith=ws,Un.at=xs,Un.before=Ea,Un.bind=Pa,Un.bindAll=Js,Un.bindKey=ka,Un.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ga(t)?t:[t]},Un.chain=fa,Un.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(ds(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(he(o/e));a<o;)u[s++]=ti(t,a,a+=e);return u},Un.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Un.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Re(Ga(n)?Ai(n):[n],vr(e,1))},Un.cond=function(t){var e=null==t?0:t.length,n=oo();return t=e?Ce(t,(function(t){if("function"!=typeof t[1])throw new Et(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Un.conforms=function(t){return function(t){var e=js(t);return function(n){return sr(n,t,e)}}(ar(t,1))},Un.constant=Qs,Un.countBy=pa,Un.create=function(t,e){var n=Fn(t);return null==e?n:nr(n,e)},Un.curry=function t(e,n,r){var o=$i(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.curryRight=function t(e,n,r){var o=$i(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Un.debounce=ja,Un.defaults=Ss,Un.defaultsDeep=Ts,Un.defer=Ca,Un.delay=Ra,Un.difference=Fo,Un.differenceBy=zo,Un.differenceWith=Bo,Un.drop=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=n||e===i?1:ds(e))<0?0:e,r):[]},Un.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,0,(e=r-(e=n||e===i?1:ds(e)))<0?0:e):[]},Un.dropRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0,!0):[]},Un.dropWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!0):[]},Un.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ds(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ds(r))<0&&(r+=o),r=n>r?0:ps(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Un.filter=function(t,e){return(Ga(t)?Pe:pr)(t,oo(e,3))},Un.flatMap=function(t,e){return vr(xa(t,e),1)},Un.flatMapDeep=function(t,e){return vr(xa(t,e),c)},Un.flatMapDepth=function(t,e,n){return n=n===i?1:ds(n),vr(xa(t,e),n)},Un.flatten=Wo,Un.flattenDeep=function(t){return null!=t&&t.length?vr(t,c):[]},Un.flattenDepth=function(t,e){return null!=t&&t.length?vr(t,e=e===i?1:ds(e)):[]},Un.flip=function(t){return $i(t,512)},Un.flow=tu,Un.flowRight=eu,Un.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Un.functions=function(t){return null==t?[]:_r(t,js(t))},Un.functionsIn=function(t){return null==t?[]:_r(t,Cs(t))},Un.groupBy=ba,Un.initial=function(t){return null!=t&&t.length?ti(t,0,-1):[]},Un.intersection=Ho,Un.intersectionBy=Yo,Un.intersectionWith=$o,Un.invert=Es,Un.invertBy=Ps,Un.invokeMap=_a,Un.iteratee=ru,Un.keyBy=wa,Un.keys=js,Un.keysIn=Cs,Un.map=xa,Un.mapKeys=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,e(t,r,i),t)})),n},Un.mapValues=function(t,e){var n={};return e=oo(e,3),gr(t,(function(t,r,i){rr(n,r,e(t,r,i))})),n},Un.matches=function(t){return Nr(ar(t,1))},Un.matchesProperty=function(t,e){return Ur(t,ar(e,1))},Un.memoize=Da,Un.merge=Rs,Un.mergeWith=Ds,Un.method=iu,Un.methodOf=ou,Un.mixin=au,Un.negate=Ia,Un.nthArg=function(t){return t=ds(t),Yr((function(e){return zr(e,t)}))},Un.omit=Is,Un.omitBy=function(t,e){return Ms(t,Ia(oo(e)))},Un.once=function(t){return Ea(2,t)},Un.orderBy=function(t,e,n,r){return null==t?[]:(Ga(e)||(e=null==e?[]:[e]),Ga(n=r?i:n)||(n=null==n?[]:[n]),Br(t,e,n))},Un.over=uu,Un.overArgs=La,Un.overEvery=lu,Un.overSome=cu,Un.partial=Ma,Un.partialRight=Na,Un.partition=Sa,Un.pick=Ls,Un.pickBy=Ms,Un.property=fu,Un.propertyOf=function(t){return function(e){return null==t?i:wr(t,e)}},Un.pull=Zo,Un.pullAll=Ko,Un.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,oo(n,2)):t},Un.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,i,n):t},Un.pullAt=Jo,Un.range=hu,Un.rangeRight=du,Un.rearg=Ua,Un.reject=function(t,e){return(Ga(t)?Pe:pr)(t,Ia(oo(e,3)))},Un.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=oo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Wr(t,i),n},Un.rest=function(t,e){if("function"!=typeof t)throw new Et(o);return Yr(t,e=e===i?e:ds(e))},Un.reverse=Qo,Un.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),(Ga(t)?Zn:qr)(t,e)},Un.set=function(t,e,n){return null==t?t:Zr(t,e,n)},Un.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Zr(t,e,n,r)},Un.shuffle=function(t){return(Ga(t)?Kn:Qr)(t)},Un.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:ds(e),n=n===i?r:ds(n)),ti(t,e,n)):[]},Un.sortBy=Ta,Un.sortedUniq=function(t){return t&&t.length?ii(t):[]},Un.sortedUniqBy=function(t,e){return t&&t.length?ii(t,oo(e,2)):[]},Un.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=ms(t))&&("string"==typeof e||null!=e&&!is(e))&&!(e=ai(e))&&rn(t)?gi(fn(t),0,n):t.split(e,n):[]},Un.spread=function(t,e){if("function"!=typeof t)throw new Et(o);return e=null==e?0:yn(ds(e),0),Yr((function(n){var r=n[e],i=gi(n,0,e);return r&&Re(i,r),Se(t,this,i)}))},Un.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Un.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===i?1:ds(e))<0?0:e):[]},Un.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ti(t,(e=r-(e=n||e===i?1:ds(e)))<0?0:e,r):[]},Un.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Un.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Un.tap=function(t,e){return e(t),t},Un.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Et(o);return Qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ja(t,e,{leading:r,maxWait:e,trailing:i})},Un.thru=ha,Un.toArray=fs,Un.toPairs=Ns,Un.toPairsIn=Us,Un.toPath=function(t){return Ga(t)?Ce(t,Mo):ss(t)?[t]:Ai(Lo(ms(t)))},Un.toPlainObject=ys,Un.transform=function(t,e,n){var r=Ga(t),i=r||Ya(t)||us(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Qa(t)&&Za(o)?Fn(Wt(t)):{}}return(i?Oe:gr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Un.unary=function(t){return Aa(t,1)},Un.union=ta,Un.unionBy=ea,Un.unionWith=na,Un.uniq=function(t){return t&&t.length?si(t):[]},Un.uniqBy=function(t,e){return t&&t.length?si(t,oo(e,2)):[]},Un.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Un.unset=function(t,e){return null==t||ui(t,e)},Un.unzip=ra,Un.unzipWith=ia,Un.update=function(t,e,n){return null==t?t:li(t,e,vi(n))},Un.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:li(t,e,vi(n),r)},Un.values=Fs,Un.valuesIn=function(t){return null==t?[]:Ze(t,Cs(t))},Un.without=oa,Un.words=Zs,Un.wrap=function(t,e){return Ma(vi(e),t)},Un.xor=aa,Un.xorBy=sa,Un.xorWith=ua,Un.zip=la,Un.zipObject=function(t,e){return di(t||[],e||[],Qn)},Un.zipObjectDeep=function(t,e){return di(t||[],e||[],Zr)},Un.zipWith=ca,Un.entries=Ns,Un.entriesIn=Us,Un.extend=bs,Un.extendWith=_s,au(Un,Un),Un.add=mu,Un.attempt=Ks,Un.camelCase=zs,Un.capitalize=Bs,Un.ceil=gu,Un.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=vs(n))==n?n:0),e!==i&&(e=(e=vs(e))==e?e:0),or(vs(t),e,n)},Un.clone=function(t){return ar(t,4)},Un.cloneDeep=function(t){return ar(t,5)},Un.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:i)},Un.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:i)},Un.conformsTo=function(t,e){return null==e||sr(t,e,js(e))},Un.deburr=Vs,Un.defaultTo=function(t,e){return null==t||t!=t?e:t},Un.divide=bu,Un.endsWith=function(t,e,n){t=ms(t),e=ai(e);var r=t.length,o=n=n===i?r:or(ds(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Un.eq=Fa,Un.escape=function(t){return(t=ms(t))&&$.test(t)?t.replace(H,en):t},Un.escapeRegExp=function(t){return(t=ms(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Un.every=function(t,e,n){var r=Ga(t)?Ee:hr;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Un.find=va,Un.findIndex=Vo,Un.findKey=function(t,e){return Ne(t,oo(e,3),gr)},Un.findLast=ya,Un.findLastIndex=Go,Un.findLastKey=function(t,e){return Ne(t,oo(e,3),br)},Un.floor=_u,Un.forEach=ma,Un.forEachRight=ga,Un.forIn=function(t,e){return null==t?t:yr(t,oo(e,3),Cs)},Un.forInRight=function(t,e){return null==t?t:mr(t,oo(e,3),Cs)},Un.forOwn=function(t,e){return t&&gr(t,oo(e,3))},Un.forOwnRight=function(t,e){return t&&br(t,oo(e,3))},Un.get=Os,Un.gt=za,Un.gte=Ba,Un.has=function(t,e){return null!=t&&ho(t,e,Or)},Un.hasIn=As,Un.head=Xo,Un.identity=nu,Un.includes=function(t,e,n,r){t=Xa(t)?t:Fs(t),n=n&&!r?ds(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),as(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Fe(t,e,n)>-1},Un.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ds(n);return i<0&&(i=yn(r+i,0)),Fe(t,e,i)},Un.inRange=function(t,e,n){return e=hs(e),n===i?(n=e,e=0):n=hs(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=vs(t),e,n)},Un.invoke=ks,Un.isArguments=Va,Un.isArray=Ga,Un.isArrayBuffer=Wa,Un.isArrayLike=Xa,Un.isArrayLikeObject=Ha,Un.isBoolean=function(t){return!0===t||!1===t||ts(t)&&Sr(t)==m},Un.isBuffer=Ya,Un.isDate=$a,Un.isElement=function(t){return ts(t)&&1===t.nodeType&&!rs(t)},Un.isEmpty=function(t){if(null==t)return!0;if(Xa(t)&&(Ga(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||us(t)||Va(t)))return!t.length;var e=fo(t);if(e==x||e==E)return!t.size;if(wo(t))return!Ir(t).length;for(var n in t)if(Dt.call(t,n))return!1;return!0},Un.isEqual=function(t,e){return jr(t,e)},Un.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?jr(t,e,i,n):!!r},Un.isError=qa,Un.isFinite=function(t){return"number"==typeof t&&Me(t)},Un.isFunction=Za,Un.isInteger=Ka,Un.isLength=Ja,Un.isMap=es,Un.isMatch=function(t,e){return t===e||Cr(t,e,so(e))},Un.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Cr(t,e,so(e),n)},Un.isNaN=function(t){return ns(t)&&t!=+t},Un.isNative=function(t){if(_o(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},Un.isNil=function(t){return null==t},Un.isNull=function(t){return null===t},Un.isNumber=ns,Un.isObject=Qa,Un.isObjectLike=ts,Un.isPlainObject=rs,Un.isRegExp=is,Un.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=f},Un.isSet=os,Un.isString=as,Un.isSymbol=ss,Un.isTypedArray=us,Un.isUndefined=function(t){return t===i},Un.isWeakMap=function(t){return ts(t)&&fo(t)==j},Un.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==Sr(t)},Un.join=function(t,e){return null==t?"":We.call(t,e)},Un.kebabCase=Gs,Un.last=qo,Un.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ds(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Ue(t,Be,o,!0)},Un.lowerCase=Ws,Un.lowerFirst=Xs,Un.lt=ls,Un.lte=cs,Un.max=function(t){return t&&t.length?dr(t,nu,Tr):i},Un.maxBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Tr):i},Un.mean=function(t){return Ve(t,nu)},Un.meanBy=function(t,e){return Ve(t,oo(e,2))},Un.min=function(t){return t&&t.length?dr(t,nu,Lr):i},Un.minBy=function(t,e){return t&&t.length?dr(t,oo(e,2),Lr):i},Un.stubArray=pu,Un.stubFalse=vu,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=wu,Un.nth=function(t,e){return t&&t.length?zr(t,ds(e)):i},Un.noConflict=function(){return fe._===this&&(fe._=Ut),this},Un.noop=su,Un.now=Oa,Un.pad=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(de(i),n)+t+Bi(he(i),n)},Un.padEnd=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?t+Bi(e-r,n):t},Un.padStart=function(t,e,n){t=ms(t);var r=(e=ds(e))?cn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Un.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ms(t).replace(rt,""),e||0)},Un.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=hs(t),e===i?(e=t,t=0):e=hs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=_n();return mn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Un.reduce=function(t,e,n){var r=Ga(t)?De:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,cr)},Un.reduceRight=function(t,e,n){var r=Ga(t)?Ie:Xe,i=arguments.length<3;return r(t,oo(e,4),n,i,fr)},Un.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:ds(e),Hr(ms(t),e)},Un.replace=function(){var t=arguments,e=ms(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Un.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Mo(e[r])];a===i&&(r=o,a=n),t=Za(a)?a.call(t):a}return t},Un.round=xu,Un.runInContext=t,Un.sample=function(t){return(Ga(t)?qn:$r)(t)},Un.size=function(t){if(null==t)return 0;if(Xa(t))return as(t)?cn(t):t.length;var e=fo(t);return e==x||e==E?t.size:Ir(t).length},Un.snakeCase=Hs,Un.some=function(t,e,n){var r=Ga(t)?Le:ei;return n&&mo(t,e,n)&&(e=i),r(t,oo(e,3))},Un.sortedIndex=function(t,e){return ni(t,e)},Un.sortedIndexBy=function(t,e,n){return ri(t,e,oo(n,2))},Un.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ni(t,e);if(r<n&&Fa(t[r],e))return r}return-1},Un.sortedLastIndex=function(t,e){return ni(t,e,!0)},Un.sortedLastIndexBy=function(t,e,n){return ri(t,e,oo(n,2),!0)},Un.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ni(t,e,!0)-1;if(Fa(t[n],e))return n}return-1},Un.startCase=Ys,Un.startsWith=function(t,e,n){return t=ms(t),n=null==n?0:or(ds(n),0,t.length),e=ai(e),t.slice(n,n+e.length)==e},Un.subtract=Su,Un.sum=function(t){return t&&t.length?He(t,nu):0},Un.sumBy=function(t,e){return t&&t.length?He(t,oo(e,2)):0},Un.template=function(t,e,n){var r=Un.templateSettings;n&&mo(t,e,n)&&(e=i),t=ms(t),e=_s({},e,r,qi);var o,a,s=_s({},e.imports,r.imports,qi),u=js(s),l=Ze(s,u),c=0,f=e.interpolate||bt,h="__p += '",d=Ot((e.escape||bt).source+"|"+f.source+"|"+(f===K?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Dt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,i,s,u){return r||(r=i),h+=t.slice(c,u).replace(_t,nn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var v=Dt.call(e,"variable")&&e.variable;if(v){if(lt.test(v))throw new wt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(W,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var y=Ks((function(){return xt(u,p+"return "+h).apply(i,l)}));if(y.source=h,qa(y))throw y;return y},Un.times=function(t,e){if((t=ds(t))<1||t>f)return[];var n=d,r=mn(t,d);e=oo(e),t-=d;for(var i=Ye(r,e);++n<t;)e(n);return i},Un.toFinite=hs,Un.toInteger=ds,Un.toLength=ps,Un.toLower=function(t){return ms(t).toLowerCase()},Un.toNumber=vs,Un.toSafeInteger=function(t){return t?or(ds(t),-9007199254740991,f):0===t?t:0},Un.toString=ms,Un.toUpper=function(t){return ms(t).toUpperCase()},Un.trim=function(t,e,n){if((t=ms(t))&&(n||e===i))return $e(t);if(!t||!(e=ai(e)))return t;var r=fn(t),o=fn(e);return gi(r,Je(r,o),Qe(r,o)+1).join("")},Un.trimEnd=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.slice(0,hn(t)+1);if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,0,Qe(r,fn(e))+1).join("")},Un.trimStart=function(t,e,n){if((t=ms(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ai(e)))return t;var r=fn(t);return gi(r,Je(r,fn(e))).join("")},Un.truncate=function(t,e){var n=30,r="...";if(Qa(e)){var o="separator"in e?e.separator:o;n="length"in e?ds(e.length):n,r="omission"in e?ai(e.omission):r}var a=(t=ms(t)).length;if(rn(t)){var s=fn(t);a=s.length}if(n>=a)return t;var u=n-cn(r);if(u<1)return r;var l=s?gi(s,0,u).join(""):t.slice(0,u);if(o===i)return l+r;if(s&&(u+=l.length-u),is(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=Ot(o.source,ms(ht.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===i?u:h)}}else if(t.indexOf(ai(o),u)!=u){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Un.unescape=function(t){return(t=ms(t))&&Y.test(t)?t.replace(X,dn):t},Un.uniqueId=function(t){var e=++It;return ms(t)+e},Un.upperCase=$s,Un.upperFirst=qs,Un.each=ma,Un.eachRight=ga,Un.first=Xo,au(Un,(yu={},gr(Un,(function(t,e){Dt.call(Un.prototype,e)||(yu[e]=t)})),yu),{chain:!1}),Un.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Un[t].placeholder=Un})),Oe(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===i?1:yn(ds(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(nu)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return Pr(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(Ia(oo(t)))},Vn.prototype.slice=function(t,e){t=ds(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ds(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(d)},gr(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Un[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Un.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof Vn,l=s[0],c=u||Ga(e),f=function(t){var e=o.apply(Un,Re([t],s));return r&&h?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=u&&!d;if(!a&&c){e=v?e:new Vn(this);var y=t.apply(e,s);return y.__actions__.push({func:ha,args:[f],thisArg:i}),new Bn(y,h)}return p&&v?t.apply(this,s):(y=this.thru(f),p?r?y.value()[0]:y.value():y)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Pt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Un.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ga(i)?i:[],t)}return this[n]((function(n){return e.apply(Ga(n)?n:[],t)}))}})),gr(Vn.prototype,(function(t,e){var n=Un[e];if(n){var r=n.name+"";Dt.call(kn,r)||(kn[r]=[]),kn[r].push({name:e,func:n})}})),kn[Ni(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ga(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,h=0,d=mn(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return fi(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var v=-1,y=t[l+=e];++v<f;){var m=c[v],g=m.iteratee,b=m.type,_=g(y);if(2==b)y=_;else if(!_){if(1==b)continue t;break t}}p[h++]=y}return p},Un.prototype.at=da,Un.prototype.chain=function(){return fa(this)},Un.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Uo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Un.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:i}),new Bn(e,this.__chain__)}return this.thru(Qo)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,qt&&(Un.prototype[qt]=function(){return this}),Un}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},880:function(t,e,n){var r,i;r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function l(t){return function(){typeof console!==e&&(u.call(this),this[t].apply(this,arguments))}}function c(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):t)}(r)||l.apply(this,arguments)}function f(t,n){var a,s,l,f=this,h="loglevel";function d(){var t;if(typeof window!==e&&h){try{t=window.localStorage[h]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=encodeURIComponent(h),i=n.indexOf(r+"=");-1!==i&&(t=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(t){}return void 0===f.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==f.levels[e.toUpperCase()]&&(e=f.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=f.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?h+=":"+t:"symbol"==typeof t&&(h=void 0),f.name=t,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||c,f.getLevel=function(){return null!=l?l:null!=s?s:a},f.setLevel=function(t,n){return l=p(t),!1!==n&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&h){try{return void(window.localStorage[h]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"="+n+";"}catch(t){}}}(l),u.call(f)},f.setDefaultLevel=function(t){s=p(t),d()||f.setLevel(t,!1)},f.resetLevel=function(){l=null,function(){if(typeof window!==e&&h){try{window.localStorage.removeItem(h)}catch(t){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}(),u.call(f)},f.enableAll=function(t){f.setLevel(f.levels.TRACE,t)},f.disableAll=function(t){f.setLevel(f.levels.SILENT,t)},f.rebuild=function(){if(o!==f&&(a=p(o.getLevel())),u.call(f),o===f)for(var t in i)i[t].rebuild()},a=p(o?o.getLevel():"WARN");var v=d();null!=v&&(l=p(v)),u.call(f)}(o=new f).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=i[t];return e||(e=i[t]=new f(t,o.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},481:(t,e,n)=>{t.exports=n(137)},137:t=>{t.exports=class{constructor(t,e,n,r){let i;if("object"==typeof t){let o=t;t=o.k_p,e=o.k_i,n=o.k_d,r=o.dt,i=o.i_max}this.k_p="number"==typeof t?t:1,this.k_i=e||0,this.k_d=n||0,this.dt=r||0,this.i_max=i||0,this.sumError=0,this.lastError=0,this.lastTime=0,this.target=0}setTarget(t){this.target=t}update(t){this.currentValue=t;let e=this.dt;if(!e){let t=Date.now();e=0===this.lastTime?0:(t-this.lastTime)/1e3,this.lastTime=t}"number"==typeof e&&0!==e||(e=1);let n=this.target-this.currentValue;if(this.sumError=this.sumError+n*e,this.i_max>0&&Math.abs(this.sumError)>this.i_max){let t=this.sumError>0?1:-1;this.sumError=t*this.i_max}let r=(n-this.lastError)/e;return this.lastError=n,this.k_p*n+this.k_i*this.sumError+this.k_d*r}reset(){this.sumError=0,this.lastError=0,this.lastTime=0}}},803:t=>{var e,n,r=document.attachEvent,i=!1;function o(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function a(t){var e=this;o(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}if(!r){var s=(n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return n(t)}),u=(e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return e(t)}),l=!1,c="",f="animationstart",h="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(l=!0),!1===l)for(var v=0;v<h.length;v++)if(void 0!==p.style[h[v]+"AnimationName"]){c="-"+h[v].toLowerCase()+"-",f=d[v],l=!0;break}var y="resizeanim",m="@"+c+"keyframes "+y+" { from { opacity: 0; } to { opacity: 0; } } ",g=c+"animation: 1ms "+y+"; "}t.exports=function(t,e){return r?t.attachEvent("onresize",e):(t.__resizeTriggers__||("static"==getComputedStyle(t).position&&(t.style.position="relative"),function(){if(!i){var t=(m||"")+".resize-triggers { "+(g||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n),i=!0}}(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',t.appendChild(t.__resizeTriggers__),o(t),t.addEventListener("scroll",a,!0),f&&t.__resizeTriggers__.addEventListener(f,(function(e){e.animationName==y&&o(t)}))),t.__resizeListeners__.push(e)),function(){r?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",a),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))}}},975:(t,e,n)=>{var r=n(101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},101:t=>{t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}}},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:()=>ki,wK:()=>xa,x_:()=>Oa,lv:()=>Ta,YQ:()=>Sa,BP:()=>oc,GZ:()=>ac,Vw:()=>Aa,Ay:()=>sc,_G:()=>ks});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(),!!Ee.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!!Ee.spyListeners.length}function _(t){if(Ee.spyListeners.length)for(var e=Ee.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 Ee.spyListeners.push(t),ae((function(){var e=Ee.spyListeners.indexOf(t);-1!==e&&Ee.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 E(t,e){ye(t,"function"==typeof Symbol&&Symbol.iterator||"@@iterator",e)}var P,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(){};P=R,k=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(P.prototype,k):void 0!==P.prototype.__proto__?P.prototype.__proto__=k:P.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);E(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===Ee.trackingDerivation,X("m028")),Ee.strictMode=t,Ee.allowStateChanges=!t}function q(t){var e=Ee.allowStateChanges;return Ee.allowStateChanges=t,e}function Z(t){Ee.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===Ee.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,Ee.computationDepth++,t)e=Je(this,this.derivation,this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Ye(t)}return Ee.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(Ee.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(Pt(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 Et=be("ObservableObjectAdministration",gt);function Pt(t){return!!ce(t)&&(Q(t),Et(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(Pt(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return Pt(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||Pt(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}();E(Kt.prototype,(function(){return this.entries()}));var Jt=be("ObservableMap",Kt),Qt=[];function te(){return"undefined"!=typeof window?window:r.g}function ee(){return++Ee.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=[]},Ee=new Ae,Pe=!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],Pt(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):Pt(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,Ee.pendingUnobservations.push(t))}function Ve(){Ee.inBatch++}function Ge(){if(0==--Ee.inBatch){fn();for(var t=Ee.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Ee.pendingUnobservations=[]}}function We(t){var e=Ee.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(){Pe||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!==Ee.trackingDerivation}function Ke(t){var e=t.observers.length>0;Ee.computationDepth>0&&e&&ne(X("m031")+t.name),!Ee.allowStateChanges&&e&&ne(X(Ee.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=++Ee.runId;var r,i=Ee.trackingDerivation;Ee.trackingDerivation=t;try{r=e.call(n)}catch(t){r=new Ye(t)}return Ee.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=Ee.trackingDerivation;return Ee.trackingDerivation=null,t}function nn(t){Ee.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 Ee.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,Ee.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}),Ee.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(){Ee.inBatch>0||Ee.isRunningReactions||cn(hn)}function hn(){Ee.isRunningReactions=!0;for(var t=Ee.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()}Ee.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(Pt(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 Ee},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(!Pt(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 Ee.globalReactionErrorHandlers.push(t),function(){var e=Ee.globalReactionErrorHandlers.indexOf(t);e>=0&&Ee.globalReactionErrorHandlers.splice(e,1)}},reserveArrayBuffer:U,resetGlobalState:function(){Ee.resetId++;var t=new Ae;for(var e in t)-1===Oe.indexOf(e)&&(Ee[e]=t[e]);Ee.allowStateChanges=!Ee.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."),Pe=!0;var t=te(),e=Ee;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?Ee=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 Ee.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:Pt,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===Pt(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=Ee.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!==Ee.resetId&&(n={},r=Ee.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 En(){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 Pn(r)}function Pn(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}Pn.prototype=En.prototype={constructor:Pn,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 Pn(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=En;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)},Er=function(){return 2*Ar()};function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}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"!=Pr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Pr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pr(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(Er));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.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,_i(r.key),r)}}function bi(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"!=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 wi=function(){function t(n,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),bi(this,"shaderProgram",void 0),bi(this,"gl",void 0),bi(this,"curTexture",void 0),bi(this,"attributeInfo",void 0),bi(this,"uniformInfo",void 0);var a=n.createShader(n.FRAGMENT_SHADER);if(!n.isShader(a))throw new Error("Could not create shader object");var s=yi()(i,o);n.shaderSource(a,s),n.compileShader(a),(0,e.isNil)(n.getShaderParameter(a,n.COMPILE_STATUS))&&Nr.info(n.getShaderInfoLog(a));var u=n.createShader(n.VERTEX_SHADER);if(!n.isShader(u))throw new Error("Could not create shader object");var l=yi()(r,o);if(n.shaderSource(u,l),n.compileShader(u),(0,e.isNil)(n.getShaderParameter(u,n.COMPILE_STATUS))&&Nr.info(n.getShaderInfoLog(u)),this.shaderProgram=n.createProgram(),n.attachShader(this.shaderProgram,a),n.attachShader(this.shaderProgram,u),n.linkProgram(this.shaderProgram),(0,e.isNil)(n.getProgramParameter(this.shaderProgram,n.LINK_STATUS)))throw new Error("Could not initialise shader");this.gl=n,this.curTexture=0,this.scanUniforms(),this.scanAttributes()}var n,r;return n=t,(r=[{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)}},{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}}}])&&gi(n.prototype,r),Object.defineProperty(n,"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 Si(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,Ti(r.key),r)}}function Ti(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)}function Oi(t){var e="function"==typeof Map?new Map:void 0;return Oi=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(Ai())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ei(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}}),Ei(n,t)},Oi(t)}function Ai(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ai=function(){return!!t})()}function Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ei(t,e)}function Pi(t){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(t)}var ki=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"===xi(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,Ai()?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&&Ei(t,e)}(e,t),n=e,(r=[{key:"toString",value:function(){return this.message}}])&&Si(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(Oi(Error));const ji="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 Ci(t){return Ci="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},Ci(t)}function Ri(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,Di(r.key),r)}}function Di(t){var e=function(t,e){if("object"!=Ci(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ci(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ci(e)?e:String(e)}var Ii=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&&Ri(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Li=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 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 Ni(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 Ui(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)?Ui(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 Ui(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 Fi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zi(r.key),r)}}function zi(t){var e=function(t,e){if("object"!=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 Bi="PhysLayout",Vi=new Float32Array(4),Gi=256,Wi=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}},Xi=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,Gi,0,0,Gi,Gi,Gi]);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,Gi,Gi,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(Bi),l.addChannel(Bi),this.stateDisposers=[],this.stateDisposers.push(r.reaction((function(){return r.graphUpdates}),(function(){var t=u.channels[Bi];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[Bi];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=Wi(t.nodes),n=e.nodeIdToIndex,r=e.nodeIndexToId;return this._nodeIdToIndex=n,this._nodeIndexToId=r,this._numNodes=t.nodes.length,this.solarMerger=new Ii(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,Gi,Gi),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=Ni(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=Ni(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=Ni(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){Vi[0]=o.x,Vi[1]=o.y,Vi[2]=0,Vi[3]=0;var s=a%vr,u=(a-s)/vr;e.texSubImage2D(e.TEXTURE_2D,0,s,u,1,1,e.RGBA,e.FLOAT,Vi),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=Wi(t.nodes).nodeIdToIndex,i=new Ii(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=Wi(this.subGraphs[0].nodes),A=O.nodeIdToIndex,E=O.nodeIndexToId;return this._nodeIdToIndex=A,this._nodeIndexToId=E,n.bindTexture(n.TEXTURE_2D,this._updateTexture),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,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(Bi),this._state.rels.removeChannel(Bi)}},{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[Bi].adds).length>0,a=Object.values(r.channels[Bi].adds).length>0,s=Object.values(n.channels[Bi].removes).length>0,u=Object.values(r.channels[Bi].removes).length>0,l=Object.values(n.channels[Bi].updates);(o||a||s||u)&&this.addRemoveData(i,{adds:n.channels[Bi].adds,removes:n.channels[Bi].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(Bi),r.clearChannel(Bi)}},{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 ki(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=Li({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=Li({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 wi(t,ji,"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,Gi)}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,Gi),f=t._newFramebuffer(e,c);t.levelsData[u]={texture:c,frameBuffer:f},t.levelsClusterTexture[u]=t._newTexture(e,n,Gi),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,Gi),this._apprxRepForceShader=new wi(e,ji,"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 wi(t,ji,"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 wi(t,ji,"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&&Fi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hi(t){return Hi="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},Hi(t)}function Yi(t){return function(t){if(Array.isArray(t))return $i(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 $i(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)?$i(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 $i(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 qi(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,Ki(r.key),r)}}function Zi(t,e,n){return(e=Ki(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ki(t){var e=function(t,e){if("object"!=Hi(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Hi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hi(e)?e:String(e)}var Ji="ForceCytoLayout",Qi="forceDirected",to="coseBilkent",eo=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),Zi(this,"physLayout",void 0),Zi(this,"coseBilkentLayout",void 0),Zi(this,"state",void 0),Zi(this,"currentLayoutType",void 0),Zi(this,"isCytoscapeEnabled",void 0),Zi(this,"currentLayout",void 0);var r=e.state,i=e.isCytoscapeEnabled;this.isCytoscapeEnabled=null==i||i,this.physLayout=new Xi(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===to&&setTimeout((function(){return n.setLayout(Qi)}),50)}}),this.currentLayout=this.physLayout,this.currentLayoutType=Qi;var o=r.nodes,a=r.rels;o.addChannel(Ji),a.addChannel(Ji),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===to?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[Ji],o=r.channels[Ji],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(Ji),r.clearChannel(Ji),this.currentLayoutType===Qi&&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(Yi(h),Yi(u))),p=r.items.map((function(t){return t.id})),v=new Set([].concat(Yi(p),Yi(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(to),this.coseBilkentLayout.update(!0,n.items,r.items)):x>0&&f.size/x>.25&&(this.setLayout(to),this.coseBilkentLayout.update(!0,b,_))}}this.physLayout.update(t),this.coseBilkentLayout.update(t)}},{key:"getShouldUpdate",value:function(){return this.currentLayout.getShouldUpdate()}},{key:"getComputing",value:function(){return this.currentLayout.getComputing()}},{key:"updateNodes",value:function(t){this.setLayout(Qi),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&&qi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function no(t){return no="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},no(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){uo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function oo(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 so(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,lo(r.key),r)}}function uo(t,e,n){return(e=lo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lo(t){var e=function(t,e){if("object"!=no(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=no(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==no(e)?e:String(e)}var co="FreeLayout",fo=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),uo(this,"state",void 0),uo(this,"positions",void 0),uo(this,"shouldUpdate",void 0),uo(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(co),a.addChannel(co),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=oo(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[co].adds).length>0,o=Object.values(r.channels[co].adds).length>0,a=Object.values(n.channels[co].removes).length>0,s=Object.values(r.channels[co].removes).length>0;(i||o||a||s)&&this.layout(n.items,n.idToItem,n.idToPosition),n.clearChannel(co),r.clearChannel(co)}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=oo(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=io({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(co),this.state.rels.removeChannel(co)}}],r&&so(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();function ho(t){return ho="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},ho(t)}function po(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 vo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?po(Object(n),!0).forEach((function(e){var r,i,o;r=t,i=e,o=n[e],(i=bo(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)):po(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yo(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 mo(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)?mo(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 mo(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 go(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,bo(r.key),r)}}function bo(t){var e=function(t,e){if("object"!=ho(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ho(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ho(e)?e:String(e)}var _o="GridLayout",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);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(_o),a.addChannel(_o),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=yo(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[_o].adds).length>0,o=Object.values(r.channels[_o].adds).length>0,a=Object.values(n.channels[_o].removes).length>0,s=Object.values(r.channels[_o].removes).length>0;(i||o||a||s)&&(this.layout(n.items,n.idToItem,n.idToPosition,r.items),n.idToPosition=this.positions),n.clearChannel(_o),r.clearChannel(_o)}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]=vo({id:v.id},y))}this.positions=d,this.shouldUpdate=!1}}},{key:"getNodePositions",value:function(t){var e,n=[],r=yo(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=this.positions[i.id],a=vo({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(_o),this.state.rels.removeChannel(_o)}}],r&&go(n.prototype,r),Object.defineProperty(n,"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 So(t,e,n){var r;return r=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)}(e),(e="symbol"==xo(r)?r:String(r))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var To="down",Oo=So(So(So(So({},"up","BT"),To,"TB"),"left","RL"),"right","LR"),Ao="bin",Eo=[Ao,"stack"],Po=["html"],ko=["html"],jo=["captionHtml"];function Co(t){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(t)}function Ro(t,e){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 Do(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,Bo(r.key),r)}}function Io(t,e,n){return e=Uo(e),function(t,e){if(e&&("object"===Co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mo(t)}(t,Lo()?Reflect.construct(e,n||[],Uo(t).constructor):e.apply(t,n))}function Lo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lo=function(){return!!t})()}function Mo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function No(){return No="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=Uo(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}},No.apply(this,arguments)}function Uo(t){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uo(t)}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}function zo(t,e,n){return(e=Bo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bo(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 Vo="HierarchicalLayout",Go=function(t){return void 0!==t?gn(t):t},Wo=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),zo(Mo(n=Io(this,e,[t])),"direction",void 0),zo(Mo(n),"packing",void 0),zo(Mo(n),"stateDisposers",void 0),zo(Mo(n),"oldComputing",void 0),zo(Mo(n),"computing",void 0),zo(Mo(n),"pendingLayoutData",void 0),zo(Mo(n),"worker",void 0),zo(Mo(n),"directionChanged",void 0),zo(Mo(n),"packingChanged",void 0),n.direction=To,n.packing=Ao;var r=n.state,i=r.nodes,o=r.rels;return i.addChannel(Vo),o.addChannel(Vo),n.stateDisposers=[n.state.reaction((function(){return n.state.graphUpdates}),(function(){if(void 0!==i.version){var t=i.channels[Vo],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[Vo],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&&Fo(t,e)}(e,t),n=e,r=[{key:"setOptions",value:function(t){if(void 0!==t){var e=t.direction,n=void 0===e?To:e,r=t.packing,i=void 0===r?Ao:r;Object.keys(Oo).includes(n)&&(this.directionChanged=this.direction&&this.direction!==n,this.direction=n),Eo.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[Vo].adds).length>0,u=Object.values(i.channels[Vo].adds).length>0,l=Object.values(r.channels[Vo].removes).length>0,c=Object.values(i.channels[Vo].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[Vo].updates));(t||s||u||l||c||o||a||f)&&this.layout(r.items,r.idToItem,r.idToPosition,i.items),r.clearChannel(Vo),i.clearChannel(Vo),this.directionChanged=!1,this.packingChanged=!1}No(Uo(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=Go(t).map((function(t){return t.html,Ro(t,Po)})),a=Go(e),s={};Object.keys(a).forEach((function(t){var e=a[t],n=(e.html,Ro(e,ko));s[t]=n}));var u=Go(r).map((function(t){return t.captionHtml,Ro(t,jo)})),l=Go(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(Vo),null===(e=this.state.rels)||void 0===e||e.clearChannel(Vo)}},{key:"destroy",value:function(){this.stateDisposers.forEach((function(t){t()})),this.state.nodes.removeChannel(Vo),this.state.rels.removeChannel(Vo),this.worker.port.close()}}],r&&Do(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}($r),Xo=r(269),Ho=r.n(Xo);function Yo(t){return Yo="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},Yo(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 qo(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,a;r=t,i=e,o=n[e],a=function(t,e){if("object"!=Yo(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i),(i="symbol"==Yo(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)):$o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Zo=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}},Ko=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}},Jo=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))},Qo=function(t,e,n,r){return Math.max(Math.min(e,n),Math.min(t,r))},ta=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]:qo({},t),e[1]=t.y<e[1].y?e[1]:qo({},t),e[2]=t.x<e[2].x?qo({},t):e[2],e[3]=t.y<e[3].y?qo({},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),Qo(i,o,Math.min(e,a),n)):Qo(i,o,e,n)};function ea(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 na(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)?na(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 na(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 ra(t){this.channels[t]={adds:{},updates:{},removes:{}}}function ia(t){delete this.channels[t]}function oa(t){this.channels[t].adds={},this.channels[t].updates={},this.channels[t].removes={}}var aa=function(t){return"html"in t?t.html:"captionHtml"in t?t.captionHtml:void 0};function sa(t,n){var r,i=!1,o=ea(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=aa(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 ua(t,e){var n,r=!1,i=ea(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=aa(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 la(t,e){var n,r=!1,i=ea(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 ca(t){var e,n=ea(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 fa(t){for(var e in this.idToHtmlOverlay){var n=this.idToHtmlOverlay[e];t.appendChild(n)}}var ha=function(){return{idToItem:zt.shallow({}),items:zt.shallow([]),channels:zt.shallow({}),idToPosition:zt.shallow({}),idToHtmlOverlay:zt.shallow({}),version:0,addChannel:rt(ra),removeChannel:rt(ia),clearChannel:rt(oa),add:rt(sa),update:rt(ua),remove:rt(la),updatePositions:rt(ca),updateHtmlOverlay:rt(fa)}};function da(t){return da="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},da(t)}function pa(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 va(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pa(Object(n),!0).forEach((function(e){var r,i,o,a;r=t,i=e,o=n[e],a=function(t,e){if("object"!=da(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=da(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i),(i="symbol"==da(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)):pa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ya="#bbb",ma="#fff",ga="#45bff8",ba={selected:{rings:[{widthFactor:.05,color:ma},{widthFactor:.1,color:ga}],shadow:{width:10,opacity:1,color:ya}},default:{rings:[]}},_a={selected:{rings:[{color:ma,width:2},{color:ga,width:4}],shadow:{width:18,opacity:1,color:ya}},default:{rings:[]}},wa=.75,xa="forceDirected",Sa="hierarchical",Ta="grid",Oa="free",Aa="d3Force",Ea="webgl",Pa="canvas";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){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,Ra(r.key),r)}}function Ca(t,e,n){return(e=Ra(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ra(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 Da=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ca(this,"elementId",void 0),Ca(this,"currentValue",void 0),Ca(this,"startValue",void 0),Ca(this,"currentTime",void 0),Ca(this,"duration",void 0),Ca(this,"status",void 0),Ca(this,"endValue",void 0),Ca(this,"startTime",void 0),Ca(this,"endTime",void 0),Ca(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)}}])&&ja(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ia(t){return Ia="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},Ia(t)}function La(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 Ma(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?La(Object(n),!0).forEach((function(e){Ua(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return 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,Fa(r.key),r)}}function Ua(t,e,n){return(e=Fa(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fa(t){var e=function(t,e){if("object"!=Ia(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ia(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ia(e)?e:String(e)}var za=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ua(this,"animations",void 0),Ua(this,"durations",void 0),Ua(this,"defaultDuration",void 0),Ua(this,"hasNextAnimation",void 0),Ua(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 Da(e,t),o=null!==(r=this.animations.get(e))&&void 0!==r?r:{};return this.animations.set(e,Ma(Ma({},o),{},Ua({},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&&Na(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ba(t){return Ba="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},Ba(t)}function Va(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,Ga(r.key),r)}}function Ga(t){var e=function(t,e){if("object"!=Ba(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ba(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ba(e)?e:String(e)}var Wa=64,Xa=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=Ga(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,Wa,Wa),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=Wa,e.height=Wa;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,Wa,Wa),e&&this.invertCanvas(i),t.drawn=!0}}},{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}}],n&&Va(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const Ha=Xa;function Ya(t){return Ya="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},Ya(t)}function $a(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 qa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ka(r.key),r)}}function Za(t,e,n){return(e=Ka(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ka(t){var e=function(t,e){if("object"!=Ya(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ya(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ya(e)?e:String(e)}var Ja=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),Za(this,"key",void 0),Za(this,"rels",void 0),Za(this,"waypointPath",void 0),Za(this,"selfReferring",void 0),Za(this,"fromId",void 0),Za(this,"toId",void 0),Za(this,"angles",void 0),Za(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 $a(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 $a(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)?$a(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&&qa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Qa="#848484",ts=2*Math.PI/50,es=.1*Math.PI,ns=gr;function rs(t){return rs="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},rs(t)}function is(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 os(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)?os(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 os(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 as(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,us(r.key),r)}}function ss(t,e,n){return(e=us(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function us(t){var e=function(t,e){if("object"!=rs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=rs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rs(e)?e:String(e)}var ls=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},cs=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},fs=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ss(this,"bundles",void 0),ss(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 Ja(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=is(u);try{for(f.s();!(l=f.n()).done;)for(var h=l.value,d=t[h.fromId],p=t[h.toId],v=ts*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*ts)}catch(t){f.e(t)}finally{f.f()}var g=c.map((function(t){return(t+2*Math.PI)%(2*Math.PI)})).sort(),b=ls(g);cs(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&&as(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();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=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 ps(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ys(r.key),r)}}function vs(t,e,n){return(e=ys(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ys(t){var e=function(t,e){if("object"!=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 ms=function(t,n){return(0,e.isFinite)(t.x)&&(0,e.isFinite)(t.y)&&(0,e.isFinite)(n.x)&&(0,e.isFinite)(n.y)},gs=function(t,e){if(!t||!e||!ms(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},bs=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vs(this,"p1",void 0),vs(this,"p2",void 0),vs(this,"unit",void 0),vs(this,"norm",void 0),vs(this,"length",void 0),vs(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&&ps(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),_s=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)},ws=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}},xs=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?ds(Object(n),!0).forEach((function(e){vs(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ds(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=_s(u,l,r))<s?i:s),u.x=l.x,u.y=l.y;return s};function Ss(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 Ts=[[.04,1],[100,2]],Os=[[.8,1.1],[3,1.6],[8,2.5]],As=[[Os[0][0],1],[100,1.25]],Es=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=Ho().get.rgb(t);return null===r?t:"rgba(".concat(r[0],",").concat(r[1],",").concat(r[2],",").concat(e,")")},Ps=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()},ks=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}))},js=function(t,e,n,r){t.beginPath(),t.arc(e,n,r,0,2*Math.PI,!1),t.closePath()},Cs=function(t,e,n,r,i){t.beginPath(),t.fillStyle=r,js(t,e,n,i),t.fill(),t.closePath()};function Rs(t,e){var n=e.find((function(e){return t<e[0]}));return void 0!==n?n[1]:e[e.length-1][1]}var Ds=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 Ss(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 Ss(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)?Ss(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}))},Is=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Ls=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Ms=function(t,e){return{x:t.x*e,y:t.y*e}},Ns=function(t,e){return function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}(Ls(t,e))},Us=function(t,e){return{x:Math.cos(t)*e,y:Math.sin(t)*e}};function Fs(t){return Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(t)}function zs(t){return function(t){if(Array.isArray(t))return Ws(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Gs(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 Bs(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 Vs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bs(Object(n),!0).forEach((function(e){var r,i,o,a;r=t,i=e,o=n[e],a=function(t,e){if("object"!=Fs(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Fs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i),(i="symbol"==Fs(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)):Bs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gs(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}}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=function(t){return!(!t||!isNaN(Number(t))||t.toLowerCase()===t.toUpperCase())&&t===t.toUpperCase()},Hs=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())&&Xs(e)&&!Xs(n)},Ys=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(Hs(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},$s=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===Os[1][1]?l=3:a===Os[2][1]&&(l=4);for(var c=a<Os[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=Gs(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=Ys(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=Ys(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 Vs(Vs({},t),{},{hasEllipsisChar:!1,hasHyphenChar:!1})}));d+=1};0===p.length;)v();return Array.from(p)},qs=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(zs(t),[Vs(Vs({},e),{},{value:i,chars:i.split("").map((function(r,i){var o,a;return 0!==n&&t.length?i<2?null:zs(null!==(o=e.styles)&&void 0!==o?o:[]):zs(null!==(a=e.styles)&&void 0!==a?a:[])}))})])}return[]}),[]);return{stylesPerChar:t.reduce((function(t,e){return[].concat(zs(t),zs(e.chars))}),[]),fullCaption:t.map((function(t){return t.value})).join("")}};function Zs(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 Ks(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)?Ks(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 Ks(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 Js=2*Math.PI,Qs=Math.PI/2,tu=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 bs(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},eu=function(t){var e=_r(),n=t.size,r=t.selected;return((null!=n?n:mr)+4+(!0===r?4:0))*e},nu=function(t,e){var n=_r();t.shadowColor=e.color,t.shadowBlur=e.width*n,t.shadowOffsetX=0,t.shadowOffsetY=0},ru=function(t){t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0},iu=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=gs(d,m)&&gs(p,g)||gs(p,m)&&gs(d,g),_=b?y[1]:null,w=b?y[y.length-2]:null,x=eu(d),S=eu(p),T=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},O=Math.max(Math.PI,Js/(c/2)),A=f?r*O*(a?1:-1)/(null!==(s=d.size)&&void 0!==s?s:mr):0,E=T(b?_:p,d),P=b?T(p,w):E,k=function(t,e,n,r){return{x:t.x+Math.cos(e)*n*(r?-1:1),y:t.y+Math.sin(e)*n*(r?-1:1)}},j=function(t,e){return k(d,E+t,e,!1)},C=function(t,e){return k(p,P-t,e,!0)},R=function(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}},D=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))*l},I=j(A,x),L=C(A,S),M=f?j(0,x):null,N=f?C(0,S):null,U=200*l,F=[];if(b){var z=D(I,_)<U;if(f&&!z){var B=R(M,_);F.push(new bs(I,B)),F.push(new bs(B,_))}else F.push(new bs(I,_));for(var V=2;V<y.length-1;V++)F.push(new bs(y[V-1],y[V]));var G=D(L,w)<U;if(f&&!G){var W=R(N,w);F.push(new bs(w,W)),F.push(new bs(W,L))}else F.push(new bs(w,L))}else{var X=f?D(M,N):0;if(f&&X>2*(30*l+Math.min(x,S)))if(u){var H=tu(d,p,x,S,o,t);F.push(new bs(I,H)),F.push(new bs(H,L))}else{var Y=r*i,$=30+x,q=Math.sqrt($*$+Y*Y),Z=30+S,K=Math.sqrt(Z*Z+Y*Y),J=j(0,q),Q=C(0,K);F.push(new bs(I,J)),F.push(new bs(J,Q)),F.push(new bs(Q,L))}else if(X>(x+S)/2){var tt=tu(d,p,x,S,o,t);F.push(new bs(I,tt)),F.push(new bs(tt,L))}else F.push(new bs(I,L))}return F}(e,n,r,d,p,t,h,s),m=[],g=y[0],b=u(g,h);m.push({x:g.p1.x+b.x,y:g.p1.y+b.y});for(var _=1;_<y.length;_++)if(1===e.size())m.push(y[_-1].p2);else{var w=y[_-1],x=y[_],S=u(w,h),T=u(x,h),O=Is(w.p1,Ms(S,v/2)),A=Is(w.p2,Ms(S,v/2)),E=Is(x.p1,Ms(T,v/2)),P=Is(x.p2,Ms(T,v/2)),k=null;a=T,(o=S).x*a.x+o.y*a.y<.99&&(k=ws(O,A,E,P));var j=null!==k?Ls(k,w.p2):Ms(S,v/2);m.push(Is(w.p2,Ms(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},ou=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=qs(f))||void 0===a?void 0:a.fullCaption:d;if(void 0!==_){var w=!0===v?"#DDDDDD":"#848484",x=6*b*u,S=!0===l?"bold":"normal",T=_;t.fillStyle=w,t.font="".concat(S," ").concat(x,"px ").concat('"Open Sans", sans-serif');var O=function(e){return t.measureText(e).width},A=(null!=p?p:1)*(!0===l?1.5:1),E=O(T);if(E>r){var P=Ys(T,O,(function(){return r}),1,!1)[0];T=!0===P.hasEllipsisChar?"".concat(P.text,"..."):T,E=r}t.save(),t.translate(e.x,e.y),s?(t.rotate(n-Qs),t.translate(2*x,0),t.rotate(-Qs)):t.rotate(n);var k=(1+b)*u,j="bottom"===m?x/2+A+k:-(A+k);t.fillText(T,-E/2,j),t.restore();var C=2*j*Math.sin(n),R=2*j*Math.cos(n),D={position:{x:e.x-C,y:e.y+R},rotation:s?n-Math.PI:n,width:r/u,height:(x+k)/u};o.setLabelInfo(i.id,D)}},au=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()},su=function(t){return t.rings[0].width*_r()*1.5},uu=function(t){return 6*t*_r()},lu=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)}},cu=function(t,e,n){var r=Math.cos(n),i=Math.sin(n);return{xRotated:t*r+e*i,yRotated:t*i-e*r}},fu=function(t,e,n){var r,i,o=n.indexOf(t),a=null!==(r=n.angles[o])&&void 0!==r?r:0,s=a-es/2,u=a+es/2,l=null!==(i=t.width)&&void 0!==i?i:1,c=_r(),f=eu(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-Qs)*c/2,y:p.y+25*Math.sin(a-Qs)*c/2},control2Point:{x:p.x+25*Math.cos(a+Qs)*c/2,y:p.y+25*Math.sin(a+Qs)*c/2}}},hu=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()},du=function(t,e,n,r,i,o,a,s){var u=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];ms(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=fu(e,n,r),p=d.startPoint,v=d.endPoint,y=d.apexPoint,m=d.control1Point,g=d.control2Point,b=a.rings,_=a.shadow,w=_r(),x=b[0].color,S=b[1].color,T=b[0].width*w,O=b[1].width*w,A=40*w,E=(null!=l?l:1)*w,P=E>1?E/2:1,k=9*P,j=2*P,C=7*P,R=!0===u,D=!0===f,I=Math.atan2(v.y-g.y,v.x-g.x),L=!0===u?T*Math.sqrt(1+2*k/C*(2*k/C)):0,M={x:v.x-Math.cos(I)*(.5*k-j+L),y:v.y-Math.sin(I)*(.5*k-j+L)},N={headPosition:{x:v.x+Math.cos(I)*(.5*k-j-L),y:v.y+Math.sin(I)*(.5*k-j-L)},headAngle:I,headHeight:k,headChinHeight:j,headWidth:C};if(t.save(),t.lineCap="round",R&&(nu(t,_),t.lineWidth=E+O,t.strokeStyle=S,hu(t,p,M,y,m,g),Ps(t,O,S,N,!1,!0),ru(t),t.lineWidth=E+T,t.strokeStyle=x,hu(t,p,M,y,m,g),Ps(t,T,x,N,!1,!0)),t.lineWidth=E,!0===c&&!R&&!D){var U=_.color;nu(t,_),t.strokeStyle=U,t.fillStyle=U,hu(t,p,M,y,m,g),Ps(t,E,U,N),ru(t)}var F=D?ns:null!=h?h:Qa;if(t.fillStyle=F,t.strokeStyle=F,hu(t,p,M,y,m,g),Ps(t,E,F,N),o||s){var z,B=r.indexOf(e),V=null!==(z=r.angles[B])&&void 0!==z?z:0,G=y.x-Math.cos(I)*(L/4),W=y.y-Math.sin(I)*(L/4),X=(V+Js)%Js<Math.PI;if(o&&ou(t,{x:G,y:W},(V+Qs)%Js,A,e,r,X),s){var H=s.position,Y=void 0===H?[0,0]:H,$=s.url,q=s.size,Z=uu(void 0===q?1:q),K=lu(Y,A,Z),J=K.widthAlign,Q=K.heightAlign+(R?su(a):0)*(Y[1]<0?-1:1),tt=cu(Q,J*(X?-1:1),V),et=Z/2,nt=G-et-tt.xRotated,rt=W-et-tt.yRotated;t.drawImage(i.getImage($),nt,rt,Z,Z)}}t.restore()}(t,e,n,i,o,a,s):function(t,e,n,r,i,o,a,s,u){var l=e.overlayIcon,c=e.color,f=e.disabled,h=e.selected,d=e.width,p=e.hovered,v=e.captionAlign,y=!0===h,m=!0===f,g=u.rings,b=u.shadow,_=iu(e,i,n,r,a,s),w=_r(),x=function(t){var e,n=!0===t.selected?1.5:1;return(null!==(e=t.width)&&void 0!==e?e:1)*n*_r()}(e),S=m?ns:null!=c?c:Qa,T=g[0].width*w,O=g[1].width*w,A=w*(d>1?d/2:1),E=9*A,P=2*A,k=7*A,j=Ns(_[_.length-2],_[_.length-1]),C=2*E,R=y?T*Math.sqrt(1+C/k*(C/k)):0,D=2-R,I=Math.floor(_.length/2);_.length>2&&y&&j<E+R-P&&(D+=j,R-=j/2+P,_.pop(),I=Math.floor(_.length/2));var L,M,N=_[_.length-2],U=_[_.length-1],F=(L=N,M=U,Math.atan2(M.y-L.y,M.x-L.x)),z=E/2+R,B=Math.cos(F),V=Math.sin(F);_[_.length-1]={x:U.x-B*z,y:U.y-V*z};var G,W={headPosition:{x:U.x+B*D,y:U.y+V*D},headAngle:F,headHeight:E,headChinHeight:P,headWidth:k},X=Zs(_);try{for(X.s();!(G=X.n()).done;){var H=G.value;H.x=Math.round(H.x),H.y=Math.round(H.y)}}catch(t){X.e(t)}finally{X.f()}if(t.save(),y){var Y=g[0].color,$=g[1].color,q=Math.atan2(_[1].y-_[0].y,_[1].x-_[0].x),Z=Us(q,su(u));_[0]=Is(_[0],Z),nu(t,b),au(t,_,x+O,$,s),Ps(t,O,$,W,!1,!0),ru(t),au(t,_,x+T,Y,s),Ps(t,T,Y,W,!1,!0)}if(!0===p&&!y&&!m){var K=b.color;nu(t,b),au(t,_,x,K,s),Ps(t,x,K,W),ru(t)}if(au(t,_,x,S,s),Ps(t,x,S,W),a||l){var J,Q,tt,et,nt,rt=n.x>r.x,it=_[I];1==(1&_.length)?(J=_[rt?I+1:I-1],Q=_[rt?I-1:I+1],s?(tt=(it.x+(J.x+Q.x)/2)/2,et=(it.y+(J.y+Q.y)/2)/2,nt=rt?Math.atan2(n.y-r.y,n.x-r.x):Math.atan2(r.y-n.y,r.x-n.x)):(Ns(it,J)>Ns(it,Q)?Q=it:J=it,tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x))):(J=_[rt?I:I-1],Q=_[rt?I-1:I],tt=(J.x+Q.x)/2,et=(J.y+Q.y)/2,nt=Math.atan2(Q.y-J.y,Q.x-J.x));var ot=y?Us(nt+Qs,su(u)):{x:0,y:0},at=Ns(J,Q);if(a){var st="bottom"===v?1:-1,ut={x:tt+ot.x*st,y:et+ot.y*st};ou(t,ut,nt,at,e,i)}if(l){var lt=l.position,ct=void 0===lt?[0,0]:lt,ft=l.url,ht=l.size,dt=uu(void 0===ht?1:ht),pt=lu(ct,at,dt),vt=pt.widthAlign,yt=pt.heightAlign,mt=cu(yt,vt,nt+Qs),gt=mt.xRotated,bt=mt.yRotated,_t=ct[1]<0?-1:1,wt=dt/2,xt=tt-wt+gt+ot.x*_t,St=et-wt+bt+ot.y*_t;t.drawImage(o.getImage(ft),xt,St,dt,dt)}}t.restore()}(t,e,n,r,i,o,a,u,s))},pu=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 ms(n,r)?n.id===r.id?function(t,e,n){for(var r=fu(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=Zs(iu(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},vu=r(4),yu=r.n(vu),mu=function(t){return t&&"light"===yu()(t)?"#000":"#fff"};function gu(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 bu(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)?bu(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 bu(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 _u=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}},wu=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=e.overlayIcon,E=i.selected,P=_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=gu(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),j=k.reduce((function(t,e){return t+e.width}),0),C=E.shadow.width*P,R=E.shadow.opacity,D=E.shadow.color,I=f*P,L=2*I,M=function(t,e){if(!t||!e)return{nodeInfoLevel:0,fontInfoLevel:1.25,iconInfoLevel:1};var n=_r(),r=1600*n*(1200*n),i=Math.pow(t,2)*Math.PI*Math.pow(e,2)/(r/100);return{nodeInfoLevel:Rs(i,Ts),fontInfoLevel:Rs(i,Os),iconInfoLevel:Rs(i,As)}}(I,o),N=M.nodeInfoLevel,U=M.fontInfoLevel,F=M.iconInfoLevel,z=e.color||"#478BFF",B=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}(U,I,b,Boolean(O)),V=mu(z),G=I,W=G,X=Boolean(d.length),H=Boolean(v.length),Y=Boolean(O),$=Boolean(A);if(j>0&&(G=I+j),_)z="#EDEDED",V="#DDDDDD";else{if(w){var q=Date.now()%1e3/1e3,Z=q<.7?q/.7:0,K=Es(z,.4-.4*Z);Cs(t,s,l,K,I+.88*I*Z)}var J=x||S?C:0,Q=r.getValueForAnimationName(T,"shadowWidth",J);Q>0&&function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=i+o,u=t.createRadialGradient(e,n,i,e,n,s);u.addColorStop(0,"transparent"),u.addColorStop(.01,Es(r,.5*a)),u.addColorStop(.05,Es(r,.5*a)),u.addColorStop(.5,Es(r,.12*a)),u.addColorStop(.75,Es(r,.03*a)),u.addColorStop(1,Es(r,0)),t.fillStyle=u,js(t,e,n,s),t.fill()}(t,s,l,D,G,Q,R)}if(Cs(t,s,l,z,I),j>0&&ks(t,s,l,W,k),Y){var tt=N<2||!(X||H),et=N>0?1:0,nt=tt?1*I:.75*I;nt/=F;var rt=tt?.5*nt:nt*(1===F?"center"===m?1.3:"bottom"===m||tt?1.1:0:"center"===m?1.35:"bottom"===m||tt?1.1:0),it=nt/2;nt=r.getValueForAnimationName(T,"iconSize",nt),it=r.getValueForAnimationName(T,"iconXPos",it),rt=r.getValueForAnimationName(T,"iconYPos",rt),t.save();var ot=!0===_?.1:et;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",ot);var at="#fff"===V,st=n.getImage(O,at);t.drawImage(st,s-it,l-rt,Math.floor(nt),Math.floor(nt)),t.restore()}if($){var ut,lt,ct,ft,ht,dt=L*(null!==(ut=A.size)&&void 0!==ut?ut:1),pt=dt/2-I*(null!==(lt=null===(ct=A.position)||void 0===ct?void 0:ct[1])&&void 0!==lt?lt:0),vt=dt/2-I*(null!==(ft=null===(ht=A.position)||void 0===ht?void 0:ht[0])&&void 0!==ft?ft:0);t.save();var yt=!0===_?.1:1;t.globalAlpha=r.getValueForAnimationName(T,"iconOpacity",yt);var mt=n.getImage(A.url);t.drawImage(mt,s-vt,l-pt,dt,dt),t.restore()}var gt=N<2?0:1,bt=r.getValueForAnimationName(T,"textOpacity",gt,0),_t=Es(V,bt),wt='"Open Sans", sans-serif';if(X&&bt>0){var xt=$s(t,d,wt,B,.7*L,Y,U,null==e||e.captionAlign);t.fillStyle=_t,t.font="normal ".concat(B,"px ").concat(wt);var St=1+B,Tt=-(xt.length-2)*St/2,Ot=d.split("").map((function(t){return[]}));Ds(t,xt,Ot,Tt,B,wt,St,s,l)}if(H){var At=N<2?0:1,Et=r.getValueForAnimationName(T,"textOpacity",At,0),Pt=Es(V,Et),kt='"Open Sans", sans-serif',jt=Boolean(O);if(Et>0){var Ct=qs(v),Rt=Ct.stylesPerChar,Dt=Ct.fullCaption,It="center"===m?.7*L:2*Math.sqrt(Math.pow(L/2,2)-Math.pow(L/3,2)),Lt=$s(t,Dt,kt,B,It,jt,U,null==e||e.captionAlign);t.fillStyle=Pt;var Mt,Nt=B,Ut=-(Lt.length-2)*Nt/2;Mt=m&&"center"!==m?"bottom"===m?Ut+I/Math.PI:Ut-I/Math.PI:Ut,Ds(t,Lt,Rt,Mt,B,kt,Nt,s,l)}}t.save(),t.restore()};function xu(t){return xu="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},xu(t)}function Su(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 Tu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Su(Object(n),!0).forEach((function(e){Pu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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}function Eu(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,ku(r.key),r)}}function Pu(t,e,n){return(e=ku(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ku(t){var e=function(t,e){if("object"!=xu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xu(e)?e:String(e)}var ju="canvasRenderer",Cu=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),Pu(this,"arrowBundler",void 0),Pu(this,"activeNodes",void 0),Pu(this,"canvas",void 0),Pu(this,"context",void 0),Pu(this,"state",void 0),Pu(this,"stateDisposers",void 0),Pu(this,"relationshipThreshold",void 0),Pu(this,"animationHandler",void 0),Pu(this,"imageCache",void 0),Pu(this,"needsRun",void 0),Pu(this,"nodeVersion",void 0),Pu(this,"relVersion",void 0),Pu(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(ju),r.rels.addChannel(ju),this.relationshipThreshold=a,this.nodeVersion=r.nodes.version,this.relVersion=r.rels.version,this.waypointVersion=r.waypoints.counter,this.animationHandler=new za,this.animationHandler.setOptions({fadeDuration:150,sizeDuration:150}),this.arrowBundler=new fs(r.rels.items,r.waypoints.data),this.imageCache=new Ha,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[ju],r=t.rels.channels[ju],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(ju)),this.relVersion<t.rels.version&&(e=Object.keys(a).length>0||Object.keys(s).length>0,t.rels.clearChannel(ju),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!==Sa);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=Ou(h.items);try{for(y.s();!(r=y.n()).done;){var m=r.value,g=s.getBundle(m),b=Tu(Tu({},p[m.from]),v[m.from]),_=Tu(Tu({},p[m.to]),v[m.to]),w=t||f>l||void 0!==m.captionHtml,x=pu(m,g,b,_,w,c!==Sa);if(null!==x){var S,T,O,A,E,P,k=this.isBoundingBoxOffScreen(x,e,n),j=Ns({x:null!==(S=b.x)&&void 0!==S?S:0,y:null!==(T=b.y)&&void 0!==T?T:0},{x:null!==(O=_.x)&&void 0!==O?O:0,y:null!==(A=_.y)&&void 0!==A?A:0}),C=((null!==(E=b.size)&&void 0!==E?E:mr)+(null!==(P=_.size)&&void 0!==P?P:mr))*devicePixelRatio,R=b.id!==_.id&&C>j;k||R||(!0===m.disabled?o.push(Tu(Tu({},m),{},{fromNode:b,toNode:_,showLabel:w})):!0===m.selected?i.push(Tu(Tu({},m),{},{fromNode:b,toNode:_,showLabel:w})):a.push(Tu(Tu({},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=Ou(t);try{for(u.s();!(r=u.n()).done;){var l,c,f=r.value,h=_u(f);this.isBoundingBoxOffScreen(h,e,n)||(!0===(null===(l=s[f.id])||void 0===l?void 0:l.disabled)?i.push(Tu({},f)):!0===(null===(c=s[f.id])||void 0===c?void 0:c.selected)?o.push(Tu({},f)):a.push(Tu({},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=Ou(t);try{for(l.s();!(r=l.n()).done;){var c=r.value;wu(e,Tu(Tu({},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=Ou(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;du(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=Ou(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=Ou(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(!ms(n,r))return 1/0;var s=n===r?function(t,e,n,r){var i=fu(e,n,r),o=i.startPoint,a=i.endPoint,s=i.apexPoint,u=i.control1Point,l=i.control2Point,c=xs(o,s,u,t),f=xs(s,a,l,t);return Math.min(c,f)}(t,e,n,i):function(t,e,n,r,i,o,a){var s=iu(e,n,r,i,o,a),u=1/0;if(a&&3===s.length)u=xs(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=_s(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!==Sa);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(ju),this.state.rels.removeChannel(ju)}},{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&&Eu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ru=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 Du(t){return Du="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},Du(t)}function Iu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uu(r.key),r)}}function Mu(t,e,n){return e&&Lu(t.prototype,e),n&&Lu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Nu(t,e,n){return(e=Uu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uu(t){var e=function(t,e){if("object"!=Du(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Du(e)?e:String(e)}var Fu="WebGLRenderer",zu=function(){function t(e){var n=this;if(Iu(this,t),Nu(this,"mainSceneRenderer",void 0),Nu(this,"minimapRenderer",void 0),Nu(this,"needsRun",void 0),Nu(this,"minimapMouseDown",void 0),Nu(this,"stateDisposers",void 0),Nu(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(Fu),s.addChannel(Fu),this.state=r,this.setupMinimapInteractions()}return Mu(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[Fu].adds).length>0,r=Object.values(e.channels[Fu].adds).length>0,i=Object.values(t.channels[Fu].removes).length>0,o=Object.values(e.channels[Fu].removes).length>0,a=Object.values(t.channels[Fu].updates),s=Object.values(e.channels[Fu].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(Fu),e.clearChannel(Fu)}},{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=Ru(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(Fu),this.state.rels.removeChannel(Fu),this.mainSceneRenderer.destroy(),this.minimapRenderer.destroy()}}]),t}(),Bu=function(){function t(){Iu(this,t),Nu(this,"mainSceneRenderer",void 0),Nu(this,"minimapRenderer",void 0),Nu(this,"needsRun",void 0),Nu(this,"minimapMouseDown",void 0),Nu(this,"stateDisposers",void 0),Nu(this,"state",void 0)}return Mu(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 Vu(t){return Vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(t)}function Gu(t,e){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 Wu(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)?Wu(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 Wu(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 Xu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yu(r.key),r)}}function Hu(t,e,n){return(e=Yu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yu(t){var e=function(t,e){if("object"!=Vu(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Vu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vu(e)?e:String(e)}var $u,qu=24,Zu=function(t){var e=new ArrayBuffer(4),n=new Uint32Array(e),r=new Uint8Array(e),i=Ho().get.rgb(t);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=255*i[3],n[0]},Ku=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),Hu(this,"nodeShader",void 0),Hu(this,"nodeAnimShader",void 0),Hu(this,"relShader",void 0),Hu(this,"relDataBuffer",void 0),Hu(this,"viewportBoxShader",void 0),Hu(this,"defaultRelColor",void 0),Hu(this,"defaultNodeColor",void 0),Hu(this,"disableRelColor",void 0),Hu(this,"disableNodeColor",void 0),Hu(this,"gl",void 0),Hu(this,"activeNodes",void 0),Hu(this,"canvas",void 0),Hu(this,"projection",void 0),Hu(this,"idToIndex",void 0),Hu(this,"posBuffer",void 0),Hu(this,"numRels",void 0),Hu(this,"numNodes",void 0),Hu(this,"nodeDataByte",void 0),Hu(this,"relIdToIndex",void 0),Hu(this,"relData",void 0),Hu(this,"containerWidth",void 0),Hu(this,"containerHeight",void 0),Hu(this,"nodeDataInt",void 0),Hu(this,"viewportBoxBuffer",void 0),Hu(this,"relBuffer",void 0),Hu(this,"nodeBuffer",void 0),Hu(this,"posTexture",void 0),void 0===e.getExtension("OES_texture_float"))throw new Error("Renderer needs floating point texture support");this.nodeShader=new wi(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 wi(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 wi(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 wi(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=Ho().get.rgb(null===(e=t.nodeBorderStyles.default)||void 0===e||null===(e=e.rings[0])||void 0===e?void 0:e.color),i=Ho().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=Gu(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=Gu(t);try{for(u.s();!(e=u.n()).done;){var l=e.value,c=r[l.id];if(l.color||l.disabled){var f=Ho().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=Gu(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:Zu(c?this.disableRelColor:l);this.relData.positionsAndColors[f*qu+0]=h,this.relData.positionsAndColors[f*qu+4]=h,this.relData.positionsAndColors[f*qu+8]=h,this.relData.positionsAndColors[f*qu+12]=h,this.relData.positionsAndColors[f*qu+16]=h,this.relData.positionsAndColors[f*qu+20]=h,i=!0,void 0!==u&&(this.relData.widths[f*qu+3]=u,this.relData.widths[f*qu+7]=u,this.relData.widths[f*qu+11]=u,this.relData.widths[f*qu+15]=u,this.relData.widths[f*qu+19]=u,this.relData.widths[f*qu+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?Zu(h):this.defaultNodeColor;a[3*u+0]=y?Zu(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*qu*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?Zu(f):e.defaultRelColor,T=p?Zu(e.disableRelColor):S,O=h||1;a[d]=n;var A=0,E=function(t,e,r,a){u[n*qu+A]=t,A++;for(var s=0;s<e.length;s++)o[s]=e[s];u[n*qu+A]=i[0],A++,o[0]=r,u[n*qu+A]=i[0],A++,l[n*qu+A]=a,A++};E(T,w,255,O),E(T,x,0,O),E(T,w,0,O),E(T,x,0,O),E(T,w,0,O),E(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&&Xu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ju=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")},Qu=function(t){Nr.warn("Error: WebGL context lost - visualization will stop working!",t),void 0!==$u&&$u(t)},tl=function(t){var e=t.parentElement.getBoundingClientRect(),n=e.width,r=e.height;Ju(t,n,r)},el=function(t,e){var n=document.createElement("canvas");return document.body.appendChild(n),Ju(n,t,e),n},nl=function(t,e){var n=document.createElement("canvas");return Object.assign(n.style,br),void 0!==t&&(t.appendChild(n),tl(n)),function(t,e){$u=e,t.addEventListener("webglcontextlost",Qu)}(n,e),n},rl=function(t){t.width=0,t.height=0,t.remove()},il=function(t){return t.getContext("2d")},ol=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},al=function(t){t.canvas.removeEventListener("webglcontextlost",Qu);var e=t.getExtension("WEBGL_lose_context");null==e||e.loseContext()};function sl(t){return function(t){if(Array.isArray(t))return cl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ll(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 ul(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ll(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 ll(t,e){if(t){if("string"==typeof t)return cl(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)?cl(t,e):void 0}}function cl(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 fl=mr*_r();function hl(t){return hl="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},hl(t)}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,pl(r.key),r)}}function pl(t){var e=function(t,e){if("object"!=hl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=hl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hl(e)?e:String(e)}var vl=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=pl(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&&dl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),yl=r(481),ml=r.n(yl);function gl(t){return gl="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},gl(t)}function bl(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,wl(r.key),r)}}function _l(t,e,n){return(e=wl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wl(t){var e=function(t,e){if("object"!=gl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=gl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gl(e)?e:String(e)}var xl=5e-5,Sl=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),_l(this,"xCtrl",void 0),_l(this,"yCtrl",void 0),_l(this,"zoomCtrl",void 0),_l(this,"getNodePositions",void 0),_l(this,"firstUpdate",void 0),_l(this,"state",void 0),_l(this,"canvas",void 0),_l(this,"defaultZoomLevel",void 0),_l(this,"stateDisposers",void 0),this.state=i,this.getNodePositions=o,this.canvas=a,this.xCtrl=new(ml())(.35,xl,.05,1),this.yCtrl=new(ml())(.35,xl,.05,1),this.zoomCtrl=new(ml())(.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=Zo(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=Ko(_,w,n,r),S=x.zoomX,T=x.zoomY;if(S===1/0&&T===1/0)a.setTarget(u);else{var O=Jo(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=Ko(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=Zo(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()}}}])&&bl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Tl(t){return Tl="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},Tl(t)}function Ol(){Ol=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"==Tl(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var i=h;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Tl(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 Al(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 El(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){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 kl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pl(Object(n),!0).forEach((function(e){Cl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jl(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,Rl(r.key),r)}}function Cl(t,e,n){return(e=Rl(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rl(t){var e=function(t,e){if("object"!=Tl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:String(e)}var Dl="NvlController",Il={filename:"visualisation.png",backgroundColor:"rgba(0,0,0,0)"},Ll="onError",Ml="onLayoutDone",Nl={},Ul=function(){var t;return null!==(t=Nl[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"])&&void 0!==t?t:Object.values(Nl).pop()};window.__Nvl_dumpNodes=function(t){var e;return null===(e=Ul(t))||void 0===e?void 0:e.dumpNodes()},window.__Nvl_dumpRelationships=function(t){var e;return null===(e=Ul(t))||void 0===e?void 0:e.dumpRelationships()},window.__Nvl_registerDoneCallback=function(t,e){var n;return null===(n=Ul(e))||void 0===n?void 0:n.on(Ml,t)},window.__Nvl_getNodesOnScreen=function(t){var e;return null===(e=Ul(t))||void 0===e?void 0:e.getNodesOnScreen()},window.__Nvl_getZoomLevel=function(t){var e;return null===(e=Ul(t))||void 0===e?void 0:e.getScale()};var Fl=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),Cl(this,"destroyed",void 0),Cl(this,"state",void 0),Cl(this,"callbacks",void 0),Cl(this,"instanceId",void 0),Cl(this,"glController",void 0),Cl(this,"webGLContext",void 0),Cl(this,"webGLMinimapContext",void 0),Cl(this,"htmlOverlay",void 0),Cl(this,"hasResized",void 0),Cl(this,"hierarchicalLayout",void 0),Cl(this,"gridLayout",void 0),Cl(this,"freeLayout",void 0),Cl(this,"d3ForceLayout",void 0),Cl(this,"forceLayout",void 0),Cl(this,"canvasRenderer",void 0),Cl(this,"glCanvas",void 0),Cl(this,"canvasRect",void 0),Cl(this,"glMinimapCanvas",void 0),Cl(this,"c2dCanvas",void 0),Cl(this,"isInRenderSwitchAnimation",void 0),Cl(this,"justSwitchedRenderer",void 0),Cl(this,"justSwitchedLayout",void 0),Cl(this,"layoutUpdating",void 0),Cl(this,"layoutComputing",void 0),Cl(this,"isRenderingDisabled",void 0),Cl(this,"setRenderSwitchAnimation",void 0),Cl(this,"stateDisposers",void 0),Cl(this,"zoomTransitionHandler",void 0),Cl(this,"currentLayout",void 0),Cl(this,"layoutTimeLimit",void 0),Cl(this,"pixelRatio",void 0),Cl(this,"removeResizeListener",void 0),Cl(this,"removeMinimapResizeListener",void 0),Cl(this,"pendingZoomOperation",void 0),Cl(this,"layoutRunner",void 0),Cl(this,"animationRequestId",void 0),Cl(this,"layoutDoneCallback",void 0),Cl(this,"layoutComputingCallback",void 0),Cl(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 vl,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=nl(g,this.onWebGLContextLost.bind(this)),_=nl(l,this.onWebGLContextLost.bind(this));if(b.setAttribute("data-testid","nvl-gl-canvas"),m)this.glController=new Bu;else{var w=ol(b),x=ol(_);this.glController=new zu({mainSceneRenderer:new Ku(w,p,v,this.state),minimapRenderer:new Ku(x,p,v,this.state),state:e}),this.webGLContext=w,this.webGLMinimapContext=x}var S=nl(g,this.onWebGLContextLost.bind(this));S.setAttribute("data-testid","nvl-c2d-canvas");var T=S.getContext("2d"),O=document.createElement("div");Object.assign(O.style,kl(kl({},br),{},{overflow:"hidden"})),g.appendChild(O),this.htmlOverlay=O,this.hasResized=!0,this.hierarchicalLayout=new Wo(kl(kl({},c),{},{state:this.state})),this.gridLayout=new wo({state:this.state}),this.freeLayout=new fo({state:this.state}),this.d3ForceLayout=new Lr({state:this.state}),this.forceLayout=m?this.d3ForceLayout:new eo(kl(kl({},c),{},{webGLContext:this.webGLContext,state:this.state})),this.state.setLayout(f),this.state.setLayoutOptions(c);var A=new Cu(S,T,e,n);this.canvasRenderer=A,this.glCanvas=b,this.canvasRect=b.getBoundingClientRect(),this.glMinimapCanvas=_,this.c2dCanvas=S,this.glCanvas.style.opacity=y?"1":"0",this.c2dCanvas.style.opacity=y?"0":"1",this.isInRenderSwitchAnimation=!1,this.justSwitchedRenderer=!1,this.justSwitchedLayout=!1,this.hasResized=!1,this.layoutUpdating=!1,this.layoutComputing=!1,this.isRenderingDisabled=!1,p.addChannel(Dl),v.addChannel(Dl),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 Sl({state:e,getNodePositions:function(t){return a.currentLayout.getNodePositions(t)},canvas:b,defaultZoomLevel:wa}),this.layoutTimeLimit=null!==(o=n.layoutTimeLimit)&&void 0!==o?o:16,this.pixelRatio=_r(),this.removeResizeListener=On()(g,(function(){tl(b),tl(S),a.canvasRect=b.getBoundingClientRect(),a.hasResized=!0})),this.removeMinimapResizeListener=On()(l,(function(){tl(_)})),function(t,e){Nl[e]=t}(this,d),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=Zo(Object.values(e.idToPosition),n),a=o.centerX,s=o.centerY,u=o.nodesWidth,l=o.nodesHeight,c=Ko(u,l,this.glMinimapCanvas.width,this.glMinimapCanvas.height),f=c.zoomX,h=c.zoomY,d=Jo(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(Ll))throw e;t.callIfRegistered(Ll,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(Dl),r.clearChannel(Dl),u||a||c||d||f||h||y||p||v){!t.pendingZoomOperation||l||t.currentLayout.getComputing()||(t.pendingZoomOperation(),t.pendingZoomOperation=null),t.zoomTransitionHandler.update(o||s||c),p&&t.glController.onResize();var m=t.currentLayout.getNodePositions(n.items);if(n.updatePositions(m),t.callIfRegistered("onLayoutStep",t.dumpNodes()),t.updateMinimapZoom(),t.glController.renderMinimap(m),!t.isRenderingDisabled){if((t.state.webGLVisible||d)&&t.glController.renderMainScene(m),!t.state.webGLVisible||d){t.canvasRenderer.processUpdates(),t.canvasRenderer.render(m);for(var g=0;g<r.items.length;g++){var b=r.items[g].id,_=t.canvasRenderer.arrowBundler.getBundle(r.items[g]),w=r.idToHtmlOverlay[b],x=_.labelInfo[b];if(w&&x){var S=x.rotation,T=x.position,O=x.width,A=x.height,E=t.mapCanvasSpaceToRelativePosition(T.x,T.y),P=E.x,k=E.y,j=O>5&&!t.state.webGLVisible;Object.assign(w.style,{top:"".concat(k,"px"),left:"".concat(P,"px"),width:"".concat(O,"px"),height:"".concat(A,"px"),display:j?"block":"none",transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),") rotate(").concat(S,"rad")})}}}for(var C=0;C<n.items.length;C++){var R=n.items[C],D=R.id,I=R.size,L=n.idToHtmlOverlay[D];if(L){var M=t.state.nodes.idToPosition[D],N=t.mapCanvasSpaceToRelativePosition(M.x,M.y),U=N.x,F=N.y,z="".concat(2*(null!=I?I:mr),"px");Object.assign(L.style,{top:"".concat(F,"px"),left:"".concat(U,"px"),width:z,height:z,transform:"translate(-50%, -50%) scale(".concat(Number(t.state.zoom),")")})}}}}var B=!a&&t.layoutUpdating,V=s!==t.layoutComputing;t.layoutComputing=s,t.layoutUpdating=a,B&&t.callIfRegistered(Ml),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(Ll))throw e;t.callIfRegistered(Ll,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 El(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)?El(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(kl(kl({},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,_=ul(s.items);try{for(_.s();!(b=_.n()).done;){var w=b.value,x=w.from,S=w.to,T=a.idToPosition[x],O=a.idToPosition[S];if(void 0!==T.x&&void 0!==T.y&&void 0!==O.x&&void 0!==O.y){var A=T.x>u&&T.x<l&&T.y>c&&T.y<f,E=O.x>u&&O.x<l&&O.y>c&&O.y<f;A&&E&&d.push(w)}}}catch(t){_.e(t)}finally{_.f()}}return{nodes:h,rels:d}}(n,r,i.x,i.y,this.state,["node"])}},{key:"registerDoneCallback",value:function(t){this.layoutDoneCallback=t}},{key:"registerComputingCallback",value:function(t){this.layoutComputingCallback=t}},{key:"getPosition",value:function(t){return this.currentLayout.getNodePositions([{id:t}])[0]}},{key:"getScale",value:function(){return this.state.zoom}},{key:"getPan",value:function(){return{x:this.state.panX,y:this.state.panY}}},{key:"setZoomLevel",value:function(t){var e=this;this.pendingZoomOperation=function(){return e.state.setZoom(t,e.glCanvas)}}},{key:"setPanCoordinates",value:function(t,e){this.state.setPan(t,e)}},{key:"setZoomAndPan",value:function(t,e,n){var r=this;this.pendingZoomOperation=function(){return r.state.setZoomPan(t,e,n,r.glCanvas)}}},{key:"fit",value:function(t,e){var n=this;this.pendingZoomOperation=function(){return n.state.fitNodes(t,e)}}},{key:"resetZoom",value:function(){var t=this;this.pendingZoomOperation=function(){return t.state.setZoomReset()}}},{key:"setRenderer",value:function(t){this.state.setRenderer(t)}},{key:"on",value:function(t,e){this.callbacks.register(t,e)}},{key:"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&&al(this.webGLContext),void 0!==this.webGLMinimapContext&&al(this.webGLMinimapContext),rl(this.glCanvas),rl(this.glMinimapCanvas),this.canvasRenderer.destroy(),rl(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 Nl[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===Sa?this.hierarchicalLayout:t===xa?this.forceLayout:t===Ta?this.gridLayout:t===Oa?this.freeLayout:t===Aa?this.d3ForceLayout:this.forceLayout}},{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=kl(kl({},Il),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=el(this.c2dCanvas.width,this.c2dCanvas.height),s=il(a);this.canvasRenderer.processUpdates(),this.canvasRenderer.render(o,{canvas:a,context:s,backgroundColor:r,ignoreAnimations:!0}),this.createDownloadLink(n,a).click(),rl(a),a=null,s=null}},{key:"prepareLargeFileForDownload",value:function(t){var e=this,n=kl(kl({},Il),t),r=this.state.nodes.items,i=n.filename,o=n.backgroundColor,a=this.currentLayout.getNodePositions(r),s=Zo(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 Nr.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=el(h,d),s=il(r);e.canvasRenderer.processUpdates(),e.canvasRenderer.render(a,{canvas:r,context:s,backgroundColor:o,ignoreAnimations:!0,showCaptions:!0}),e.createDownloadLink(i,r).click(),rl(r),r=null,s=null,t(!0)}catch(t){n(t)}}),500)}))}},{key:"saveFullGraphToLargeFile",value:(r=Ol().mark((function t(e){var n,r,i,o;return Ol().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=kl(kl({},Il),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),Nr.error("An error occurred while downloading the image"),!this.callbacks.isCallbackRegistered(Ll)){t.next=16;break}this.callIfRegistered(Ll,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){Al(o,n,i,a,s,"next",t)}function s(t){Al(o,n,i,a,s,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&jl(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function zl(t){return zl="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},zl(t)}function Bl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vl(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,Wl(r.key),r)}}function Gl(t,e,n){return e&&Vl(t.prototype,e),n&&Vl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wl(t){var e=function(t,e){if("object"!=zl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=zl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zl(e)?e:String(e)}var Xl=function(){function t(e,n){if(Bl(this,t),!e)throw new Error("Tried to create a node with no data");this.data=e,this.parent=n,this.children=[]}return Gl(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}(),Hl=function(){function t(e){Bl(this,t),this.name=e,this.startTime=performance.now(),this.endTime=null}return Gl(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}(),Yl=function(){function t(){Bl(this,t),this.root=new Xl(new Hl("Performance Tree"),null),this.current=this.root}return Gl(t,[{key:"clear",value:function(){this.root.children=[],this.current=this.root}},{key:"add",value:function(t){if(this.current){var e=new Xl(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 Xl(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}(),$l=function(){function t(){Bl(this,t),window.performance?(this.disabled=!1,this.tree=new Yl):(this.disabled=!0,this.tree=null)}return Gl(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 Hl(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}(),ql=function(t){return Boolean(t)&&"string"==typeof t.id&&t.id.length>0};function Zl(t){return Zl="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},Zl(t)}function Kl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Jl(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){if(t){if("string"==typeof t)return Ql(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)?Ql(t,e):void 0}}function Ql(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 tc(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 ec(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tc(Object(n),!0).forEach((function(e){rc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nc(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,ic(r.key),r)}}function rc(t,e,n){return(e=ic(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ic(t){var e=function(t,e){if("object"!=Zl(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Zl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zl(e)?e:String(e)}var oc=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),rc(this,"externalCallbackHandler",void 0),rc(this,"performance",void 0),rc(this,"visState",void 0),rc(this,"nvlController",void 0),rc(this,"options",void 0),this.setupLogging(i),this.externalCallbackHandler=new s(o),this.performance=new $l,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,ec({},n)),this.visState.rels.update(e,ec({},n)),this.visState.nodes.add(t,ec({},n)),this.visState.rels.add(e,ec({},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 ec(ec({},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,ec({},n)),this.visState.rels.update(e,ec({},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,ec({},n)),this.visState.rels.add(e,ec({},n)),this.nvlController.updateHtmlOverlay()}},{key:"removeNodesWithIds",value:function(t){if(Array.isArray(t)&&!(0,e.isEmpty)(t)){var n,r={},i=Kl(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=Kl(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 ec(ec({},t),{},{selected:!1})})),this.visState.rels.items.map((function(t){return ec(ec({},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?Ea: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?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=Ru(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,sl(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=ul(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,sl(function(t,e){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o={},a=ul(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=_s({x:l.x,y:l.y},{x:c.x,y:c.y},{x:t,y:e});if(f<=fl){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,sl(n.getCanvasNodesAt({x:t,y:e},i.hitNodeMarginWidth))),r.includes("relationship")&&a.push.apply(a,sl(n.getCanvasRelsAt({x:t,y:e}))),{nodes:o,relationships:a}}(f,h,o,e,n);return ec(ec({},t),{},{nvlTargets:d})}},{key:"getContainer",value:function(){return this.options.frame}},{key:"initialise",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]:{};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.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:Ea: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=va({},ba.default);void 0!==u&&("string"==typeof u&&null!==Ho().get.rgb(u)?w.rings=[{color:u,widthFactor:.05}]:Nr.warn("Invalid color string for nodeDefaultBorderColor:",u));var x=va({},ba.selected),S=va({},_a.selected);return void 0!==l&&("string"==typeof u&&null!==Ho().get.rgb(l)?(x.rings[1].color=l,S.rings[1].color=l):Nr.warn("Invalid color string for selectedBorderColor:",l)),zt({zoom:p||wa,minimapZoom:wa,defaultZoomLevel:wa,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},relationshipBorderStyles:{default:_a.default,selected:S},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===Ea||t},nodes:ha(),rels:ha(),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=ta(i,b,_,r,t,this.zoom);a!==this.zoom&&(this.zoom=a,t===a&&(this.panX=e,this.panY=n))}else{var s=Qo(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=ta(n,b,_,e,t,this.zoom)}else this.zoom=Qo(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=ta(a,b,_,r,t,this.zoom)}else i=Qo(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})}(r),this.nvlController=new Fl(this.visState,r),this.addAndUpdateElementsInGraph(t,n),this.nvlController.on("restart",this.restart.bind(this));var i,o,a,s,u=Kl((i=this.externalCallbackHandler.callbacks,Object.entries(i)));try{for(u.s();!(o=u.n()).done;){var l=(a=o.value,s=2,function(t){if(Array.isArray(t))return t}(a)||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}}(a,s)||Jl(a,s)||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.")}()),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()}}},{key:"setupLogging",value:function(t){var e,n=t.logging;void 0!==n&&(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];"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=ec(ec({},o.idToItem),s),f=a.idToItem,h=0;h<t.length;h++){var d=t[h];if(!ql(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 ki("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&&nc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(),ac={textColorForBackground:mu};const sc=oc})();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};
|