veoflow 0.4.4 → 0.5.1
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/bin/veoflow.mjs +22 -1
- package/dist/veo.mjs +8379 -2726
- package/native/veo-extract.darwin-arm64.node +0 -0
- package/native/veo-extract.darwin-x64.node +0 -0
- package/native/veo-extract.linux-arm64-gnu.node +0 -0
- package/native/veo-extract.linux-x64-gnu.node +0 -0
- package/native/veo-extract.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
- package/web/assets/index-BsMOu4TX.js +340 -0
- package/web/assets/index-sMLLcywh.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-Bx_159jR.js +0 -340
- package/web/assets/index-C8y32Zs3.css +0 -1
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),o=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=e((e=>{var t=i(),r=n(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),H=Symbol.for(`react.legacy_hidden`),U=Symbol.for(`react.memo_cache_sentinel`),W=Symbol.for(`react.view_transition`),G=Symbol.for(`react.recoverable`),K=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=K&&e[K]||e[`@@iterator`],typeof e==`function`?e:null)}var q=Symbol.for(`react.client.reference`);function J(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===q?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case W:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?J(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var te=Array.isArray,Y=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function se(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function ce(e,t){ae++,ie[ae]=e.current,e.current=t}var le=oe(null),ue=oe(null),de=oe(null),fe=oe(null);function pe(e,t){switch(ce(de,t),ce(ue,e),ce(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}se(le),ce(le,e)}function me(){se(le),se(ue),se(de)}function he(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,ce(fe,e)),t=le.current;var n=dp(t,e.type);t!==n&&(ce(ue,e),ce(le,n))}function ge(e){ue.current===e&&(se(le),se(ue)),fe.current===e&&(se(fe),sh._currentValue=re)}var _e,ve;function ye(e){if(_e===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||``,ve=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+_e+e+ve}var be=!1;function xe(e,t){if(!e||be)return``;be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ye(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye(`Lazy`);case 13:return e.child!==t&&t!==null?ye(`Suspense Fallback`):ye(`Suspense`);case 19:return ye(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return ye(`Activity`);case 30:return ye(`ViewTransition`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,X=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Be(n),i=1<<r;t|=e[r],n&=~i}return t}function Ze(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qe(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function $e(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function et(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:at(n),(n&(e.suspendedLanes|t))===0?n:0}function at(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ot(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function st(){var e=ne.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function ct(e,t){var n=ne.p;try{return ne.p=e,t()}finally{ne.p=n}}var lt=Math.random().toString(36).slice(2),ut=`__reactFiber$`+lt,dt=`__reactProps$`+lt,ft=`__reactContainer$`+lt,pt=`__reactEvents$`+lt,mt=`__reactListeners$`+lt,ht=`__reactHandles$`+lt,gt=`__reactResources$`+lt,_t=`__reactMarker$`+lt,vt=`__reactLoad$`+lt;function yt(e){delete e[ut],delete e[dt],delete e[mt],delete e[ht]}function bt(e){var t;if(t=e[ut])return t;for(var n=e.parentNode;n;){if(t=n[ft]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[ut])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Z(e){if(e=e[ut]||e[ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function St(e){var t=e[gt];return t||=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[_t]=!0}function wt(e){e[vt]=void 0}var Q=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)Q.add(t[e])}var Ot=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),kt={},At={};function jt(e){return we.call(At,e)?!0:we.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}var Mt=!1;function Nt(){var e=Mt;return Mt=!1,e}function Pt(e,t,n){if(jt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function It(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Ht=/[\n"\\]/g;function Ut(e){return e.replace(Ht,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Wt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Kt(e,Lt(n)):o===`number`&&e.value==t?Kt(e,Lt(e.value)):Kt(e,Lt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Lt(s):e.removeAttribute(`name`)}function Gt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Bt(e)}function Kt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Lt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Jt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Yt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(te(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Xt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function $t(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(s(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Mt=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(Qt(e,i,r),Mt=!0)}else for(var a in t)t.hasOwnProperty(a)&&Qt(e,a,t[a])}function en(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var tn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),nn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rn(e){return nn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function an(){}var on=null;function sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cn=null,ln=null;function un(e){var t=Z(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ut(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[dt]||null;if(!i)throw Error(s(90));Wt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Vt(r)}break a;case`textarea`:Jt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&qt(e,!!n.multiple,t,!1)}}}var dn=!1;function fn(e,t,n){if(dn)return e(t,n);dn=!0;try{return e(t)}finally{if(dn=!1,(cn!==null||ln!==null)&&(Id(),cn&&(t=cn,e=ln,ln=cn=null,un(t),e)))for(t=0;t<e.length;t++)un(e[t])}}function pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(s(231,t,typeof n));return n}var mn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,hn=!1;if(mn)try{var gn={};Object.defineProperty(gn,"passive",{get:function(){hn=!0}}),window.addEventListener(`test`,gn,gn),window.removeEventListener(`test`,gn,gn)}catch{hn=!1}var _n=null,vn=null,yn=null;function bn(){if(yn)return yn;var e,t=vn,n=t.length,r,i=`value`in _n?_n.value:_n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return yn=i.slice(e,1<r?1-r:void 0)}function xn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sn(){return!0}function Cn(){return!1}function wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Sn:Cn,this.isPropagationStopped=Cn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Sn)},persist:function(){},isPersistent:Sn}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=D({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=D({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(D({},Mn,{dataTransfer:0})),Fn=wn(D({},Dn,{relatedTarget:0})),In=wn(D({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(D({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(D({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(D({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=xn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?xn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?xn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=wn(D({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=wn(D({},Tn,{submitter:0})),qn=wn(D({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),Jn=wn(D({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Yn=wn(D({},Mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Xn=wn(D({},Tn,{newState:0,oldState:0,source:0})),Zn=[9,13,27,32],Qn=mn&&`CompositionEvent`in window,$n=null;mn&&`documentMode`in document&&($n=document.documentMode);var er=mn&&`TextEvent`in window&&!$n,tr=mn&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=bn(),yn=vn=_n=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){cn?ln?ln.push(r):ln=[r]:cn=r,t=qf(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){zf(e,0)}function hr(e){if(Vt(xt(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(mn){var vr;if(mn){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,sn(e)),fn(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!we.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ar(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ar(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=mn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ar(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&kr(zr,r)||(zr=r,r=qf(Rr,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionrun:Hr(`Transition`,`TransitionRun`),transitionstart:Hr(`Transition`,`TransitionStart`),transitioncancel:Hr(`Transition`,`TransitionCancel`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};mn&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionrun`),Zr=Kr(`transitionstart`),Qr=Kr(`transitioncancel`),$r=Kr(`transitionend`),ei=new Map,ti=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ti.push(`scrollEnd`);function ni(e,t){ei.set(e,t),Et(t,[e])}var ri=0;function ii(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=_d.identifierPrefix;var n=ri++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function ai(e){if(e==null||typeof e==`string`)return e;var t=null,n=Td;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function oi(e,t){return e=ai(e),t=ai(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var si=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ci=[],li=0,ui=0;function di(){for(var e=li,t=ui=li=0;t<e;){var n=ci[t];ci[t++]=null;var r=ci[t];ci[t++]=null;var i=ci[t];ci[t++]=null;var a=ci[t];if(ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&hi(n,i,a)}}function fi(e,t,n,r){ci[li++]=e,ci[li++]=t,ci[li++]=n,ci[li++]=r,ui|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function pi(e,t,n,r){return fi(e,t,n,r),gi(e)}function mi(e,t){return fi(e,null,null,t),gi(e)}function hi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function gi(e){if(50<Ed)throw Ed=0,Dd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _i={};function vi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(e,t,n,r){return new vi(e,t,n,r)}function bi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xi(e,t){var n=e.alternate;return n===null?(n=yi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Si(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ci(e,t,n,r,i,a){var o=0;if(r=e,typeof r==`function`)bi(r)&&(o=1);else if(typeof r==`string`)o=qm(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=yi(31,n,t,i),e.elementType=V,e.lanes=a,e;case j:return wi(n.children,i,a,t);case M:o=8,i|=24;break;case N:return e=yi(12,n,t,i|2),e.elementType=N,e.lanes=a,e;case L:return e=yi(13,n,t,i),e.elementType=L,e.lanes=a,e;case R:return e=yi(19,n,t,i),e.elementType=R,e.lanes=a,e;case H:case W:return e=i|32,e=yi(30,n,t,e),e.elementType=W,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:o=10;break a;case P:o=9;break a;case I:o=11;break a;case z:o=14;break a;case B:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=yi(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function wi(e,t,n,r){return e=yi(7,e,r,t),e.lanes=n,e}function Ti(e,t,n){return e=yi(6,e,null,t),e.lanes=n,e}function Ei(e){var t=yi(18,null,null,0);return t.stateNode=e,t}function Di(e,t,n){return t=yi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Oi=new WeakMap;function ki(e,t){if(typeof e==`object`&&e){var n=Oi.get(e);return n===void 0?(t={value:e,source:t,stack:Ce(t)},Oi.set(e,t),t):n}return{value:e,source:t,stack:Ce(t)}}var Ai=[],ji=0,Mi=null,Ni=0,Pi=[],Fi=0,Ii=null,Li=1,Ri=``;function zi(e,t){Ai[ji++]=Ni,Ai[ji++]=Mi,Mi=e,Ni=t}function Bi(e,t,n){Pi[Fi++]=Li,Pi[Fi++]=Ri,Pi[Fi++]=Ii,Ii=e;var r=Li;e=Ri;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Li=1<<32-Be(t)+i|n<<i|r,Ri=a+e}else Li=1<<a|n<<i|r,Ri=e}function Vi(e){e.return!==null&&(zi(e,1),Bi(e,1,0))}function Hi(e){for(;e===Mi;)Mi=Ai[--ji],Ai[ji]=null,Ni=Ai[--ji],Ai[ji]=null;for(;e===Ii;)Ii=Pi[--Fi],Pi[Fi]=null,Ri=Pi[--Fi],Pi[Fi]=null,Li=Pi[--Fi],Pi[Fi]=null}function Ui(e,t){Pi[Fi++]=Li,Pi[Fi++]=Ri,Pi[Fi++]=Ii,Li=t.id,Ri=t.overflow,Ii=e}var Wi=null,Gi=null,Ki=!1,qi=null,Ji=!1,Yi=Error(s(519));function Xi(e){throw na(ki(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Yi}function Zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ut]=e,t[dt]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),Gt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),Yt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||Xi(e,!0)}function Qi(e){for(Wi=e.return;Wi;)switch(Wi.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:Wi=Wi.return}}function $i(e){if(e!==Wi)return!1;if(!Ki)return Qi(e),Ki=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Gi&&Xi(e),Qi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));Gi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));Gi=dm(e)}else t===27?(t=Gi,Sp(e.type)?(e=um,um=null,Gi=e):Gi=t):Gi=Wi?lm(e.stateNode.nextSibling):null;return!0}function ea(){Gi=Wi=null,Ki=!1}function ta(){var e=qi;return e!==null&&(ld===null?ld=e:ld.push.apply(ld,e),qi=null),e}function na(e){qi===null?qi=[e]:qi.push(e)}var ra=oe(null),ia=null,aa=null;function oa(e,t,n){ce(ra,t._currentValue),t._currentValue=n}function sa(e){e._currentValue=ra.current,se(ra)}function ca(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function la(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ca(a.return,n,e),r||(o=null);break a}a=c.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(s(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ca(o,n,e),o=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ca(i.return,n,e),o=i.child,o=o===null?null:o.sibling):o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function ua(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(s(387));if(o=o.memoizedProps,o!==null){var c=i.type;Or(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===fe.current){if(o=i.alternate,o===null)throw Error(s(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&la(t,e,n,r),t.flags|=262144,e!==null}function da(e){for(e=e.firstContext;e!==null;){if(!Or(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fa(e){ia=e,aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pa(e){return ha(ia,e)}function ma(e,t){return ia===null&&fa(e),ha(e,t)}function ha(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},aa===null){if(e===null)throw Error(s(308));aa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else aa=aa.next=t;return n}var ga=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},_a=t.unstable_scheduleCallback,va=t.unstable_NormalPriority,ya={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ba(){return{controller:new ga,data:new Map,refCount:0}}function xa(e){e.refCount--,e.refCount===0&&_a(va,function(){e.controller.abort()})}function Sa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ca=null;function wa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ta=null,Ea=0,Da=0,Oa=null;function ka(e,t){if(Ta===null){var n=Ta=[];Ea=0,Da=Mf(),Oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ea++,t.then(Aa,Aa),t}function Aa(){if(--Ea===0&&(Ca=null,Ta!==null)){Oa!==null&&(Oa.status=`fulfilled`);var e=Ta;Ta=null,Da=0,Oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ja(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ma=Y.S;Y.S=function(e,t){if(fd=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ka(e,t),Ca!==null)for(var n=vf;n!==null;)Sa(n,Ca),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)Sa(r,n),r=r.next;if(Da!==0){r=Ca,r===null&&(r=Ca=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ma!==null&&Ma(e,t)};var Na=oe(null);function Pa(){var e=Na.current;return e===null?qu.pooledCache:e}function Fa(e,t){t===null?ce(Na,Na.current):ce(Na,t.pool)}function Ia(){var e=Pa();return e===null?null:{parent:ya._currentValue,pool:e}}var La=Error(s(460)),Ra=Error(s(474)),za=Error(s(542)),Ba={then:function(){}};function Va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ha(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ka(e),e===void 0&&!(`reason`in t)?Error(s(600)):e;default:if(typeof t.status==`string`)t.then(an,an);else{if(e=qu,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ka(e),e}throw Wa=t,La}}function Ua(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Wa=e,La):e}}var Wa=null;function Ga(){if(Wa===null)throw Error(s(459));var e=Wa;return Wa=null,e}function Ka(e){if(e===La||e===za)throw Error(s(483))}var qa=null,Ja=0;function Ya(e){var t=Ja;return Ja+=1,qa===null&&(qa=[]),Ha(qa,e,t)}function Xa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Za(e,t){throw t.$$typeof===O?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Qa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=xi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function o(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ti(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),Xa(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===B&&Ua(a)===t.type)?(t=i(t,n.props),Xa(t,n),t.return=e,t):(t=Ci(n.type,n.key,n.props,null,e.mode,r),Xa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Di(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=wi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ti(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ci(t.type,t.key,t.props,null,e.mode,n),Xa(n,t),n.return=e,n;case A:return t=Di(t,e.mode,n),t.return=e,t;case B:return t=Ua(t),f(e,t,n)}if(te(t)||ee(t))return t=wi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ya(t),n);if(t.$$typeof===F)return f(e,ma(e,t),n);Za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Ua(n),p(e,t,n,r)}if(te(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ya(n),r);if(n.$$typeof===F)return p(e,t,ma(e,n),r);Za(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Ua(r),m(e,t,n,r,i)}if(te(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ya(r),i);if(r.$$typeof===F)return m(e,t,n,ma(t,r),i);Za(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ki&&zi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return Ki&&zi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ki&&zi(i,h),l}function g(i,o,c,l){if(c==null)throw Error(s(151));for(var u=null,d=null,h=o,g=o=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),o=a(y,o,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Ki&&zi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return Ki&&zi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Ki&&zi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),Xa(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ua(l)===r.type){n(e,r.sibling),c=i(r,a.props),Xa(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=wi(a.props.children,e.mode,c,a.key),Xa(c,a),c.return=e,e=c):(c=Ci(a.type,a.key,a.props,null,e.mode,c),Xa(c,a),c.return=e,e=c)}return o(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Di(a,e.mode,c),c.return=e,e=c}return o(e);case B:return a=Ua(a),_(e,r,a,c)}if(te(a))return h(e,r,a,c);if(ee(a)){if(l=ee(a),typeof l!=`function`)throw Error(s(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,Ya(a),c);if(a.$$typeof===F)return _(e,r,ma(e,a),c);Za(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Ti(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{Ja=0;var i=_(e,t,n,r);return qa=null,i}catch(t){if(t===La||t===za)throw t;var a=yi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var $a=Qa(!0),eo=Qa(!1),to=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ro(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function io(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ao(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ku&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=gi(e),hi(e,null,n),t}return fi(e,r,t,n),gi(e)}function oo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function so(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var co=!1;function lo(){if(co){var e=Oa;if(e!==null)throw e}}function uo(e,t,n,r){co=!1;var i=e.updateQueue;to=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Yu&f)===f:(r&f)===f){f!==0&&f===Da&&(co=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:to=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),rd|=o,e.lanes=o,e.memoizedState=d}}function fo(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function po(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)fo(n[e],t)}var mo=oe(null),ho=oe(0);function go(e,t){e=td,ce(ho,e),ce(mo,t),td=e|t.baseLanes}function _o(){ce(ho,td),ce(mo,mo.current)}function vo(){td=ho.current,se(mo),se(ho)}var yo=oe(null),bo=null;function xo(e){var t=e.alternate;ce(Eo,Eo.current&1),ce(yo,e),bo===null&&(t===null||mo.current!==null||t.memoizedState!==null)&&(bo=e)}function So(e){ce(Eo,Eo.current),ce(yo,e),bo===null&&(bo=e)}function Co(e){e.tag===22?(ce(Eo,Eo.current),ce(yo,e),bo===null&&(bo=e)):wo()}function wo(){ce(Eo,Eo.current),ce(yo,yo.current)}function To(e){se(yo),bo===e&&(bo=null),se(Eo)}var Eo=oe(0);function Do(e,t){ce(yo,yo.current),ce(Eo,t)}function Oo(e){se(Eo),se(yo),bo===e&&(bo=null)}function ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ao=0,jo=null,Mo=null,No=null,Po=!1,Fo=!1,Io=!1,Lo=0,Ro=0,zo=null,Bo=0;function Vo(){throw Error(s(321))}function Ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Uo(e,t,n,r,i,a){return Ao=a,jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Y.H=e===null||e.memoizedState===null?oc:sc,Io=!1,a=n(r,i),Io=!1,Fo&&(a=Go(t,n,r,i)),Wo(e),a}function Wo(e){Y.H=ac;var t=Mo!==null&&Mo.next!==null;if(Ao=0,No=Mo=jo=null,Po=!1,Ro=0,zo=null,t)throw Error(s(300));e===null||wc||(e=e.dependencies,e!==null&&da(e)&&(wc=!0))}function Go(e,t,n,r){jo=e;var i=0;do{if(Fo&&(zo=null),Ro=0,Fo=!1,25<=i)throw Error(s(301));if(i+=1,No=Mo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Y.H=cc,a=t(n,r)}while(Fo);return a}function Ko(){var e=Y.H,t=e.useState()[0];return t=typeof t.then==`function`?$o(t):t,e=e.useState()[0],(Mo===null?null:Mo.memoizedState)!==e&&(jo.flags|=1024),t}function qo(){var e=Lo!==0;return Lo=0,e}function Jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Yo(e){if(Po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Po=!1}Ao=0,No=Mo=jo=null,Fo=!1,Ro=Lo=0,zo=null}function Xo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?jo.memoizedState=No=e:No=No.next=e,No}function Zo(){if(Mo===null){var e=jo.alternate;e=e===null?null:e.memoizedState}else e=Mo.next;var t=No===null?jo.memoizedState:No.next;if(t!==null)No=t,Mo=e;else{if(e===null)throw jo.alternate===null?Error(s(467)):Error(s(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},No===null?jo.memoizedState=No=e:No=No.next=e}return No}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $o(e){var t=Ro;return Ro+=1,zo===null&&(zo=[]),e=Ha(zo,e,t),t=jo,(No===null?t.memoizedState:No.next)===null&&(t=t.alternate,Y.H=t===null||t.memoizedState===null?oc:sc),e}function es(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return $o(e);if(e.$$typeof===G)return;if(e.$$typeof===F)return pa(e)}throw Error(s(438,String(e)))}function ts(e){var t=null,n=jo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=jo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Qo(),jo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=U;return t.index++,n}function ns(e,t){return typeof t==`function`?t(e):t}function rs(e){return is(Zo(),Mo,e)}function is(e,t,n){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=o=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ao&f)===f:(Yu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Da&&(d=!0);else if((Ao&p)===p){u=u.next,p===Da&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,o=a):l=l.next=f,jo.lanes|=p,rd|=p;f=u.action,Io&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,o=a):l=l.next=p,jo.lanes|=f,rd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!Or(a,e.memoizedState)&&(wc=!0,d&&(n=Oa,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function as(e){var t=Zo(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Or(a,t.memoizedState)||(wc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function os(e,t,n){var r=jo,i=Zo(),a=Ki;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!Or((Mo||i).memoizedState,n);if(o&&(i.memoizedState=n,wc=!0),i=i.queue,js(ls.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||No!==null&&!!(No.memoizedState.tag&1),Es(e?9:8,{destroy:void 0},cs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,qu===null)throw Error(s(349));a||Ao&127||ss(r,t,n)}return n}function ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jo.updateQueue,t===null?(t=Qo(),jo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cs(e,t,n,r){t.value=n,t.getSnapshot=r,us(t)&&ds(e)}function ls(e,t,n){return n(function(){us(t)&&ds(e)})}function us(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function ds(e){var t=mi(e,2);t!==null&&jd(t,e,2)}function fs(e){var t=Xo();if(typeof e==`function`){var n=e;if(e=n(),Io){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:e},t}function ps(e,t,n,r){return e.baseState=n,is(e,Mo,typeof r==`function`?r:ns)}function ms(e,t,n,r,i){if(nc(e))throw Error(s(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};Y.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,hs(t,a)):(a.next=n.next,t.pending=n.next=a)}}function hs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=Y.T,o={};o.types=a===null?null:a.types,Y.T=o;try{var s=n(i,r),c=Y.S;c!==null&&c(o,s),gs(e,t,s)}catch(n){vs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),Y.T=a}}else try{a=n(i,r),gs(e,t,a)}catch(n){vs(e,t,n)}}function gs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){_s(e,t,n)},function(n){return vs(e,t,n)}):_s(e,t,n)}function _s(e,t,n){t.status=`fulfilled`,t.value=n,ys(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,hs(e,n)))}function vs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ys(t),t=t.next;while(t!==r)}e.action=null}function ys(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bs(e,t){return t}function xs(e,t){if(Ki){var n=qu.formState;if(n!==null){a:{var r=jo;if(Ki){if(Gi){b:{for(var i=Gi,a=Ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Gi=lm(i.nextSibling),r=i.data===`F!`;break a}}Xi(r)}r=!1}r&&(t=n[0])}}return n=Xo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:t},n.queue=r,n=$s.bind(null,jo,r),r.dispatch=n,r=fs(!1),a=tc.bind(null,jo,!1,r.queue),r=Xo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ms.bind(null,jo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ss(e){return Cs(Zo(),Mo,e)}function Cs(e,t,n){if(t=is(e,t,bs)[0],e=rs(ns)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=$o(t)}catch(e){throw e===La?za:e}else r=t;t=Zo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(jo.flags|=2048,Es(9,{destroy:void 0},ws.bind(null,i,n),null)),[r,a,e]}function ws(e,t){e.action=t}function Ts(e){var t=Zo(),n=Mo;if(n!==null)return Cs(t,n,e);Zo(),t=t.memoizedState,n=Zo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=jo.updateQueue,t===null&&(t=Qo(),jo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ds(){return Zo().memoizedState}function Os(e,t,n,r){var i=Xo();jo.flags|=e,i.memoizedState=Es(1|t,{destroy:void 0},n,r===void 0?null:r)}function ks(e,t,n,r){var i=Zo();r=r===void 0?null:r;var a=i.memoizedState.inst;Mo!==null&&r!==null&&Ho(r,Mo.memoizedState.deps)?i.memoizedState=Es(t,a,n,r):(jo.flags|=e,i.memoizedState=Es(1|t,a,n,r))}function As(e,t){Os(8390656,8,e,t)}function js(e,t){ks(2048,8,e,t)}function Ms(e){jo.flags|=4;var t=jo.updateQueue;if(t===null)t=Qo(),jo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ns(e){var t=Zo().memoizedState;return Ms({ref:t,nextImpl:e}),function(){if(Ku&2)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Ps(e,t){return ks(4,2,e,t)}function Fs(e,t){return ks(4,4,e,t)}function Is(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ls(e,t,n){n=n==null?null:n.concat([e]),ks(4,4,Is.bind(null,t,e),n)}function Rs(){}function zs(e,t){var n=Zo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bs(e,t){var n=Zo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ho(t,r[1]))return r[0];if(r=e(),Io){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function Vs(e,t,n){return n===void 0||Ao&1073741824&&!(Yu&261930)?e.memoizedState=t:(e.memoizedState=n,e=kd(),jo.lanes|=e,rd|=e,n)}function Hs(e,t,n,r){return Or(n,t)?n:mo.current===null?!(Ao&106)||Ao&1073741824&&!(Yu&261930)?(wc=!0,e.memoizedState=n):(e=kd(),jo.lanes|=e,rd|=e,t):(e=Vs(e,n,r),Or(e,t)||(wc=!0),e)}function Us(e,t,n,r,i){var a=ne.p;ne.p=a!==0&&8>a?a:8;var o=Y.T,s={};s.types=o===null?null:o.types,Y.T=s,tc(e,!1,t,n);try{var c=i(),l=Y.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ec(e,t,ja(c,r),Od(e)):ec(e,t,r,Od(e))}catch(n){ec(e,t,{then:function(){},status:`rejected`,reason:n},Od())}finally{ne.p=a,o!==null&&s.types!==null&&(o.types=s.types),Y.T=o}}function Ws(){}function Gs(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=Ks(e).queue;Us(e,i,t,re,n===null?Ws:function(){return qs(e),n(r)})}function Ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function qs(e){var t=Ks(e);t.next===null&&(t=e.alternate.memoizedState),ec(e,t.next.queue,{},Od())}function Js(){return pa(sh)}function Ys(){return Zo().memoizedState}function Xs(){return Zo().memoizedState}function Zs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Od();e=io(n);var r=ao(t,e,n);r!==null&&(jd(r,t,n),oo(r,t,n)),t={cache:ba()},e.payload=t;return}t=t.return}}function Qs(e,t,n){var r=Od();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nc(e)?rc(t,n):(n=pi(e,t,n,r),n!==null&&(jd(n,e,r),ic(n,t,r)))}function $s(e,t,n){ec(e,t,n,Od())}function ec(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(nc(e))rc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return fi(e,t,i,0),qu===null&&di(),!1}catch{}if(n=pi(e,t,i,r),n!==null)return jd(n,e,r),ic(n,t,r),!0}return!1}function tc(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},nc(e)){if(t)throw Error(s(479))}else t=pi(e,n,r,2),t!==null&&jd(t,e,2)}function nc(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function rc(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ic(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var ac={readContext:pa,use:es,useCallback:Vo,useContext:Vo,useEffect:Vo,useImperativeHandle:Vo,useLayoutEffect:Vo,useInsertionEffect:Vo,useMemo:Vo,useReducer:Vo,useRef:Vo,useState:Vo,useDebugValue:Vo,useDeferredValue:Vo,useTransition:Vo,useSyncExternalStore:Vo,useId:Vo,useHostTransitionStatus:Vo,useFormState:Vo,useActionState:Vo,useOptimistic:Vo,useMemoCache:Vo,useCacheRefresh:Vo,useEffectEvent:Vo},oc={readContext:pa,use:es,useCallback:function(e,t){return Xo().memoizedState=[e,t===void 0?null:t],e},useContext:pa,useEffect:As,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Os(4194308,4,Is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var n=Xo();t=t===void 0?null:t;var r=e();if(Io){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Xo();if(n!==void 0){var i=n(t);if(Io){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Qs.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Xo();return e={current:e},t.memoizedState=e},useState:function(e){e=fs(e);var t=e.queue,n=$s.bind(null,jo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Rs,useDeferredValue:function(e,t){return Vs(Xo(),e,t)},useTransition:function(){var e=fs(!1);return e=Us.bind(null,jo,e.queue,!0,!1),Xo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=jo,i=Xo();if(Ki){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),qu===null)throw Error(s(349));Yu&127||ss(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,As(ls.bind(null,r,a,e),[e]),r.flags|=2048,Es(9,{destroy:void 0},cs.bind(null,r,a,n,t),null),n},useId:function(){var e=Xo(),t=qu.identifierPrefix;if(Ki){var n=Ri,r=Li;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Js,useFormState:xs,useActionState:xs,useOptimistic:function(e){var t=Xo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tc.bind(null,jo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ts,useCacheRefresh:function(){return Xo().memoizedState=Zs.bind(null,jo)},useEffectEvent:function(e){var t=Xo(),n={impl:e};return t.memoizedState=n,function(){if(Ku&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},sc={readContext:pa,use:es,useCallback:zs,useContext:pa,useEffect:js,useImperativeHandle:Ls,useInsertionEffect:Ps,useLayoutEffect:Fs,useMemo:Bs,useReducer:rs,useRef:Ds,useState:function(){return rs(ns)},useDebugValue:Rs,useDeferredValue:function(e,t){return Hs(Zo(),Mo.memoizedState,e,t)},useTransition:function(){var e=rs(ns)[0],t=Zo().memoizedState;return[typeof e==`boolean`?e:$o(e),t]},useSyncExternalStore:os,useId:Ys,useHostTransitionStatus:Js,useFormState:Ss,useActionState:Ss,useOptimistic:function(e,t){return ps(Zo(),Mo,e,t)},useMemoCache:ts,useCacheRefresh:Xs,useEffectEvent:Ns},cc={readContext:pa,use:es,useCallback:zs,useContext:pa,useEffect:js,useImperativeHandle:Ls,useInsertionEffect:Ps,useLayoutEffect:Fs,useMemo:Bs,useReducer:as,useRef:Ds,useState:function(){return as(ns)},useDebugValue:Rs,useDeferredValue:function(e,t){var n=Zo();return Mo===null?Vs(n,e,t):Hs(n,Mo.memoizedState,e,t)},useTransition:function(){var e=as(ns)[0],t=Zo().memoizedState;return[typeof e==`boolean`?e:$o(e),t]},useSyncExternalStore:os,useId:Ys,useHostTransitionStatus:Js,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){var n=Zo();return Mo===null?(n.baseState=e,[e,n.queue.dispatch]):ps(n,Mo,e,t)},useMemoCache:ts,useCacheRefresh:Xs,useEffectEvent:Ns};function lc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Od(),i=io(r);i.payload=t,n!=null&&(i.callback=n),t=ao(e,i,r),t!==null&&(jd(t,e,r),oo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Od(),i=io(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ao(e,i,r),t!==null&&(jd(t,e,r),oo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Od(),r=io(n);r.tag=2,t!=null&&(r.callback=t),t=ao(e,r,n),t!==null&&(jd(t,e,n),oo(t,e,n))}};function dc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function fc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&uc.enqueueReplaceState(t,t.state,null)}function pc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function mc(e){si(e)}function hc(e){console.error(e)}function gc(e){si(e)}function _c(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function vc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function yc(e,t,n){return n=io(n),n.tag=3,n.payload={element:null},n.callback=function(){_c(e,t)},n}function bc(e){return e=io(e),e.tag=3,e}function xc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){vc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){vc(t,n,r),typeof i!=`function`&&(hd===null?hd=new Set([this]):hd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Sc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ua(t,n,i,!0),n=yo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return bo===null?Ud():n.alternate===null&&nd===0&&(nd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,i)),!1;case 22:return n.flags|=65536,r===Ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ff(e,r,i)),!1}throw Error(s(435,n.tag))}return ff(e,r,i),Ud(),!1}if(Ki)return t=yo.current,t===null?(r!==Yi&&(t=Error(s(423),{cause:r}),na(ki(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ki(r,n),i=yc(e.stateNode,r,i),so(e,i),nd!==4&&(nd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Yi&&(e=Error(s(422),{cause:r}),na(ki(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=ki(a,n),cd===null?cd=[a]:cd.push(a),nd!==4&&(nd=2),t===null)return!0;r=ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=yc(n.stateNode,r,e),so(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(hd===null||!hd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=bc(i),xc(i,e,n,r),so(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Cc=Error(s(461)),wc=!1;function Tc(e,t,n,r){t.child=e===null?eo(t,null,n,r):$a(t,e.child,n,r)}function Ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return fa(t),r=Uo(e,t,n,o,a,i),s=qo(),e!==null&&!wc?(Jo(e,t,i),el(e,t,i)):(Ki&&s&&Vi(t),t.flags|=1,Tc(e,t,r,i),t.child)}function Dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!bi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Oc(e,t,a,r,i)):(e=Ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!tl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return el(e,t,i)}return t.flags|=1,e=xi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref){if(wc=!1,t.pendingProps=r=a,tl(e,i))e.flags&131072&&(wc=!0);else return t.lanes=e.lanes,el(e,t,i)}}return Ic(e,t,n,r,i)}function kc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fa(t,a===null?null:a.cachePool),a===null?_o():go(t,a),Co(t);else return r=t.lanes=536870912,jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Fa(t,null),_o(),wo()):(Fa(t,a.cachePool),go(t,a),wo(),t.memoizedState=null);return Tc(e,t,i,n),t.child}function Ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jc(e,t,n,r,i){var a=Pa();return a=a===null?null:{parent:ya._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Fa(t,null),_o(),Co(t),e!==null&&ua(e,t,r,!0),t.childLanes=i,null}function Mc(e,t){return t=Gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nc(e,t,n){return $a(t,e.child,null,n),e=Mc(t,t.pendingProps),e.flags|=2,To(t),t.memoizedState=null,e}function Pc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ki){if(r.mode===`hidden`)return e=Mc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ac(null,e);if(So(t),(e=Gi)?(e=am(e,Ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ii===null?null:{id:Li,overflow:Ri},retryLane:536870912,hydrationErrors:null},n=Ei(e),n.return=t,t.child=n,Wi=t,Gi=null)):e=null,e===null)throw Xi(t);return t.lanes=536870912,null}return Mc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(So(t),i){if(t.flags&256)t.flags&=-257,t=Nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558))}else if(wc||ua(e,t,n,!1),i=(n&e.childLanes)!==0,wc||i){if(mo.current===null){if(r=qu,r!==null&&(o=it(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,mi(e,o),jd(r,e,o),Cc;Ud()}t=Nc(e,t,n)}else e=a.treeContext,Gi=lm(o.nextSibling),Wi=t,Ki=!0,qi=null,Ji=!1,e!==null&&Ui(t,e),t=Mc(t,r),t.flags|=134221824;return t}return e=xi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ic(e,t,n,r,i){return fa(t),n=Uo(e,t,n,r,void 0,i),r=qo(),e!==null&&!wc?(Jo(e,t,i),el(e,t,i)):(Ki&&r&&Vi(t),t.flags|=1,Tc(e,t,n,i),t.child)}function Lc(e,t,n,r,i,a){return fa(t),t.updateQueue=null,n=Go(t,r,n,i),Wo(e),r=qo(),e!==null&&!wc?(Jo(e,t,a),el(e,t,a)):(Ki&&r&&Vi(t),t.flags|=1,Tc(e,t,n,a),t.child)}function Rc(e,t,n,r,i){if(fa(t),t.stateNode===null){var a=_i,o=n.contextType;typeof o==`object`&&o&&(a=pa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=uc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},no(t),o=n.contextType,a.context=typeof o==`object`&&o?pa(o):_i,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(lc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&uc.enqueueReplaceState(a,a.state,null),uo(t,r,a,i),lo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=pc(n,s);a.props=c;var l=a.context,u=n.contextType;o=_i,typeof u==`object`&&u&&(o=pa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&fc(t,a,r,o),to=!1;var f=t.memoizedState;a.state=f,uo(t,r,a,i),lo(),l=t.memoizedState,s||f!==l||to?(typeof d==`function`&&(lc(t,n,d,r),l=t.memoizedState),(c=to||dc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ro(e,t),o=t.memoizedProps,u=pc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=_i,typeof l==`object`&&l&&(c=pa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&fc(t,a,r,c),to=!1,f=t.memoizedState,a.state=f,uo(t,r,a,i),lo();var p=t.memoizedState;o!==d||f!==p||to||e!==null&&e.dependencies!==null&&da(e.dependencies)?(typeof s==`function`&&(lc(t,n,s,r),p=t.memoizedState),(u=to||dc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&da(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Fc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=$a(t,e.child,null,i),t.child=$a(t,null,n,i)):Tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=el(e,t,i),e}function zc(e,t,n,r){return ea(),t.flags|=256,Tc(e,t,n,r),t.child}var Bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vc(e){return{baseLanes:e,cachePool:Ia()}}function Hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=od),e}function Uc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Eo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Ki){if(i?xo(t):wo(),(e=Gi)?(e=am(e,Ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ii===null?null:{id:Li,overflow:Ri},retryLane:536870912,hydrationErrors:null},n=Ei(e),n.return=t,t.child=n,Wi=t,Gi=null)):e=null,e===null)throw Xi(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(wo(),i=t.mode,a=Gc({mode:`hidden`,children:a},i),r=wi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Vc(n),r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(null,r)):(xo(t),Wc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return qc(e,t,a,o,r,c,s,n)}return i?(wo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=xi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=wi(i,a,n,null),i.flags|=2):i=xi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ac(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Vc(n):(a=i.cachePool,a===null?a=Ia():(s=ya._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Hc(e,o,n),t.memoizedState=Bc,Ac(e.child,r)):(xo(t),n=e.child,e=n.sibling,n=xi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Wc(e,t){return t=Gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Gc(e,t){return e=yi(22,e,null,t),e.lanes=0,e}function Kc(e,t,n){return $a(t,e.child,null,n),e=Wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qc(e,t,n,r,i,a,o,c){if(n)return t.flags&256?(xo(t),t.flags&=-257,Kc(e,t,c)):t.memoizedState===null?(wo(),a=i.fallback,o=t.mode,i=Gc({mode:`visible`,children:i.children},o),a=wi(a,o,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,$a(t,e.child,null,c),i=t.child,i.memoizedState=Vc(c),i.childLanes=Hc(e,r,c),t.memoizedState=Bc,Ac(null,i)):(wo(),t.child=e.child,t.flags|=128,null);if(xo(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(s(419)),i.stack=``,i.digest=r,na({value:i,source:null,stack:null})),Kc(e,t,c)}if(wc||ua(e,t,c,!1),r=(c&e.childLanes)!==0,wc||r){if(mo.current!==null)return Kc(e,t,c);if(r=qu,r!==null&&(i=it(r,c),i!==0&&i!==o.retryLane))throw o.retryLane=i,mi(e,i),jd(r,e,i),Cc;return om(a)||Ud(),Kc(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,Gi=lm(a.nextSibling),Wi=t,Ki=!0,qi=null,Ji=!1,e!==null&&Ui(t,e),t=Wc(t,i.children),t.flags|=134221824,t)}function Jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ca(e.return,t,n)}function Yc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&ko(n)===null&&(t=e),e=e.sibling}return t}function Xc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Zc(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Qc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Eo.current;if(t.flags&128)return Do(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Do(t,o),i===`backwards`&&e!==null?(Zc(e),Tc(e,t,r,n),Zc(e)):Tc(e,t,r,n),r=Ki?Ni:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jc(e,n,t);else if(e.tag===19)Jc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Zc(t)),Xc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Xc(t,!0,n,null,a,r);break;case`together`:Xc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Yc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Xc(t,!1,i,n,a,r)}return t.child}function $c(e,t,n){var r=t.pendingProps;return oa(t,t.type,r.value),Tc(e,t,r.children,n),t.child}function el(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ua(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=xi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&da(e)))}function nl(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),oa(t,ya,e.memoizedState.cache),ea();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,So(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return xo(t),t.flags|=128,null;r=ua(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Uc(e,t,n):(xo(t),e=el(e,t,n),e===null?null:e.sibling)}xo(t);break;case 19:if(t.flags&128)return Qc(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ua(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Qc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Do(t,Eo.current),r)break;return null;case 22:return t.lanes=0,kc(e,t,n,t.pendingProps);case 24:oa(t,ya,e.memoizedState.cache)}return el(e,t,n)}function rl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)wc=!0;else{if(!tl(e,n)&&!(t.flags&128))return wc=!1,nl(e,t,n);wc=!!(e.flags&131072)}}else wc=!1,Ki&&t.flags&1048576&&Bi(t,Ni,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ua(t.elementType),t.type=e,typeof e==`function`)bi(e)?(r=pc(e,r),t.tag=1,t=Rc(null,t,e,r,n)):(t.tag=0,t=Ic(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===I){t.tag=11,t=Ec(null,t,e,r,n);break a}if(i===z){t.tag=14,t=Dc(null,t,e,r,n);break a}if(i===F){t.tag=10,t.type=e,t=$c(null,t,n);break a}}throw t=J(e)||e,Error(s(306,t,``))}}return t;case 0:return Ic(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=pc(r,t.pendingProps),Rc(e,t,r,i,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,ro(e,t),uo(t,r,null,n);var o=t.memoizedState;if(r=o.cache,oa(t,ya,r),r!==a.cache&&la(t,[ya],n,!0),lo(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=zc(e,t,r,n);break a}if(r!==i){i=ki(Error(s(424)),t),na(i),t=zc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Gi=lm(e.firstChild),Wi=t,Ki=!0,qi=null,Ji=!0,n=eo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ea(),r===i){t=el(e,t,n);break a}Tc(e,t,r,n)}t=t.child}return t;case 26:return Fc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ki||(t.stateNode=fp(t.type,t.pendingProps,de.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),e===null&&Ki&&(r=t.stateNode=hm(t.type,t.pendingProps,de.current),Wi=t,Ji=!0,i=Gi,Sp(t.type)?(um=i,Gi=lm(r.firstChild)):Gi=i),Tc(e,t,t.pendingProps.children,n),Fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ki&&((i=r=Gi)&&(r=rm(r,t.type,t.pendingProps,Ji),r===null?i=!1:(t.stateNode=r,Wi=t,Gi=lm(r.firstChild),Ji=!1,i=!0)),i||Xi(t)),he(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:o!==null&&pp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Uo(e,t,Ko,null,null,n),sh._currentValue=i),Fc(e,t),Tc(e,t,r,n),t.child;case 6:return e===null&&Ki&&((e=n=Gi)&&(n=im(n,t.pendingProps,Ji),n===null?e=!1:(t.stateNode=n,Wi=t,Gi=null,e=!0)),e||Xi(t)),null;case 13:return Uc(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$a(t,null,r,n):Tc(e,t,r,n),t.child;case 11:return Ec(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Fc(e,t),Tc(e,t,r,n),t.child;case 8:return Tc(e,t,t.pendingProps.children,n),t.child;case 12:return Tc(e,t,t.pendingProps.children,n),t.child;case 10:return $c(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,fa(t),i=pa(i),r=r(i),t.flags|=1,Tc(e,t,r,n),t.child;case 14:return Dc(e,t,t.type,t.pendingProps,n);case 15:return Oc(e,t,t.type,t.pendingProps,n);case 19:return Qc(e,t,n);case 31:return Pc(e,t,n);case 22:return kc(e,t,n,t.pendingProps);case 24:return fa(t),r=pa(ya),e===null?(i=Pa(),i===null&&(i=qu,a=ba(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},no(t),oa(t,ya,i)):((e.lanes&n)!==0&&(ro(e,t),uo(t,null,null,n),lo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,oa(t,ya,r),r!==i.cache&&la(t,[ya],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),oa(t,ya,r))),Tc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:Ki&&Vi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Fc(e,t),Tc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function il(e){e.flags|=4}function al(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Wa=Ba,Ra}}else e.flags&=-16777217}function ol(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Wa=Ba,Ra}}function sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Qe(),e.lanes|=t,sd|=t)}function cl(e,t){if(!Ki)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ll(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ul(e,t,n){var r=t.pendingProps;switch(Hi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ll(t),null;case 1:return ll(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),sa(ya),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&($i(t)?il(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ta())),ll(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(il(t),a===null?(ll(t),al(t,i,null,r,n)):(ll(t),ol(t,a))):a?a===e.memoizedState?(ll(t),t.flags&=-16777217):(il(t),ll(t),ol(t,a)):(e=e.memoizedProps,e!==r&&il(t),ll(t),al(t,i,e,r,n)),null;case 27:if(ge(t),n=de.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ll(t),t.subtreeFlags&=-33554433,null}e=le.current,$i(t)?Zi(t,e):(e=hm(i,r,n),t.stateNode=e,il(t))}return ll(t),t.subtreeFlags&=-33554433,null;case 5:if(ge(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ll(t),t.subtreeFlags&=-33554433,null}if(a=le.current,$i(t))Zi(t,a);else{var o=lp(de.current);switch(a){case 1:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=o.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?o.createElement(`select`,{is:r.is}):o.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?o.createElement(i,{is:r.is}):o.createElement(i)}}a[ut]=t,a[dt]=r;a:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break a;for(;o.sibling===null;){if(o.return===null||o.return===t)break a;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&il(t)}}return ll(t),t.subtreeFlags&=-33554433,al(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&il(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=de.current,$i(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Wi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||Xi(t,!0)}else e=lp(e).createTextNode(r),e[ut]=t,t.stateNode=e}return ll(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=$i(t),n!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(557));e[ut]=t}else ea(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),e=!1}else n=ta(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(To(t),t):(To(t),null);if(t.flags&128)throw Error(s(558))}return ll(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=$i(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(s(317));i[ut]=t}else ea(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ll(t),i=!1}else i=ta(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(To(t),t):(To(t),null)}return To(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),sl(t,t.updateQueue),ll(t),null);case 4:return me(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,ll(t),null;case 10:return sa(t.type),ll(t),null;case 19:if(Oo(t),r=t.memoizedState,r===null)return ll(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)cl(r,!1);else{if(nd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ko(e),a!==null){for(t.flags|=128,cl(r,!1),e=a.updateQueue,t.updateQueue=e,sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Si(n,e),n=n.sibling;return Do(t,Eo.current&1|2),Ki&&zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>pd&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=ko(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,sl(t,e),cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!Ki)return ll(t),null}else 2*Oe()-r.renderingStartTime>pd&&n!==536870912&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,a=Eo.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Ki?Do(t,a):(n=a,ce(yo,t),ce(Eo,n),bo===null&&(bo=t)),Ki&&zi(t,r.treeForkCount),e}return ll(t),null;case 22:case 23:return To(t),vo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ll(t),t.subtreeFlags&6&&(t.flags|=8192)):ll(t),n=t.updateQueue,n!==null&&sl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(Na),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),sa(ya),ll(t),null;case 25:return null;case 30:return t.flags|=33554432,ll(t),null}throw Error(s(156,t.tag))}function dl(e,t){switch(Hi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sa(ya),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(To(t),t.alternate===null)throw Error(s(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(To(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return me(),null;case 10:return sa(t.type),null;case 22:case 23:return To(t),vo(),e!==null&&se(Na),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sa(ya),null;case 25:return null;default:return null}}function fl(e,t){switch(Hi(t),t.tag){case 3:sa(ya),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&To(t);break;case 13:To(t);break;case 19:Oo(t);break;case 10:sa(t.type);break;case 22:case 23:To(t),vo(),e!==null&&se(Na);break;case 24:sa(ya)}}function pl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){df(t,t.return,e)}}function ml(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function hl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{po(t,n)}catch(t){df(e,e.return,t)}}}function gl(e,t,n){n.props=pc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function _l(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=ii(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function vl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){df(e,t,n)}else n.current=null}}function yl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function bl(e){for(var t=e.return;t!==null&&(Cl(t)&&em(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function xl(e){for(var t=e.return;t!==null&&(Cl(t)&&tm(e.stateNode,t.stateNode),!Sl(t));)t=t.return}function Sl(e){return e.tag===5||e.tag===3||e.tag===27}function Cl(e){return e&&e.tag===7&&e.stateNode!==null}function wl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){df(e,e.return,t)}}function Tl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[dt]=t}catch(t){df(e,e.return,t)}}function El(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Dl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||El(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ol(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an)),yl(e,r),Mt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ol(e,t,n,r),e=e.sibling;e!==null;)Ol(e,t,n,r),e=e.sibling}function kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),yl(e,r),Mt=!0;else if(i!==4&&(i===27&&(yl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(kl(e,t,n,r),e=e.sibling;e!==null;)kl(e,t,n,r),e=e.sibling}function Al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[ut]=e,t[dt]=n}catch(t){df(e,e.return,t)}}var jl=!1,Ml=null;function Nl(e){(e.tag===30||e.subtreeFlags&33554432)&&(jl=!0)}var Pl=null;function Fl(){var e=Pl;return Pl=null,e}var Il=0;function Ll(e,t,n,r,i){return Il=0,Rl(e.child,t,n,r,i)}function Rl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);jl=!0,Tp(o,Il===0?t:t+`_`+Il,n),Il++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Rl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function zl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||zl(e.child,t)),e=e.sibling}function Bl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Bl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(s(544));var n=t.name;t=oi(t.default,t.share),t!==`none`&&(Ll(e,n,t,null,!1)||zl(e.child,!1))}e=e.sibling}}function Vl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ii(r,n),a=oi(r.default,n.paired?r.share:r.enter);a===`none`?Bl(e):Ll(e,i,a,null,!1)?(Bl(e),n.paired||t||Ad(e,r.onEnter)):zl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Vl(e,t),e=e.sibling;else Bl(e)}function Hl(e){if(Ml!==null&&Ml.size!==0){var t=Ml;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=oi(n.default,n.share);if(a!==`none`&&(Ll(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ad(e,n.onShare)):zl(e.child,!1)),t.delete(r),t.size===0)break}}}Hl(e)}e=e.sibling}}}function Ul(e){if(e.tag===30){var t=e.memoizedProps,n=ii(t,e.stateNode),r=Ml===null?void 0:Ml.get(n),i=oi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ll(e,n,i,null,!1)?r===void 0?Ad(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ml.delete(n),Ad(e,t.onShare)):zl(e.child,!1)),Ml!==null&&Hl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e),e=e.sibling;else Ml!==null&&Hl(e)}function Wl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ii(t,e.stateNode);t=oi(t.default,t.update),e.flags&=-5,t!==`none`&&Ll(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Wl(e);e=e.sibling}}function Gl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,zl(e.child,!1))}Gl(e)}e=e.sibling}}function Kl(e){if(e.tag===30)e.stateNode.paired=null,zl(e.child,!1),Gl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Gl(e)}function ql(e){for(e=e.child;e!==null;)e.tag===30?zl(e.child,!1):e.subtreeFlags&33554432&&ql(e),e=e.sibling}function Jl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Il<a.length){var l=a[Il],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Il===0?n:n+`_`+Il,i),s&&e.flags&4||(Pl===null&&(Pl=[]),Pl.push(c,Il===0?r:r+`_`+Il,t.memoizedProps)),Il++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Jl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Yl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ii(n,r),a=oi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Il=0,i=Jl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ad(e,n.onUpdate))}else e.subtreeFlags&33554432&&Yl(e,t);e=e.sibling}}var Xl=!1,Zl=!1,Ql=!1,$l=!1,eu=typeof WeakSet==`function`?WeakSet:Set,tu=null,nu=!1,ru=!1,iu=!1,au=!1;function ou(e,t,n){if(e=e.containerInfo,sp=gh,e=Pr(e),Fr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,tu=t,t=n?9270:1024;tu!==null;){if(e=tu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ul(r[a]);if(e.alternate===null&&e.flags&2)n&&Nl(e),su(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ul(r),su(n);continue}if(r!==null&&r.memoizedState!==null){n&&Nl(e),su(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,tu=r):(n&&Wl(e),su(n))}}Ml=null}function su(e){for(;tu!==null;){var t=tu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var o=pc(t.type,i);n=a.getSnapshotBeforeUpdate(o,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=ii(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=oi(i.default,i.update),i!==`none`&&Ll(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(s(163))}if(r=t.sibling,r!==null){r.return=t.return,tu=r;break}tu=t.return}}function cu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Du(e,n),r&4&&pl(5,n);break;case 1:if(Du(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=pc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&hl(n),r&512&&_l(n,n.return);break;case 3:if(Du(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{po(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&Al(n);case 26:case 5:Du(e,n),t===null&&r&4&&wl(n),r&512&&_l(n,n.return);break;case 12:Du(e,n);break;case 31:Du(e,n),r&4&&gu(e,n);break;case 13:Du(e,n),r&4&&_u(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Xl,!r){var a=t!==null&&t.memoizedState!==null||Zl;t=Xl,i=Zl,Xl=r,(Zl=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ku(e,n,r)):Du(e,n),Xl=t,Zl=i}break;case 30:Du(e,n),r&512&&_l(n,n.return);break;case 7:r&512&&_l(n,n.return);default:Du(e,n)}}function lu(e,t){for(e=e.child;e!==null;)uu(e,t),e=e.sibling}function uu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}$(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Mt=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&lu(e,t);break;default:lu(e,t)}}function $(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:uu(n,r);break a;case 22:n.memoizedState===null&&$(n,r);break a;default:$(n,r)}}e=e.sibling}}function du(e){var t=e.alternate;t!==null&&(e.alternate=null,du(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var fu=null,pu=!1;function mu(e,t,n){for(n=n.child;n!==null;)hu(e,t,n),n=n.sibling}function hu(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:Zl||vl(n,t),mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Zl&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zl||vl(n,t),xl(n);var r=fu,i=pu;Sp(n.type)&&(fu=n.stateNode,pu=!1),mu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),fu=r,pu=i;break;case 5:Zl||vl(n,t),xl(n);case 6:if(n.tag===6&&xl(n),r=fu,i=pu,fu=null,mu(e,t,n),fu=r,pu=i,fu!==null){if(pu)try{(fu.nodeType===9?fu.body:fu.nodeName===`HTML`?fu.ownerDocument.body:fu).removeChild(n.stateNode),Mt=!0}catch(e){df(n,t,e)}else try{fu.removeChild(n.stateNode),Mt=!0}catch(e){df(n,t,e)}}break;case 18:fu!==null&&(pu?(e=fu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(fu,n.stateNode));break;case 4:r=fu,i=pu,fu=n.stateNode.containerInfo,pu=!0,mu(e,t,n),fu=r,pu=i;break;case 0:case 11:case 14:case 15:ml(2,n,t),Zl||ml(4,n,t),mu(e,t,n);break;case 1:Zl||(vl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&gl(n,t,r)),mu(e,t,n);break;case 21:mu(e,t,n);break;case 22:Zl=(r=Zl)||n.memoizedState!==null,mu(e,t,n),Zl=r;break;case 30:vl(n,t),mu(e,t,n);break;case 7:Zl||vl(n,t),mu(e,t,n);break;default:mu(e,t,n)}}function gu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function _u(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function vu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new eu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new eu),t;default:throw Error(s(435,e.tag))}}function yu(e,t){var n=vu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function bu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){fu=l.stateNode,pu=!1;break a}break;case 5:fu=l.stateNode,pu=!1;break a;case 3:case 4:fu=l.stateNode.containerInfo,pu=!0;break a}l=l.return}if(fu===null)throw Error(s(160));hu(o,c,a),fu=null,pu=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Su(t,e,n),t=t.sibling}var xu=null;function Su(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var o=r[a];o.ref.impl=o.nextImpl}bu(t,e,n),Cu(e),i&4&&(ml(3,e,e.return),pl(3,e),ml(5,e,e.return));break;case 1:bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),i&64&&Xl&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=xu,bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Xl)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[_t]||r[ut]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[ut]=e,Ct(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(o=0;o<a.length;o++)if(r=a[o],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(s(468,t))}r[ut]=e,Ct(r),t=r}e.stateNode=t}}else Xl||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Tl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||Zl||t.parentNode.removeChild(t)):i.count--,n===null?Xl||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:bu(t,e,n),Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),r!==null&&i&4&&Tl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=Ql,Ql=!1,bu(t,e,n),Ql=a,Cu(e),i&512&&(Zl||r===null||vl(r,r.return)),e.flags&32){t=e.stateNode;try{Xt(t,``),Mt=!0}catch(t){df(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Tl(e,t,r===null?t:r.memoizedProps)),i&1024&&($l=!0);break;case 6:if(bu(t,e,n),Cu(e),i&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Mt=!0}catch(t){df(e,e.return,t)}}break;case 3:if(Mt=!1,Wm=null,a=xu,xu=bm(t.containerInfo),bu(t,e,n),xu=a,Cu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}$l&&($l=!1,wu(e)),Mt=!1;break;case 4:i=Ql,Ql=Xl,r=Nt(),a=xu,xu=bm(e.stateNode.containerInfo),bu(t,e,n),Cu(e),xu=a,Mt&&ru&&(iu=!0),Mt=r,Ql=i;break;case 12:bu(t,e,n),Cu(e);break;case 31:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 13:bu(t,e,n),Cu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(dd=Oe()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 22:a=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var c=Xl,l=Zl,u=Ql;Xl=c||a,Ql=u||a,Zl=l||o,bu(t,e,n),Zl=l,Ql=u,Xl=c,Cu(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||o||Xl||Zl||(t=o||Zl,n=Xl,r=Zl,Xl=a||Xl,Zl=t,Ou(e,2),Xl=n,Zl=r),!a&&Ql||lu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,yu(e,n))));break;case 19:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 30:i&512&&(Zl||r===null||vl(r,r.return)),i=Nt(),a=ru,o=(n&335544064)===n,c=e.memoizedProps,ru=o&&oi(c.default,c.update)!==`none`,bu(t,e,n),Cu(e),o&&r!==null&&Mt&&(e.flags|=4),ru=a,Mt=i;break;case 21:break;case 7:i&512&&(Zl||r===null||vl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:bu(t,e,n),Cu(e)}}function Cu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(El(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Cl(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Sl(i))break;i=i.return}var o=r;if(n==null)throw Error(s(160));switch(n.tag){case 27:var c=n.stateNode;kl(e,Dl(e),c,o);break;case 5:var l=n.stateNode;n.flags&32&&(Xt(l,``),n.flags&=-33),kl(e,Dl(e),l,o);break;case 3:case 4:var u=n.stateNode.containerInfo;Ol(e,Dl(e),u,o);break;default:throw Error(s(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Tu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Eu(t,e),t=t.sibling;else Yl(t,!1)}function Eu(e,t){var n=e.alternate;if(n===null)Vl(e,!1);else switch(e.tag){case 3:if(au=nu=!1,Fl(),Tu(t,e),!nu&&!iu){if(e=Pl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),au=!0}Pl=null;break;case 5:Tu(t,e);break;case 4:r=nu,nu=!1,Tu(t,e),nu&&(iu=!0),nu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Tu(t,e):Vl(e,!1));break;case 30:r=nu,i=Fl(),nu=!1,Tu(t,e),nu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ii(a,o),o=ii(n.memoizedProps,o);var s=oi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Il=0,t=Jl(e,n,t,o,s,a,!0),Il!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ad(e,e.memoizedProps.onUpdate),Pl=i):i!==null&&(i.push.apply(i,Pl),Pl=i),nu=e.flags&32?!0:r;break;default:Tu(t,e)}}function Du(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cu(e,t.alternate,t),t=t.sibling}function Ou(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:ml(4,n,n.return),Ou(n,r);break;case 1:vl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&gl(n,n.return,i),Ou(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:vl(n,n.return),n.tag!==5&&n.tag!==27||xl(n),Ou(n,r);break;case 6:xl(n);break;case 26:vl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Zl||i.parentNode.removeChild(i),Ou(n,r);break;case 22:n.memoizedState===null&&Ou(n,r);break;case 30:vl(n,n.return),Ou(n,r);break;case 7:vl(n,n.return);default:Ou(n,r)}e=e.sibling}}function ku(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:ku(i,a,n),pl(4,a);break;case 1:if(ku(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)fo(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&hl(a),_l(a,a.return);break;case 27:n&2&&Al(a);case 5:a.tag!==5&&a.tag!==27||bl(a),ku(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 6:bl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Xl||Km(bm(c.ownerDocument),a.type,c),ku(i,a,n),s&&r===null&&o&4&&wl(a),_l(a,a.return);break;case 12:ku(i,a,n);break;case 31:ku(i,a,n),s&&o&4&&gu(i,a);break;case 13:ku(i,a,n),s&&o&4&&_u(i,a);break;case 22:a.memoizedState===null&&ku(i,a,n),_l(a,a.return);break;case 30:ku(i,a,n),_l(a,a.return);break;case 7:_l(a,a.return);default:ku(i,a,n)}t=t.sibling}}function Au(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&xa(n))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xa(e))}function Mu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Nu(e,t,n,r),t=t.sibling;else i&&ql(t)}function Nu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Kl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Mu(e,t,n,r),a&2048&&pl(9,t);break;case 1:Mu(e,t,n,r);break;case 3:Mu(e,t,n,r),i&&au&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&xa(a)));break;case 12:if(a&2048){Mu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Mu(e,t,n,r);break;case 31:Mu(e,t,n,r);break;case 13:Mu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Kl(t),o._visibility&2?Mu(e,t,n,r):(o._visibility|=2,Pu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Kl(s),o._visibility&2?Mu(e,t,n,r):Fu(e,t)),a&2048&&Au(s,t);break;case 24:Mu(e,t,n,r),a&2048&&ju(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(zl(a.child,!0),zl(t.child,!0))),Mu(e,t,n,r);break;default:Mu(e,t,n,r)}}function Pu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Pu(a,o,s,c,i),pl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pu(a,o,s,c,i)):u._visibility&2?Pu(a,o,s,c,i):Fu(a,o),i&&l&2048&&Au(o.alternate,o);break;case 24:Pu(a,o,s,c,i),i&&l&2048&&ju(o.alternate,o);break;default:Pu(a,o,s,c,i)}t=t.sibling}}function Fu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Fu(n,r),i&2048&&Au(r.alternate,r);break;case 24:Fu(n,r),i&2048&&ju(r.alternate,r);break;default:Fu(n,r)}t=t.sibling}}var Iu=8192;function Lu(e,t,n){if(e.subtreeFlags&Iu)for(e=e.child;e!==null;)Ru(e,t,n),e=e.sibling}function Ru(e,t,n){switch(e.tag){case 26:Lu(e,t,n),e.flags&Iu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,xu,e.memoizedState,e.memoizedProps));break;case 5:Lu(e,t,n),e.flags&Iu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=xu;xu=bm(e.stateNode.containerInfo),Lu(e,t,n),xu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Iu,Iu=16777216,Lu(e,t,n),Iu=r):Lu(e,t,n));break;case 30:if((e.flags&Iu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ml===null&&(Ml=new Map),Ml.set(r,i)}Lu(e,t,n);break;default:Lu(e,t,n)}}function zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Bu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Uu(r,e)}zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vu(e),e=e.sibling}function Vu(e){switch(e.tag){case 0:case 11:case 15:Bu(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Bu(e);break;case 12:Bu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hu(e)):Bu(e);break;default:Bu(e)}}function Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tu=r,Uu(r,e)}zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),Hu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hu(t));break;default:Hu(t)}e=e.sibling}}function Uu(e,t){for(;tu!==null;){var n=tu;switch(n.tag){case 0:case 11:case 15:ml(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:xa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tu=r;else a:for(n=e;tu!==null;){r=tu;var i=r.sibling,a=r.return;if(du(r),r===n){tu=null;break a}if(i!==null){i.return=a,tu=i;break a}tu=a}}}var Wu={getCacheForType:function(e){var t=pa(ya),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return pa(ya).controller.signal}},Gu=typeof WeakMap==`function`?WeakMap:Map,Ku=0,qu=null,Ju=null,Yu=0,Xu=0,Zu=null,Qu=!1,$u=!1,ed=!1,td=0,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=null,ld=null,ud=!1,dd=0,fd=0,pd=1/0,md=null,hd=null,gd=0,_d=null,vd=null,yd=0,bd=0,xd=null,Sd=null,Cd=null,wd=null,Td=null,Ed=0,Dd=null;function Od(){return Ku&2&&Yu!==0?Yu&-Yu:Y.T===null?st():Mf()}function kd(){if(od===0){if(!(Yu&536870912)||Ki){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),od=e}else od=536870912}return e=yo.current,e!==null&&(e.flags|=32),od}function Ad(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(ii(e.memoizedProps,n))),wd===null&&(wd=[]),wd.push(t.bind(null,r))}}function jd(e,t,n){(e===qu&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,Yu,od,!1)),et(e,n),(!(Ku&2)||e!==qu)&&(e===qu&&(!(Ku&2)&&(id|=n),nd===4&&Fd(e,Yu,od,!1)),wf(e))}function Md(e,t,n){if(Ku&6)throw Error(s(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ye(e,t),i=r?Kd(e,t):Wd(e,t,!0),a=r;do{if(i===0){$u&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Pd(n)){i=Wd(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o===0?o&536870912?536870912:0:o;if(o!==0){t=o;a:{var c=e;i=cd;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,o).flags|=256),o=Wd(c,o,!1),o!==2&&o!==6){if(ed&&!l){c.errorRecoveryDisabledLanes|=a,id|=a,i=4;break a}a=ld,ld=i,a!==null&&(ld===null?ld=a:ld.push.apply(ld,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Rd(e,0),Fd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fd(r,t,od,!Qu);break a;case 2:ld=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=dd+300-Oe(),10<i)){if(Fd(r,t,od,!Qu),Je(r,0,!0)!==0)break a;yd=t,r.timeoutHandle=gp(Nd.bind(null,r,n,ld,md,ud,t,od,id,sd,Qu,a,`Throttled`,-0,0),i);break a}Nd(r,n,ld,md,ud,t,od,id,sd,Qu,a,null,-0,0)}break}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Ml=null,Ru(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?dd-Oe():(a&4194048)===a?fd-Oe():0,m=eh(d,m),m!==null)){yd=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l);return}$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fd(e,t,n,r){t=Xe(e,t),t&=~ad,t&=~id,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function Id(){return Ku&6?!0:(Tf(0,!1),!1)}function Ld(){if(Ju!==null){if(Xu===0)var e=Ju.return;else e=Ju,aa=ia=null,Yo(e),qa=null,Ja=0,e=Ju;for(;e!==null;)fl(e.alternate,e),e=e.return;Ju=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yd=0,Ld(),qu=e,Ju=n=xi(e.current,null),Yu=t,Xu=0,Zu=null,Qu=!1,$u=Ye(e,t),ed=!1,sd=od=ad=id=rd=nd=0,ld=cd=null,ud=!1,td=Xe(e,t),di(),n}function zd(e,t){jo=null,Y.H=ac,t===La||t===za?(t=Ga(),Xu=3):t===Ra?(t=Ga(),Xu=4):Xu=t===Cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zu=t,Ju===null&&(nd=1,_c(e,ki(t,e.current)))}function Bd(){var e=yo.current;return e===null?!0:(Yu&4194048)===Yu?bo===null:(Yu&62914560)===Yu||Yu&536870912?e===bo:!1}function Vd(){var e=Y.H;return Y.H=ac,e===null?ac:e}function Hd(){var e=Y.A;return Y.A=Wu,e}function Ud(){nd=4,Qu||(Yu&4194048)!==Yu&&yo.current!==null||($u=!0),!(rd&134217727)&&!(id&134217727)||qu===null||Fd(qu,Yu,od,!1)}function Wd(e,t,n){var r=Ku;Ku|=2;var i=Vd(),a=Hd();(qu!==e||Yu!==t)&&(md=null,Rd(e,t)),t=!1;var o=nd;a:do try{if(Xu!==0&&Ju!==null){var s=Ju,c=Zu;switch(Xu){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:yo.current===null&&(t=!0);var l=Xu;if(Xu=0,Zu=null,Xd(e,s,c,l),n&&$u){o=0;break a}break;default:l=Xu,Xu=0,Zu=null,Xd(e,s,c,l)}}Gd(),o=nd;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,aa=ia=null,Ku=r,Y.H=i,Y.A=a,Ju===null&&(qu=null,Yu=0,di()),o}function Gd(){for(;Ju!==null;)Jd(Ju)}function Kd(e,t){var n=Ku;Ku|=2;var r=Vd(),i=Hd();qu!==e||Yu!==t?(md=null,pd=Oe()+500,Rd(e,t)):$u=Ye(e,t);a:do try{if(Xu!==0&&Ju!==null){t=Ju;var a=Zu;b:switch(Xu){case 1:Xu=0,Zu=null,Xd(e,t,a,1);break;case 2:case 9:if(Va(a)){Xu=0,Zu=null,Yd(t);break}t=function(){Xu!==2&&Xu!==9||qu!==e||(Xu=7),wf(e)},a.then(t,t);break a;case 3:Xu=7;break a;case 4:Xu=5;break a;case 7:Va(a)?(Xu=0,Zu=null,Yd(t)):(Xu=0,Zu=null,Xd(e,t,a,7));break;case 5:var o=null;switch(Ju.tag){case 26:o=Ju.memoizedState;case 5:case 27:var c=Ju;if(o?Ym(o):c.stateNode.complete){Xu=0,Zu=null;var l=c.sibling;if(l!==null)Ju=l;else{var u=c.return;u===null?Ju=null:(Ju=u,Zd(u))}break b}}Xu=0,Zu=null,Xd(e,t,a,5);break;case 6:Xu=0,Zu=null,Xd(e,t,a,6);break;case 8:Ld(),nd=6;break a;default:throw Error(s(462))}}qd();break}catch(t){zd(e,t)}while(1);return aa=ia=null,Y.H=r,Y.A=i,Ku=n,Ju===null?(qu=null,Yu=0,di(),nd):0}function qd(){for(;Ju!==null&&!Ee();)Jd(Ju)}function Jd(e){var t=rl(e.alternate,e,td);e.memoizedProps=e.pendingProps,t===null?Zd(e):Ju=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lc(n,t,t.pendingProps,t.type,void 0,Yu);break;case 11:t=Lc(n,t,t.pendingProps,t.type.render,t.ref,Yu);break;case 5:Yo(t);var r=t;r===Wi&&(Ki?(Qi(r),r.tag===5&&r.stateNode!=null&&(Gi=r.stateNode)):(Qi(r),Ki=!0));default:fl(n,t),t=Ju=Si(t,td),t=rl(n,t,td)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Ju=t}function Xd(e,t,n,r){aa=ia=null,Yo(t),qa=null,Ja=0;var i=t.return;try{if(Sc(e,i,t,n,Yu)){nd=1,_c(e,ki(n,e.current)),Ju=null;return}}catch(t){if(i!==null)throw Ju=i,t;nd=1,_c(e,ki(n,e.current)),Ju=null;return}t.flags&32768?(Ki||r===1?e=!0:$u||Yu&536870912?e=!1:(Qu=e=!0,(r===2||r===9||r===3||r===6)&&(r=yo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,Qu);return}e=t.return;var n=ul(t.alternate,t,td);if(n!==null){Ju=n;return}if(t=t.sibling,t!==null){Ju=t;return}Ju=t=e}while(t!==null);nd===0&&(nd=5)}function Qd(e,t){do{var n=dl(e.alternate,e);if(n!==null){n.flags&=32767,Ju=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ju=e;return}Ju=e=n}while(e!==null);nd=6,Ju=null}function $d(e,t,n,r,i,a,o,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(gd!==0);if(Ku&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===qu&&(Ju=qu=null,Yu=0),vd=t,_d=e,yd=n,xd=i,Sd=r,ef(e,t,n,o,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(bd=s,s|=ui,tt(e,n,s,r,i,a),wd=null,(n&335544064)===n?(Td=wa(e),r=10262):(Td=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(Me,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=Y.T,Y.T=null,i=ne.p,ne.p=2,a=Ku,Ku|=4;try{ou(e,t,n)}finally{Ku=a,ne.p=i,Y.T=r}}gd=1,jl?Cd=Mp(o,e.containerInfo,Td,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(gd!==0){var t=_d.onRecoverableError;t(e,{componentStack:null})}}function nf(){gd===3&&(gd=0,Eu(vd,_d),gd=4)}function rf(){if(gd===1){gd=0;var e=_d,t=vd,n=yd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=Y.T,Y.T=null;var i=ne.p;ne.p=2;var a=Ku;Ku|=4;try{ru=iu=!1,Su(t,e,n),n=cp;var o=Pr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Nr(s.ownerDocument.documentElement,s)){if(c!==null&&Fr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Ku=a,ne.p=i,Y.T=r}}e.current=t,gd=2}}function af(){if(gd===2){gd=0;var e=_d,t=vd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=Y.T,Y.T=null;var r=ne.p;ne.p=2;var i=Ku;Ku|=4;try{cu(e,t.alternate,t)}finally{Ku=i,ne.p=r,Y.T=n}}gd=3}}function of(){if(gd===4||gd===3){gd=0;var e=Cd;Cd=null,De();var t=_d,n=vd,r=yd,i=Sd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?gd=5:(gd=0,vd=_d=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(hd=null),ot(r),n=n.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=Y.T,a=ne.p,ne.p=2,Y.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{Y.T=n,ne.p=a}}if(i=wd,o=Td,Td=null,i!==null&&(wd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);yd&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Dd?Ed++:(Ed=0,Dd=t):(Ed=0,Dd=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xa(t)))}function cf(){return Cd!==null&&(Cd.skipTransition(),Cd=null),rf(),af(),of(),lf()}function lf(){if(gd!==5)return!1;var e=_d,t=bd;bd=0;var n=ot(yd),r=Y.T,i=ne.p;try{ne.p=32>n?32:n,Y.T=null,n=xd,xd=null;var a=_d,o=yd;if(gd=0,vd=_d=null,yd=0,Ku&6)throw Error(s(331));var c=Ku;if(Ku|=4,Vu(a.current),Nu(a,a.current,o,n),Ku=c,Tf(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,a)}catch{}return!0}finally{ne.p=i,Y.T=r,sf(e,t)}}function uf(e,t,n){t=ki(n,t),t=yc(e.stateNode,t,2),e=ao(e,t,2),e!==null&&(et(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hd===null||!hd.has(r))){e=ki(n,e),n=bc(2),r=ao(t,n,2),r!==null&&(xc(n,r,t,e),et(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ed=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,qu===e&&(Yu&n)===n&&(nd===4||nd===3&&(Yu&62914560)===Yu&&300>Oe()-dd?Ku&2?ad|=n:Rd(e,0):ad|=n,sd===Yu&&(sd=0)),wf(e)}function mf(e,t){t===0&&(t=Qe()),e=mi(e,t),e!==null&&(et(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),mf(e,n)}function _f(e,t){return Te(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=Yu,a=Je(r,r===qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=Oe(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}gd!==0&&gd!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ze(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=qu,n=Yu,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&X(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&X(r),ot(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=kf.bind(null,e),n=Te(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&X(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(gd!==0&&gd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=Yu;return r=Je(e,e===qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Md(e,r,t),Of(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;Md(e,t,!0)}function jf(){bp(function(){Ku&6?Te(Ae,Ef):Df()})}function Mf(){if(Cf===0){var e=Da;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:rn(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[dt]||null).action),o=r.submitter;o&&(t=(t=o[dt]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new En(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);Gs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Gs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<ti.length;Ff++){var If=ti[Ff];ni(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}ni(qr,`onAnimationEnd`),ni(Jr,`onAnimationIteration`),ni(Yr,`onAnimationStart`),ni(`dblclick`,`onDoubleClick`),ni(`focusin`,`onFocus`),ni(`focusout`,`onBlur`),ni(Xr,`onTransitionRun`),ni(Zr,`onTransitionStart`),ni(Qr,`onTransitionCancel`),ni($r,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){si(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){si(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[pt];n===void 0&&(n=t[pt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Q.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!hn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=bt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}fn(function(){var r=a,i=sn(n),o=[];a:{var s=ei.get(e);if(s!==void 0){var c=En,u=e;switch(e){case`keypress`:if(xn(n)===0)break a;case`keydown`:case`keyup`:c=Wn;break;case`focusin`:u=`focus`,c=Fn;break;case`focusout`:u=`blur`,c=Fn;break;case`beforeblur`:case`afterblur`:c=Fn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=qn;break;case qr:case Jr:case Yr:c=In;break;case $r:c=Jn;break;case`scroll`:case`scrollend`:c=On;break;case`wheel`:c=Yn;break;case`copy`:case`cut`:case`paste`:c=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Gn;break;case`submit`:c=Kn;break;case`toggle`:case`beforetoggle`:c=Xn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=pn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==on&&(u=n.relatedTarget||n.fromElement)&&(bt(u)||u[ft]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?bt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Nn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Gn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:xt(s),h=c==null?u:xt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,bt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?E(s,c,Jf):null,s!==null&&Yf(o,u,s,d,!1),c!==null&&f!==null&&Yf(o,f,c,d,!0)))}a:{if(s=r?xt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=gr;else if(ur(s)){if(_r)_=Er;else{_=wr;var v=Cr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&en(r.elementType)&&(_=gr):_=Tr;if(_&&=_(e,r)){dr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?xt(r):window,e){case`focusin`:(ur(v)||v.contentEditable===`true`)&&(Lr=v,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var y;if(Qn)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else or?ir(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(tr&&n.locale!==`ko`&&(or||b!==`onCompositionStart`?b===`onCompositionEnd`&&or&&(y=bn()):(_n=i,vn=`value`in _n?_n.value:_n.textContent,or=!0)),v=qf(r,b),0<v.length&&(b=new Rn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=ar(n),y!==null&&(b.data=y)))),(y=er?sr(e,n):cr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Pf(o,e,r,n,i)}zf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=pn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=pn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=pn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=pn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
9
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||Xt(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&Xt(e,``+r);else return;break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:$t(e,r,a);return;case`data`:if(t!==`object`){Ft(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=an);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=rn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=tn.get(n)||n,Pt(e,n,r);else return}Mt=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:$t(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)Xt(e,r);else if(typeof r==`number`||typeof r==`bigint`)Xt(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=an);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[dt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}Mt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Pt(e,n,r)}return}Mt=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:ep(e,t,a,o,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:ep(e,t,r,d,n,null)}}Gt(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Bf(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&qt(e,!!r,n,!0):qt(e,!!r,t,!1);return;case`textarea`:for(o in Bf(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:ep(e,t,o,c,n,null)}Yt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:ep(e,t,u,r,n,null)}return;default:if(en(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Mt=!0),a=m;break;case`name`:m!==f&&(Mt=!0),i=m;break;case`checked`:m!==f&&(Mt=!0),u=m;break;case`defaultChecked`:m!==f&&(Mt=!0),d=m;break;case`value`:m!==f&&(Mt=!0),o=m;break;case`defaultValue`:m!==f&&(Mt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Wt(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ep(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(Mt=!0),p=a;break;case`defaultValue`:a!==l&&(Mt=!0),c=a;break;case`multiple`:a!==l&&(Mt=!0),o=a;default:a!==l&&ep(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?qt(e,!!n,n?[]:``,!1):qt(e,!!n,t,!0)):qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:i!==a&&(Mt=!0),p=i;break;case`defaultValue`:i!==a&&(Mt=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&ep(e,t,o,i,r,a)}Jt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Mt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(en(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[ut]=r,n[dt]=t,np(n,e,t),Ct(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[_t]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=bt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(s(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),yt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[_t])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===an&&(e.onclick=null),yt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=ne.d;ne.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=Z(e);t!==null&&t.tag===5&&t.type===`form`?qs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Ut(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ut(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ut(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ut(n.imageSizes)+`"]`)):i+=`[href="`+Ut(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[vt]=!0,o.onload=o.onerror=function(){wt(o)}),Ct(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ut(r)+`"][href="`+Ut(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=St(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ct(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=St(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ct(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=St(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ct(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=de.current)?bm(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=St(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=St(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(Fm(e)))?a._p||(o.instance=a,o.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=St(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Pm(e){return`href="`+Ut(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[vt]){r.loading=1;return}}else t=e.createElement(`link`),t[vt]=!0,t.onload=t.onerror=wt.bind(null,t),np(t,`link`,n),Ct(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Ut(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ut(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Ct(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Ct(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Ct(i),i):(r=n,(i=vm.get(a))&&(r=D({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ct(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[_t]||a[ut]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=yi(3,null,null,t),e.current=a,a.stateNode=e,t=ba(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},no(a),e}function uh(e){return e?(e=_i,e):_i}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=io(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ao(e,r,t),n!==null&&(jd(n,e,t),oo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=mi(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=at(t);var n=mi(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=Y.T;Y.T=null;var a=ne.p;try{ne.p=2,yh(e,t,n,r)}finally{ne.p=a,Y.T=i}}function vh(e,t,n,r){var i=Y.T;Y.T=null;var a=ne.p;try{ne.p=8,yh(e,t,n,r)}finally{ne.p=a,Y.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Z(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Ku&6)&&(pd=Oe()+500,Tf(0,!1))}}break;case 31:case 13:s=mi(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=sn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=bt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Z(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=bt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,ct(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,ct(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);on=r,n.target.dispatchEvent(r),on=null}else return t=Z(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Z(n);a!==null&&(e.splice(t,3),t-=3,Gs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[dt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[dt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[ft]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=st();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(s(527,Kh,`19.3.0`));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:Y,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Le=Jh.inject(qh),Re=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=mc,a=hc,o=gc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,o,Uh),e[ft]=t.current,Uf(e),new Wh(t)}})),c=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()}));function l(e){if(e.carrying===void 0)return{weight:e.imports+e.calls+(e.references??0)};let t=e.calls+(e.references??0);return t===0&&e.carrying===0?null:{weight:t}}var u={"dynamic-dispatch":`type unknown`,untyped:`type unknown`,reflection:`reflection`,"computed-member":`computed name`,computed:`computed name`,metaprogramming:`built at run time`,"dynamic-sql":`SQL built at run time`,"imported-symbol":`imported, not linked`,"runtime-global":`built-in`,"builtin-value":`built-in value`,"template-binding":`awaiting its component`,"template-reference":`registered elsewhere`,candidates:`narrowed to candidates`,ambiguous:`could be several functions`,"not-exported":`not exported`,"not-found":`not found`,"not-a-function":`a value, not a function`,undeclared:`not declared by its type`,"no-body":`no body known`,"bodies-unknown":`not every body is known`,"unknown-wrapper":`wrapped in a function it can't see into`,"depth-limit":`too many imports deep to follow`,cycle:`imports go round in a cycle`,broken:`its import is broken`,pending:`its import waits for a source not added`,"not-analyzed":`its import reaches a file not analyzed`,default:`only a default is known`,member:`a member of a function`,truncated:`too deep to follow`,unresolved:`not resolved`};function d(e){return u[e]??e.replace(/-/g,` `)}var f=[`open`,`adjudicated`,`dynamic-only`];function p(e){return f.includes(e.status)}var m=/(^|\/)(__tests__|__mocks__|tests?|e2e|specs?|fixtures?)\/|\.(test|spec|e2e|stories)\.[a-z0-9]+$/i;function h(e){return m.test(e)}function g(e){return e.origin===void 0&&!h(e.path)}function _(e,t){return(t.get(e.source)??[]).some(t=>e.path===t||e.path.startsWith(`${t}/`))}function v(e){return t=>g(t)&&!_(t,e)}var y=n(),b=c(),x=(e,t)=>e?.runId===t?e:{runId:t,stages:[],finished:[]};function S(e,t){switch(t.type){case`run.started`:return{runId:t.runId,startedAt:new Date().toISOString(),stages:[],finished:[]};case`run.planned`:return e=x(e,t.runId),{...e,stages:t.stages,planned:{listed:t.sources.reduce((e,t)=>e+t.listed,0),toAnalyze:t.sources.reduce((e,t)=>e+t.toAnalyze,0),notAnalyzed:t.sources.reduce((e,t)=>e+Object.values(t.notAnalyzed).reduce((e,t)=>e+t,0),0)}};case`stage.started`:{e=x(e,t.runId);let{runId:n,startedAt:r,planned:i,stages:a,finished:o}=e;return{runId:n,...r?{startedAt:r}:{},...i?{planned:i}:{},stages:a.length?a:[t.stage],finished:o,stage:t.stage,index:t.index}}case`stage.progress`:{e=x(e,t.runId);let{done:n,total:r,unit:i,...a}=e,{type:o,projectId:s,runId:c,stage:l,...u}=t;return{...a,stage:l,...u}}case`stage.completed`:return e?.runId===t.runId?{...e,finished:[...e.finished,{stage:t.stage,durationMs:t.durationMs}]}:e;case`run.committed`:case`run.failed`:return e?.runId===t.runId?null:e;default:return e}}var C={stage1:`Reading files`,"template-link":`Linking component templates`,stage2:`Linking across files`},w=e=>e.toLocaleString(`en-US`);function T(e){if(e.stage===void 0)return{text:e.planned?`Planned: ${w(e.planned.toAnalyze)} files to analyze${e.planned.notAnalyzed?` (${w(e.planned.notAnalyzed)} not analyzed)`:``}`:`Planning…`,fraction:0};let t=e.stages.length>1&&e.index!==void 0?` · stage ${e.index+1} of ${e.stages.length}`:``,n=C[e.stage]??e.stage,r=``,i=null;if(e.phase===`saving results`)return{text:`${n}: saving results${t}`,fraction:1};if(e.phase){let t=e.total===void 0?``:e.done===void 0?` (${w(e.total)}${e.unit?` ${e.unit}`:``})`:`: ${w(e.done)} of ${w(e.total)}${e.unit&&e.unit!==`files`?` ${e.unit}`:``}`,n=e.steps&&e.steps>1?`, step ${e.step} of ${e.steps}`:``;r=e.phase===`reading files`?t:`: ${e.phase}${t}${n}`,e.done!==void 0&&e.total?i=e.done/e.total:e.steps&&e.step&&(i=(e.step-1)/e.steps)}return{text:`${n}${r}${t}`,fraction:i}}var E={v:1,project:null,file:null,selection:null,panel:`evidence`,showUnresolved:!1,tab:`file`,group:null,pick:null,fileLevel:!1,showPending:!1,expand:[],source:null,run:null,history:!1,compare:null,only:null,area:null,reach:null},D=(e,t=!1)=>n=>t&&n[e]===void 0||typeof n[e]==`string`&&n[e].length>0?[]:[e],O=(e,t)=>n=>t.includes(n[e])?[]:[e],k=(...e)=>t=>e.flatMap(e=>e(t)),A=()=>[],j={selectProject:{description:`Show a project`,control:{kind:`select`,testId:`select-project`},check:D(`project`),apply:(e,t)=>({...E,project:t.project,panel:e.panel,tab:e.tab,...t.project===e.project?{run:e.run,history:e.history,compare:e.compare}:{}})},goHome:{description:`Go to the projects home: every project, its last run and its findings`,control:{kind:`button`,testId:`go-home`},check:A,apply:e=>({...E,panel:e.panel})},openFile:{description:`Show a file: its functions and calls (File tab), or its imports and cross-file calls (Imports tab)`,control:{kind:`tree`,testId:`open-file`},check:D(`file`),apply:(e,t)=>({...e,only:null,file:t.file,selection:null,fileLevel:e.tab===`imports`,pick:e.tab===`imports`?null:e.pick})},select:{description:`Select a function, call or unresolved call site to see its evidence`,control:{kind:`canvas`,testId:`select`,shortcut:`Enter`},check:k(O(`kind`,[`function`,`call`,`site`]),D(`id`),D(`file`,!0)),apply:(e,t)=>({...e,file:t.file??e.file,selection:{kind:t.kind,id:t.id},panel:`evidence`,tab:`file`,fileLevel:!1,showUnresolved:t.kind===`site`||e.showUnresolved})},clearSelection:{description:`Clear the selection`,control:{kind:`button`,testId:`clear-selection`,shortcut:`Escape`},check:A,apply:e=>({...e,selection:null,pick:null})},showPanel:{description:`Show the evidence panel, the open-questions list or the last answer`,control:{kind:`tab`,testId:`show-panel`},check:O(`panel`,[`evidence`,`questions`,`answer`]),apply:(e,t)=>({...e,panel:t.panel})},showTab:{description:`Show the File tab (inside one file) or the Imports tab (how files depend on each other)`,control:{kind:`tab`,testId:`show-tab`},check:O(`tab`,[`file`,`imports`,`reach`]),apply:(e,t)=>t.tab===`reach`&&!e.reach?e:t.tab===`imports`&&e.tab===`file`&&e.file?{...e,tab:`imports`,fileLevel:!0,group:null,pick:null,only:null,expand:[]}:t.tab===`imports`&&e.tab===`imports`?{...e,fileLevel:!1,group:null,pick:null,only:null,expand:[],area:null}:{...e,tab:t.tab}},openReach:{description:`Open the Reach tab on a function or file: what paths from it reach (forward) or what reaches it (backward), and where they stop`,control:{kind:`button`,testId:`open-reach`},check:k(D(`root`),e=>e.direction===void 0||e.direction===`forward`||e.direction===`backward`?[]:[`direction`]),apply:(e,t)=>({...e,tab:`reach`,reach:{root:t.root,direction:t.direction??e.reach?.direction??`forward`},pick:null,only:null})},pickNode:{description:`Pick a group on the Imports tab's map to see its details`,control:{kind:`canvas`,testId:`pick-node`},check:D(`id`),apply:(e,t)=>({...e,tab:`imports`,pick:t.id,panel:`evidence`})},openGroup:{description:`Open a group on the Imports tab (its files and imports), or go back to the project map`,control:{kind:`canvas`,testId:`open-group`},check:k(D(`group`,!0),D(`folder`,!0)),apply:(e,t)=>{let n=t.group===e.group||e.group===null?e.expand:[];return{...e,only:null,tab:`imports`,group:t.group??null,pick:null,fileLevel:!1,area:t.group?e.area:null,expand:t.folder&&!n.includes(t.folder)?[...n,t.folder].sort():n}}},openArea:{description:`Show one part of a large project map: a repository, or a folder in one (none: the whole map)`,control:{kind:`canvas`,testId:`open-area`},check:D(`area`,!0),apply:(e,t)=>({...e,only:null,tab:`imports`,group:null,pick:null,fileLevel:!1,area:t.area??null})},openImportsFile:{description:`Open a file on the Imports tab: its imports and its cross-file calls`,control:{kind:`canvas`,testId:`open-imports-file`},check:k(D(`file`),D(`group`,!0),D(`pick`,!0)),apply:(e,t)=>({...e,only:null,tab:`imports`,file:t.file,group:t.group??e.group,fileLevel:!0,pick:t.pick??null,panel:t.pick?`evidence`:e.panel,selection:null})},toggleFolder:{description:`Open or close a folder in a large group on the Imports tab`,control:{kind:`canvas`,testId:`toggle-folder`},check:D(`path`),apply:(e,t)=>({...e,expand:e.expand.includes(t.path)?e.expand.filter(e=>e!==t.path&&!e.startsWith(`${t.path}/`)):[...e.expand,t.path].sort()})},scopeSource:{description:`Limit the navigator, the map and Findings to one repository, or show all of them`,control:{kind:`select`,testId:`scope-source`},check:D(`source`,!0),apply:(e,t)=>({...e,only:null,source:t.source??null,group:t.source?null:e.group,pick:null,area:null})},openRun:{description:`Read the graph at another run (the draft of uncommitted edits, or an older run), or back at the latest`,control:{kind:`button`,testId:`open-run`},check:e=>e.run===void 0||Number.isInteger(e.run)&&e.run>0?[]:[`run`],apply:(e,t)=>({...e,run:t.run??null,compare:null,selection:null,pick:null})},toggleHistory:{description:`Open or close the History panel: runs by commit, and comparing two`,control:{kind:`toggle`,testId:`toggle-history`},check:A,apply:e=>({...e,history:!e.history})},compareRuns:{description:`Compare two runs (the change list and the diff on the canvas), or stop comparing`,control:{kind:`button`,testId:`compare-runs`},check:e=>{if(e.a===void 0&&e.b===void 0)return[];let t=e=>Number.isInteger(e)&&e>0;return[...t(e.a)?[]:[`a`],...t(e.b)?[]:[`b`]]},apply:(e,t)=>t.a===void 0||t.b===void 0?{...e,compare:null,run:null}:{...e,compare:{a:Math.min(t.a,t.b),b:Math.max(t.a,t.b)},run:Math.max(t.a,t.b),history:!0}},showOnlyLinks:{description:`Show only an item and what it links to (a group, a file or a function), or everything again`,control:{kind:`canvas`,testId:`show-only-links`},check:D(`id`,!0),apply:(e,t)=>({...e,only:t.id??null})},togglePending:{description:`Show or hide imports waiting for another source (pending)`,control:{kind:`toggle`,testId:`toggle-pending`},check:A,apply:e=>({...e,showPending:!e.showPending})},toggleUnresolved:{description:`Show or hide unresolved call sites in the graph`,control:{kind:`toggle`,testId:`toggle-unresolved`,shortcut:`u`},check:A,apply:e=>({...e,showUnresolved:!e.showUnresolved})}},M=class extends Error{code;fields;constructor(e,t,n=[]){super(t),this.code=e,this.fields=n}};function N(e,t){let n=Object.hasOwn(j,t.name)?j[t.name]:void 0;if(!n)throw new M(`unknown-command`,`no command ${t.name}`);let r=t.args??{},i=n.check(r);if(i.length>0)throw new M(`invalid-arguments`,`invalid arguments for ${t.name}: ${i.join(`, `)}`,i);return n.apply(e,r)}function P(e=E){return{past:[],present:e,future:[]}}function F(e,t){let n=N(e.present,t);return JSON.stringify(n)===JSON.stringify(e.present)?e:{past:[...e.past,e.present].slice(-200),present:n,future:[]}}function I(e){let t=e.past.at(-1);return t?{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}:e}function L(e){let t=e.future[0];return t?{past:[...e.past,e.present],present:t,future:e.future.slice(1)}:e}function R(e){return encodeURIComponent(JSON.stringify(e))}function z(e){let t=e,n=e=>Number.isInteger(e)&&e>0;return t&&typeof t==`object`&&n(t.a)&&n(t.b)?{a:t.a,b:t.b}:null}function B(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.root==`string`&&t.root&&(t.direction===`forward`||t.direction===`backward`)?{root:t.root,direction:t.direction}:null}function V(e){if(!e)return E;let t;try{t=JSON.parse(decodeURIComponent(e))}catch{return E}if(!t||typeof t!=`object`||t.v!==1)return E;let n=e=>typeof e==`string`&&e.length>0?e:null,r=t.selection,i=r&&typeof r==`object`&&[`function`,`call`,`site`].includes(r.kind)&&n(r.id)?{kind:r.kind,id:r.id}:null;return{v:1,project:n(t.project),file:n(t.file),selection:i,panel:t.panel===`questions`||t.panel===`answer`?t.panel:`evidence`,showUnresolved:typeof t.showUnresolved==`boolean`?t.showUnresolved:E.showUnresolved,tab:t.tab===`imports`?`imports`:t.tab===`reach`&&B(t.reach)?`reach`:`file`,group:n(t.group),pick:n(t.pick),fileLevel:t.fileLevel===!0,showPending:t.showPending===!0,source:n(t.source),run:Number.isInteger(t.run)&&t.run>0?t.run:null,history:t.history===!0,compare:z(t.compare),only:n(t.only),area:n(t.area),reach:B(t.reach),expand:Array.isArray(t.expand)?t.expand.filter(e=>typeof e==`string`&&e.length>0):[]}}var H={addFolder:{description:`Add a folder to the project and analyze it`,control:{kind:`button`,testId:`add-folder`},check:D(`root`)},analyze:{description:`Analyze the project again`,control:{kind:`button`,testId:`reanalyze`},check:A},analyzeDraft:{description:`Analyze the working tree's uncommitted edits as a draft, beside the current graph`,control:{kind:`button`,testId:`analyze-draft`},check:A},analyzeDebug:{description:`A debug run that stops after a chosen stage, beside the current graph: never committed, replaced by the next one`,control:{kind:`button`,testId:`analyze-debug`},check:D(`until`)},analyzeFrom:{description:`Analyze again from a later stage: the stages before it are reused when nothing they read changed since the latest run`,control:{kind:`button`,testId:`analyze-from`},check:D(`from`)},ask:{description:`Ask a question about the analyzed code (built-in questions offline; anything with a model)`,control:{kind:`button`,testId:`ask`,shortcut:`Mod+K`},check:D(`question`)},openSettings:{description:`Set the model provider: base URL, API key and model name`,control:{kind:`button`,testId:`settings`},check:A},analyzeSource:{description:`Analyze one repository again (the others stay at their commits)`,control:{kind:`button`,testId:`repo-analyze`},check:D(`source`)},chooseFiles:{description:`Choose which files are analyzed, opened at a folder or file (to leave it out, or add it back)`,control:{kind:`button`,testId:`repo-choose`},check:k(D(`source`),D(`path`,!0))},openProjectSettings:{description:`The project's settings, at a tab: its repositories (re-analyze, choose files, rename, edit rules, remove), analysis options, or the license`,control:{kind:`button`,testId:`project-settings`},check:(e=>e.tab===void 0?[]:O(`tab`,[`repositories`,`analysis`,`license`])(e))}};function U(e,t={}){let n=Object.hasOwn(H,e)?H[e]:void 0;if(!n)throw new M(`unknown-command`,`no action ${e}`);let r=n.check(t);if(r.length>0)throw new M(`invalid-arguments`,`invalid arguments for ${e}: ${r.join(`, `)}`,r)}function W(e){return e.file?e.kind===`file`?[{name:`openFile`,args:{file:e.file}}]:e.kind===`function`||e.kind===`call`||e.kind===`site`?[{name:`openFile`,args:{file:e.file}},{name:`select`,args:{kind:e.kind,id:e.id,file:e.file}}]:[]:[]}var G=null;function K(e){return e?.details?.kind===`run`}function ee(e){G=e}async function q(e,t){let n=t?.method??`GET`;G!==null&&e.startsWith(`/api/projects/`)&&(n===`GET`||e.endsWith(`/snippet`)||e.endsWith(`/ask`))&&(e=`${e}${e.includes(`?`)?`&`:`?`}run=${G}`);let r=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers??{}}}),i=await r.json();if(!r.ok){let e=i.details,t=i.code,n=r.status===404?`gone`:r.status===403&&t===`entitlement`?`history`:null;throw n&&e?.kind===`run`&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(`veo-run-gone`,{detail:{run:G,reason:n}})),i}return i}var J=e=>`/api/projects/${encodeURIComponent(e)}`,te=e=>new URLSearchParams(e).toString(),Y={projects:(e=!1)=>q(`/api/projects${e?`?findings=1`:``}`),createProject:(e,t)=>q(`/api/projects`,{method:`POST`,body:JSON.stringify(t===void 0?{name:e}:{name:e,root:t})}),projectDisk:e=>q(`${J(e)}/disk`),deleteProject:e=>q(J(e),{method:`DELETE`,body:`{}`}),addSource:(e,t)=>q(`${J(e)}/sources`,{method:`POST`,body:JSON.stringify({root:t})}),analyze:e=>q(`${J(e)}/runs`,{method:`POST`,body:`{}`}),history:e=>q(`${J(e)}/history?limit=200`),diff:(e,t,n)=>q(`${J(e)}/diff?${te({a:String(t),b:String(n),limit:`5000`})}`),cancelRun:e=>q(`${J(e)}/runs/cancel`,{method:`POST`,body:`{}`}),analyzeDraft:e=>q(`${J(e)}/runs?draft=true`,{method:`POST`,body:`{}`}),analyzeFrom:(e,t)=>q(`${J(e)}/runs?${te({from:t})}`,{method:`POST`,body:`{}`}),analyzeDebug:(e,t)=>q(`${J(e)}/runs?${te({debug:`true`,until:t})}`,{method:`POST`,body:`{}`}),stages:e=>q(`${J(e)}/stages`),status:e=>q(`${J(e)}/status`),files:e=>q(`${J(e)}/files`),search:(e,t,n,r=6)=>q(`${J(e)}/search?${te({label:t,text:n,limit:String(r)})}`),aggregate:(e,t,n,r=5,i=!1)=>q(`${J(e)}/aggregate?${te({label:t,groupBy:n,limit:String(r),...i?{ownCode:`true`}:{}})}`),fileCounts:e=>q(`${J(e)}/file-counts`),stale:e=>q(`${J(e)}/stale`),groups:(e,t)=>q(`${J(e)}/groups${t?`?${te({source:t})}`:``}`),group:(e,t,n,r)=>{let i=new URLSearchParams({group:t});for(let e of n)i.append(`expand`,e);return r&&i.set(`pending`,`true`),q(`${J(e)}/group?${i.toString()}`)},libraries:(e,t)=>q(`${J(e)}/libraries${t?`?${te({source:t})}`:``}`),library:(e,t,n,r)=>q(`${J(e)}/library?${te({name:t,ecosystem:n,...r?{source:r}:{}})}`),imports:(e,t)=>q(`${J(e)}/imports?${te({file:t})}`),findings:(e,t,n,r=1e3,i=0)=>{let a=new URLSearchParams({limit:String(r),offset:String(i)});for(let e of t)a.append(`kind`,e);return n.file&&a.set(`file`,n.file),n.group&&a.set(`group`,n.group),n.source&&a.set(`source`,n.source),n.own&&a.set(`own`,`true`),q(`${J(e)}/findings?${a.toString()}`)},callsBetween:(e,t,n,r=0)=>{let i=new URLSearchParams;for(let e of t)i.append(`from`,e);for(let e of n)i.append(`to`,e);return i.set(`limit`,`200`),r&&i.set(`offset`,String(r)),q(`${J(e)}/cross-file-calls?${i.toString()}`)},crossFileCalls:(e,t,n)=>q(`${J(e)}/cross-file-calls?${te({file:t,direction:n,limit:`500`})}`),totals:(e,t=10,n,r=!1)=>q(`${J(e)}/totals?${te({top:String(t),...n?{source:n}:{},...r?{own:`true`}:{}})}`),reach:(e,t,n)=>q(`${J(e)}/reach?${te({...t.split(`:`).length>2?{function:t}:{file:t},direction:n})}`),references:(e,t,n=`out`)=>q(`${J(e)}/references?${te({function:t,direction:n,limit:`500`})}`),siteLinks:(e,t)=>q(`${J(e)}/site-links?${te({file:t})}`),explain:(e,t)=>q(`${J(e)}/explain?${te({id:t})}`),fileGraph:(e,t)=>q(`${J(e)}/file-graph?${te({file:t})}`),unresolved:(e,t,n)=>q(`${J(e)}/unresolved?${te({...t?{file:t}:{},...n?{limit:String(n.limit),offset:String(n.offset??0)}:{}})}`),snippet:(e,t,n)=>q(`${J(e)}/snippet`,{method:`POST`,body:JSON.stringify({file:t,span:n})}),ask:(e,t,n,r,i,a)=>q(`${J(e)}/ask`,{method:`POST`,body:JSON.stringify({question:t,...n?{mode:n}:{},...r?{file:r}:{},...a?{source:a}:{}}),...i?{signal:i}:{}}),suggestions:e=>q(`${J(e)}/suggestions`),settings:()=>q(`/api/settings`),saveSettings:e=>q(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),testSettings:(e={})=>q(`/api/settings/test`,{method:`POST`,body:JSON.stringify(e)}),sources:e=>q(`${J(e)}/sources`),select:(e,t,n,r,i=!1)=>q(`${J(e)}/sources/${encodeURIComponent(t)}/select`,{method:`POST`,body:JSON.stringify({paths:n,selected:r,...i?{keep:i}:{}})}),browse:(e,t,n)=>q(`${J(e)}/sources/${encodeURIComponent(t)}/browse?${te({dir:n})}`),updateSource:(e,t,n)=>q(`${J(e)}/sources/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(n)}),removeSource:(e,t)=>q(`${J(e)}/sources/${encodeURIComponent(t)}`,{method:`DELETE`,body:`{}`}),analyzeSource:(e,t)=>q(`${J(e)}/runs?${te({source:t})}`,{method:`POST`,body:`{}`}),license:e=>q(e?`${J(e)}/license`:`/api/license`),installLicense:e=>q(`/api/license`,{method:`PUT`,body:JSON.stringify({key:e})}),refreshLicense:()=>q(`/api/license/refresh`,{method:`POST`,body:`{}`}),projectSettings:e=>q(`${J(e)}/settings`),saveProjectSettings:(e,t)=>q(`${J(e)}/settings`,{method:`PUT`,body:JSON.stringify(t)})};function ne(e,t){let n=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/events`,r=null,i,a=!1,o=!1,s=()=>{a||(r=new WebSocket(n),r.onopen=()=>{o&&e(),o=!1},r.onmessage=e=>{try{t(JSON.parse(String(e.data)))}catch{}},r.onclose=()=>{a||(o=!0,i=setTimeout(s,1e3))})};return s(),()=>{a=!0,clearTimeout(i),r?.close()}}function re(e){let t=[],n=0,r=``;for(let i of e)i===`<`?n++:i===`>`&&(n=Math.max(0,n-1)),i===`.`&&n===0?(t.push(r),r=``):r+=i;return t.push(r),t.filter(e=>e.length>0)}function ie(e,t){let n=/^<([a-z]+)(?::([^>]*))?>(?:#(\d+))?$/.exec(e);if(!n)return e;let[,r,i,a]=n,o=t===void 0?a?` #${a}`:``:` · line ${t}`;switch(r){case`callback`:return`${i??`anonymous`} callback${o}`;case`module`:return`file top level`;case`template`:return`template`;case`component`:return`component options`;case`iife`:return`immediately invoked function${o}`;case`anonymous`:return`anonymous function${o}`;case`object`:return`object literal${o}`;default:return`${r}${i?` ${i}`:``}${o}`}}function ae(e,t,n){if(!e.includes(`<`))return{name:e,parent:``};let r=re(e),i=r.pop()??e,a=r.some(e=>e.startsWith(`<`)),o=/^<callback:([^>]*)>(?:#\d+)?$/.exec(i);return{name:n&&o?`${o[1]} “${n}”`:i===`<module>`||i===`<template>`?ie(i):ie(i,t),parent:a?r.map(e=>ie(e)).join(` › `):r.join(`.`)}}function oe(e,t,n){let{name:r,parent:i}=ae(e,t,n);return i?`${r} (in ${i})`:r}var se=/^<(callback|iife|anonymous)(?::([^>]*))?>(?:#\d+)?$/;function ce(e){return se.exec(re(e).pop()??``)}function le(e){return ce(e)!==null}var ue=new Set([`call`,`iife`]),de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),fe=24,pe=e=>e.length>fe?e.startsWith(`(`)?`(…)`:`…`:e;function me(e){let t=/^(async\s+)?(?:<[^<>]*>\s*)?(\([^()]*\)|[\w$]+)\s*(?::\s*[^=()]+?)?\s*=>/.exec(e);if(t)return{text:`${t[1]??``}${pe(t[2])} => …`,arrow:!0};let n=/^(async\s+)?function\b\s*(\*?)\s*([\w$]*)\s*\(([^()]*)\)/.exec(e);if(n){let e=n[3]?` ${n[3]}`:` `;return{text:`${n[1]??``}function${n[2]}${e}(${pe(n[4])}) {…}`,arrow:!1}}return null}function he(e,t){let n=de(e);if(RegExp(`(?<![\\w$])${n}\\s*=\\s*\\{\\s*$`).test(t))return{call:e,extra:!1,jsx:!0};let r=RegExp(`(\\??\\.)?(?<![\\w$])${n}\\s*(?:<[^<>]*>)?\\s*\\(([^()]*)$`).exec(t);return r?{call:`${r[1]?`.`:``}${e}`,extra:r[2].trim()!==``,jsx:!1}:null}function ge(e,t,n){let r=ce(e);if(!r||!t||n)return null;let i=me(t.head);if(!i)return null;let[,a,o]=r;if(a===`iife`)return`(${i.text})()`;if(a===`anonymous`||!o)return i.text;let s=he(o,t.before);return s?.jsx?`${o}={${i.text}}`:!s&&ue.has(o)?i.text:`${s?.call??o}(${s?.extra?`…, `:``}${i.text})`}function _e(e,t){let n=t instanceof Set?t:new Set(t),r=re(e);for(r.pop();r.length>0;){let e=r.join(`.`);if(n.has(e))return e;r.pop()}return le(e)&&n.has(`<module>`)&&e!==`<module>`?`<module>`:null}function ve(e,t,n,r){let i=ce(e);if(!i)return null;let[,a,o]=i,s=!r||r===`<module>`,c=s?`the file's top level`:oe(r),l=t?me(t.head):null,u=l?l.arrow?`An arrow function`:`A function expression`:`A function`;if(a===`iife`)return`A function run where it is written (an immediately invoked function), in ${c} (line ${n}).`;if(a===`anonymous`||!o)return`${u} with no name, in ${c} (line ${n}).`;let d=t?he(o,t.before):null,f=d?.jsx?o:`${d?.call??o}()`;return`${u} handed to ${f} in ${c} (line ${n}). It has no name in the code; ${d?.jsx?`it runs when ${o} fires`:`${f} runs it`}, not ${s?`the top level`:c}.`}function ye(e){let t=ae(e.qualifiedName,e.evidence.span.start.line,e.title);return{name:ge(e.qualifiedName,e.code,e.title)??t.name,parent:t.parent,unnamed:le(e.qualifiedName)&&!e.title}}function be(e){let t=ae(e.name,e.line,e.title),n=ge(e.name,e.code,e.title),r=le(e.name)&&!e.title;return{name:`${r?`λ `:``}${n??t.name}`,parent:e.suite?`“${e.suite}”`:t.parent,unnamed:r,test:e.title!==void 0||e.suite!==void 0}}function xe(e){let{name:t,parent:n}=be(e);return n?`${t} (in ${n})`:t}function Se(e){return{stage1:`in-file analysis (Stage 1)`,"template-link":`template linking`,stage2:`import analysis (Stage 2)`}[e]??e}function Ce(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<60?`just now`:t<3600?`${Math.round(t/60)} min ago`:t<86400?`${Math.round(t/3600)} h ago`:`${Math.round(t/86400)} days ago`}function we(e,t=56){if(e.length<=t)return e;let n=e.split(`/`);if(n.length<3)return e;let r=n.pop(),i=n.shift();for(;n.length>0&&i.length+r.length+n[n.length-1].length+4<=t;)r=`${n.pop()}/${r}`;return`${i}/…/${r}`}var Te=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),X=e(((e,t)=>{t.exports=Te()}))(),Ee=/^(who calls|callers of|what does|where is|functions in|open questions in)\s+(\S{2,})$/i;function De({project:e,modelName:t,disabled:n,loading:r,suggestions:i,recent:a,onAsk:o,busy:s,handle:c,palette:l,onOpenFunction:u}){let[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1),b=e=>g(()=>{let t=typeof e==`function`?e(x.current):e;return t>=0?S.current[t]?.key??null:null}),x=(0,y.useRef)(-1),S=(0,y.useRef)([]),C=(0,y.useRef)(u);C.current=u;let w=(0,y.useRef)(null),[T,E]=(0,y.useState)([]),[D,O]=(0,y.useState)(new Map);(0,y.useEffect)(()=>{let t=Ee.exec(d.trim());if(!t||!e)return E([]);let[,n,r]=t,i=/^(functions in|open questions in)$/i.test(n)?`File`:`Function`,a=!1,o=setTimeout(()=>{Y.search(e,i,r,30).then(e=>{if(a)return;let t=/^what does$/i.test(n)?` call`:/^where is$/i.test(n)?` defined`:``,o=r.toLowerCase(),s=/(^|\/)(__tests__|tests?|e2e|specs?)\/|\.(test|spec)\.[a-z]+$/i,c=e=>e.toLowerCase()===o?0:e.toLowerCase().startsWith(o)?1:2,l=[...e.results].filter(e=>!e.name.includes(`<`)).sort((e,t)=>c(e.name)-c(t.name)||Number(s.test(e.path))-Number(s.test(t.path))||(t.callers??0)-(e.callers??0)).slice(0,6),u=l.map(e=>`${n.toLowerCase()} ${i===`File`?e.path:e.name}${t}`);E(u),O(new Map(l.map((e,t)=>[u[t],i===`File`?``:`${e.path.split(`/`).pop()}${e.callers===void 0?``:` · ${e.callers} caller${e.callers===1?``:`s`}`}`])))},()=>!a&&E([]))},120);return()=>{a=!0,clearTimeout(o)}},[d,e]);let[k,A]=(0,y.useState)([]);(0,y.useEffect)(()=>{let t=d.trim();if(!p||!e||!C.current||t.length<2||Ee.test(t)||/\s/.test(t))return A([]);let n=!1,r=setTimeout(()=>{Y.search(e,`Function`,t,6).then(e=>!n&&A(e.results.filter(e=>!e.name.includes(`<`))),()=>!n&&A([]))},120);return()=>{n=!0,clearTimeout(r)}},[d,e,p]);let j=(0,y.useMemo)(()=>{let e=[...T,...a,...i.filter(e=>!a.includes(e))],t=d.trim().toLowerCase(),n=new Set;return(t?e.filter(e=>T.includes(e)||e.toLowerCase().includes(t)&&e.toLowerCase()!==t):e).filter(e=>!n.has(e)&&n.add(e)).slice(0,l?6:8)},[T,a,i,d,l]),M=(0,y.useMemo)(()=>{let e=j.map(e=>({key:`ask:${e}`,group:`Ask`,label:e,...D.get(e)?{detail:D.get(e)}:a.includes(e)?{detail:`recent`}:{},run:()=>z(e)})),t=k.map(e=>({key:`fn:${e.id}`,group:`Functions`,label:e.name,detail:e.path,run:()=>C.current?.(e.id,e.id.slice(0,e.id.indexOf(`:`,e.id.indexOf(`:`)+1)))}));return[...e,...t,...l&&p?l(d):[]]},[j,k,l,d,D,a,p]);S.current=M;let N=d.trim(),P=h===null&&!_&&!/\s/.test(N)&&/[A-Z_.$0-9]/.test(N.slice(1))&&N.length>=2?M.findIndex(e=>e.group!==`Ask`):-1,F=h===null?P:M.findIndex(e=>e.key===h);x.current=h===null?-1:F;let I=p&&M.length>0;(0,y.useImperativeHandle)(c,()=>({prefill:e=>{f(e),m(!1),b(-1),requestAnimationFrame(()=>{let t=w.current;if(!t)return;t.focus();let n=e.indexOf(`<`),r=e.indexOf(`>`,n);n>=0&&r>n&&t.setSelectionRange(n,r+1)})}})),(0,y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),w.current?.focus(),w.current?.select(),m(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let L=(0,y.useRef)(void 0),R=()=>{m(!1),b(-1)},z=e=>{let t=e.trim();!t||n||t.includes(`<`)||(o(t),f(t),R(),w.current?.blur())};return(0,X.jsxs)(`form`,{className:`ask`,role:`search`,onSubmit:e=>{e.preventDefault();let t=F>=0?M[F]:void 0;t?(t.run(),t.group!==`Ask`&&(f(``),R(),w.current?.blur())):z(d)},children:[(0,X.jsx)(`input`,{ref:w,"data-testid":`ask`,"aria-label":`Ask about this code`,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":I?`ask-options`:void 0,"aria-activedescendant":I&&F>=0?`ask-option-${F}`:void 0,placeholder:r?`Loading…`:n?`Open a project to ask about its code`:l?`Ask, or go to a function, file, group or command… ⌘K`:`Ask about this code… ⌘K`,disabled:n,value:d,onChange:e=>{clearTimeout(L.current),v(!1),f(e.target.value),m(!0),b(-1)},onFocus:()=>{clearTimeout(L.current),m(!0)},onBlur:()=>{L.current=setTimeout(R,120)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),m(!0),b(e=>Math.min(M.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),(h===null||x.current<=0)&&v(!0),b(e=>Math.max(-1,e-1))):e.key===`Escape`?(R(),w.current?.blur()):e.key===`Enter`&&e.shiftKey&&(e.preventDefault(),z(d))}}),s&&(0,X.jsx)(`span`,{className:`spinner`,"aria-label":`Answering`}),I&&(0,X.jsxs)(`ul`,{className:`ask-options`,id:`ask-options`,role:`listbox`,"data-testid":`ask-options`,children:[M.map((e,t)=>(0,X.jsxs)(y.Fragment,{children:[(t===0||M[t-1].group!==e.group)&&(0,X.jsx)(`li`,{className:`ask-group`,role:`presentation`,"aria-hidden":`true`,children:e.group}),(0,X.jsxs)(`li`,{id:`ask-option-${t}`,role:`option`,"aria-selected":t===F,className:t===F?`active`:``,"data-group":e.group,"data-key":e.key,"data-testid":`palette-item`,"aria-label":e.group===`Ask`?e.label:`${e.group}: ${e.label}`,onMouseDown:t=>{t.preventDefault(),e.run(),e.group!==`Ask`&&(f(``),R(),w.current?.blur())},children:[(0,X.jsx)(`span`,{children:e.label}),e.detail&&(0,X.jsx)(`small`,{className:`muted`,children:e.detail})]})]},e.key)),(0,X.jsx)(`li`,{className:`ask-hint`,role:`presentation`,children:t?`Or ask anything in plain words: it goes to ${t.split(`/`).pop()} (your question and the names and paths it looks up are sent to the provider).`:`These are answered offline. To ask anything else, add a model in Settings.`})]})]})}function Oe(e,t){let n=[],r=e;for(;;){let e=null;for(let n of t){let t=r.indexOf(n.text);t<0||(!e||t<e.at||t===e.at&&n.text.length>e.c.text.length)&&(e={at:t,c:n})}if(!e)break;n.push(r.slice(0,e.at),e.c),r=r.slice(e.at+e.c.text.length)}return n.push(r),n}var ke=`<(?:callback|module|iife|anonymous|object)(?::[^<>\\s]*)?>(?:#\\d+)?`,Ae=RegExp(`(?<![\\w$])(?:[A-Za-z_$][\\w$]*(?:\\.(?:[\\w$]+|${ke}))*\\.${ke}(?:\\.(?:[\\w$]+|${ke}))*|${ke})`,`g`);function je({answer:e,onCite:t}){let n=e.citations??[],r=new Map,i=new Map;for(let t of[...e.results,...e.lookups??[]])t.kind===`function`&&t.line!==void 0&&r.set(t.label,t.line),(t.kind===`function`||t.kind===`call`)&&t.title&&i.set(t.label,t.title);let a=e=>e.replace(Ae,e=>oe(e,r.get(e),i.get(e))),o=(e,r)=>Oe(e,n).map((e,n)=>typeof e==`string`?a(e):e.verified?(0,X.jsx)(`button`,{className:`cite`,title:e.target?`Returned by a tool. Open it`:`Returned by a tool`,onClick:()=>t(e),children:e.text},`${r}.${n}`):(0,X.jsxs)(`span`,{className:`cite unverified`,title:`Not returned by any tool: check it`,"aria-label":`${e.text}, not returned by any tool`,children:[e.text,` ⚠`]},`${r}.${n}`)),s=(e,t)=>e.split(/(`[^`]+`|\*\*[^*]+\*\*)/).map((e,n)=>e.startsWith("`")&&e.endsWith("`")&&e.length>1?(0,X.jsx)(`code`,{children:o(e.slice(1,-1),`${t}.${n}`)},`${t}.${n}`):e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3?(0,X.jsx)(`strong`,{children:o(e.slice(2,-2),`${t}.${n}`)},`${t}.${n}`):(0,X.jsx)(`span`,{children:o(e,`${t}.${n}`)},`${t}.${n}`)),c=[];for(let t of(e.prose??``).split(`
|
|
10
|
+
`)){let e=/^\s*(?:[-*•]|\d+[.)])\s+(.*)$/.exec(t),n=c[c.length-1];e?n?.list?n.lines.push(e[1]):c.push({list:!0,lines:[e[1]]}):t.trim()?n&&!n.list&&n.lines.length?n.lines.push(t):c.push({list:!1,lines:[t]}):c.push({list:!1,lines:[]})}return(0,X.jsx)(`div`,{className:`prose`,"data-testid":`answer-prose`,children:c.filter(e=>e.lines.length).map((e,t)=>e.list?(0,X.jsx)(`ul`,{children:e.lines.map((e,n)=>(0,X.jsx)(`li`,{children:s(e,`${t}.${n}`)},n))},t):(0,X.jsx)(`p`,{children:s(e.lines.join(` `),String(t))},t))})}var Me=20;function Ne({r:e,active:t,onOpen:n}){let r=e.kind===`function`||e.kind===`call`?ae(e.label,e.kind===`call`?e.fnLine:e.line,e.title).name:e.label.replace(/^\? /,``);return e.kind===`group`||!e.file?(0,X.jsxs)(`div`,{className:`result static`,children:[(0,X.jsx)(`span`,{className:`label`,children:r}),e.detail&&(0,X.jsx)(`small`,{children:e.detail})]}):(0,X.jsxs)(`button`,{className:`result${t?` active`:``}`,"data-kind":e.kind,"aria-current":t||void 0,onClick:()=>n(e),children:[(0,X.jsxs)(`span`,{className:`label`,children:[(0,X.jsx)(`span`,{className:`kind ${e.kind}`,"aria-hidden":`true`,children:Ie[e.kind]}),` `,r]}),e.detail&&(0,X.jsx)(`small`,{children:e.detail})]})}function Pe(e){let t=e.model??`the model`,n=e.toolCalls.length,r=e.citations??[],i=r.filter(e=>e.verified).length,a=[t,n===0?`no lookups`:`${n} lookup${n===1?``:`s`}`];return r.length&&a.push(`${i} of ${r.length} citation${r.length===1?``:`s`} checked ✓`),a.push(n===0?`only your question was sent`:`your question and the names, paths and lines it looked up were sent to the provider`),a.join(` · `)}function Fe({answer:e,busy:t,pending:n,elapsed:r,modelConfigured:i,selectedId:a,wide:o,onWide:s,onOpen:c,onAsk:l,onCancel:u,onTemplate:d,onSettings:f,onShowQuestions:p}){let[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=(0,y.useRef)(null);(0,y.useEffect)(()=>{h(!1),_.current?.focus({preventScroll:!0}),g.current?.closest(`aside`)?.scrollTo({top:0})},[e]);let v=t&&(0,X.jsxs)(`p`,{className:`pending`,"data-testid":`answer-pending`,children:[`Answering “`,n,`”…`,r>=2?` ${r} s`:``,` `,(0,X.jsx)(`button`,{className:`link`,onClick:u,"data-testid":`ask-cancel`,children:`Cancel`})]});if(t&&!e)return(0,X.jsx)(`div`,{className:`answer`,children:v});if(!e)return(0,X.jsxs)(`div`,{className:`hint`,children:[(0,X.jsx)(`p`,{children:`Ask a question in the bar above (⌘K), for example “who calls <function>” or “largest files”.`}),!i&&(0,X.jsxs)(`p`,{children:[`Built-in questions work offline. To ask anything,`,` `,(0,X.jsx)(`button`,{className:`link`,onClick:f,children:`add a model in Settings`}),`.`]})]});let b=m?e.results:e.results.slice(0,Me),x=e.lookups??[],S=e=>{e.target&&c(e.target)},C=(e.suggestions??[]).filter(e=>e.includes(`<`)),w=(e.suggestions??[]).filter(e=>!e.includes(`<`)),T=e.error!==void 0,E=T&&/auth|not-found|rate-limit/.test(e.error.code);return(0,X.jsxs)(`div`,{className:`answer${t?` busy`:``}`,"data-testid":`answer`,"aria-busy":t,ref:g,children:[v,(0,X.jsxs)(`div`,{className:`answer-head`,children:[(0,X.jsx)(`h3`,{className:`question`,tabIndex:-1,ref:_,children:e.question}),(0,X.jsx)(`button`,{className:`icon`,onClick:()=>s(!o),title:o?`Narrower panel`:`Wider panel`,"aria-label":o?`Narrower panel`:`Wider panel`,"data-testid":`answer-wide`,children:o?`⇥`:`⇤`})]}),e.via===`model`&&!T&&(0,X.jsx)(`p`,{className:`via muted small`,"data-testid":`answer-via`,children:Pe(e)}),T?(0,X.jsxs)(`div`,{className:`note`,"data-testid":`answer-summary`,role:`alert`,children:[(0,X.jsx)(`p`,{children:e.error.message}),(0,X.jsx)(`button`,{className:`link`,onClick:()=>l(e.question,e.mode===`model`||e.via===`model`?`model`:void 0),children:`Retry`}),E&&(0,X.jsxs)(X.Fragment,{children:[` · `,(0,X.jsx)(`button`,{className:`link`,onClick:f,children:`Open Settings`})]})]}):e.via===`model`&&e.prose?(0,X.jsxs)(X.Fragment,{children:[e.ungrounded&&(0,X.jsx)(`p`,{className:`note`,"data-testid":`answer-ungrounded`,children:`Not from your code: the model answered without looking anything up in the graph. Ask about a function or file by name for an answer backed by the graph.`}),(0,X.jsx)(je,{answer:e,onCite:S})]}):(0,X.jsx)(`p`,{className:`summary`,"data-testid":`answer-summary`,children:e.summary}),e.via===`grammar`&&(0,X.jsxs)(`p`,{className:`via muted small`,"data-testid":`answer-via`,children:[`Answered from the analysis; no model was used.`,i&&(0,X.jsxs)(X.Fragment,{children:[` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>l(e.question,`model`),"data-testid":`ask-model`,children:`Ask the model instead`})]})]}),e.via===`help`&&!i&&(0,X.jsxs)(`p`,{className:`via muted small`,"data-testid":`answer-via`,children:[`No model is configured; nothing was sent anywhere.`,` `,(0,X.jsx)(`button`,{className:`link`,onClick:f,children:`Set up a model`})]}),e.intent===`open-questions-in-file`&&e.results[0]?.file&&(0,X.jsx)(`p`,{className:`small`,children:(0,X.jsx)(`button`,{className:`link`,onClick:()=>p(e.results[0].file),children:`Show them grouped in the Open questions tab`})}),e.note&&(0,X.jsx)(`p`,{className:`note`,children:e.note}),e.truncated&&(0,X.jsxs)(`p`,{className:`note`,children:[`Stopped early: `,e.truncated.reason,`.`]}),b.length>0&&(0,X.jsxs)(X.Fragment,{children:[e.via===`model`&&(0,X.jsx)(`h4`,{className:`results-title`,children:`In this answer`}),(0,X.jsx)(`ul`,{className:`results`,"data-testid":`answer-results`,children:b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(Ne,{r:e,active:e.id===a,onOpen:c})},`${e.kind}:${e.id}`))})]}),e.results.length>Me&&!m&&(0,X.jsxs)(`button`,{className:`more`,onClick:()=>h(!0),"data-testid":`answer-more`,children:[`Show all `,e.results.length]}),x.length>0&&(0,X.jsxs)(`details`,{className:`lookups`,open:b.length===0,"data-testid":`answer-lookups`,children:[(0,X.jsxs)(`summary`,{children:[`What the model looked at (`,e.toolCalls.length,` lookup`,e.toolCalls.length===1?``:`s`,`, `,x.length,` item`,x.length===1?``:`s`,`)`]}),(0,X.jsx)(`ul`,{className:`results`,children:x.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(Ne,{r:e,active:e.id===a,onOpen:c})},`${e.kind}:${e.id}`))})]}),(w.length>0||C.length>0)&&(0,X.jsxs)(`div`,{className:`chips`,"aria-label":`Suggested questions`,children:[w.map(e=>(0,X.jsx)(`button`,{className:`chip`,onClick:()=>l(e),children:e},e)),C.map(e=>(0,X.jsx)(`button`,{className:`chip template`,onClick:()=>d(e),title:`Fill in the name`,children:e},e))]})]})}var Ie={function:`ƒ`,call:`→`,file:`▤`,site:`?`,group:`#`};function Le({project:e,id:t,start:n=!1}){let[r,i]=(0,y.useState)(null),a=()=>{i({id:t,items:null}),Y.explain(e,t).then(e=>i(n=>n?.id===t?{id:t,items:e.items}:n),e=>i(n=>n?.id===t?{id:t,items:[{id:`error`,summary:`Couldn't explain this: ${e.message}`,steps:[]}]}:n))};(0,y.useEffect)(()=>{n&&a()},[n,t]);let o=r?.id===t?r:null;return(0,X.jsx)(`div`,{className:`explain`,"data-testid":`explain`,children:o===null?(0,X.jsx)(`button`,{className:`button-link`,"data-command":`explain`,onClick:a,children:`Explain`}):o.items===null?(0,X.jsx)(`p`,{className:`muted small`,children:`Explaining…`}):o.items.map(e=>(0,X.jsxs)(`div`,{"data-testid":`explanation`,children:[(0,X.jsx)(`p`,{children:e.summary}),(0,X.jsx)(`ol`,{className:`steps`,children:e.steps.map((e,t)=>(0,X.jsx)(`li`,{children:e.detail},t))}),e.toResolve&&(0,X.jsxs)(`p`,{className:`small`,"data-testid":`explain-to-resolve`,children:[`To resolve it: `,e.toResolve]}),e.names&&e.names.length>0&&(0,X.jsx)(`ul`,{className:`explain-names`,"data-testid":`explain-names`,children:e.names.map(e=>(0,X.jsx)(`li`,{children:e.summary},e.local))})]},e.id))})}var Re=[[`multi-repo`,`Several repositories per project`],[`history`,`History older than 30 days`],[`agents`,`Agent tools`],[`topology`,`Deployment topology`],[`runtime`,`Runtime confirmation`],[`sharing`,`Sharing`],[`sso`,`Single sign-on`],[`audit`,`Audit log`],[`retention`,`Retention settings`]],ze={javascript:`JavaScript`,typescript:`TypeScript`,python:`Python`,go:`Go`,rust:`Rust`,java:`Java`,kotlin:`Kotlin`},Be=new Set([`javascript`,`typescript`]);function Ve({license:e}){return e.source===`beta`?(0,X.jsxs)(`p`,{"data-testid":`license-source`,"data-source":`beta`,children:[(0,X.jsx)(`strong`,{children:`Beta license.`}),` Every language and feature is enabled until the paid launch: nothing is restricted.`]}):e.source===`free`?(0,X.jsxs)(`p`,{"data-testid":`license-source`,"data-source":`free`,children:[(0,X.jsx)(`strong`,{children:`Free.`}),` JavaScript and TypeScript, one repository per project, and the last 30 days of history.`]}):(0,X.jsxs)(`p`,{"data-testid":`license-source`,"data-source":`license`,children:[(0,X.jsxs)(`strong`,{children:[`License `,e.license,e.tier?` (${e.tier})`:``]}),` `,`for `,e.holder,e.validUntil?`, valid until ${e.validUntil}`:``,e.seats?`, ${e.seats} seat${e.seats===1?``:`s`}`:``,`.`]})}function He({onChanged:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!1;return Y.license().then(t=>!e&&n(t),t=>!e&&c({ok:!1,text:t.message})),()=>{e=!0}},[]);let l=async(t,r)=>{o(!0),c(null);try{return n(await t()),c({ok:!0,text:r}),e(),!0}catch(e){return c({ok:!1,text:e.message??String(e)}),!1}finally{o(!1)}};if(!t)return s?(0,X.jsx)(`p`,{className:`error`,children:s.text}):(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let u=t.license;return(0,X.jsxs)(`div`,{className:`license-tab`,"data-testid":`license-tab`,children:[(0,X.jsx)(Ve,{...t}),u.problem&&(0,X.jsxs)(`p`,{className:`error`,role:`alert`,"data-testid":`license-problem`,"data-status":u.problem.status,children:[`The installed license isn't used: `,u.problem.message,`.`]}),u.source===`beta`&&(0,X.jsx)(`p`,{className:`muted small`,"data-testid":`license-beta-note`,children:`A license key replaces the beta license: only what the license includes stays enabled.`}),(0,X.jsx)(`h4`,{className:`muted small`,children:`Languages the license covers`}),(0,X.jsx)(`p`,{"data-testid":`license-languages`,children:Object.keys(ze).filter(e=>u.languages.includes(e)).map(e=>ze[e]).join(`, `)}),u.languages.some(e=>e in ze&&!Be.has(e))&&(0,X.jsx)(`p`,{className:`muted small`,"data-testid":`license-languages-note`,children:`veoflow analyzes JavaScript and TypeScript today; the other languages are covered once veoflow reads them.`}),(0,X.jsx)(`h4`,{className:`muted small`,children:`Features`}),(0,X.jsx)(`ul`,{className:`license-features`,"data-testid":`license-features`,children:Re.map(([e,t])=>{let n=u.features.includes(e);return(0,X.jsxs)(`li`,{"data-feature":e,"data-included":n,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:n?`✓`:`–`}),` `,t,!n&&(0,X.jsx)(`span`,{className:`muted small`,children:` · not included`})]},e)})}),(0,X.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),l(()=>Y.installLicense(r),`License installed.`).then(e=>e&&i(``))},children:[(0,X.jsxs)(`label`,{children:[u.installed?`Replace the license key`:`Add a license key`,(0,X.jsx)(`textarea`,{"data-testid":`license-key`,value:r,spellCheck:!1,autoComplete:`off`,placeholder:`Paste the key from your license email`,onChange:e=>i(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`actions`,children:[u.installed&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`license-refresh`,disabled:a,onClick:()=>void l(()=>Y.refreshLicense(),`Checked the installed license again (offline: veoflow never phones home).`),children:`Check again`}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,"data-testid":`license-install`,disabled:a||!r.trim(),children:u.installed?`Replace`:`Add`})]})]}),s&&(0,X.jsx)(`p`,{className:s.ok?`muted small`:`error`,role:s.ok?`status`:`alert`,"data-testid":`license-note`,children:s.text})]})}function Ue({project:e,run:t,refresh:n,onManage:r}){let[i,a]=(0,y.useState)([]);return(0,y.useEffect)(()=>{let t=!1;return Y.license(e).then(e=>!t&&a(e.findings??[]),()=>!t&&a([])),()=>{t=!0}},[e,t,n]),i.length===0?null:(0,X.jsxs)(`div`,{className:`license-notices`,role:`note`,"data-testid":`license-notices`,children:[(0,X.jsx)(`ul`,{children:i.map(e=>(0,X.jsx)(`li`,{"data-kind":e.kind,children:e.message},e.id))}),(0,X.jsx)(`span`,{className:`muted small`,children:`As of the last analysis. `}),(0,X.jsx)(`button`,{className:`link small`,"data-command":`manage-license`,onClick:r,children:`License…`})]})}var We={selector:`.only-out`,style:{display:`none`}};function Ge(e,t){let n=e.elements(`.only-out`).nonempty();e.batch(()=>{if(e.elements().removeClass(`only-out`),!t)return;let n=e.getElementById(t);if(n.empty()||!n.isNode())return;let r=n.closedNeighborhood();e.elements().not(r).not(`[kind = "box"]`).addClass(`only-out`)}),(t&&!e.getElementById(t).empty()||!t&&n)&&e.fit(e.elements().not(`.only-out`).not(`.hidden`),40)}function Ke(e){if(!e)return null;let t=new Map,n=new Map,r=new Map,i=new Map;for(let a of e.items)(a.type===`IMPORTS`||a.type===`UnresolvedImport`)&&a.file&&i.set(a.file,`changed`),t.set(a.id,a.change),a.type===`File`&&n.set(a.id,a.change),a.type===`Group`&&r.set(a.id,a.change);for(let t of e.items)t.file&&t.type!==`File`&&!n.has(t.file)&&n.set(t.file,`changed`);for(let t of e.files)t.group&&!r.has(t.group.id)&&t.added+t.removed+t.changed>0&&r.set(t.group.id,`changed`);return{byId:t,byFile:n,byGroup:r,removed:e.items.filter(e=>e.change===`removed`),importsByFile:i,fileFacts:new Map(e.items.filter(e=>e.type===`File`).map(e=>[e.id,e.change]))}}var qe=e=>e?`diff-${e}`:``,Je=[{selector:`node.diff-added`,style:{"border-width":3,"border-color":`#1f5fd6`,"border-style":`solid`}},{selector:`node.diff-removed`,style:{"border-width":2,"border-color":`#d9730d`,"border-style":`dashed`,opacity:.75}},{selector:`node.diff-changed`,style:{"border-width":4,"border-color":`#7a3fc4`,"border-style":`double`}},{selector:`edge.diff-added`,style:{"line-color":`#1f5fd6`,"target-arrow-color":`#1f5fd6`,width:3}},{selector:`edge.diff-removed`,style:{"line-color":`#d9730d`,"target-arrow-color":`#d9730d`,"line-style":`dashed`,width:2}},{selector:`edge.diff-changed`,style:{"line-color":`#7a3fc4`,"target-arrow-color":`#7a3fc4`,"line-style":`dotted`,width:3}}];function Ye(e,t){let n=t?[...t.byFile.keys()].map(e=>e.slice(e.indexOf(`:`)+1)):[];e.batch(()=>{e.elements().removeClass(`diff-added diff-removed diff-changed`),t&&e.elements().forEach(e=>{let r=e.id(),i=e.data(),a=t.byGroup.get(r)??t.byFile.get(r)??t.byId.get(r)??(i.edge?t.byId.get(i.edge):void 0)??(/^(caller|callee)\|/.test(r)?t.byId.get(r.slice(r.indexOf(`|`)+1)):void 0)??(i.file&&!/^(caller|callee)\|/.test(r)?t.fileFacts.get(i.file):void 0)??(i.calls??[]).map(e=>t.byId.get(e)).find(Boolean)??(i.kind===`imports`&&i.source?t.importsByFile.get(i.source):void 0)??(i.kind===`folder`&&i.path!==void 0&&n.some(e=>e.startsWith(`${i.path}/`))?`changed`:void 0);a&&e.addClass(`diff-${a}`)})})}function Xe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ze(e){if(Array.isArray(e))return e}function Qe(e){if(Array.isArray(e))return Xe(e)}function $e(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,dt(r.key),r)}}function tt(e,t,n){return t&&et(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nt(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=pt(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function rt(e,t,n){return(t=dt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function it(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function at(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ot(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function st(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ct(e,t){return Ze(e)||at(e,t)||pt(e,t)||ot()}function lt(e){return Qe(e)||it(e)||pt(e)||st()}function ut(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function dt(e){var t=ut(e,`string`);return typeof t==`symbol`?t:t+``}function ft(e){"@babel/helpers - typeof";return ft=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ft(e)}function pt(e,t){if(e){if(typeof e==`string`)return Xe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(e,t):void 0}}var mt=typeof window>`u`?null:window,ht=mt?mt.navigator:null;mt&&mt.document;var gt=ft(``),_t=ft({}),vt=ft(function(){}),yt=typeof HTMLElement>`u`?`undefined`:ft(HTMLElement),bt=function(e){return e&&e.instanceString&&xt(e.instanceString)?e.instanceString():null},Z=function(e){return e!=null&&ft(e)==gt},xt=function(e){return e!=null&&ft(e)===vt},St=function(e){return!Dt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ct=function(e){return e!=null&&ft(e)===_t&&!St(e)&&e.constructor===Object},wt=function(e){return e!=null&&ft(e)===_t},Q=function(e){return e!=null&&ft(e)===ft(1)&&!isNaN(e)},Tt=function(e){return Q(e)&&Math.floor(e)===e},Et=function(e){if(yt!==`undefined`)return e!=null&&e instanceof HTMLElement},Dt=function(e){return Ot(e)||kt(e)},Ot=function(e){return bt(e)===`collection`&&e._private.single},kt=function(e){return bt(e)===`collection`&&!e._private.single},At=function(e){return bt(e)===`core`},jt=function(e){return bt(e)===`stylesheet`},Mt=function(e){return bt(e)===`event`},Nt=function(e){return!!(e==null||e===``||e.match(/^\s+$/))},Pt=function(e){return typeof HTMLElement>`u`?!1:e instanceof HTMLElement},Ft=function(e){return Ct(e)&&Q(e.x1)&&Q(e.x2)&&Q(e.y1)&&Q(e.y2)},It=function(e){return wt(e)&&xt(e.then)},Lt=function(){return ht&&ht.userAgent.match(/msie|trident|edge/i)},Rt=function(e,t){t||=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return`undefined`;for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join(`$`)};var n=function(){var r=this,i=arguments,a,o=t.apply(r,i),s=n.cache;return(a=s[o])||(a=s[o]=e.apply(r,i)),a};return n.cache={},n},zt=Rt(function(e){return e.replace(/([A-Z])/g,function(e){return`-`+e.toLowerCase()})}),Bt=Rt(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Vt=Rt(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+`$`+t}),Ht=function(e){return Nt(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ut=function(e,t){return e.slice(-1*t.length)===t},Wt=`(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))`,Gt=`rgb[a]?\\((`+Wt+`[%]?)\\s*,\\s*(`+Wt+`[%]?)\\s*,\\s*(`+Wt+`[%]?)(?:\\s*,\\s*(`+Wt+`))?\\)`,Kt=`rgb[a]?\\((?:`+Wt+`[%]?)\\s*,\\s*(?:`+Wt+`[%]?)\\s*,\\s*(?:`+Wt+`[%]?)(?:\\s*,\\s*(?:`+Wt+`))?\\)`,qt=`hsl[a]?\\((`+Wt+`)\\s*,\\s*(`+Wt+`[%])\\s*,\\s*(`+Wt+`[%])(?:\\s*,\\s*(`+Wt+`))?\\)`,Jt=`hsl[a]?\\((?:`+Wt+`)\\s*,\\s*(?:`+Wt+`[%])\\s*,\\s*(?:`+Wt+`[%])(?:\\s*,\\s*(?:`+Wt+`))?\\)`,Yt=`\\#[0-9a-fA-F]{3}`,Xt=`\\#[0-9a-fA-F]{6}`,Zt=function(e,t){return e<t?-1:+(e>t)},Qt=function(e,t){return-1*Zt(e,t)},$t=Object.assign==null?function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e}:Object.assign.bind(Object),en=function(e){if(!(e.length!==4&&e.length!==7||e[0]!==`#`)){var t=e.length===4,n,r,i,a=16;return t?(n=parseInt(e[1]+e[1],a),r=parseInt(e[2]+e[2],a),i=parseInt(e[3]+e[3],a)):(n=parseInt(e[1]+e[2],a),r=parseInt(e[3]+e[4],a),i=parseInt(e[5]+e[6],a)),[n,r,i]}},tn=function(e){var t,n,r,i,a,o,s,c;function l(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=RegExp(`^`+qt+`$`).exec(e);if(u){if(n=parseInt(u[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,r=parseFloat(u[2]),r<0||r>100||(r/=100,i=parseFloat(u[3]),i<0||i>100)||(i/=100,a=u[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(r===0)o=s=c=Math.round(i*255);else{var d=i<.5?i*(1+r):i+r-i*r,f=2*i-d;o=Math.round(255*l(f,d,n+1/3)),s=Math.round(255*l(f,d,n)),c=Math.round(255*l(f,d,n-1/3))}t=[o,s,c,a]}return t},nn=function(e){var t,n=RegExp(`^`+Gt+`$`).exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if(a[a.length-1]===`%`&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;t.push(c)}}return t},rn=function(e){return on[e.toLowerCase()]},an=function(e){return(St(e)?e:null)||rn(e)||en(e)||nn(e)||tn(e)},on={transparent:[0,0,0,0],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],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],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],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]},sn=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Ct(a))throw Error(`Tried to set map with object key`);i<n.length-1?(t[a]??(t[a]={}),t=t[a]):t[a]=e.value}},cn=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Ct(a))throw Error(`Tried to get map with object key`);if(t=t[a],t==null)return t}return t},ln=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function un(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var dn,fn;function pn(){if(fn)return dn;fn=1;function e(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}return dn=e,dn}var mn,hn;function gn(){return hn?mn:(hn=1,mn=typeof ln==`object`&&ln&&ln.Object===Object&&ln,mn)}var _n,vn;function yn(){if(vn)return _n;vn=1;var e=gn(),t=typeof self==`object`&&self&&self.Object===Object&&self;return _n=e||t||Function(`return this`)(),_n}var bn,xn;function Sn(){if(xn)return bn;xn=1;var e=yn();return bn=function(){return e.Date.now()},bn}var Cn,wn;function Tn(){if(wn)return Cn;wn=1;var e=/\s/;function t(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}return Cn=t,Cn}var En,Dn;function On(){if(Dn)return En;Dn=1;var e=Tn(),t=/^\s+/;function n(n){return n&&n.slice(0,e(n)+1).replace(t,``)}return En=n,En}var kn,An;function jn(){return An?kn:(An=1,kn=yn().Symbol,kn)}var Mn,Nn;function Pn(){if(Nn)return Mn;Nn=1;var e=jn(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(e){var t=n.call(e,i),a=e[i];try{e[i]=void 0;var o=!0}catch{}var s=r.call(e);return o&&(t?e[i]=a:delete e[i]),s}return Mn=a,Mn}var Fn,In;function Ln(){if(In)return Fn;In=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return Fn=t,Fn}var Rn,zn;function Bn(){if(zn)return Rn;zn=1;var e=jn(),t=Pn(),n=Ln(),r=`[object Null]`,i=`[object Undefined]`,a=e?e.toStringTag:void 0;function o(e){return e==null?e===void 0?i:r:a&&a in Object(e)?t(e):n(e)}return Rn=o,Rn}var Vn,Hn;function Un(){if(Hn)return Vn;Hn=1;function e(e){return typeof e==`object`&&!!e}return Vn=e,Vn}var Wn,Gn;function Kn(){if(Gn)return Wn;Gn=1;var e=Bn(),t=Un(),n=`[object Symbol]`;function r(r){return typeof r==`symbol`||t(r)&&e(r)==n}return Wn=r,Wn}var qn,Jn;function Yn(){if(Jn)return qn;Jn=1;var e=On(),t=pn(),n=Kn(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function c(c){if(typeof c==`number`)return c;if(n(c))return r;if(t(c)){var l=typeof c.valueOf==`function`?c.valueOf():c;c=t(l)?l+``:l}if(typeof c!=`string`)return c===0?c:+c;c=e(c);var u=a.test(c);return u||o.test(c)?s(c.slice(2),u?2:8):i.test(c)?r:+c}return qn=c,qn}var Xn,Zn;function Qn(){if(Zn)return Xn;Zn=1;var e=pn(),t=Sn(),n=Yn(),r=`Expected a function`,i=Math.max,a=Math.min;function o(o,s,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof o!=`function`)throw TypeError(r);s=n(s)||0,e(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?i(n(c.maxWait)||0,s):d,v=`trailing`in c?!!c.trailing:v);function y(e){var t=l,n=u;return l=u=void 0,h=e,f=o.apply(n,t),f}function b(e){return h=e,p=setTimeout(C,s),g?y(e):f}function x(e){var t=e-m,n=e-h,r=s-t;return _?a(r,d-n):r}function S(e){var t=e-m,n=e-h;return m===void 0||t>=s||t<0||_&&n>=d}function C(){var e=t();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(t())}function D(){var e=t(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,s),y(m)}return p===void 0&&(p=setTimeout(C,s)),f}return D.cancel=T,D.flush=E,D}return Xn=o,Xn}var $n=un(Qn()),er=mt?mt.performance:null,tr=er&&er.now?function(){return er.now()}:function(){return Date.now()},nr=function(){if(mt){if(mt.requestAnimationFrame)return function(e){mt.requestAnimationFrame(e)};if(mt.mozRequestAnimationFrame)return function(e){mt.mozRequestAnimationFrame(e)};if(mt.webkitRequestAnimationFrame)return function(e){mt.webkitRequestAnimationFrame(e)};if(mt.msRequestAnimationFrame)return function(e){mt.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(tr())},1e3/60)}}(),rr=function(e){return nr(e)},ir=tr,ar=9261,or=65599,sr=5381,cr=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ar,n;n=e.next(),!n.done;)t=t*or+n.value|0;return t},lr=function(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:ar)*or+e|0},ur=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sr;return(t<<5)+t+e|0},dr=function(e,t){return e*2097152+t},fr=function(e){return e[0]*2097152+e[1]},pr=function(e,t){return[lr(e[0],t[0]),ur(e[1],t[1])]},mr=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return cr({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},hr=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return cr({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},gr=function(){return _r(arguments)},_r=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=n===0?hr(r):hr(r,t)}return t};function vr(e,t,n,r,i){var a=i*Math.PI/180;return{x:Math.cos(a)*(e-n)-Math.sin(a)*(t-r)+n,y:Math.sin(a)*(e-n)+Math.cos(a)*(t-r)+r}}var yr=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}};function br(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=vr(e.x,e.y,r,i,n),c=yr(s.x,s.y,r,i,a,o);return{x:c.x,y:c.y}}var xr=!0,Sr=console.warn!=null,Cr=console.trace!=null,wr=2**53-1||9007199254740991,Tr=function(){return!0},Er=function(){return!1},Dr=function(){return 0},Or=function(){},kr=function(e){throw Error(e)},Ar=function(e){if(e!==void 0)xr=!!e;else return xr},jr=function(e){Ar()&&(Sr?console.warn(e):(console.log(e),Cr&&console.trace()))},Mr=function(e){return $t({},e)},Nr=function(e){return e==null?e:St(e)?e.slice():Ct(e)?Mr(e):e},Pr=function(e){return e.slice()},Fr=function(e,t){for(t=e=``;e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):`-`);return t},Ir={},Lr=function(){return Ir},Rr=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=n?.[a];r[a]=o===void 0?e[a]:o}return r}},zr=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},Br=function(e){e.splice(0,e.length)},Vr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},Hr=function(e,t,n){return n&&(t=Vt(n,t)),e[t]},Ur=function(e,t,n,r){n&&(t=Vt(n,t)),e[t]=r},Wr=typeof Map<`u`?Map:function(){function e(){$e(this,e),this._obj={}}return tt(e,[{key:`set`,value:function(e,t){return this._obj[e]=t,this}},{key:`delete`,value:function(e){return this._obj[e]=void 0,this}},{key:`clear`,value:function(){this._obj={}}},{key:`has`,value:function(e){return this._obj[e]!==void 0}},{key:`get`,value:function(e){return this._obj[e]}}])}(),Gr=`undefined`,Kr=function(){function e(t){if($e(this,e),this._obj=Object.create(null),this.size=0,t!=null)for(var n=t.instanceString!=null&&t.instanceString()===this.instanceString()?t.toArray():t,r=0;r<n.length;r++)this.add(n[r])}return tt(e,[{key:`instanceString`,value:function(){return`set`}},{key:`add`,value:function(e){var t=this._obj;t[e]!==1&&(t[e]=1,this.size++)}},{key:`delete`,value:function(e){var t=this._obj;t[e]===1&&(t[e]=0,this.size--)}},{key:`clear`,value:function(){this._obj=Object.create(null)}},{key:`has`,value:function(e){return this._obj[e]===1}},{key:`toArray`,value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:`forEach`,value:function(e,t){return this.toArray().forEach(e,t)}}])}(),qr=(typeof Set>`u`?`undefined`:ft(Set))===Gr?Kr:Set,Jr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!At(e)){kr(`An element must have a core reference and parameters set`);return}var r=t.group;if(r??=t.data&&t.data.source!=null&&t.data.target!=null?`edges`:`nodes`,r!==`nodes`&&r!==`edges`){kr("An element must be of type `nodes` or `edges`; you specified `"+r+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0||!!t.grabbable,pannable:t.pannable===void 0?r===`edges`:!!t.pannable,active:!1,classes:new qr,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x??(i.position.x=0),i.position.y??(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var c=[];St(t.classes)?c=t.classes:Z(t.classes)&&(c=t.classes.split(/\s+/));for(var l=0,u=c.length;l<u;l++){var d=c[l];d&&d!==``&&i.classes.add(d)}this.createEmitter(),(n===void 0||n)&&this.restore();var f=t.style||t.css;f&&(jr("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f))},Yr=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;Ct(t)&&!Dt(t)&&(i=t,t=i.roots||i.root,n=i.visit,r=i.directed),r=arguments.length===2&&!xt(n)?n:r,n=xt(n)?n:function(){};for(var a=this._private.cy,o=t=Z(t)?this.filter(t):t,s=[],c=[],l={},u={},d={},f=0,p,m=this.byGroup(),h=m.nodes,g=m.edges,_=0;_<o.length;_++){var v=o[_],y=v.id();v.isNode()&&(s.unshift(v),e.bfs&&(d[y]=!0,c.push(v)),u[y]=0)}for(var b=function(){var t=e.bfs?s.shift():s.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,c.push(t)}var a=u[i],o=l[i],m=o==null?null:o.source(),_=o==null?null:o.target(),v=o==null?void 0:t.same(m)?_[0]:m[0],y=n(t,o,v,f++,a);if(y===!0)return p=t,1;if(y===!1)return 1;for(var b=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&g.has(e)}),x=0;x<b.length;x++){var S=b[x],C=S.connectedNodes().filter(function(e){return!e.same(t)&&h.has(e)}),w=C.id();C.length!==0&&!d[w]&&(C=C[0],s.push(C),e.bfs&&(d[w]=!0,c.push(C)),l[w]=S,u[w]=u[i]+1)}},x;s.length!==0&&(x=b(),x===0||x!==1););for(var S=a.collection(),C=0;C<c.length;C++){var w=c[C],T=l[w.id()];T!=null&&S.push(T),S.push(w)}return{path:a.collection(S),found:a.collection(p)}}},Xr={breadthFirstSearch:Yr({bfs:!0}),depthFirstSearch:Yr({dfs:!0})};Xr.bfs=Xr.breadthFirstSearch,Xr.dfs=Xr.depthFirstSearch;var Zr={exports:{}},Qr=Zr.exports,$r;function ei(){return $r?Zr.exports:($r=1,(function(e,t){(function(){var t,n,r=Math.floor,i,a,o,s,c,l,u=Math.min,d,f,p,m,h;n=function(e,t){return e<t?-1:+(e>t)},l=function(e,t,i,a,o){var s;if(i??=0,o??=n,i<0)throw Error(`lo must be non-negative`);for(a??=e.length;i<a;)s=r((i+a)/2),o(t,e[s])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return r??=n,e.push(t),m(e,0,e.length-1,r)},a=function(e,t){var r,i;return t??=n,r=e.pop(),e.length?(i=e[0],e[0]=r,h(e,0,t)):i=r,i},c=function(e,t,r){var i;return r??=n,i=e[0],e[0]=t,h(e,0,r),i},s=function(e,t,r){var i;return r??=n,e.length&&r(e[0],t)<0&&(i=[e[0],t],t=i[0],e[0]=i[1],h(e,0,r)),t},i=function(e,t){var i,a,o,s,c,l;for(t??=n,s=(function(){l=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}).apply(this).reverse(),c=[],a=0,o=s.length;a<o;a++)i=s[a],c.push(h(e,i,t));return c},p=function(e,t,r){var i;if(r??=n,i=e.indexOf(t),i!==-1)return m(e,0,i,r),h(e,i,r)},d=function(e,t,r){var a,o,c,l,u;if(r??=n,o=e.slice(0,t),!o.length)return o;for(i(o,r),u=e.slice(t),c=0,l=u.length;c<l;c++)a=u[c],s(o,a,r);return o.sort(r).reverse()},f=function(e,t,r){var o,s,c,d,f,p,m,h,g;if(r??=n,t*10<=e.length){if(c=e.slice(0,t).sort(r),!c.length)return c;for(s=c[c.length-1],m=e.slice(t),d=0,p=m.length;d<p;d++)o=m[d],r(o,s)<0&&(l(c,o,0,null,r),c.pop(),s=c[c.length-1]);return c}for(i(e,r),g=[],f=0,h=u(t,e.length);0<=h?f<h:f>h;0<=h?++f:--f)g.push(a(e,r));return g},m=function(e,t,r,i){var a,o,s;for(i??=n,a=e[r];r>t;){if(s=r-1>>1,o=e[s],i(a,o)<0){e[r]=o,r=s;continue}break}return e[r]=a},h=function(e,t,r){var i,a,o,s,c;for(r??=n,a=e.length,c=t,o=e[t],i=2*t+1;i<a;)s=i+1,s<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],t=i,i=2*t+1;return e[t]=o,m(e,c,t,r)},t=(function(){e.push=o,e.pop=a,e.replace=c,e.pushpop=s,e.heapify=i,e.updateItem=p,e.nlargest=d,e.nsmallest=f;function e(e){this.cmp=e??n,this.nodes=[]}return e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return this.nodes.length===0},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t=new e;return t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e})(),(function(t,n){return e.exports=n()})(this,function(){return t})}).call(Qr)})(Zr),Zr.exports)}var ti,ni;function ri(){return ni?ti:(ni=1,ti=ei(),ti)}var ii=un(ri()),ai=Rr({root:null,weight:function(e){return 1},directed:!1}),oi={dijkstra:function(e){if(!Ct(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=ai(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,c=Z(r)?this.filter(r)[0]:r[0],l={},u={},d={},f=this.byGroup(),p=f.nodes,m=f.edges;m.unmergeBy(function(e){return e.isLoop()});for(var h=function(e){return l[e.id()]},g=function(e,t){l[e.id()]=t,_.updateItem(e)},_=new ii(function(e,t){return h(e)-h(t)}),v=0;v<p.length;v++){var y=p[v];l[y.id()]=y.same(c)?0:1/0,_.push(y)}for(var b=function(e,t){for(var n=(a?e.edgesTo(t):e.edgesWith(t)).intersect(m),r=1/0,i,o=0;o<n.length;o++){var c=n[o],l=s(c);(l<r||!i)&&(r=l,i=c)}return{edge:i,dist:r}};_.size()>0;){var x=_.pop(),S=h(x),C=x.id();if(d[C]=S,S!==1/0)for(var w=x.neighborhood().intersect(p),T=0;T<w.length;T++){var E=w[T],D=E.id(),O=b(x,E),k=S+O.dist;k<h(E)&&(g(E,k),u[D]={node:x,edge:O.edge})}}return{distanceTo:function(e){return d[(Z(e)?p.filter(e)[0]:e[0]).id()]},pathTo:function(e){var t=Z(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),r=a.node,i=r.id()}return o.spawn(n)}}}},si={kruskal:function(e){e||=function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++)if(a[t].has(e))return t},c=0;c<i;c++)a[c]=this.spawn(n[c]);for(var l=r.sort(function(t,n){return e(t)-e(n)}),u=0;u<l.length;u++){var d=l[u],f=d.source()[0],p=d.target()[0],m=s(f),h=s(p),g=a[m],_=a[h];m!==h&&(o.merge(d),g.merge(_),a.splice(h,1))}return o}},ci=Rr({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),li={aStar:function(e){var t=this.cy(),n=ci(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var c=r.id(),l=i.id(),u={},d={},f={},p=new ii(function(e,t){return d[e.id()]-d[t.id()]}),m=new qr,h={},g={},_=function(e,t){p.push(e),m.add(t)},v,y,b=function(){v=p.pop(),y=v.id(),m.delete(y)},x=function(e){return m.has(e)};_(r,c),u[c]=0,d[c]=a(r);for(var S=0;p.size()>0;){if(b(),S++,y===l){for(var C=[],w=i,T=l,E=g[T];C.unshift(w),E!=null&&C.unshift(E),w=h[T],w!=null;)T=w.id(),E=g[T];return{found:!0,distance:u[y],path:this.spawn(C),steps:S}}f[y]=!0;for(var D=v._private.edges,O=0;O<D.length;O++){var k=D[O];if(this.hasElementWithId(k.id())&&!(o&&k.data(`source`)!==y)){var A=k.source(),j=k.target(),M=A.id()===y?j:A,N=M.id();if(this.hasElementWithId(N)&&!f[N]){var P=u[y]+s(k);if(!x(N)){u[N]=P,d[N]=P+a(M),_(M,N),h[N]=v,g[N]=k;continue}P<u[N]&&(u[N]=P,d[N]=P+a(M),p.updateItem(M),h[N]=v,g[N]=k)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},ui=Rr({weight:function(e){return 1},directed:!1}),di={floydWarshall:function(e){for(var t=this.cy(),n=ui(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,c=o.edges,l=s.length,u=l*l,d=function(e){return s.indexOf(e)},f=function(e){return s[e]},p=Array(u),m=0;m<u;m++){var h=m%l;(m-h)/l===h?p[m]=0:p[m]=1/0}for(var g=Array(u),_=Array(u),v=0;v<c.length;v++){var y=c[v],b=y.source()[0],x=y.target()[0];if(b!==x){var S=d(b),C=d(x),w=S*l+C,T=a(y);if(p[w]>T&&(p[w]=T,g[w]=C,_[w]=y),!i){var E=C*l+S;!i&&p[E]>T&&(p[E]=T,g[E]=S,_[E]=y)}}}for(var D=0;D<l;D++)for(var O=0;O<l;O++)for(var k=O*l+D,A=0;A<l;A++){var j=O*l+A,M=D*l+A;p[k]+p[M]<p[j]&&(p[j]=p[k]+p[M],g[j]=g[k])}var N=function(e){return(Z(e)?t.filter(e):e)[0]},P=function(e){return d(N(e))};return{distance:function(e,t){var n=P(e),r=P(t);return p[n*l+r]},path:function(e,n){var r=P(e),i=P(n),a=f(r);if(r===i)return a.collection();if(g[r*l+i]==null)return t.collection();var o=t.collection(),s=r,c;for(o.merge(a);r!==i;)s=r,r=g[r*l+i],c=_[s*l+r],o.merge(c),o.merge(f(r));return o}}}},fi=Rr({weight:function(e){return 1},directed:!1,root:null}),pi={bellmanFord:function(e){var t=this,n=fi(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,c=this.cy(),l=this.byGroup(),u=l.edges,d=l.nodes,f=d.length,p=new Wr,m=!1,h=[];a=c.collection(a)[0],u.unmergeBy(function(e){return e.isLoop()});for(var g=u.length,_=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},v=function(e){return(Z(e)?c.$(e):e)[0]},y=function(e){return _(v(e)).dist},b=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=v(e),i=[],o=r;;){if(o==null)return t.spawn();var c=_(o),l=c.edge,u=c.pred;if(i.unshift(o[0]),o.same(n)&&i.length>0)break;l!=null&&i.unshift(l),o=u}return s.spawn(i)},x=0;x<f;x++){var S=d[x],C=_(S);C.dist=S.same(a)?0:1/0,C.pred=null,C.edge=null}for(var w=!1,T=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,w=!0)},E=1;E<f;E++){w=!1;for(var D=0;D<g;D++){var O=u[D],k=O.source(),A=O.target(),j=o(O),M=_(k),N=_(A);T(k,A,O,M,N,j),i||T(A,k,O,N,M,j)}if(!w)break}if(w)for(var P=[],F=0;F<g;F++){var I=u[F],L=I.source(),R=I.target(),z=o(I),B=_(L).dist,V=_(R).dist;if(B+z<V||!i&&V+z<B){if(m||=(jr(`Graph contains a negative weight cycle for Bellman-Ford`),!0),e.findNegativeWeightCycles!==!1){var H=[];B+z<V&&H.push(L),!i&&V+z<B&&H.push(R);for(var U=H.length,W=0;W<U;W++){var G=H[W],K=[G];K.push(_(G).edge);for(var ee=_(G).pred;K.indexOf(ee)===-1;)K.push(ee),K.push(_(ee).edge),ee=_(ee).pred;K=K.slice(K.indexOf(ee));for(var q=K[0].id(),J=0,te=2;te<K.length;te+=2)K[te].id()<q&&(q=K[te].id(),J=te);K=K.slice(J).concat(K.slice(0,J)),K.push(K[0]);var Y=K.map(function(e){return e.id()}).join(`,`);P.indexOf(Y)===-1&&(h.push(s.spawn(K)),P.push(Y))}}else break}}return{distanceTo:y,pathTo:b,hasNegativeWeightCycle:m,negativeWeightCycles:h}}},mi=Math.sqrt(2),hi=function(e,t,n){n.length===0&&kr(`Karger-Stein must be run on a connected (sub)graph`);for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],c=n,l=c.length-1;l>=0;l--){var u=c[l],d=u[1],f=u[2];(t[d]===o&&t[f]===s||t[d]===s&&t[f]===o)&&c.splice(l,1)}for(var p=0;p<c.length;p++){var m=c[p];m[1]===s?(c[p]=m.slice(),c[p][1]=o):m[2]===s&&(c[p]=m.slice(),c[p][2]=o)}for(var h=0;h<t.length;h++)t[h]===s&&(t[h]=o);return c},gi=function(e,t,n,r){for(;n>r;)t=hi(Math.floor(Math.random()*t.length),e,t),n--;return t},_i={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil((Math.log(i)/Math.LN2)**2),s=Math.floor(i/mi);if(i<2){kr(`At least 2 nodes are required for Karger-Stein algorithm`);return}for(var c=[],l=0;l<a;l++){var u=r[l];c.push([l,n.indexOf(u.source()),n.indexOf(u.target())])}for(var d=1/0,f=[],p=Array(i),m=Array(i),h=Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},_=0;_<=o;_++){for(var v=0;v<i;v++)m[v]=v;var y=gi(m,c.slice(),i,s),b=y.slice();g(m,h);var x=gi(m,y,s,2),S=gi(h,b,s,2);x.length<=S.length&&x.length<d?(d=x.length,f=x,g(m,p)):S.length<=x.length&&S.length<d&&(d=S.length,f=S,g(h,p))}for(var C=this.spawn(f.map(function(e){return r[e[0]]})),w=this.spawn(),T=this.spawn(),E=p[0],D=0;D<p.length;D++){var O=p[D],k=n[D];O===E?w.merge(k):T.merge(k)}var A=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!C.contains(t)&&n.merge(t)})}),n};return{cut:C,components:[A(w),A(T)],partition1:w,partition2:T}}},vi=function(e){return{x:e.x,y:e.y}},yi=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},bi=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},xi=function(e){return{x:e[0],y:e[1]}},Si=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r},Ci=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r},wi=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i},Ti=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var c=e[s];a?isFinite(c)||(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2==0?(e[u-1+o]+e[u+o])/2:e[u+1+o]},Ei=function(e,t){return t===0?e:Ei(t,e%t)},Di=function(e){for(var t=e[0],n=0;n<e.length;n++)if(Tt(e[n]))n>0&&(t=Ei(t,e[n]));else return 0;return t},Oi=function(e){return Math.PI*e/180},ki=function(e,t){return Math.atan2(t,e)-Math.PI/2},Ai=Math.log2||function(e){return Math.log(e)/Math.log(2)},ji=function(e){return e>0?1:e<0?-1:0},Mi=function(e,t){return Math.sqrt(Ni(e,t))},Ni=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Pi=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Fi=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Ii=function(e,t,n,r){return{x:Fi(e.x,t.x,n.x,r),y:Fi(e.y,t.y,n.y,r)}},Li=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=Mi(e,t),o={x:i.x/a,y:i.y/a};return n??=0,r??=n*a,{x:e.x+o.x*r,y:e.y+o.y*r}},Ri=function(e,t,n){return Math.max(e,Math.min(n,t))},zi=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Bi=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Vi=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Hi=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Ui=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Wi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Gi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,r,i,a;if(t.length===1)n=r=i=a=t[0];else if(t.length===2)n=i=t[0],a=r=t[1];else if(t.length===4){var o=ct(t,4);n=o[0],r=o[1],i=o[2],a=o[3]}return e.x1-=a,e.x2+=r,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ki=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},qi=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Ji=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Yi=function(e,t){return Ji(e,t.x,t.y)},Xi=function(e,t){return Ji(e,t.x1,t.y1)&&Ji(e,t.x2,t.y2)},Zi=Math.hypot??function(e,t){return Math.sqrt(e*e+t*t)};function Qi(e,t){if(e.length<3)throw Error(`Need at least 3 vertices`);var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=Zi(e.x,e.y);return t===0?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return t/2},c=function(e,t,o,s){var c=r(t,e),l=r(s,o),u=a(c,l);return Math.abs(u)<1e-9?n(e,i(c,.5)):n(e,i(c,a(r(o,e),l)/u))},l=e.map(function(e){return{x:e.x,y:e.y}});s(l)<0&&l.reverse();for(var u=l.length,d=[],f=0;f<u;f++){var p=l[f],m=l[(f+1)%u],h=r(m,p),g=o({x:h.y,y:-h.x});d.push(g)}for(var _=d.map(function(e,r){return{p1:n(l[r],i(e,t)),p2:n(l[(r+1)%u],i(e,t))}}),v=[],y=0;y<u;y++){var b=_[(y-1+u)%u],x=_[y],S=c(b.p1,b.p2,x.p1,x.p2);v.push(S)}return v}function $i(e,t,n,r,i,a){var o=Qi(_a(e,t,n,r,i),a),s=zi();return o.forEach(function(e){return Ui(s,e.x,e.y)}),s}var ea=function(e,t,n,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:`auto`,c=s===`auto`?wa(i,a):s,l=i/2,u=a/2;c=Math.min(c,l,u);var d=c!==l,f=c!==u,p;if(d){var m=n-l+c-o,h=r-u-o;if(p=ga(e,t,n,r,m,h,n+l-c+o,h,!1),p.length>0)return p}if(f){var g=n+l+o;if(p=ga(e,t,n,r,g,r-u+c-o,g,r+u-c+o,!1),p.length>0)return p}if(d){var _=n-l+c-o,v=r+u+o;if(p=ga(e,t,n,r,_,v,n+l-c+o,v,!1),p.length>0)return p}if(f){var y=n-l-o;if(p=ga(e,t,n,r,y,r-u+c-o,y,r+u-c+o,!1),p.length>0)return p}var b,x=n-l+c,S=r-u+c;if(b=ma(e,t,n,r,x,S,c+o),b.length>0&&b[0]<=x&&b[1]<=S)return[b[0],b[1]];var C=n+l-c,w=r-u+c;if(b=ma(e,t,n,r,C,w,c+o),b.length>0&&b[0]>=C&&b[1]<=w)return[b[0],b[1]];var T=n+l-c,E=r+u-c;if(b=ma(e,t,n,r,T,E,c+o),b.length>0&&b[0]>=T&&b[1]>=E)return[b[0],b[1]];var D=n-l+c,O=r+u-c;return b=ma(e,t,n,r,D,O,c+o),b.length>0&&b[0]<=D&&b[1]>=O?[b[0],b[1]]:[]},ta=function(e,t,n,r,i,a,o){var s=o,c=Math.min(n,i),l=Math.max(n,i),u=Math.min(r,a),d=Math.max(r,a);return c-s<=e&&e<=l+s&&u-s<=t&&t<=d+s},na=function(e,t,n,r,i,a,o,s,c){var l={x1:Math.min(n,o,i)-c,x2:Math.max(n,o,i)+c,y1:Math.min(r,s,a)-c,y2:Math.max(r,s,a)+c};return!(e<l.x1||e>l.x2||t<l.y1||t>l.y2)},ra=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},ia=function(e,t,n,r,i){e===0&&(e=1e-5),t/=e,n/=e,r/=e;var a,o=(3*n-t*t)/9,s=-(27*r)+t*(9*n-t*t*2),c,l,u,d,f;if(s/=54,a=o*o*o+s*s,i[1]=0,d=t/3,a>0){l=s+Math.sqrt(a),l=l<0?-((-l)**(1/3)):l**(1/3),u=s-Math.sqrt(a),u=u<0?-((-u)**(1/3)):u**(1/3),i[0]=-d+l+u,d+=(l+u)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-u+l)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,a===0){f=s<0?-((-s)**(1/3)):s**(1/3),i[0]=-d+2*f,i[4]=i[2]=-(f+d);return}o=-o,c=o*o*o,c=Math.acos(s/Math.sqrt(c)),f=2*Math.sqrt(o),i[0]=-d+f*Math.cos(c/3),i[2]=-d+f*Math.cos((c+2*Math.PI)/3),i[4]=-d+f*Math.cos((c+4*Math.PI)/3)},aa=function(e,t,n,r,i,a,o,s){var c=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,l=9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,u=3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,f=[];ia(c,l,u,d,f);for(var p=1e-7,m=[],h=0;h<6;h+=2)Math.abs(f[h+1])<p&&f[h]>=0&&f[h]<=1&&m.push(f[h]);m.push(1),m.push(0);for(var g=-1,_,v,y,b=0;b<m.length;b++)_=(1-m[b])**2*n+2*(1-m[b])*m[b]*i+m[b]*m[b]*o,v=(1-m[b])**2*r+2*(1-m[b])*m[b]*a+m[b]*m[b]*s,y=(_-e)**2+(v-t)**2,g>=0?y<g&&(g=y):g=y;return g},oa=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-r],c=s[0]*s[0]+s[1]*s[1],l=o[0]*o[0]+o[1]*o[1],u=o[0]*s[0]+o[1]*s[1],d=u*u/c;return u<0?l:d>c?(e-i)*(e-i)+(t-a)*(t-a):l-d},sa=function(e,t,n){for(var r,i,a,o,s,c=0,l=0;l<n.length/2;l++)if(r=n[l*2],i=n[l*2+1],l+1<n.length/2?(a=n[(l+1)*2],o=n[(l+1)*2+1]):(a=n[(l+1-n.length/2)*2],o=n[(l+1-n.length/2)*2+1]),r!=e||a!=e){if(r>=e&&e>=a||r<=e&&e<=a)s=(e-r)/(a-r)*(o-i)+i,s>t&&c++;else continue}return c%2!=0},ca=function(e,t,n,r,i,a,o,s,c){var l=Array(n.length),u;s[0]==null?u=s:(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2);for(var d=Math.cos(-u),f=Math.sin(-u),p=0;p<l.length/2;p++)l[p*2]=a/2*(n[p*2]*d-n[p*2+1]*f),l[p*2+1]=o/2*(n[p*2+1]*d+n[p*2]*f),l[p*2]+=r,l[p*2+1]+=i;return sa(e,t,c>0?ua(da(l,-c)):l)},la=function(e,t,n,r,i,a,o,s){for(var c=Array(n.length*2),l=0;l<s.length;l++){var u=s[l];if(c[l*4+0]=u.startX,c[l*4+1]=u.startY,c[l*4+2]=u.stopX,c[l*4+3]=u.stopY,(u.cx-e)**2+(u.cy-t)**2<=u.radius**2)return!0}return sa(e,t,c)},ua=function(e){for(var t=Array(e.length/2),n,r,i,a,o,s,c,l,u=0;u<e.length/4;u++){n=e[u*4],r=e[u*4+1],i=e[u*4+2],a=e[u*4+3],u<e.length/4-1?(o=e[(u+1)*4],s=e[(u+1)*4+1],c=e[(u+1)*4+2],l=e[(u+1)*4+3]):(o=e[0],s=e[1],c=e[2],l=e[3]);var d=ga(n,r,i,a,o,s,c,l,!0);t[u*2]=d[0],t[u*2+1]=d[1]}return t},da=function(e,t){for(var n=Array(e.length*2),r,i,a,o,s=0;s<e.length/2;s++){r=e[s*2],i=e[s*2+1],s<e.length/2-1?(a=e[(s+1)*2],o=e[(s+1)*2+1]):(a=e[0],o=e[1]);var c=o-i,l=-(a-r),u=Math.sqrt(c*c+l*l),d=c/u,f=l/u;n[s*4]=r+d*t,n[s*4+1]=i+f*t,n[s*4+2]=a+d*t,n[s*4+3]=o+f*t}return n},fa=function(e,t,n,r,i,a){var o=n-e,s=r-t;o/=i,s/=a;var c=Math.sqrt(o*o+s*s),l=c-1;if(l<0)return[];var u=l/c;return[(n-e)*u+e,(r-t)*u+t]},pa=function(e,t,n,r,i,a,o){return e-=i,t-=a,e/=n/2+o,t/=r/2+o,e*e+t*t<=1},ma=function(e,t,n,r,i,a,o){var s=[n-e,r-t],c=[e-i,t-a],l=s[0]*s[0]+s[1]*s[1],u=2*(c[0]*s[0]+c[1]*s[1]),d=c[0]*c[0]+c[1]*c[1]-o*o,f=u*u-4*l*d;if(f<0)return[];var p=(-u+Math.sqrt(f))/(2*l),m=(-u-Math.sqrt(f))/(2*l),h=Math.min(p,m),g=Math.max(p,m),_=[];if(h>=0&&h<=1&&_.push(h),g>=0&&g<=1&&_.push(g),_.length===0)return[];var v=_[0]*s[0]+e,y=_[0]*s[1]+t;return _.length>1?_[0]==_[1]?[v,y]:[v,y,_[1]*s[0]+e,_[1]*s[1]+t]:[v,y]},ha=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ga=function(e,t,n,r,i,a,o,s,c){var l=e-i,u=n-e,d=o-i,f=t-a,p=r-t,m=s-a,h=d*f-m*l,g=u*f-p*l,_=m*u-d*p;if(_!==0){var v=h/_,y=g/_,b=.001,x=0-b,S=1+b;return x<=v&&v<=S&&x<=y&&y<=S||c?[e+v*u,t+v*p]:[]}return h===0||g===0?ha(e,n,o)===o?[o,s]:ha(e,n,i)===i?[i,a]:ha(i,o,n)===n?[n,r]:[]:[]},_a=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,c=t,l=n;a.push({x:c+o*e[0],y:l+s*e[1]});for(var u=1;u<e.length/2;u++)a.push({x:c+o*e[u*2],y:l+s*e[u*2+1]});return a},va=function(e,t,n,r,i,a,o,s){var c=[],l,u=Array(n.length),d=!0;a??(d=!1);var f;if(d){for(var p=0;p<u.length/2;p++)u[p*2]=n[p*2]*a+r,u[p*2+1]=n[p*2+1]*o+i;f=s>0?ua(da(u,-s)):u}else f=n;for(var m,h,g,_,v=0;v<f.length/2;v++)m=f[v*2],h=f[v*2+1],v<f.length/2-1?(g=f[(v+1)*2],_=f[(v+1)*2+1]):(g=f[0],_=f[1]),l=ga(e,t,r,i,m,h,g,_),l.length!==0&&c.push(l[0],l[1]);return c},ya=function(e,t,n,r,i,a,o,s,c){var l=[],u,d=Array(n.length*2);c.forEach(function(n,a){a===0?(d[d.length-2]=n.startX,d[d.length-1]=n.startY):(d[a*4-2]=n.startX,d[a*4-1]=n.startY),d[a*4]=n.stopX,d[a*4+1]=n.stopY,u=ma(e,t,r,i,n.cx,n.cy,n.radius),u.length!==0&&l.push(u[0],u[1])});for(var f=0;f<d.length/4;f++)u=ga(e,t,r,i,d[f*4],d[f*4+1],d[f*4+2],d[f*4+3],!1),u.length!==0&&l.push(u[0],u[1]);if(l.length>2){for(var p=[l[0],l[1]],m=(p[0]-e)**2+(p[1]-t)**2,h=1;h<l.length/2;h++){var g=(l[h*2]-e)**2+(l[h*2+1]-t)**2;g<=m&&(p[0]=l[h*2],p[1]=l[h*2+1],m=g)}return p}return l},ba=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},xa=function(e,t){var n=Ca(e,t);return n=Sa(n),n},Sa=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,c=0;c<r;c++)t=e[2*c],n=e[2*c+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var l=2/(o-i),u=2/(s-a),d=0;d<r;d++)t=e[2*d]=e[2*d]*l,n=e[2*d+1]=e[2*d+1]*u,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var f=0;f<r;f++)n=e[2*f+1]=e[2*f+1]+(-1-a);return e},Ca=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i=Array(e*2),a,o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},wa=function(e,t){return Math.min(e/4,t/4,8)},Ta=function(e,t){return Math.min(e/10,t/10,8)},Ea=function(){return 8},Da=function(e,t,n){return[e-2*t+n,2*(t-e),e]},Oa=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function ka(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length],a={x:i.x-r.x,y:i.y-r.y},o={x:-a.y,y:a.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function r(e,t){var n=1/0,r=-1/0,i=nt(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.x*t.x+o.y*t.y;n=Math.min(n,s),r=Math.max(r,s)}}catch(e){i.e(e)}finally{i.f()}return{min:n,max:r}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var a=nt([].concat(lt(n(e)),lt(n(t)))),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!i(r(e,s),r(t,s)))return!1}}catch(e){a.e(e)}finally{a.f()}return!0}var Aa=Rr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),ja={pageRank:function(e){for(var t=Aa(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),c=s.nodes,l=s.edges,u=c.length,d=u*u,f=l.length,p=Array(d),m=Array(u),h=(1-n)/u,g=0;g<u;g++){for(var _=0;_<u;_++){var v=g*u+_;p[v]=0}m[g]=0}for(var y=0;y<f;y++){var b=l[y],x=b.data(`source`),S=b.data(`target`);if(x!==S){var C=c.indexOfId(x),w=c.indexOfId(S),T=a(b),E=w*u+C;p[E]+=T,m[C]+=T}}for(var D=1/u+h,O=0;O<u;O++)if(m[O]===0)for(var k=0;k<u;k++){var A=k*u+O;p[A]=D}else for(var j=0;j<u;j++){var M=j*u+O;p[M]=p[M]/m[O]+h}for(var N=Array(u),P=Array(u),F,I=0;I<u;I++)N[I]=1;for(var L=0;L<i;L++){for(var R=0;R<u;R++)P[R]=0;for(var z=0;z<u;z++)for(var B=0;B<u;B++){var V=z*u+B;P[z]+=p[V]*N[B]}Pi(P),F=N,N=P,P=F;for(var H=0,U=0;U<u;U++){var W=F[U]-N[U];H+=W*W}if(H<r)break}return{rank:function(e){return e=o.collection(e)[0],N[c.indexOf(e)]}}}},Ma=Rr({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Na={degreeCentralityNormalized:function(e){e=Ma(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,c=0;c<r;c++){var l=n[c],u=l.id();e.root=l;var d=this.degreeCentrality(e);o<d.indegree&&(o=d.indegree),s<d.outdegree&&(s=d.outdegree),i[u]=d.indegree,a[u]=d.outdegree}return{indegree:function(e){return o==0?0:(Z(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return s===0?0:(Z(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var f={},p=0,m=0;m<r;m++){var h=n[m];e.root=h;var g=this.degreeCentrality(e);p<g.degree&&(p=g.degree),f[h.id()]=g.degree}return{degree:function(e){return p===0?0:(Z(e)&&(e=t.filter(e)),f[e.id()]/p)}}},degreeCentrality:function(e){e=Ma(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var c=i.connectedEdges(),l=c.filter(function(e){return e.target().same(i)&&n.has(e)}),u=c.filter(function(e){return e.source().same(i)&&n.has(e)}),d=l.length,f=u.length,p=0,m=0,h=0;h<l.length;h++)p+=a(l[h]);for(var g=0;g<u.length;g++)m+=a(u[g]);return{indegree:d**(1-s)*p**+s,outdegree:f**(1-s)*m**+s}}for(var _=i.connectedEdges().intersection(n),v=_.length,y=0,b=0;b<_.length;b++)y+=a(_[b]);return{degree:v**(1-s)*y**+s}}};Na.dc=Na.degreeCentrality,Na.dcn=Na.degreeCentralityNormalised=Na.degreeCentralityNormalized;var Pa=Rr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Fa={closenessCentralityNormalized:function(e){for(var t=Pa(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,c=this.nodes(),l=this.floydWarshall({weight:r,directed:i}),u=0;u<c.length;u++){for(var d=0,f=c[u],p=0;p<c.length;p++)if(u!==p){var m=l.distance(f,c[p]);d+=n?1/m:m}n||(d=1/d),s<d&&(s=d),o[f.id()]=d}return{closeness:function(e){return s==0?0:(e=Z(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=Pa(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,c=this.nodes(),l=0;l<c.length;l++){var u=c[l];if(!u.same(n)){var d=o.distanceTo(u);s+=a?1/d:d}}return a?s:1/s}};Fa.cc=Fa.closenessCentrality,Fa.ccn=Fa.closenessCentralityNormalised=Fa.closenessCentralityNormalized;var Ia=Rr({weight:null,directed:!1}),La={betweennessCentrality:function(e){for(var t=Ia(e),n=t.directed,r=t.weight,i=r!=null,a=this.cy(),o=this.nodes(),s={},c={},l=0,u={set:function(e,t){c[e]=t,t>l&&(l=t)},get:function(e){return c[e]}},d=0;d<o.length;d++){var f=o[d],p=f.id();s[p]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),u.set(p,0)}for(var m=function(){for(var e=o[h].id(),t=[],n={},c={},l={},d=new ii(function(e,t){return l[e]-l[t]}),f=0;f<o.length;f++){var p=o[f].id();n[p]=[],c[p]=0,l[p]=1/0}for(c[e]=1,l[e]=0,d.push(e);!d.empty();){var m=d.pop();if(t.push(m),i)for(var g=0;g<s[m].length;g++){var _=s[m][g],v=a.getElementById(m),y=void 0;y=v.edgesTo(_).length>0?v.edgesTo(_)[0]:_.edgesTo(v)[0];var b=r(y);_=_.id(),l[_]>l[m]+b&&(l[_]=l[m]+b,d.nodes.indexOf(_)<0?d.push(_):d.updateItem(_),c[_]=0,n[_]=[]),l[_]==l[m]+b&&(c[_]=c[_]+c[m],n[_].push(m))}else for(var x=0;x<s[m].length;x++){var S=s[m][x].id();l[S]==1/0&&(d.push(S),l[S]=l[m]+1),l[S]==l[m]+1&&(c[S]=c[S]+c[m],n[S].push(m))}}for(var C={},w=0;w<o.length;w++)C[o[w].id()]=0;for(;t.length>0;){for(var T=t.pop(),E=0;E<n[T].length;E++){var D=n[T][E];C[D]=C[D]+c[D]/c[T]*(1+C[T])}T!=o[h].id()&&u.set(T,u.get(T)+C[T])}},h=0;h<o.length;h++)m();var g={betweenness:function(e){var t=a.collection(e).id();return u.get(t)},betweennessNormalized:function(e){if(l==0)return 0;var t=a.collection(e).id();return u.get(t)/l}};return g.betweennessNormalised=g.betweennessNormalized,g}};La.bc=La.betweennessCentrality;var Ra=Rr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),za=function(e){return Ra(e)},Ba=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Va=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},Ha=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},Ua=function(e,t,n){for(var r=Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},Wa=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Ua(e,r,t);return e},Ga=function(e,t,n){for(var r=Array(t*t),i=0;i<t*t;i++)r[i]=e[i]**+n;return Ha(r,t),r},Ka=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*10**r)/10**r!=Math.round(t[i]*10**r)/10**r)return!1;return!0},qa=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(e[a*t+s]*1e3)/1e3>0&&o.push(n[s]);o.length!==0&&i.push(r.collection(o))}return i},Ja=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Ya=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Ja(e[t],e[n])&&e.splice(n,1);return e},Xa=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=za(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s=t.length,c=s*s,l=Array(c),u,d=0;d<c;d++)l[d]=0;for(var f=0;f<n.length;f++){var p=n[f],m=a[p.source().id()],h=a[p.target().id()],g=Ba(p,i.attributes);l[m*s+h]+=g,l[h*s+m]+=g}Va(l,s,i.multFactor),Ha(l,s);for(var _=!0,v=0;_&&v<i.maxIterations;)_=!1,u=Wa(l,s,i.expandFactor),l=Ga(u,s,i.inflateFactor),Ka(l,u,c,4)||(_=!0),v++;var y=qa(l,s,t,r);return y=Ya(y),y},Za={markovClustering:Xa,mcl:Xa},Qa=function(e){return e},$a=function(e,t){return Math.abs(t-e)},eo=function(e,t,n){return e+$a(t,n)},to=function(e,t,n){return e+(n-t)**2},no=function(e){return Math.sqrt(e)},ro=function(e,t,n){return Math.max(e,$a(t,n))},io=function(e,t,n,r,i){for(var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Qa,o=r,s,c,l=0;l<e;l++)s=t(l),c=n(l),o=i(o,s,c);return a(o)},ao={euclidean:function(e,t,n){return e>=2?io(e,t,n,0,to,no):io(e,t,n,0,eo)},squaredEuclidean:function(e,t,n){return io(e,t,n,0,to)},manhattan:function(e,t,n){return io(e,t,n,0,eo)},max:function(e,t,n){return io(e,t,n,-1/0,ro)}};ao[`squared-euclidean`]=ao.squaredEuclidean,ao.squaredeuclidean=ao.squaredEuclidean;function oo(e,t,n,r,i,a){var o=xt(e)?e:ao[e]||ao.euclidean;return t===0&&xt(e)?o(i,a):o(t,n,r,i,a)}var so=Rr({k:2,m:2,sensitivityThreshold:1e-4,distance:`euclidean`,maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),co=function(e){return so(e)},lo=function(e,t,n,r,i){var a=i===`kMedoids`?function(e){return r[e](n)}:function(e){return n[e]},o=function(e){return r[e](t)},s=n,c=t;return oo(e,r.length,a,o,s,c)},uo=function(e,t,n){for(var r=n.length,i=Array(r),a=Array(r),o=Array(t),s=null,c=0;c<r;c++)i[c]=e.min(n[c]).value,a[c]=e.max(n[c]).value;for(var l=0;l<t;l++){s=[];for(var u=0;u<r;u++)s[u]=Math.random()*(a[u]-i[u])+i[u];o[l]=s}return o},fo=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var c=lo(n,e,t[s],r,i);c<a&&(a=c,o=s)}return o},po=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)i=t[a],n[i.id()]===e&&r.push(i);return r},mo=function(e,t,n){return Math.abs(t-e)<=n},ho=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},go=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},_o=function(e,t){var n=Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];go(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},vo=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=lo(`manhattan`,t[i],e,n,`kMedoids`);return r},yo=function(e){var t=this.cy(),n=this.nodes(),r=null,i=co(e),a=Array(i.k),o={},s;i.testMode?typeof i.testCentroids==`number`?(i.testCentroids,s=uo(n,i.k,i.attributes)):s=ft(i.testCentroids)===`object`?i.testCentroids:uo(n,i.k,i.attributes):s=uo(n,i.k,i.attributes);for(var c=!0,l=0;c&&l<i.maxIterations;){for(var u=0;u<n.length;u++)r=n[u],o[r.id()]=fo(r,s,i.distance,i.attributes,`kMeans`);c=!1;for(var d=0;d<i.k;d++){var f=po(d,n,o);if(f.length!==0){for(var p=i.attributes.length,m=s[d],h=Array(p),g=Array(p),_=0;_<p;_++){g[_]=0;for(var v=0;v<f.length;v++)r=f[v],g[_]+=i.attributes[_](r);h[_]=g[_]/f.length,mo(h[_],m[_],i.sensitivityThreshold)||(c=!0)}s[d]=h,a[d]=t.collection(f)}}l++}return a},bo=function(e){var t=this.cy(),n=this.nodes(),r=null,i=co(e),a=Array(i.k),o,s={},c,l=Array(i.k);i.testMode?typeof i.testCentroids==`number`||(o=ft(i.testCentroids)===`object`?i.testCentroids:_o(n,i.k)):o=_o(n,i.k);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<n.length;f++)r=n[f],s[r.id()]=fo(r,o,i.distance,i.attributes,`kMedoids`);u=!1;for(var p=0;p<o.length;p++){var m=po(p,n,s);if(m.length!==0){l[p]=vo(o[p],m,i.attributes);for(var h=0;h<m.length;h++)c=vo(m[h],m,i.attributes),c<l[p]&&(l[p]=c,o[p]=m[h],u=!0);a[p]=t.collection(m)}}d++}return a},xo=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var c=0;c<e.length;c++)r[s][c]=n[s][c]**+i.m;for(var l=0;l<e.length;l++)for(var u=0;u<i.attributes.length;u++){a=0,o=0;for(var d=0;d<t.length;d++)a+=r[d][l]*i.attributes[u](t[d]),o+=r[d][l];e[l][u]=a/o}},So=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,c,l=2/(i.m-1),u=0;u<n.length;u++)for(var d=0;d<r.length;d++){o=0;for(var f=0;f<n.length;f++)s=lo(i.distance,r[d],n[u],i.attributes,`cmeans`),c=lo(i.distance,r[d],n[f],i.attributes,`cmeans`),o+=(s/c)**+l;e[d][u]=1/o}},Co=function(e,t,n,r){for(var i=Array(n.k),a=0;a<i.length;a++)i[a]=[];for(var o,s,c=0;c<t.length;c++){o=-1/0,s=-1;for(var l=0;l<t[0].length;l++)t[c][l]>o&&(o=t[c][l],s=l);i[s].push(e[c])}for(var u=0;u<i.length;u++)i[u]=r.collection(i[u]);return i},wo=function(e){for(var t=this.cy(),n=this.nodes(),r=co(e),i,a,o,s=Array(n.length),c,l=0;l<n.length;l++)s[l]=Array(r.k);o=Array(n.length);for(var u=0;u<n.length;u++)o[u]=Array(r.k);for(var d=0;d<n.length;d++){for(var f=0,p=0;p<r.k;p++)o[d][p]=Math.random(),f+=o[d][p];for(var m=0;m<r.k;m++)o[d][m]=o[d][m]/f}a=Array(r.k);for(var h=0;h<r.k;h++)a[h]=Array(r.attributes.length);c=Array(n.length);for(var g=0;g<n.length;g++)c[g]=Array(r.k);for(var _=!0,v=0;_&&v<r.maxIterations;)_=!1,xo(a,n,o,c,r),So(o,s,a,n,r),ho(o,s,r.sensitivityThreshold)||(_=!0),v++;return i=Co(n,o,r,t),{clusters:i,degreeOfMembership:o}},To={kMeans:yo,kMedoids:bo,fuzzyCMeans:wo,fcm:wo},Eo=Rr({distance:`euclidean`,linkage:`min`,mode:`threshold`,threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Do={single:`min`,complete:`max`},Oo=function(e){var t=Eo(e),n=Do[t.linkage];return n!=null&&(t.linkage=n),t},ko=function(e,t,n,r,i){for(var a=0,o=1/0,s,c=i.attributes,l=function(e,t){return oo(i.distance,c.length,function(t){return c[t](e)},function(e){return c[e](t)},e,t)},u=0;u<e.length;u++){var d=e[u].key,f=n[d][r[d]];f<o&&(a=d,o=f)}if(i.mode===`threshold`&&o>=i.threshold||i.mode===`dendrogram`&&e.length===1)return!1;var p=t[a],m=t[r[a]],h=i.mode===`dendrogram`?{left:p,right:m,key:p.key}:{value:p.value.concat(m.value),key:p.key};e[p.index]=h,e.splice(m.index,1),t[p.key]=h;for(var g=0;g<e.length;g++){var _=e[g];p.key===_.key?s=1/0:i.linkage===`min`?(s=n[p.key][_.key],n[p.key][_.key]>n[m.key][_.key]&&(s=n[m.key][_.key])):i.linkage===`max`?(s=n[p.key][_.key],n[p.key][_.key]<n[m.key][_.key]&&(s=n[m.key][_.key])):s=i.linkage===`mean`?(n[p.key][_.key]*p.size+n[m.key][_.key]*m.size)/(p.size+m.size):i.mode===`dendrogram`?l(_.value,p.value):l(_.value[0],p.value[0]),n[p.key][_.key]=n[_.key][p.key]=s}for(var v=0;v<e.length;v++){var y=e[v].key;if(r[y]===p.key||r[y]===m.key){for(var b=y,x=0;x<e.length;x++){var S=e[x].key;n[y][S]<n[y][b]&&(b=S)}r[y]=b}e[v].index=v}return p.key=m.key=p.index=m.index=null,!0},Ao=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Ao(e.left,t),e.right&&Ao(e.right,t)))},jo=function(e,t){if(!e)return``;if(e.left&&e.right){var n=jo(e.left,t),r=jo(e.right,t),i=t.add({group:`nodes`,data:{id:n+`,`+r}});return t.add({group:`edges`,data:{source:n,target:i.id()}}),t.add({group:`edges`,data:{source:r,target:i.id()}}),i.id()}if(e.value)return e.value.id()},Mo=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return t===0?(e.left&&Ao(e.left,r),e.right&&Ao(e.right,i),a=r.concat(i),[n.collection(a)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Ao(e.left,r),e.right&&Ao(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=Mo(e.left,t-1,n)),e.right&&(i=Mo(e.right,t-1,n)),r.concat(i))},No=function(e){for(var t=this.cy(),n=this.nodes(),r=Oo(e),i=r.attributes,a=function(e,t){return oo(r.distance,i.length,function(t){return i[t](e)},function(e){return i[e](t)},e,t)},o=[],s=[],c=[],l=[],u=0;u<n.length;u++){var d={value:r.mode===`dendrogram`?n[u]:[n[u]],key:u,index:u};o[u]=d,l[u]=d,s[u]=[],c[u]=0}for(var f=0;f<o.length;f++)for(var p=0;p<=f;p++){var m=void 0;m=r.mode===`dendrogram`?f===p?1/0:a(o[f].value,o[p].value):f===p?1/0:a(o[f].value[0],o[p].value[0]),s[f][p]=m,s[p][f]=m,m<s[f][c[f]]&&(c[f]=p)}for(var h=ko(o,l,s,c,r);h;)h=ko(o,l,s,c,r);var g;return r.mode===`dendrogram`?(g=Mo(o[0],r.dendrogramDepth,t),r.addDendrogram&&jo(o[0],t)):(g=Array(o.length),o.forEach(function(e,n){e.key=e.index=null,g[n]=t.collection(e.value)})),g},Po={hierarchicalClustering:No,hca:No},Fo=Rr({distance:`euclidean`,preference:`median`,damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Io=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||kr(`Damping must range on [0.5, 1). Got: ${t}`);var r=[`median`,`mean`,`min`,`max`];return r.some(function(e){return e===n})||Q(n)||kr(`Preference must be one of [${r.map(function(e){return`'${e}'`}).join(`, `)}] or a number. Got: ${n}`),Fo(e)},Lo=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-oo(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},Ro=function(e,t){var n=null;return n=t===`median`?Ti(e):t===`mean`?wi(e):t===`min`?Si(e):t===`max`?Ci(e):t,n},zo=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r},Bo=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var c=n[s];t[i*e+c]>o&&(a=c,o=t[i*e+c])}a>0&&r.push(a)}for(var l=0;l<n.length;l++)r[n[l]]=n[l];return r},Vo=function(e,t,n){for(var r=Bo(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,c=-1/0,l=0;l<a.length;l++){for(var u=0,d=0;d<a.length;d++)u+=t[a[d]*e+a[l]];u>c&&(s=l,c=u)}n[i]=a[s]}return r=Bo(e,t,n),r},Ho=function(e){for(var t=this.cy(),n=this.nodes(),r=Io(e),i={},a=0;a<n.length;a++)i[n[a].id()]=a;for(var o=n.length,s=o*o,c=Array(s),l,u,d,f=0;f<s;f++)c[f]=-1/0;for(var p=0;p<o;p++)for(var m=0;m<o;m++)p!==m&&(c[p*o+m]=Lo(r.distance,n[p],n[m],r.attributes));l=Ro(c,r.preference);for(var h=0;h<o;h++)c[h*o+h]=l;u=Array(s);for(var g=0;g<s;g++)u[g]=0;d=Array(s);for(var _=0;_<s;_++)d[_]=0;for(var v=Array(o),y=Array(o),b=Array(o),x=0;x<o;x++)v[x]=0,y[x]=0,b[x]=0;for(var S=Array(o*r.minIterations),C=0;C<S.length;C++)S[C]=0;for(var w=0;w<r.maxIterations;w++){for(var T=0;T<o;T++){for(var E=-1/0,D=-1/0,O=-1,k=0,A=0;A<o;A++)v[A]=u[T*o+A],k=d[T*o+A]+c[T*o+A],k>=E?(D=E,E=k,O=A):k>D&&(D=k);for(var j=0;j<o;j++)u[T*o+j]=(1-r.damping)*(c[T*o+j]-E)+r.damping*v[j];u[T*o+O]=(1-r.damping)*(c[T*o+O]-D)+r.damping*v[O]}for(var M=0;M<o;M++){for(var N=0,P=0;P<o;P++)v[P]=d[P*o+M],y[P]=Math.max(0,u[P*o+M]),N+=y[P];N-=y[M],y[M]=u[M*o+M],N+=y[M];for(var F=0;F<o;F++)d[F*o+M]=(1-r.damping)*Math.min(0,N-y[F])+r.damping*v[F];d[M*o+M]=(1-r.damping)*(N-y[M])+r.damping*v[M]}for(var I=0,L=0;L<o;L++){var R=+(d[L*o+L]+u[L*o+L]>0);S[w%r.minIterations*o+L]=R,I+=R}if(I>0&&(w>=r.minIterations-1||w==r.maxIterations-1)){for(var z=0,B=0;B<o;B++){b[B]=0;for(var V=0;V<r.minIterations;V++)b[B]+=S[V*o+B];(b[B]===0||b[B]===r.minIterations)&&z++}if(z===o)break}}for(var H=zo(o,u,d),U=Vo(o,c,H),W={},G=0;G<H.length;G++)W[H[G]]=[];for(var K=0;K<n.length;K++){var ee=U[i[n[K].id()]];ee!=null&&W[ee].push(n[K])}for(var q=Array(H.length),J=0;J<H.length;J++)q[J]=t.collection(W[H[J]]);return q},Uo={affinityPropagation:Ho,ap:Ho},Wo=Rr({root:void 0,directed:!1}),Go={hierholzer:function(e){if(!Ct(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=Wo(e),r=n.root,i=n.directed,a=this,o=!1,s,c,l;r&&(l=Z(r)?this.filter(r)[0].id():r[0].id());var u={},d={};i?a.forEach(function(e){var t=e.id();if(e.isNode()){var n=e.indegree(!0),r=e.outdegree(!0),i=n-r,a=r-n;i==1?s?o=!0:s=t:a==1?c?o=!0:c=t:(a>1||i>1)&&(o=!0),u[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[t].push(e.id())})}else d[t]=[void 0,e.target().id()]}):a.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(s?c?o=!0:c=t:s=t),u[t]=[],e.connectedEdges().forEach(function(e){return u[t].push(e.id())})):d[t]=[e.source().id(),e.target().id()]});var f={found:!1,trail:void 0};if(o)return f;if(c&&s){if(i){if(l&&c!=l)return f;l=c}else if(l&&c!=l&&s!=l)return f;else l||=c}else l||=a[0].id();var p=function(e){for(var t=e,n=[e],r,a,o;u[t].length;)r=u[t].shift(),a=d[r][0],o=d[r][1],t==o?!i&&t!=a&&(u[a]=u[a].filter(function(e){return e!=r}),t=a):(u[o]=u[o].filter(function(e){return e!=r}),t=o),n.unshift(r),n.unshift(t);return n},m=[],h=[];for(h=p(l);h.length!=1;)u[h[0]].length==0?(m.unshift(a.getElementById(h.shift())),m.unshift(a.getElementById(h.shift()))):h=p(h.shift()).concat(h);for(var g in m.unshift(a.getElementById(h.shift())),u)if(u[g].length)return f;return f.found=!0,f.trail=this.spawn(m,!0),f}},Ko=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(n,r){for(var o=a.length-1,s=[],c=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);c.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);c.merge(n),t[r].cutVertex?c.merge(i.filter(function(e){return e.isLoop()})):c.merge(i)})}),i.push(c)},c=function(l,u,d){l===d&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.size()===0)i.push(e.spawn(e.getElementById(u)));else{var p,m,h,g;f.forEach(function(e){p=e.source().id(),m=e.target().id(),h=p===u?m:p,h!==d&&(g=e.id(),o[g]||(o[g]=!0,a.push({x:u,y:h,edge:e})),h in t?t[u].low=Math.min(t[u].low,t[h].id):(c(l,h,u),t[u].low=Math.min(t[u].low,t[h].low),t[u].id<=t[h].low&&(t[u].cutVertex=!0,s(u,h))))})}};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,c(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},qo={hopcroftTarjanBiconnected:Ko,htbc:Ko,htb:Ko,hopcroftTarjanBiconnectedComponents:Ko},Jo=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var c=e.spawn();;){var l=i.pop();if(c.merge(e.getElementById(l)),t[l].low=t[s].index,t[l].explored=!0,l===s)break}var u=c.edgesWith(c),d=c.merge(u);r.push(d),a=a.difference(d)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},Yo={tarjanStronglyConnected:Jo,tsc:Jo,tscc:Jo,tarjanStronglyConnectedComponents:Jo},Xo={};[Xr,oi,si,li,di,pi,_i,ja,Na,Fa,La,Za,To,Po,Uo,Go,qo,Yo].forEach(function(e){$t(Xo,e)});var Zo=0,Qo=1,$o=2,es=function(e){if(!(this instanceof es))return new es(e);this.id=`Thenable/1.0.7`,this.state=Zo,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e==`function`&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};es.prototype={fulfill:function(e){return ts(this,Qo,`fulfillValue`,e)},reject:function(e){return ts(this,$o,`rejectReason`,e)},then:function(e,t){var n=this,r=new es;return n.onFulfilled.push(is(e,r,`fulfill`)),n.onRejected.push(is(t,r,`reject`)),ns(n),r.proxy}};var ts=function(e,t,n,r){return e.state===Zo&&(e.state=t,e[n]=r,ns(e)),e},ns=function(e){e.state===Qo?rs(e,`onFulfilled`,e.fulfillValue):e.state===$o&&rs(e,`onRejected`,e.rejectReason)},rs=function(e,t,n){if(e[t].length!==0){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};typeof setImmediate==`function`?setImmediate(i):setTimeout(i,0)}},is=function(e,t,n){return function(r){if(typeof e!=`function`)t[n].call(t,r);else{var i;try{i=e(r)}catch(e){t.reject(e);return}as(t,i)}}},as=function(e,t){if(e===t||e.proxy===t){e.reject(TypeError(`cannot resolve promise with itself`));return}var n;if(ft(t)===`object`&&t!==null||typeof t==`function`)try{n=t.then}catch(t){e.reject(t);return}if(typeof n==`function`){var r=!1;try{n.call(t,function(n){r||(r=!0,n===t?e.reject(TypeError(`circular thenable chain`)):as(e,n))},function(t){r||(r=!0,e.reject(t))})}catch(t){r||e.reject(t)}return}e.fulfill(t)};es.all=function(e){return new es(function(t,n){for(var r=Array(e.length),i=0,a=function(n,a){r[n]=a,i++,i===e.length&&t(r)},o=0;o<e.length;o++)(function(t){var r=e[t];r!=null&&r.then!=null?r.then(function(e){a(t,e)},function(e){n(e)}):a(t,r)})(o)})},es.resolve=function(e){return new es(function(t,n){t(e)})},es.reject=function(e){return new es(function(t,n){n(e)})};var os=typeof Promise<`u`?Promise:es,ss=function(e,t,n){var r=At(e),i=!r,a=this._private=$t({duration:1e3},t,n);if(a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&xt(a.complete)&&a.completes.push(a.complete),i){var o=e.position();a.startPosition=a.startPosition||{x:o.x,y:o.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(r){var s=e.pan();a.startPan={x:s.x,y:s.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},cs=ss.prototype;$t(cs,{instanceString:function(){return`animation`},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;t=e.queue?n.queue:n.current,t.push(this),Dt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];r!=null&&(e[t]=e[n],e[n]=r)};if(n(`zoom`,`startZoom`),n(`pan`,`startPan`),n(`position`,`startPosition`),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case`frame`:n=t.frames;break;default:case`complete`:case`completed`:n=t.completes}return new os(function(e,t){n.push(function(){e()})})}}),cs.complete=cs.completed,cs.run=cs.play,cs.running=cs.playing;var ls={animated:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];if(n)return n._private.animation.current.length>0}},clearQueue:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){var r=t[n];r._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=n.length!==void 0,i=r?n:[n],a=this._private.cy||this,o=!r,s=!o;if(!a.styleEnabled())return this;var c=a.style();if(e=$t({},e,t),Object.keys(e).length===0)return new ss(i[0],e);switch(e.duration===void 0&&(e.duration=400),e.duration){case`slow`:e.duration=600;break;case`fast`:e.duration=200}if(s&&(e.style=c.getPropsList(e.style||e.css),e.css=void 0),s&&e.renderedPosition!=null){var l=e.renderedPosition,u=a.pan(),d=a.zoom();e.position=bi(l,d,u)}if(o&&e.panBy!=null){var f=e.panBy,p=a.pan();e.pan={x:p.x+f.x,y:p.y+f.y}}var m=e.center||e.centre;if(o&&m!=null){var h=a.getCenterPan(m.eles,e.zoom);h!=null&&(e.pan=h)}if(o&&e.fit!=null){var g=e.fit,_=a.getFitViewport(g.eles||g.boundingBox,g.padding);_!=null&&(e.pan=_.pan,e.zoom=_.zoom)}if(o&&Ct(e.zoom)){var v=a.getZoomedViewport(e.zoom);v==null?e.zoom=null:(v.zoomed&&(e.zoom=v.zoom),v.panned&&(e.pan=v.pan))}return new ss(i[0],e)}},animate:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n;if(!(this._private.cy||this).styleEnabled())return this;t&&(e=$t({},e,t));for(var i=0;i<r.length;i++){var a=r[i],o=a.animated()&&(e.queue===void 0||e.queue);a.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n,i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<r.length;a++){for(var o=r[a]._private,s=o.animation.current,c=0;c<s.length;c++){var l=s[c]._private;t&&(l.duration=0)}e&&(o.animation.queue=[]),t||(o.animation.current=[])}return i.notify(`draw`),this}}},us,ds;function fs(){return ds?us:(ds=1,us=Array.isArray,us)}var ps,ms;function hs(){if(ms)return ps;ms=1;var e=fs(),t=Kn(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(i,a){if(e(i))return!1;var o=typeof i;return o==`number`||o==`symbol`||o==`boolean`||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return ps=i,ps}var gs,_s;function vs(){if(_s)return gs;_s=1;var e=Bn(),t=pn(),n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Proxy]`;function o(o){if(!t(o))return!1;var s=e(o);return s==r||s==i||s==n||s==a}return gs=o,gs}var ys,bs;function xs(){return bs?ys:(bs=1,ys=yn()[`__core-js_shared__`],ys)}var Ss,Cs;function ws(){if(Cs)return Ss;Cs=1;var e=xs(),t=function(){var t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||``);return t?`Symbol(src)_1.`+t:``}();function n(e){return!!t&&t in e}return Ss=n,Ss}var Ts,Es;function Ds(){if(Es)return Ts;Es=1;var e=Function.prototype.toString;function t(t){if(t!=null){try{return e.call(t)}catch{}try{return t+``}catch{}}return``}return Ts=t,Ts}var Os,ks;function As(){if(ks)return Os;ks=1;var e=vs(),t=ws(),n=pn(),r=Ds(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=RegExp(`^`+c.call(l).replace(i,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function d(i){return!n(i)||t(i)?!1:(e(i)?u:a).test(r(i))}return Os=d,Os}var js,Ms;function Ns(){if(Ms)return js;Ms=1;function e(e,t){return e?.[t]}return js=e,js}var Ps,Fs;function Is(){if(Fs)return Ps;Fs=1;var e=As(),t=Ns();function n(n,r){var i=t(n,r);return e(i)?i:void 0}return Ps=n,Ps}var Ls,Rs;function zs(){return Rs?Ls:(Rs=1,Ls=Is()(Object,`create`),Ls)}var Bs,Vs;function Hs(){if(Vs)return Bs;Vs=1;var e=zs();function t(){this.__data__=e?e(null):{},this.size=0}return Bs=t,Bs}var Us,Ws;function Gs(){if(Ws)return Us;Ws=1;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}return Us=e,Us}var Ks,qs;function Js(){if(qs)return Ks;qs=1;var e=zs(),t=`__lodash_hash_undefined__`,n=Object.prototype.hasOwnProperty;function r(r){var i=this.__data__;if(e){var a=i[r];return a===t?void 0:a}return n.call(i,r)?i[r]:void 0}return Ks=r,Ks}var Ys,Xs;function Zs(){if(Xs)return Ys;Xs=1;var e=zs(),t=Object.prototype.hasOwnProperty;function n(n){var r=this.__data__;return e?r[n]!==void 0:t.call(r,n)}return Ys=n,Ys}var Qs,$s;function ec(){if($s)return Qs;$s=1;var e=zs(),t=`__lodash_hash_undefined__`;function n(n,r){var i=this.__data__;return this.size+=+!this.has(n),i[n]=e&&r===void 0?t:r,this}return Qs=n,Qs}var tc,nc;function rc(){if(nc)return tc;nc=1;var e=Hs(),t=Gs(),n=Js(),r=Zs(),i=ec();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,tc=a,tc}var ic,ac;function oc(){if(ac)return ic;ac=1;function e(){this.__data__=[],this.size=0}return ic=e,ic}var sc,cc;function lc(){if(cc)return sc;cc=1;function e(e,t){return e===t||e!==e&&t!==t}return sc=e,sc}var uc,dc;function fc(){if(dc)return uc;dc=1;var e=lc();function t(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}return uc=t,uc}var pc,mc;function hc(){if(mc)return pc;mc=1;var e=fc(),t=Array.prototype.splice;function n(n){var r=this.__data__,i=e(r,n);return i<0?!1:(i==r.length-1?r.pop():t.call(r,i,1),--this.size,!0)}return pc=n,pc}var gc,_c;function vc(){if(_c)return gc;_c=1;var e=fc();function t(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}return gc=t,gc}var yc,bc;function xc(){if(bc)return yc;bc=1;var e=fc();function t(t){return e(this.__data__,t)>-1}return yc=t,yc}var Sc,Cc;function wc(){if(Cc)return Sc;Cc=1;var e=fc();function t(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this}return Sc=t,Sc}var Tc,Ec;function Dc(){if(Ec)return Tc;Ec=1;var e=oc(),t=hc(),n=vc(),r=xc(),i=wc();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Tc=a,Tc}var Oc,kc;function Ac(){return kc?Oc:(kc=1,Oc=Is()(yn(),`Map`),Oc)}var jc,Mc;function Nc(){if(Mc)return jc;Mc=1;var e=rc(),t=Dc(),n=Ac();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return jc=r,jc}var Pc,Fc;function Ic(){if(Fc)return Pc;Fc=1;function e(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}return Pc=e,Pc}var Lc,Rc;function zc(){if(Rc)return Lc;Rc=1;var e=Ic();function t(t,n){var r=t.__data__;return e(n)?r[typeof n==`string`?`string`:`hash`]:r.map}return Lc=t,Lc}var Bc,Vc;function Hc(){if(Vc)return Bc;Vc=1;var e=zc();function t(t){var n=e(this,t).delete(t);return this.size-=+!!n,n}return Bc=t,Bc}var Uc,Wc;function Gc(){if(Wc)return Uc;Wc=1;var e=zc();function t(t){return e(this,t).get(t)}return Uc=t,Uc}var Kc,qc;function Jc(){if(qc)return Kc;qc=1;var e=zc();function t(t){return e(this,t).has(t)}return Kc=t,Kc}var Yc,Xc;function Zc(){if(Xc)return Yc;Xc=1;var e=zc();function t(t,n){var r=e(this,t),i=r.size;return r.set(t,n),this.size+=r.size==i?0:1,this}return Yc=t,Yc}var Qc,$c;function el(){if($c)return Qc;$c=1;var e=Nc(),t=Hc(),n=Gc(),r=Jc(),i=Zc();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Qc=a,Qc}var tl,nl;function rl(){if(nl)return tl;nl=1;var e=el(),t=`Expected a function`;function n(r,i){if(typeof r!=`function`||i!=null&&typeof i!=`function`)throw TypeError(t);var a=function(){var e=arguments,t=i?i.apply(this,e):e[0],n=a.cache;if(n.has(t))return n.get(t);var o=r.apply(this,e);return a.cache=n.set(t,o)||n,o};return a.cache=new(n.Cache||e),a}return n.Cache=e,tl=n,tl}var il,al;function ol(){if(al)return il;al=1;var e=rl(),t=500;function n(n){var r=e(n,function(e){return i.size===t&&i.clear(),e}),i=r.cache;return r}return il=n,il}var sl,cl;function ll(){if(cl)return sl;cl=1;var e=ol(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g;return sl=e(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(``),e.replace(t,function(e,t,i,a){r.push(i?a.replace(n,`$1`):t||e)}),r}),sl}var ul,dl;function fl(){if(dl)return ul;dl=1;function e(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}return ul=e,ul}var pl,ml;function hl(){if(ml)return pl;ml=1;var e=jn(),t=fl(),n=fs(),r=Kn(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(e){if(typeof e==`string`)return e;if(n(e))return t(e,o)+``;if(r(e))return a?a.call(e):``;var i=e+``;return i==`0`&&1/e==-1/0?`-0`:i}return pl=o,pl}var gl,_l;function vl(){if(_l)return gl;_l=1;var e=hl();function t(t){return t==null?``:e(t)}return gl=t,gl}var yl,bl;function xl(){if(bl)return yl;bl=1;var e=fs(),t=hs(),n=ll(),r=vl();function i(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return yl=i,yl}var Sl,Cl;function wl(){if(Cl)return Sl;Cl=1;var e=Kn();function t(t){if(typeof t==`string`||e(t))return t;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n}return Sl=t,Sl}var Tl,El;function Dl(){if(El)return Tl;El=1;var e=xl(),t=wl();function n(n,r){r=e(r,n);for(var i=0,a=r.length;n!=null&&i<a;)n=n[t(r[i++])];return i&&i==a?n:void 0}return Tl=n,Tl}var Ol,kl;function Al(){if(kl)return Ol;kl=1;var e=Dl();function t(t,n,r){var i=t==null?void 0:e(t,n);return i===void 0?r:i}return Ol=t,Ol}var jl=un(Al()),Ml,Nl;function Pl(){if(Nl)return Ml;Nl=1;var e=Is();return Ml=function(){try{var t=e(Object,`defineProperty`);return t({},``,{}),t}catch{}}(),Ml}var Fl,Il;function Ll(){if(Il)return Fl;Il=1;var e=Pl();function t(t,n,r){n==`__proto__`&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}return Fl=t,Fl}var Rl,zl;function Bl(){if(zl)return Rl;zl=1;var e=Ll(),t=lc(),n=Object.prototype.hasOwnProperty;function r(r,i,a){var o=r[i];(!(n.call(r,i)&&t(o,a))||a===void 0&&!(i in r))&&e(r,i,a)}return Rl=r,Rl}var Vl,Hl;function Ul(){if(Hl)return Vl;Hl=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(n,r){var i=typeof n;return r??=e,!!r&&(i==`number`||i!=`symbol`&&t.test(n))&&n>-1&&n%1==0&&n<r}return Vl=n,Vl}var Wl,Gl;function Kl(){if(Gl)return Wl;Gl=1;var e=Bl(),t=xl(),n=Ul(),r=pn(),i=wl();function a(a,o,s,c){if(!r(a))return a;o=t(o,a);for(var l=-1,u=o.length,d=u-1,f=a;f!=null&&++l<u;){var p=i(o[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return a;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=r(h)?h:n(o[l+1])?[]:{})}e(f,p,m),f=f[p]}return a}return Wl=a,Wl}var ql,Jl;function Yl(){if(Jl)return ql;Jl=1;var e=Kl();function t(t,n,r){return t==null?t:e(t,n,r)}return ql=t,ql}var Xl=un(Yl()),Zl,Ql;function $l(){if(Ql)return Zl;Ql=1;function e(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}return Zl=e,Zl}var eu,tu;function nu(){if(tu)return eu;tu=1;var e=fl(),t=$l(),n=fs(),r=Kn(),i=ll(),a=wl(),o=vl();function s(s){return n(s)?e(s,a):r(s)?[s]:t(i(o(s)))}return eu=s,eu}var ru=un(nu()),iu={data:function(e){return e=$t({},{field:`data`,bindingEvent:`data`,allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:`data`,settingTriggersEvent:!1,triggerFnName:`trigger`,immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,a=i.length!==void 0,o=a?i:[i],s=a?i[0]:i;if(Z(t)){var c=t.indexOf(`.`)!==-1&&ru(t);if(r.allowGetting&&n===void 0){var l;return s&&(r.beforeGet(s),l=c&&s._private[r.field][t]===void 0?jl(s._private[r.field],c):s._private[r.field][t]),l}if(r.allowSetting&&n!==void 0&&!r.immutableKeys[t]){var u=rt({},t,n);r.beforeSet(i,u);for(var d=0,f=o.length;d<f;d++){var p=o[d];r.canSet(p)&&(c&&s._private[r.field][t]===void 0?Xl(p._private[r.field],c,n):p._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&Ct(t)){var m=t,h,g,_=Object.keys(m);r.beforeSet(i,m);for(var v=0;v<_.length;v++)if(h=_[v],g=m[h],!r.immutableKeys[h])for(var y=0;y<o.length;y++){var b=o[y];r.canSet(b)&&(b._private[r.field][h]=g)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&xt(t)){var x=t;i.on(r.bindingEvent,x)}else if(r.allowGetting&&t===void 0){var S;return s&&(r.beforeGet(s),S=s._private[r.field]),S}return i}},removeData:function(e){return e=$t({},{field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=r.length===void 0?[r]:r;if(Z(t)){for(var a=t.split(/\s+/),o=a.length,s=0;s<o;s++){var c=a[s];if(!Nt(c)&&!n.immutableKeys[c])for(var l=0,u=i.length;l<u;l++)i[l]._private[n.field][c]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(t===void 0){for(var d=0,f=i.length;d<f;d++)for(var p=i[d]._private[n.field],m=Object.keys(p),h=0;h<m.length;h++){var g=m[h];n.immutableKeys[g]||(p[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},au={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new os(function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)})}}},ou={};[ls,iu,au].forEach(function(e){$t(ou,e)});var su={animate:ou.animate(),animation:ou.animation(),animated:ou.animated(),clearQueue:ou.clearQueue(),delay:ou.delay(),delayAnimation:ou.delayAnimation(),stop:ou.stop()},cu={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(e){return n.push(e)}),n}St(e)||(e=(e||``).match(/\S+/g)||[]);for(var r=[],i=new qr(e),a=0;a<t.length;a++){for(var o=t[a],s=o._private,c=s.classes,l=!1,u=0;u<e.length;u++){var d=e[u];if(!c.has(d)){l=!0;break}}l||=c.size!==e.length,l&&(s.classes=i,r.push(o))}return r.length>0&&this.spawn(r).updateStyle().emit(`class`),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){St(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=t===void 0,i=[],a=0,o=n.length;a<o;a++)for(var s=n[a],c=s._private.classes,l=!1,u=0;u<e.length;u++){var d=e[u],f=c.has(d),p=!1;t||r&&!f?(c.add(d),p=!0):(!t||r&&f)&&(c.delete(d),p=!0),!l&&p&&(i.push(s),l=!0)}return i.length>0&&this.spawn(i).updateStyle().emit(`class`),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};cu.className=cu.classNames=cu.classes;var lu={metaChar:`[\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\\`\\{\\|\\}\\~]`,comparatorOp:`=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=`,boolOp:`\\?|\\!|\\^`,string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Wt,meta:`degree|indegree|outdegree`,separator:`\\s*,\\s*`,descendant:`\\s+`,child:`\\s+>\\s+`,subject:`\\$`,group:`node|edge|\\*`,directedEdge:`\\s+->\\s+`,undirectedEdge:`\\s+<->\\s+`};lu.variable=`(?:[\\w-.]|(?:\\\\`+lu.metaChar+`))+`,lu.className=`(?:[\\w-]|(?:\\\\`+lu.metaChar+`))+`,lu.value=lu.string+`|`+lu.number,lu.id=lu.variable,(function(){for(var e=lu.comparatorOp.split(`|`),t,n=0;n<e.length;n++)t=e[n],lu.comparatorOp+=`|@`+t;for(e=lu.comparatorOp.split(`|`),n=0;n<e.length;n++)t=e[n],!(t.indexOf(`!`)>=0)&&t!==`=`&&(lu.comparatorOp+=`|\\!`+t)})();var uu=function(){return{checks:[]}},$={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},du=[{selector:`:selected`,matches:function(e){return e.selected()}},{selector:`:unselected`,matches:function(e){return!e.selected()}},{selector:`:selectable`,matches:function(e){return e.selectable()}},{selector:`:unselectable`,matches:function(e){return!e.selectable()}},{selector:`:locked`,matches:function(e){return e.locked()}},{selector:`:unlocked`,matches:function(e){return!e.locked()}},{selector:`:visible`,matches:function(e){return e.visible()}},{selector:`:hidden`,matches:function(e){return!e.visible()}},{selector:`:transparent`,matches:function(e){return e.transparent()}},{selector:`:grabbed`,matches:function(e){return e.grabbed()}},{selector:`:free`,matches:function(e){return!e.grabbed()}},{selector:`:removed`,matches:function(e){return e.removed()}},{selector:`:inside`,matches:function(e){return!e.removed()}},{selector:`:grabbable`,matches:function(e){return e.grabbable()}},{selector:`:ungrabbable`,matches:function(e){return!e.grabbable()}},{selector:`:animated`,matches:function(e){return e.animated()}},{selector:`:unanimated`,matches:function(e){return!e.animated()}},{selector:`:parent`,matches:function(e){return e.isParent()}},{selector:`:childless`,matches:function(e){return e.isChildless()}},{selector:`:child`,matches:function(e){return e.isChild()}},{selector:`:orphan`,matches:function(e){return e.isOrphan()}},{selector:`:nonorphan`,matches:function(e){return e.isChild()}},{selector:`:compound`,matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:`:loop`,matches:function(e){return e.isLoop()}},{selector:`:simple`,matches:function(e){return e.isSimple()}},{selector:`:active`,matches:function(e){return e.active()}},{selector:`:inactive`,matches:function(e){return!e.active()}},{selector:`:backgrounding`,matches:function(e){return e.backgrounding()}},{selector:`:nonbackgrounding`,matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return Qt(e.selector,t.selector)}),fu=function(){for(var e={},t,n=0;n<du.length;n++)t=du[n],e[t.selector]=t.matches;return e}(),pu=function(e,t){return fu[e](t)},mu=`(`+du.map(function(e){return e.selector}).join(`|`)+`)`,hu=function(e){return e.replace(RegExp(`\\\\(`+lu.metaChar+`)`,`g`),function(e,t){return t})},gu=function(e,t,n){e[e.length-1]=n},_u=[{name:`group`,query:!0,regex:`(`+lu.group+`)`,populate:function(e,t,n){var r=ct(n,1)[0];t.checks.push({type:$.GROUP,value:r===`*`?r:r+`s`})}},{name:`state`,query:!0,regex:mu,populate:function(e,t,n){var r=ct(n,1)[0];t.checks.push({type:$.STATE,value:r})}},{name:`id`,query:!0,regex:`\\#(`+lu.id+`)`,populate:function(e,t,n){var r=ct(n,1)[0];t.checks.push({type:$.ID,value:hu(r)})}},{name:`className`,query:!0,regex:`\\.(`+lu.className+`)`,populate:function(e,t,n){var r=ct(n,1)[0];t.checks.push({type:$.CLASS,value:hu(r)})}},{name:`dataExists`,query:!0,regex:`\\[\\s*(`+lu.variable+`)\\s*\\]`,populate:function(e,t,n){var r=ct(n,1)[0];t.checks.push({type:$.DATA_EXIST,field:hu(r)})}},{name:`dataCompare`,query:!0,regex:`\\[\\s*(`+lu.variable+`)\\s*(`+lu.comparatorOp+`)\\s*(`+lu.value+`)\\s*\\]`,populate:function(e,t,n){var r=ct(n,3),i=r[0],a=r[1],o=r[2];o=RegExp(`^`+lu.string+`$`).exec(o)==null?parseFloat(o):o.substring(1,o.length-1),t.checks.push({type:$.DATA_COMPARE,field:hu(i),operator:a,value:o})}},{name:`dataBool`,query:!0,regex:`\\[\\s*(`+lu.boolOp+`)\\s*(`+lu.variable+`)\\s*\\]`,populate:function(e,t,n){var r=ct(n,2),i=r[0],a=r[1];t.checks.push({type:$.DATA_BOOL,field:hu(a),operator:i})}},{name:`metaCompare`,query:!0,regex:`\\[\\[\\s*(`+lu.meta+`)\\s*(`+lu.comparatorOp+`)\\s*(`+lu.number+`)\\s*\\]\\]`,populate:function(e,t,n){var r=ct(n,3),i=r[0],a=r[1],o=r[2];t.checks.push({type:$.META_COMPARE,field:hu(i),operator:a,value:parseFloat(o)})}},{name:`nextQuery`,separator:!0,regex:lu.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return n!=null&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=uu()}},{name:`directedEdge`,separator:!0,regex:lu.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=uu(),r=t,i=uu();return n.checks.push({type:$.DIRECTED_EDGE,source:r,target:i}),gu(e,t,n),e.edgeCount++,i}var a=uu(),o=t,s=uu();return a.checks.push({type:$.NODE_SOURCE,source:o,target:s}),gu(e,t,a),e.edgeCount++,s}},{name:`undirectedEdge`,separator:!0,regex:lu.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=uu(),r=t,i=uu();return n.checks.push({type:$.UNDIRECTED_EDGE,nodes:[r,i]}),gu(e,t,n),e.edgeCount++,i}var a=uu(),o=t,s=uu();return a.checks.push({type:$.NODE_NEIGHBOR,node:o,neighbor:s}),gu(e,t,a),s}},{name:`child`,separator:!0,regex:lu.child,populate:function(e,t){if(e.currentSubject==null){var n=uu(),r=uu(),i=e[e.length-1];return n.checks.push({type:$.CHILD,parent:i,child:r}),gu(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=uu(),o=e[e.length-1],s=uu(),c=uu(),l=uu(),u=uu();return a.checks.push({type:$.COMPOUND_SPLIT,left:o,right:s,subject:c}),c.checks=t.checks,t.checks=[{type:$.TRUE}],u.checks.push({type:$.TRUE}),s.checks.push({type:$.PARENT,parent:u,child:l}),gu(e,o,a),e.currentSubject=c,e.compoundCount++,l}var d=uu(),f=uu(),p=[{type:$.PARENT,parent:d,child:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:`descendant`,separator:!0,regex:lu.descendant,populate:function(e,t){if(e.currentSubject==null){var n=uu(),r=uu(),i=e[e.length-1];return n.checks.push({type:$.DESCENDANT,ancestor:i,descendant:r}),gu(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=uu(),o=e[e.length-1],s=uu(),c=uu(),l=uu(),u=uu();return a.checks.push({type:$.COMPOUND_SPLIT,left:o,right:s,subject:c}),c.checks=t.checks,t.checks=[{type:$.TRUE}],u.checks.push({type:$.TRUE}),s.checks.push({type:$.ANCESTOR,ancestor:u,descendant:l}),gu(e,o,a),e.currentSubject=c,e.compoundCount++,l}var d=uu(),f=uu(),p=[{type:$.ANCESTOR,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:`subject`,modifier:!0,regex:lu.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return jr("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=n==null?null:n.type;r===$.DIRECTED_EDGE?n.type=$.NODE_TARGET:r===$.UNDIRECTED_EDGE&&(n.type=$.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];_u.forEach(function(e){return e.regexObj=RegExp(`^`+e.regex)});var vu=function(e){for(var t,n,r,i=0;i<_u.length;i++){var a=_u[i],o=a.name,s=e.match(a.regexObj);if(s!=null){n=s,t=a,r=o;var c=s[0];e=e.substring(c.length);break}}return{expr:t,match:n,name:r,remaining:e}},yu=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},bu={parse:function(e){var t=this,n=t.inputText=e,r=t[0]=uu();for(t.length=1,n=yu(n);;){var i=vu(n);if(i.expr==null)return jr("The selector `"+e+"`is invalid"),!1;var a=i.match.slice(1),o=i.expr.populate(t,r,a);if(o===!1)return!1;if(o!=null&&(r=o),n=i.remaining,n.match(/^\s*$/))break}var s=t[t.length-1];t.currentSubject!=null&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var c=0;c<t.length;c++){var l=t[c];if(l.compoundCount>0&&l.edgeCount>0)return jr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return jr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;l.edgeCount===1&&jr("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(e){return e??``},t=function(t){return Z(t)?`"`+t+`"`:e(t)},n=function(e){return` `+e+` `},r=function(r,a){var o=r.type,s=r.value;switch(o){case $.GROUP:var c=e(s);return c.substring(0,c.length-1);case $.DATA_COMPARE:var l=r.field,u=r.operator;return`[`+l+n(e(u))+t(s)+`]`;case $.DATA_BOOL:var d=r.operator,f=r.field;return`[`+e(d)+f+`]`;case $.DATA_EXIST:return`[`+r.field+`]`;case $.META_COMPARE:var p=r.operator;return`[[`+r.field+n(e(p))+t(s)+`]]`;case $.STATE:return s;case $.ID:return`#`+s;case $.CLASS:return`.`+s;case $.PARENT:case $.CHILD:return i(r.parent,a)+n(`>`)+i(r.child,a);case $.ANCESTOR:case $.DESCENDANT:return i(r.ancestor,a)+` `+i(r.descendant,a);case $.COMPOUND_SPLIT:var m=i(r.left,a),h=i(r.subject,a),g=i(r.right,a);return m+(m.length>0?` `:``)+h+g;case $.TRUE:return``}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&a===0?`$`:``)+r(i,t)},``)},a=``,o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=`, `)}return this.toStringCache=a,a}},xu=function(e,t,n){var r,i=Z(e),a=Q(e),o=Z(n),s,c,l=!1,u=!1,d=!1;switch(t.indexOf(`!`)>=0&&(t=t.replace(`!`,``),u=!0),t.indexOf(`@`)>=0&&(t=t.replace(`@`,``),l=!0),(i||o||l)&&(s=!i&&!a?``:``+e,c=``+n),l&&(e=s=s.toLowerCase(),n=c=c.toLowerCase()),t){case`*=`:r=s.indexOf(c)>=0;break;case`$=`:r=s.indexOf(c,s.length-c.length)>=0;break;case`^=`:r=s.indexOf(c)===0;break;case`=`:r=e===n;break;case`>`:d=!0,r=e>n;break;case`>=`:d=!0,r=e>=n;break;case`<`:d=!0,r=e<n;break;case`<=`:d=!0,r=e<=n;break;default:r=!1}return u&&(e!=null||!d)&&(r=!r),r},Su=function(e,t){switch(t){case`?`:return!!e;case`!`:return!e;case`^`:return e===void 0}},Cu=function(e){return e!==void 0},wu=function(e,t){return e.data(t)},Tu=function(e,t){return e[t]()},Eu=[],Du=function(e,t){return e.checks.every(function(e){return Eu[e.type](e,t)})};Eu[$.GROUP]=function(e,t){var n=e.value;return n===`*`||n===t.group()},Eu[$.STATE]=function(e,t){var n=e.value;return pu(n,t)},Eu[$.ID]=function(e,t){var n=e.value;return t.id()===n},Eu[$.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)},Eu[$.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return xu(Tu(t,n),r,i)},Eu[$.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return xu(wu(t,n),r,i)},Eu[$.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return Su(wu(t,n),r)},Eu[$.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,Cu(wu(t,n))},Eu[$.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return Du(n,i)&&Du(r,a)||Du(r,i)&&Du(n,a)},Eu[$.NODE_NEIGHBOR]=function(e,t){return Du(e.node,t)&&t.neighborhood().some(function(t){return t.isNode()&&Du(e.neighbor,t)})},Eu[$.DIRECTED_EDGE]=function(e,t){return Du(e.source,t.source())&&Du(e.target,t.target())},Eu[$.NODE_SOURCE]=function(e,t){return Du(e.source,t)&&t.outgoers().some(function(t){return t.isNode()&&Du(e.target,t)})},Eu[$.NODE_TARGET]=function(e,t){return Du(e.target,t)&&t.incomers().some(function(t){return t.isNode()&&Du(e.source,t)})},Eu[$.CHILD]=function(e,t){return Du(e.child,t)&&Du(e.parent,t.parent())},Eu[$.PARENT]=function(e,t){return Du(e.parent,t)&&t.children().some(function(t){return Du(e.child,t)})},Eu[$.DESCENDANT]=function(e,t){return Du(e.descendant,t)&&t.ancestors().some(function(t){return Du(e.ancestor,t)})},Eu[$.ANCESTOR]=function(e,t){return Du(e.ancestor,t)&&t.descendants().some(function(t){return Du(e.descendant,t)})},Eu[$.COMPOUND_SPLIT]=function(e,t){return Du(e.subject,t)&&Du(e.left,t)&&Du(e.right,t)},Eu[$.TRUE]=function(){return!0},Eu[$.COLLECTION]=function(e,t){return e.value.has(t)},Eu[$.FILTER]=function(e,t){var n=e.value;return n(t)};var Ou={matches:function(e){for(var t=this,n=0;n<t.length;n++){var r=t[n];if(Du(r,e))return!0}return!1},filter:function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===$.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Du(r,e))return!0}return!1};return t.text()??(n=function(){return!0}),e.filter(n)}},ku=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Z(e)&&e.match(/^\s*$/)||(Dt(e)?this.addQuery({checks:[{type:$.COLLECTION,value:e.collection()}]}):xt(e)?this.addQuery({checks:[{type:$.FILTER,value:e}]}):Z(e)?this.parse(e)||(this.invalid=!0):kr(`A selector must be created from a string; found `))},Au=ku.prototype;[bu,Ou].forEach(function(e){return $t(Au,e)}),Au.text=function(){return this.inputText},Au.size=function(){return this.length},Au.eq=function(e){return this[e]},Au.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Au.addQuery=function(e){this[this.length++]=e},Au.selector=Au.toString;var ju={allAre:function(e){var t=new ku(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new ku(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length?t===1?this[0]===e[0]:this.every(function(t){return e.hasElementWithId(t.id())}):!1},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(e){return t.hasElementWithId(e.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(e){return t.hasElementWithId(e.id())})}};ju.allAreNeighbours=ju.allAreNeighbors,ju.has=ju.contains,ju.equal=ju.equals=ju.same;var Mu=function(e,t){return function(n,r,i,a){var o=n,s=this,c;if(o==null?c=``:Dt(o)&&o.length===1&&(c=o.id()),s.length===1&&c){var l=s[0]._private,u=l.traversalCache=l.traversalCache||{},d=u[t]=u[t]||[],f=hr(c);return d[f]||(d[f]=e.call(s,n,r,i,a))}return e.call(s,n,r,i,a)}},Nu={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t||=r,t=t.intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isChild()}).filter(e)},children:Mu(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)},`children`),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(e){for(var r=0;r<e.length;r++){var i=e[r];t.push(i),i.children().nonempty()&&n(i.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function Pu(e,t,n,r){for(var i=[],a=new qr,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var c=e[s];n?i.push(c):o&&r(i,a,c)}for(;i.length>0;){var l=i.shift();t(l),a.add(l.id()),o&&r(i,a,l)}return e}function Fu(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}Nu.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Pu(this,e,t,Fu)};function Iu(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}Nu.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Pu(this,e,t,Iu)};function Lu(e,t,n){Iu(e,t,n),Fu(e,t,n)}Nu.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Pu(this,e,t,Lu)},Nu.ancestors=Nu.parents;var Ru=zu={data:ou.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ou.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ou.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:ou.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),rscratch:ou.data({field:`rscratch`,allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ou.removeData({field:`rscratch`,triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},zu;Ru.attr=Ru.data,Ru.removeAttr=Ru.removeData;var Bu=zu,Vu={};function Hu(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;o<a.length;o++){var s=a[o];(t||!s.isLoop())&&(r+=e(i,s))}return r}}}$t(Vu,{degree:Hu(function(e,t){return t.source().same(t.target())?2:1}),indegree:Hu(function(e,t){return+!!t.target().same(e)}),outdegree:Hu(function(e,t){return+!!t.source().same(e)})});function Uu(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}$t(Vu,{minDegree:Uu(`degree`,function(e,t){return e<t}),maxDegree:Uu(`degree`,function(e,t){return e>t}),minIndegree:Uu(`indegree`,function(e,t){return e<t}),maxIndegree:Uu(`indegree`,function(e,t){return e>t}),minOutdegree:Uu(`outdegree`,function(e,t){return e<t}),maxOutdegree:Uu(`outdegree`,function(e,t){return e>t})}),$t(Vu,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Wu,Gu,Ku=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:t.x==null?0:t.x-a.x,y:t.y==null?0:t.y-a.y};i.isParent()&&(o.x!==0||o.y!==0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},qu={field:`position`,bindingEvent:`position`,allowBinding:!0,allowSetting:!0,settingEvent:`position`,settingTriggersEvent:!0,triggerFnName:`emitAndNotify`,allowGetting:!0,validKeys:[`x`,`y`],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Ku(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Wu=Gu={position:ou.data(qu),silentPosition:ou.data($t({},qu,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Ku(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Ct(e))t?this.silentPosition(e):this.position(e);else if(xt(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a=this[i],o=void 0;(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(Ct(e)?(r={x:Q(e.x)?e.x:0,y:Q(e.y)?e.y:0},n=t):Z(e)&&Q(t)&&(r={x:0,y:0},r[e]=t),r!=null){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var s=o.position(),c={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(c):o.position(c)}}i.endBatch()}return this},silentShift:function(e,t){return Ct(e)?this.shift(e,!0):Z(e)&&Q(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=Ct(e)?e:void 0,s=o!==void 0||t!==void 0&&Z(e);if(n&&n.isNode()){if(s)for(var c=0;c<this.length;c++){var l=this[c];t===void 0?o!==void 0&&l.position(bi(o,i,a)):l.position(e,(t-a[e])/i)}else return o=yi(n.position(),i,a),e===void 0?o:o[e]}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=Ct(e)?e:void 0,a=i!==void 0||t!==void 0&&Z(e),o=r.hasCompoundNodes();if(n&&n.isNode()){if(a)for(var s=0;s<this.length;s++){var c=this[s],l=o?c.parent():null,u=l&&l.length>0,d=u;u&&(l=l[0]);var f=d?l.position():{x:0,y:0};t===void 0?i!==void 0&&c.position({x:i.x+f.x,y:i.y+f.y}):c.position(e,t+f[e])}else{var p=n.position(),m=o?n.parent():null,h=m&&m.length>0,g=h;h&&(m=m[0]);var _=g?m.position():{x:0,y:0};return i={x:p.x-_.x,y:p.y-_.y},e===void 0?i:i[e]}}else if(!a)return;return this}},Wu.modelPosition=Wu.point=Wu.position,Wu.modelPositions=Wu.points=Wu.positions,Wu.renderedPoint=Wu.renderedPosition,Wu.relativePoint=Wu.relativePosition;var Ju=Gu,Yu=function(e){switch(e){case`left`:case`right-inside`:return`left`;case`right`:case`left-inside`:return`right`;default:return`center`}},Xu=function(e){switch(e){case`top`:case`bottom-inside`:return`top`;case`bottom`:case`top-inside`:return`bottom`;default:return`center`}},Zu=function(e){switch(e){case`left`:return`right`;case`right`:return`left`;case`left-inside`:return`left`;case`right-inside`:return`right`;default:return`center`}},Qu=$u={},$u;$u.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,c=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:c,w:o-a,h:c-s}},$u.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()||this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify(`bounds`)}}),this},$u.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()||!e&&t.batching())return this;function n(e){if(!e.isParent())return;var t=e._private,n=e.children(),r=e.pstyle(`compound-sizing-wrt-labels`).value===`include`,i={width:{val:e.pstyle(`min-width`).pfValue,left:e.pstyle(`min-width-bias-left`),right:e.pstyle(`min-width-bias-right`)},height:{val:e.pstyle(`min-height`).pfValue,top:e.pstyle(`min-height-bias-top`),bottom:e.pstyle(`min-height-bias-bottom`)}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;(a.w===0||a.h===0)&&(a={w:e.pstyle(`width`).pfValue,h:e.pstyle(`height`).pfValue},a.x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);function s(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}function c(e,t,n,r){if(n.units===`%`)switch(r){case`width`:return e>0?n.pfValue*e:0;case`height`:return t>0?n.pfValue*t:0;case`average`:return e>0&&t>0?n.pfValue*(e+t)/2:0;case`min`:return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case`max`:return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}else if(n.units===`px`)return n.pfValue;else return 0}var l=i.width.left.value;i.width.left.units===`px`&&i.width.val>0&&(l=l*100/i.width.val);var u=i.width.right.value;i.width.right.units===`px`&&i.width.val>0&&(u=u*100/i.width.val);var d=i.height.top.value;i.height.top.units===`px`&&i.height.val>0&&(d=d*100/i.height.val);var f=i.height.bottom.value;i.height.bottom.units===`px`&&i.height.val>0&&(f=f*100/i.height.val);var p=s(i.width.val-a.w,l,u),m=p.biasDiff,h=p.biasComplementDiff,g=s(i.height.val-a.h,d,f),_=g.biasDiff,v=g.biasComplementDiff;t.autoPadding=c(a.w,a.h,e.pstyle(`padding`),e.pstyle(`padding-relative-to`).value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-m+a.x1+a.x2+h)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-_+a.y1+a.y2+v)/2}for(var r=0;r<this.length;r++){var i=this[r],a=i._private;(!a.compoundBoundsClean||e)&&(n(i),t.batching()||(a.compoundBoundsClean=!0))}return this};var ed=function(e){return e===1/0||e===-1/0?0:e},td=function(e,t,n,r,i){r-t!==0&&i-n!==0&&t!=null&&n!=null&&r!=null&&i!=null&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},nd=function(e,t){return t==null?e:td(e,t.x1,t.y1,t.x2,t.y2)},rd=function(e,t,n){return Hr(e,t,n)},id=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+`-arrow-shape`).value,s,c;if(o!==`none`){n===`source`?(s=i.srcX,c=i.srcY):n===`target`?(s=i.tgtX,c=i.tgtY):(s=i.midX,c=i.midY);var l=r.arrowBounds=r.arrowBounds||{},u=l[n]=l[n]||{};u.x1=s-a,u.y1=c-a,u.x2=s+a,u.y2=c+a,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Wi(u,1),td(e,u.x1,u.y1,u.x2,u.y2)}}},ad=function(e,t,n){if(!t.cy().headless()){var r=n?n+`-`:``,i=t._private,a=i.rstyle;if(t.pstyle(r+`label`).strValue){var o=t.pstyle(`text-halign`),s=t.pstyle(`text-valign`),c=rd(a,`labelWidth`,n),l=rd(a,`labelHeight`,n),u=rd(a,`labelX`,n),d=rd(a,`labelY`,n),f=t.pstyle(r+`text-margin-x`).pfValue,p=t.pstyle(r+`text-margin-y`).pfValue,m=t.isEdge(),h=t.pstyle(r+`text-rotation`),g=t.pstyle(`text-outline-width`).pfValue,_=t.pstyle(`text-border-width`).pfValue/2,v=t.pstyle(`text-background-padding`).pfValue,y=2,b=l,x=c,S=x/2,C=b/2,w,T,E,D;if(m)w=u-S,T=u+S,E=d-C,D=d+C;else{switch(Yu(o.value)){case`left`:w=u-x,T=u;break;case`center`:w=u-S,T=u+S;break;case`right`:w=u,T=u+x}switch(Xu(s.value)){case`top`:E=d-b,D=d;break;case`center`:E=d-C,D=d+C;break;case`bottom`:E=d,D=d+b}}var O=f-Math.max(g,_)-v-y,k=f+Math.max(g,_)+v+y,A=p-Math.max(g,_)-v-y,j=p+Math.max(g,_)+v+y;w+=O,T+=k,E+=A,D+=j;var M=n||`main`,N=i.labelBounds,P=N[M]=N[M]||{};P.x1=w,P.y1=E,P.x2=T,P.y2=D,P.w=T-w,P.h=D-E,P.leftPad=O,P.rightPad=k,P.topPad=A,P.botPad=j;var F=m&&h.strValue===`autorotate`,I=h.pfValue!=null&&h.pfValue!==0;if(F||I){var L=F?rd(i.rstyle,`labelAngle`,n):h.pfValue,R=Math.cos(L),z=Math.sin(L),B=(w+T)/2,V=(E+D)/2;if(!m){switch(Yu(o.value)){case`left`:B=T;break;case`right`:B=w}switch(Xu(s.value)){case`top`:V=D;break;case`bottom`:V=E}}var H=function(e,t){return e-=B,t-=V,{x:e*R-t*z+B,y:e*z+t*R+V}},U=H(w,E),W=H(w,D),G=H(T,E),K=H(T,D);w=Math.min(U.x,W.x,G.x,K.x),T=Math.max(U.x,W.x,G.x,K.x),E=Math.min(U.y,W.y,G.y,K.y),D=Math.max(U.y,W.y,G.y,K.y)}var ee=M+`Rot`,q=N[ee]=N[ee]||{};q.x1=w,q.y1=E,q.x2=T,q.y2=D,q.w=T-w,q.h=D-E,td(e,w,E,T,D),td(i.labelBounds.all,w,E,T,D)}return e}},od=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`outline-opacity`).value,r=t.pstyle(`outline-width`).value+t.pstyle(`outline-offset`).value;sd(e,t,n,r,`outside`,r/2)}},sd=function(e,t,n,r,i,a){if(!(n===0||r<=0||i===`inside`)){var o=t.cy().renderer(),s=o.nodeShapes[o.getNodeShape(t)];if(s){var c=t.position(),l=c.x,u=c.y,d=t.width(),f=t.height();s.hasMiterBounds?(i===`center`&&(r/=2),nd(e,s.miterBounds(l,u,d,f,r))):a!=null&&a>0&&Gi(e,[a,a,a,a])}}},cd=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`border-opacity`).value,r=t.pstyle(`border-width`).pfValue,i=t.pstyle(`border-position`).value;sd(e,t,n,r,i)}},ld=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=zi(),o=e._private,s=e.isNode(),c=e.isEdge(),l,u,d,f,p,m,h=o.rstyle,g=s&&r?e.pstyle(`bounds-expansion`).pfValue:[0],_=function(e){return e.pstyle(`display`).value!==`none`},v=!r||_(e)&&(!c||_(e.source())&&_(e.target()));if(v){var y=0,b=0;r&&t.includeOverlays&&(y=e.pstyle(`overlay-opacity`).value,y!==0&&(b=e.pstyle(`overlay-padding`).value));var x=0,S=0;r&&t.includeUnderlays&&(x=e.pstyle(`underlay-opacity`).value,x!==0&&(S=e.pstyle(`underlay-padding`).value));var C=Math.max(b,S),w=0,T=0;if(r&&(w=e.pstyle(`width`).pfValue,T=w/2),s&&t.includeNodes){var E=e.position();p=E.x,m=E.y;var D=e.outerWidth()/2,O=e.outerHeight()/2;l=p-D,u=p+D,d=m-O,f=m+O,td(a,l,d,u,f),r&&od(a,e),r&&t.includeOutlines&&!i&&od(a,e),r&&cd(a,e)}else if(c&&t.includeEdges){if(r&&!i){var k=e.pstyle(`curve-style`).strValue;if(l=Math.min(h.srcX,h.midX,h.tgtX),u=Math.max(h.srcX,h.midX,h.tgtX),d=Math.min(h.srcY,h.midY,h.tgtY),f=Math.max(h.srcY,h.midY,h.tgtY),l-=T,u+=T,d-=T,f+=T,td(a,l,d,u,f),k===`haystack`){var A=h.haystackPts;if(A&&A.length===2){if(l=A[0].x,d=A[0].y,u=A[1].x,f=A[1].y,l>u){var j=l;l=u,u=j}if(d>f){var M=d;d=f,f=M}td(a,l-T,d-T,u+T,f+T)}}else if(k===`bezier`||k===`unbundled-bezier`||Ut(k,`segments`)||Ut(k,`taxi`)){var N;switch(k){case`bezier`:case`unbundled-bezier`:N=h.bezierPts;break;case`segments`:case`taxi`:case`round-segments`:case`round-taxi`:N=h.linePts}if(N!=null)for(var P=0;P<N.length;P++){var F=N[P];l=F.x-T,u=F.x+T,d=F.y-T,f=F.y+T,td(a,l,d,u,f)}}}else{var I=e.source().position(),L=e.target().position();if(l=I.x,u=L.x,d=I.y,f=L.y,l>u){var R=l;l=u,u=R}if(d>f){var z=d;d=f,f=z}l-=T,u+=T,d-=T,f+=T,td(a,l,d,u,f)}}if(r&&t.includeEdges&&c&&(id(a,e,`mid-source`),id(a,e,`mid-target`),id(a,e,`source`),id(a,e,`target`)),r&&e.pstyle(`ghost`).value===`yes`){var B=e.pstyle(`ghost-offset-x`).pfValue,V=e.pstyle(`ghost-offset-y`).pfValue;td(a,a.x1+B,a.y1+V,a.x2+B,a.y2+V)}var H=o.bodyBounds=o.bodyBounds||{};Ki(H,a),Gi(H,g),Wi(H,1),r&&(l=a.x1,u=a.x2,d=a.y1,f=a.y2,td(a,l-C,d-C,u+C,f+C));var U=o.overlayBounds=o.overlayBounds||{};Ki(U,a),Gi(U,g),Wi(U,1);var W=o.labelBounds=o.labelBounds||{};W.all==null?W.all=zi():Vi(W.all),r&&t.includeLabels&&(t.includeMainLabels&&ad(a,e,null),c&&(t.includeSourceLabels&&ad(a,e,`source`),t.includeTargetLabels&&ad(a,e,`target`)))}return a.x1=ed(a.x1),a.y1=ed(a.y1),a.x2=ed(a.x2),a.y2=ed(a.y2),a.w=ed(a.x2-a.x1),a.h=ed(a.y2-a.y1),a.w>0&&a.h>0&&v&&(Gi(a,g),Wi(a,1)),a},ud=function(e){var t=0,n=function(e){return+!!e<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays),r+=n(e.includeOutlines),r},dd=function(e){var t=function(e){return Math.round(e)};if(e.isEdge()){var n=e.source().position(),r=e.target().position();return mr([t(n.x),t(n.y),t(r.x),t(r.y)])}var i=e.position();return mr([t(i.x),t(i.y)])},fd=function(e,t){var n=e._private,r,i=e.isEdge(),a=(t==null?md:ud(t))===md;if(n.bbCache==null?(r=ld(e,pd),n.bbCache=r,n.bbCachePosKey=dd(e)):r=n.bbCache,!a){var o=e.isNode();r=zi(),(t.includeNodes&&o||t.includeEdges&&!o)&&(t.includeOverlays?nd(r,n.overlayBounds):nd(r,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?nd(r,n.labelBounds.all):(t.includeMainLabels&&nd(r,n.labelBounds.mainRot),t.includeSourceLabels&&nd(r,n.labelBounds.sourceRot),t.includeTargetLabels&&nd(r,n.labelBounds.targetRot))),r.w=r.x2-r.x1,r.h=r.y2-r.y1}return r},pd={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},md=ud(pd),hd=Rr(pd);$u.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=Rt(function(e){var t=e._private;return t.bbCache==null||t.styleDirty||t.bbCachePosKey!==dd(e)},function(e){return e.id()});if(n&&this.length===1&&!r(this[0]))e=e===void 0?pd:hd(e),t=fd(this[0],e);else{t=zi(),e||=pd;var i=hd(e),a=this,o=a.cy().styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var s=0;s<a.length;s++){var c=a[s];r(c)&&c.dirtyBoundingBoxCache(),nd(t,fd(c,i))}}return t.x1=ed(t.x1),t.y1=ed(t.y1),t.x2=ed(t.x2),t.y2=ed(t.y2),t.w=ed(t.x2-t.x1),t.h=ed(t.y2-t.y1),t},$u.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds[`mid-source`]=null,t.arrowBounds[`mid-target`]=null}return this.emitAndNotify(`bounds`),this},$u.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter(function(e){return e.isParent()}),t=t.not(i)),Ct(e)){var a=e;e=function(){return a}}var o=function(t,n){return t._private.bbAtOldPos=e(t,n)},s=function(e){return e._private.bbAtOldPos};n.startBatch(),t.forEach(o).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var c=Bi(this.boundingBox({useCache:!1}));return t.silentPositions(s),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),c},Qu.boundingbox=Qu.bb=Qu.boundingBox,Qu.renderedBoundingbox=Qu.renderedBoundingBox;var gd=$u,_d=vd={},vd,yd=function(e){e.uppercaseName=Ht(e.name),e.autoName=`auto`+e.uppercaseName,e.labelName=`label`+e.uppercaseName,e.outerName=`outer`+e.uppercaseName,e.uppercaseOuterName=Ht(e.outerName),_d[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);switch(i.strValue){case`label`:return t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return i.pfValue}}else return 1}},_d[`outer`+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t){if(n){var r=t[e.name](),i=t.pstyle(`border-position`).value,a=i===`center`?t.pstyle(`border-width`).pfValue:i===`outside`?2*t.pstyle(`border-width`).pfValue:0,o=2*t.padding();return r+a+o}return 1}},_d[`rendered`+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},_d[`rendered`+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};yd({name:`width`}),yd({name:`height`}),vd.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding===void 0?e.pstyle(`padding`).pfValue:t.autoPadding):e.pstyle(`padding`).pfValue},vd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},vd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var bd=vd,xd=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},Sd=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return yi(t(e),n.zoom(),n.pan())}},Cd=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map(function(e){return yi(e,i,r)})}},wd={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Td=function(e){return`rendered`+e[0].toUpperCase()+e.substr(1)},Ed=$t({},Ju,gd,bd,Object.keys(wd).reduce(function(e,t){var n=wd[t],r=Td(t);return e[t]=function(){return xd(this,n.get)},e[r]=n.mult?function(){return Cd(this,n.get)}:function(){return Sd(this,n.get)},e},{})),Dd=function(e,t){this.recycle(e,t)};function Od(){return!1}function kd(){return!0}Dd.prototype={instanceString:function(){return`event`},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Od,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?kd:Od):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type==null?this.type:t.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=kd;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=kd;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=kd,this.stopPropagation()},isDefaultPrevented:Od,isPropagationStopped:Od,isImmediatePropagationStopped:Od};var Ad=/^([^.]+)(\.(?:[^.]+))?$/,jd=`.*`,Md={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Nd=Object.keys(Md),Pd={};function Fd(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pd,t=arguments.length>1?arguments[1]:void 0,n=0;n<Nd.length;n++){var r=Nd[n];this[r]=e[r]||Md[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Id=Fd.prototype,Ld=function(e,t,n,r,i,a,o){xt(r)&&(i=r,r=null),o&&(a=a==null?o:$t({},a,o));for(var s=St(n)?n:n.split(/\s+/),c=0;c<s.length;c++){var l=s[c];if(!Nt(l)){var u=l.match(Ad);if(u){var d=u[1];if(t(e,l,d,u[2]?u[2]:null,r,i,a)===!1)break}}}},Rd=function(e,t){return e.addEventFields(e.context,t),new Dd(t.type,t)},zd=function(e,t,n){if(Mt(n)){t(e,n);return}if(Ct(n)){t(e,Rd(e,n));return}for(var r=St(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!Nt(a)){var o=a.match(Ad);if(o){var s=o[1];t(e,Rd(e,{type:s,namespace:o[2]?o[2]:null,target:e.context}))}}}};Id.on=Id.addListener=function(e,t,n,r,i){return Ld(this,function(e,t,n,r,i,a,o){xt(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})},e,t,n,r,i),this},Id.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Id.removeListener=Id.off=function(e,t,n,r){var i=this;this.emitting!==0&&(this.listeners=Pr(this.listeners));for(var a=this.listeners,o=function(o){var s=a[o];Ld(i,function(t,n,r,i,c,l){if((s.type===r||e===`*`)&&(!i&&s.namespace!==`.*`||s.namespace===i)&&(!c||t.qualifierCompare(s.qualifier,c))&&(!l||s.callback===l))return a.splice(o,1),!1},e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},Id.removeAllListeners=function(){return this.removeListener(`*`)},Id.emit=Id.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,St(t)||(t=[t]),zd(this,function(e,a){n!=null&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(){var n=r[s];if(n.type===a.type&&(!n.namespace||n.namespace===a.namespace||n.namespace===jd)&&e.eventMatches(e.context,n,a)){var i=[a];t!=null&&Vr(i,t),e.beforeEmit(e.context,n,a),n.conf&&n.conf.one&&(e.listeners=e.listeners.filter(function(e){return e!==n}));var o=e.callbackContext(e.context,n,a),c=n.callback.apply(o,i);e.afterEmit(e.context,n,a),c===!1&&(a.stopPropagation(),a.preventDefault())}},s=0;s<i;s++)o();e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)},e),this.emitting--,this};var Bd={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&Ot(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Vd=function(e){return Z(e)?new ku(e):e},Hd={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||=new Fd(Bd,t)}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Vd(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=Vd(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=Vd(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=Vd(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};ou.eventAliasesOn(Hd);var Ud={nodes:function(e){return this.filter(function(e){return e.isNode()}).filter(e)},edges:function(e){return this.filter(function(e){return e.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(Z(e)||Dt(e))return new ku(e).filter(this);if(xt(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var a=r[i];(t?e.apply(t,[a,i,r]):e(a,i,r))&&n.push(a)}return n}return this.spawn()},not:function(e){if(e){Z(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(Z(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=this,i=e,a=this.length<e.length,o=a?r:i,s=a?i:r,c=0;c<o.length;c++){var l=o[c];s.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;Z(e)&&(e=t.$(e));var n=this.spawn(),r=this,i=e,a=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return a(r,i),a(i,r),n},diff:function(e){var t=this._private.cy;Z(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=this,o=e,s=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return s(a,o,n),s(o,a,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(Z(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i];this.has(a)||r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&Z(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var c=this.length++;this[c]=o,i.set(s,{ele:o,index:c})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&Z(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var a=r[i],o=t?e.apply(t,[a,i,r]):e(a,i,r);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n=-1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s>n&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s<n&&(n=s,r=o)}return{value:n,ele:r}}},Wd=Ud;Wd.u=Wd[`|`]=Wd[`+`]=Wd.union=Wd.or=Wd.add,Wd[`\\`]=Wd[`!`]=Wd[`-`]=Wd.difference=Wd.relativeComplement=Wd.subtract=Wd.not,Wd.n=Wd[`&`]=Wd[`.`]=Wd.and=Wd.intersection=Wd.intersect,Wd[`^`]=Wd[`(+)`]=Wd[`(-)`]=Wd.symmetricDifference=Wd.symdiff=Wd.xor,Wd.fnFilter=Wd.filterFn=Wd.stdFilter=Wd.filter,Wd.complement=Wd.abscomp=Wd.absoluteComplement;var Gd={isNode:function(){return this.group()===`nodes`},isEdge:function(){return this.group()===`edges`},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Kd=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle(`z-compound-depth`);return t.value===`auto`?n?e.zDepth():0:t.value===`bottom`?-1:t.value===`top`?wr:0}var i=r(e)-r(t);if(i!==0)return i;function a(e){return e.pstyle(`z-index-compare`).value===`auto`?+!!e.isNode():0}var o=a(e)-a(t);if(o!==0)return o;var s=e.pstyle(`z-index`).value-t.pstyle(`z-index`).value;return s===0?e.poolIndex()-t.poolIndex():s},qd={forEach:function(e,t){if(xt(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if((t?e.apply(t,[i,r,this]):e(i,r,this))===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;t??=r,e??=0,e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!xt(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Kd)},zDepth:function(){var e=this[0];if(e){var t=e._private;if(t.group===`nodes`){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:wr-1}var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}};qd.each=qd.forEach,(function(){var e=`undefined`;(typeof Symbol>`u`?`undefined`:ft(Symbol))!=e&&ft(Symbol.iterator)!=e&&(qd[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return rt({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})})})();var Jd=Rr({nodeDimensionsIncludeLabels:!1}),Yd={layoutDimensions:function(e){e=Jd(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter(function(e){return!e.isParent()}),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=Rt(n,o);e.emit({type:`layoutstart`,layout:e}),e.animations=[];var c=function(e,t,n){var r={x:t.x1+t.w/2,y:t.y1+t.h/2},i={x:(n.x-r.x)*e,y:(n.y-r.y)*e};return{x:r.x+i.x,y:r.y+i.y}},l=t.spacingFactor&&t.spacingFactor!==1,u=function(){if(!l)return null;for(var e=zi(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);Ui(e,i.x,i.y)}return e}(),d=Rt(function(e,n){var r=s(e,n);return l&&(r=c(Math.abs(t.spacingFactor),u,r)),t.transform!=null&&(r=t.transform(e,r)),r},o);if(t.animate){for(var f=0;f<r.length;f++){var p=r[f],m=d(p,f);if(t.animateFilter==null||t.animateFilter(p,f)){var h=p.animation({position:m,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(h)}else p.position(m)}if(t.fit){var g=i.animation({fit:{boundingBox:a.boundingBoxAt(d),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}else if(t.zoom!==void 0&&t.pan!==void 0){var _=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(_)}e.animations.forEach(function(e){return e.play()}),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),os.all(e.animations.map(function(e){return e.promise()})).then(function(){e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e})})}else r.positions(d),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e});return this},layout:function(e){return this.cy().makeLayout($t({},e,{eles:this}))}};Yd.createLayout=Yd.makeLayout=Yd.layout;function Xd(e,t,n){var r=n._private,i=r.styleCache=r.styleCache||[],a;return(a=i[e])??(a=i[e]=t(n)),a}function Zd(e,t){return e=hr(e),function(n){return Xd(e,t,n)}}function Qd(e,t){e=hr(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Xd(e,n,t)}}var $d={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(e){return e._private.styleCache=null};if(e.hasCompoundNodes()){var n=this.spawnSelf().merge(this.descendants()).merge(this.parents());n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(e){t(e),e.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=t.hasCompoundNodes(),r=this;e=!!(e||e===void 0),n&&(r=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=r;return e?i.emitAndNotify(`style`):i.emit(`style`),r.forEach(function(e){return e._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],r=n.cy();if(r.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n)),n._private.style[e]??(t?r.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue===void 0?n.value:n.pfValue}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(Ct(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify(`style`)}else if(Z(e)){if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify(`style`)}else if(e===void 0){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(e===void 0)for(var a=0;a<i.length;a++){var o=i[a];r.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var s=0;s<i.length;s++){var c=i[s];r.removeBypasses(c,e,n)}}return this.emitAndNotify(`style`),this},show:function(){return this.css(`display`,`element`),this},hide:function(){return this.css(`display`,`none`),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle(`opacity`).value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++)i=a[o].pstyle(`opacity`).value*i;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();if(e)return t?e.effectiveOpacity()===0:e.pstyle(`opacity`).value===0},backgrounding:function(){return this.cy().styleEnabled()?!!this[0]._private.backgrounding:!1}};function ef(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){var i=n[r];if(!t(i))return!1}return!0}function tf(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||ef(i,r);var s=o.source,c=o.target;return n(s)&&(!a||ef(s,n))&&(s===c||n(c)&&(!a||ef(c,n)))}}}var nf=Zd(`eleTakesUpSpace`,function(e){return e.pstyle(`display`).value===`element`&&e.width()!==0&&(!e.isNode()||e.height()!==0)});$d.takesUpSpace=Qd(`takesUpSpace`,tf({ok:nf})),$d.interactive=Qd(`interactive`,tf({ok:Zd(`eleInteractive`,function(e){return e.pstyle(`events`).value===`yes`&&e.pstyle(`visibility`).value===`visible`&&nf(e)}),parentOk:Zd(`parentInteractive`,function(e){return e.pstyle(`visibility`).value===`visible`&&nf(e)}),edgeOkViaNode:nf})),$d.noninteractive=function(){var e=this[0];if(e)return!e.interactive()},$d.visible=Qd(`visible`,tf({ok:Zd(`eleVisible`,function(e){return e.pstyle(`visibility`).value===`visible`&&e.pstyle(`opacity`).pfValue!==0&&nf(e)}),edgeOkViaNode:nf})),$d.hidden=function(){var e=this[0];if(e)return!e.visible()},$d.isBundledBezier=Qd(`isBundledBezier`,function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle(`curve-style`).value===`bezier`&&this.takesUpSpace():!1}),$d.bypass=$d.css=$d.style,$d.renderedCss=$d.renderedStyle,$d.removeBypass=$d.removeCss=$d.removeStyle,$d.pstyle=$d.parsedStyle;var rf={};function af(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(t.length===1&&xt(t[0])){var a=t[0];this.on(e.event,a)}else if(t.length===0||t.length===1&&St(t[0])){for(var o=t.length===1?t[0]:null,s=0;s<this.length;s++){var c=this[s],l=!e.ableField||c._private[e.ableField],u=c._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(c);if(d!==void 0&&(l=d,!d))return this}l&&(c._private[e.field]=e.value,u&&n.push(c))}var f=this.spawn(n);f.updateStyle(),f.emit(e.event),o&&f.emit(o)}return this}}function of(e){rf[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},rf[e.on]=af({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),rf[e.off]=af({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}of({field:`locked`,overrideField:function(e){return e.cy().autolock()?!0:void 0},on:`lock`,off:`unlock`}),of({field:`grabbable`,overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:`grabify`,off:`ungrabify`}),of({field:`selected`,ableField:`selectable`,overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:`select`,off:`unselect`}),of({field:`selectable`,overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:`selectify`,off:`unselectify`}),rf.deselect=rf.unselect,rf.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},of({field:`active`,on:`activate`,off:`unactivate`}),of({field:`pannable`,on:`panify`,off:`unpanify`}),rf.inactive=function(){var e=this[0];if(e)return!e._private.active};var sf={},cf=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode()){for(var o=!1,s=a.connectedEdges(),c=0;c<s.length;c++){var l=s[c],u=l.source(),d=l.target();if(e.noIncomingEdges&&d===a&&u!==a||e.noOutgoingEdges&&u===a&&d!==a){o=!0;break}}o||r.push(a)}}return this.spawn(r,!0).filter(t)}},lf=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode())for(var o=a.connectedEdges(),s=0;s<o.length;s++){var c=o[s],l=c.source(),u=c.target();e.outgoing&&l===a?(r.push(c),r.push(u)):e.incoming&&u===a&&(r.push(c),r.push(l))}}return this.spawn(r,!0).filter(t)}},uf=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(a.length===0)break;for(var o=!1,s=0;s<a.length;s++){var c=a[s],l=c.id();i[l]||(i[l]=!0,r.push(c),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}};sf.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},$t(sf,{roots:cf({noIncomingEdges:!0}),leaves:cf({noOutgoingEdges:!0}),outgoers:Mu(lf({outgoing:!0}),`outgoers`),successors:uf({outgoing:!0}),incomers:Mu(lf({incoming:!0}),`incomers`),predecessors:uf({})}),$t(sf,{neighborhood:Mu(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],c=s.source(),l=s.target(),u=i===c?l:c;u.length>0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},`neighborhood`),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),sf.neighbourhood=sf.neighborhood,sf.closedNeighbourhood=sf.closedNeighborhood,sf.openNeighbourhood=sf.openNeighborhood,$t(sf,{source:Mu(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},`source`),target:Mu(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},`target`),sources:df({attr:`source`}),targets:df({attr:`target`})});function df(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}$t(sf,{edgesWith:Mu(ff(),`edgesWith`),edgesTo:Mu(ff({thisIsSrc:!0}),`edgesTo`)});function ff(e){return function(t){var n=[],r=this._private.cy,i=e||{};Z(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var c=o[s],l=c._private.data,u=this.hasElementWithId(l.source)&&t.hasElementWithId(l.target),d=t.hasElementWithId(l.source)&&this.hasElementWithId(l.target);(u||d)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!u||i.thisIsTgt&&!d)||n.push(c))}return this.spawn(n,!0)}}$t(sf,{connectedEdges:Mu(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var a=i._private.edges,o=0;o<a.length;o++){var s=a[o];t.push(s)}}return this.spawn(t,!0).filter(e)},`connectedEdges`),connectedNodes:Mu(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(t.push(i.source()[0]),t.push(i.target()[0]))}return this.spawn(t,!0).filter(e)},`connectedNodes`),parallelEdges:Mu(pf(),`parallelEdges`),codirectedEdges:Mu(pf({codirected:!0}),`codirectedEdges`)});function pf(e){return e=$t({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,c=s._private.data.id,l=o.data.target,u=s._private.edges,d=0;d<u.length;d++){var f=u[d],p=f._private.data,m=p.target,h=p.source,g=m===l&&h===c,_=c===m&&l===h;(i.codirected&&g||!i.codirected&&(g||_))&&n.push(f)}return this.spawn(n,!0).filter(t)}}$t(sf,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=e==null?t.nodes():e.nodes(),a=[];e!=null&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach(function(n){n.connectedEdges().forEach(function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)})})};do s();while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),sf.componentsOf=sf.components;var mf=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e===void 0){kr(`A collection must have a reference to the core`);return}var i=new Wr,a=!1;if(!t)t=[];else if(t.length>0&&Ct(t[0])&&!Ot(t[0])){a=!0;for(var o=[],s=new qr,c=0,l=t.length;c<l;c++){var u=t[c];u.data??={};var d=u.data;if(d.id==null)d.id=Fr();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var f=new Jr(e,u,!1);o.push(f),s.add(d.id)}t=o}this.length=0;for(var p=0,m=t.length;p<m;p++){var h=t[p][0];if(h!=null){var g=h._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:h}),this[this.length]=h,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap??this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Wr,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),a&&!r&&this.restore()},hf=Jr.prototype=mf.prototype=Object.create(Array.prototype);hf.instanceString=function(){return`collection`},hf.spawn=function(e,t){return new mf(this.cy(),e,t)},hf.spawnSelf=function(){return this.spawn(this)},hf.cy=function(){return this._private.cy},hf.renderer=function(){return this._private.cy.renderer()},hf.element=function(){return this[0]},hf.collection=function(){return kt(this)?this:new mf(this._private.cy,[this])},hf.unique=function(){return new mf(this._private.cy,this,!0)},hf.hasElementWithId=function(e){return e=``+e,this._private.map.has(e)},hf.getElementById=function(e){e=``+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new mf(t)},hf.$id=hf.getElementById,hf.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},hf.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},hf.indexOfId=function(e){return e=``+e,this._private.map.get(e).index},hf.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(Ct(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,c=e.data.target;s!=null&&s!=i.source&&(o.source=``+s,a=!0),c!=null&&c!=i.target&&(o.target=``+c,a=!0),a&&(t=t.move(o))}else{var l=`parent`in e.data,u=e.data.parent;l&&(u!=null||i.parent!=null)&&u!=i.parent&&(u===void 0&&(u=null),u!=null&&(u=``+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var d=function(n,i,a){var o=e[n];o!=null&&o!==r[n]&&(o?t[i]():t[a]())};return d(`removed`,`remove`,`restore`),d(`selected`,`select`,`unselect`),d(`selectable`,`selectify`,`unselectify`),d(`locked`,`lock`,`unlock`),d(`grabbable`,`grabify`,`ungrabify`),d(`pannable`,`panify`,`unpanify`),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}if(e===void 0){var f={data:Nr(r.data),position:Nr(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};f.classes=``;var p=0;return r.classes.forEach(function(e){return f.classes+=p++===0?e:` `+e}),f}}},hf.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},hf.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=new Jr(e,this[n].json(),!1);t.push(r)}return new mf(e,t)},hf.copy=hf.clone,hf.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),i=r._private,a=[],o=[],s,c=0,l=n.length;c<l;c++){var u=n[c];(!t||u.removed())&&(u.isNode()?a.push(u):o.push(u))}s=a.concat(o);var d,f=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var p=s[d],m=p._private,h=m.data;if(p.clearTraversalCache(),t||m.removed){if(h.id===void 0)h.id=Fr();else if(Q(h.id))h.id=``+h.id;else if(Nt(h.id)||!Z(h.id)){kr("Can not create element with invalid string ID `"+h.id+"`"),f();continue}else if(r.hasElementWithId(h.id)){kr("Can not create second element with ID `"+h.id+"`"),f();continue}}var g=h.id;if(p.isNode()){var _=m.position;_.x??=0,_.y??=0}if(p.isEdge()){for(var v=p,y=[`source`,`target`],b=y.length,x=!1,S=0;S<b;S++){var C=y[S],w=h[C];Q(w)&&(w=h[C]=``+h[C]),w==null||w===``?(kr("Can not create edge `"+g+"` with unspecified "+C),x=!0):r.hasElementWithId(w)||(kr("Can not create edge `"+g+"` with nonexistent "+C+" `"+w+"`"),x=!0)}if(x){f();continue}var T=r.getElementById(h.source),E=r.getElementById(h.target);T.same(E)?T._private.edges.push(v):(T._private.edges.push(v),E._private.edges.push(v)),v._private.source=T,v._private.target=E}m.map=new Wr,m.map.set(g,{ele:p,index:0}),m.removed=!1,t&&r.addToPool(p)}for(var D=0;D<a.length;D++){var O=a[D],k=O._private.data;Q(k.parent)&&(k.parent=``+k.parent);var A=k.parent;if(A!=null||O._private.parent){var j=O._private.parent?r.collection().merge(O._private.parent):r.getElementById(A);if(j.empty())k.parent=void 0;else if(j[0].removed())jr(`Node added with missing parent, reference to parent removed`),k.parent=void 0,O._private.parent=null;else{for(var M=!1,N=j;!N.empty();){if(O.same(N)){M=!0,k.parent=void 0;break}N=N.parent()}M||(j[0]._private.children.push(O),O._private.parent=j[0],i.hasCompoundNodes=!0)}}}if(s.length>0){for(var P=s.length===n.length?n:new mf(r,s),F=0;F<P.length;F++){var I=P[F];I.isNode()||(I.parallelEdges().clearTraversalCache(),I.source().clearTraversalCache(),I.target().clearTraversalCache())}(i.hasCompoundNodes?r.collection().merge(P).merge(P.connectedNodes()).merge(P.parent()):P).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?P.emitAndNotify(`add`):t&&P.emit(`add`)}return n},hf.removed=function(){var e=this[0];return e&&e._private.removed},hf.inside=function(){var e=this[0];return e&&!e._private.removed},hf.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n<t.length;n++)c(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)c(t[n])}function c(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),o(e),s(e)):r.unshift(e))}for(var l=0,u=n.length;l<u;l++){var d=n[l];c(d)}function f(e,t){var n=e._private.edges;zr(n,t),e.clearTraversalCache()}function p(e){e.clearTraversalCache()}var m=[];m.ids={};function h(e,t){t=t[0],e=e[0];var n=e._private.children,r=e.id();zr(n,t),t._private.parent=null,m.ids[r]||(m.ids[r]=!0,m.push(e))}n.dirtyCompoundBoundsCache(),t&&a.removeFromPool(r);for(var g=0;g<r.length;g++){var _=r[g];if(_.isEdge()){var v=_.source()[0],y=_.target()[0];f(v,_),f(y,_);for(var b=_.parallelEdges(),x=0;x<b.length;x++){var S=b[x];p(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var C=_.parent();C.length!==0&&h(C,_)}t&&(_._private.removed=!0)}var w=a._private.elements;a._private.hasCompoundNodes=!1;for(var T=0;T<w.length;T++)if(w[T].isParent()){a._private.hasCompoundNodes=!0;break}var E=new mf(this.cy(),r);E.size()>0&&(e?E.emitAndNotify(`remove`):t&&E.emit(`remove`));for(var D=0;D<m.length;D++){var O=m[D];(!t||!O.removed())&&O.updateStyle()}return E},hf.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,a=function(e){return e==null?e:``+e};if(e.source!==void 0||e.target!==void 0){var o=a(e.source),s=a(e.target),c=o!=null&&t.hasElementWithId(o),l=s!=null&&t.hasElementWithId(s);(c||l)&&(t.batch(function(){n.remove(r,i),n.emitAndNotify(`moveout`);for(var e=0;e<n.length;e++){var t=n[e],a=t._private.data;t.isEdge()&&(c&&(a.source=o),l&&(a.target=s))}n.restore(r,i)}),n.emitAndNotify(`move`))}else if(e.parent!==void 0){var u=a(e.parent);if(u===null||t.hasElementWithId(u)){var d=u===null?void 0:u;t.batch(function(){var e=n.remove(r,i);e.emitAndNotify(`moveout`);for(var t=0;t<n.length;t++){var a=n[t],o=a._private.data;a.isNode()&&(o.parent=d)}e.restore(r,i)}),n.emitAndNotify(`move`)}}return this},[Xo,su,cu,ju,Nu,Bu,Vu,Ed,Hd,Ud,Gd,qd,Yd,$d,rf,sf].forEach(function(e){$t(hf,e)});var gf={add:function(e){var t,n=this;if(Dt(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],a=0;a<r.length;a++){var o=r[a];i.push(o.json())}t=new mf(n,i)}}else if(St(e))t=new mf(n,e);else if(Ct(e)&&(St(e.nodes)||St(e.edges))){for(var s=e,c=[],l=[`nodes`,`edges`],u=0,d=l.length;u<d;u++){var f=l[u],p=s[f];if(St(p))for(var m=0,h=p.length;m<h;m++){var g=$t({group:f},p[m]);c.push(g)}}t=new mf(n,c)}else t=new Jr(n,e).collection();return t},remove:function(e){if(!Dt(e)&&Z(e)){var t=e;e=this.$(t)}return e.remove()}};function _f(e,t,n,r){var i=11,a=1/(i-1),o=typeof Float32Array<`u`;if(arguments.length!==4)return!1;for(var s=0;s<4;++s)if(typeof arguments[s]!=`number`||isNaN(arguments[s])||!isFinite(arguments[s]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var c=o?new Float32Array(i):Array(i);function l(e,t){return 1-3*t+3*e}function u(e,t){return 3*t-6*e}function d(e){return 3*e}function f(e,t,n){return((l(t,n)*e+u(t,n))*e+d(t))*e}function p(e,t,n){return 3*l(t,n)*e*e+2*u(t,n)*e+d(t)}function m(t,r){for(var i=0;i<4;++i){var a=p(r,e,n);if(a===0)return r;var o=f(r,e,n)-t;r-=o/a}return r}function h(){for(var t=0;t<i;++t)c[t]=f(t*a,e,n)}function g(t,r,i){var a,o,s=0;do o=r+(i-r)/2,a=f(o,e,n)-t,a>0?i=o:r=o;while(Math.abs(a)>1e-7&&++s<10);return o}function _(t){for(var r=0,o=1,s=i-1;o!==s&&c[o]<=t;++o)r+=a;--o;var l=(t-c[o])/(c[o+1]-c[o]),u=r+l*a,d=p(u,e,n);return d>=.001?m(t,u):d===0?u:g(t,r,r+a)}var v=!1;function y(){v=!0,(e!==t||n!==r)&&h()}var b=function(i){return v||y(),e===t&&n===r?i:i===0?0:i===1?1:f(_(i),t,r)};b.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var x=`generateBezier(`+[e,t,n,r]+`)`;return b.toString=function(){return x},b}var vf=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,r*.5,i),o=t(n,r*.5,a),s=t(n,r,o),c=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),l=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x+=c*r,n.v+=l*r,n}return function e(t,r,i){var a={x:-1,v:0,tension:null,friction:null},o=[0],s=0,c=1/1e4,l=16/1e3,u,d,f;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i||=null,a.tension=t,a.friction=r,u=i!==null,u?(s=e(t,r),d=s/i*l):d=l;f=n(f||a,d),o.push(1+f.x),s+=16,Math.abs(f.x)>c&&Math.abs(f.v)>c;);return u?function(e){return o[e*(o.length-1)|0]}:s}}(),yf=function(e,t,n,r){var i=_f(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},bf={linear:function(e,t,n){return e+(t-e)*n},ease:yf(.25,.1,.25,1),"ease-in":yf(.42,0,1,1),"ease-out":yf(0,0,.58,1),"ease-in-out":yf(.42,0,.58,1),"ease-in-sine":yf(.47,0,.745,.715),"ease-out-sine":yf(.39,.575,.565,1),"ease-in-out-sine":yf(.445,.05,.55,.95),"ease-in-quad":yf(.55,.085,.68,.53),"ease-out-quad":yf(.25,.46,.45,.94),"ease-in-out-quad":yf(.455,.03,.515,.955),"ease-in-cubic":yf(.55,.055,.675,.19),"ease-out-cubic":yf(.215,.61,.355,1),"ease-in-out-cubic":yf(.645,.045,.355,1),"ease-in-quart":yf(.895,.03,.685,.22),"ease-out-quart":yf(.165,.84,.44,1),"ease-in-out-quart":yf(.77,0,.175,1),"ease-in-quint":yf(.755,.05,.855,.06),"ease-out-quint":yf(.23,1,.32,1),"ease-in-out-quint":yf(.86,0,.07,1),"ease-in-expo":yf(.95,.05,.795,.035),"ease-out-expo":yf(.19,1,.22,1),"ease-in-out-expo":yf(1,0,0,1),"ease-in-circ":yf(.6,.04,.98,.335),"ease-out-circ":yf(.075,.82,.165,1),"ease-in-out-circ":yf(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return bf.linear;var r=vf(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":yf};function xf(e,t,n,r,i){if(r===1||t===n)return n;var a=i(t,n,r);return e==null?a:((e.roundValue||e.color)&&(a=Math.round(a)),e.min!==void 0&&(a=Math.max(a,e.min)),e.max!==void 0&&(a=Math.min(a,e.max)),a)}function Sf(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!==`%`)?e.pfValue:e.value:e}function Cf(e,t,n,r,i){var a=i==null?null:i.type;n<0?n=0:n>1&&(n=1);var o=Sf(e,i),s=Sf(t,i);if(Q(o)&&Q(s))return xf(a,o,s,n,r);if(St(o)&&St(s)){for(var c=[],l=0;l<s.length;l++){var u=o[l],d=s[l];if(u!=null&&d!=null){var f=xf(a,u,d,n,r);c.push(f)}else c.push(d)}return c}}function wf(e,t,n,r){var i=!r,a=e._private,o=t._private,s=o.easing,c=o.startTime,l=(r?e:e.cy()).style();if(!o.easingImpl){if(s==null)o.easingImpl=bf.linear;else{var u=Z(s)?l.parse(`transition-timing-function`,s).value:s,d,f;Z(u)?(d=u,f=[]):(d=u[1],f=u.slice(2).map(function(e){return+e})),f.length>0?(d===`spring`&&f.push(o.duration),o.easingImpl=bf[d].apply(null,f)):o.easingImpl=bf[d]}}var p=o.easingImpl,m=o.duration===0?1:(n-c)/o.duration;if(o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var h=o.startPosition,g=o.position;if(g&&i&&!e.locked()){var _={};Tf(h.x,g.x)&&(_.x=Cf(h.x,g.x,m,p)),Tf(h.y,g.y)&&(_.y=Cf(h.y,g.y,m,p)),e.position(_)}var v=o.startPan,y=o.pan,b=a.pan,x=y!=null&&r;x&&(Tf(v.x,y.x)&&(b.x=Cf(v.x,y.x,m,p)),Tf(v.y,y.y)&&(b.y=Cf(v.y,y.y,m,p)),e.emit(`pan`));var S=o.startZoom,C=o.zoom,w=C!=null&&r;w&&(Tf(S,C)&&(a.zoom=Ri(a.minZoom,Cf(S,C,m,p),a.maxZoom)),e.emit(`zoom`)),(x||w)&&e.emit(`viewport`);var T=o.style;if(T&&T.length>0&&i){for(var E=0;E<T.length;E++){var D=T[E],O=D.name,k=D,A=o.startStyle[O],j=l.properties[A.name],M=Cf(A,k,m,p,j);l.overrideBypass(e,O,M)}e.emit(`style`)}}return o.progress=m,m}function Tf(e,t){return e==null||t==null?!1:!!(Q(e)&&Q(t)||e&&t)}function Ef(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Df(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(a.length===0){var c=o.shift();c&&a.push(c)}for(var l=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t];n()}e.splice(0,e.length)},u=a.length-1;u>=0;u--){var d=a[u],f=d._private;if(f.stopped){a.splice(u,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.frames);continue}(f.playing||f.applying)&&(f.playing&&f.applying&&(f.applying=!1),f.started||Ef(t,d,e),wf(t,d,e,n),f.applying&&=!1,l(f.frames),f.step!=null&&f.step(e),d.completed()&&(a.splice(u,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.completes)),s=!0)}return!n&&a.length===0&&o.length===0&&r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=n[o],c=i(s);a||=c}var l=i(t,!0);(a||l)&&(n.length>0?t.notify(`draw`,n):t.notify(`draw`)),n.unmerge(r),t.emit(`step`)}var Of={animate:ou.animate(),animation:ou.animation(),animated:ou.animated(),clearQueue:ou.clearQueue(),delay:ou.delay(),delayAnimation:ou.delayAnimation(),stop:ou.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&rr(function(n){Df(n,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(t,n){Df(n,e)},n.beforeRenderPriorities.animations):t()}},kf={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&Ot(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target}},Af=function(e){return Z(e)?new ku(e):e},jf={createEmitter:function(){var e=this._private;return e.emitter||=new Fd(kf,this),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Af(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Af(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Af(t),n),this},once:function(e,t,n){return this.emitter().one(e,Af(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};ou.eventAliasesOn(jf);var Mf={png:function(e){var t=this._private.renderer;return e||={},t.png(e)},jpg:function(e){var t=this._private.renderer;return e||={},e.bg=e.bg||`#fff`,t.jpg(e)}};Mf.jpeg=Mf.jpg;var Nf={layout:function(e){var t=this;if(e==null){kr(`Layout options must be specified to make a layout`);return}if(e.name==null){kr("A `name` must be specified to make a layout");return}var n=e.name,r=t.extension(`layout`,n);if(r==null){kr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}return new r($t({},e,{cy:t,eles:Z(e.eles)?t.$(e.eles):e.eles==null?t.$():e.eles}))}};Nf.createLayout=Nf.makeLayout=Nf.layout;var Pf={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&r.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount??=0,e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}})}},Ff=Rr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),If={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify(`draw`),this},resize:function(){return this.invalidateSize(),this.emitAndNotify(`resize`),this},initRenderer:function(e){var t=this,n=t.extension(`renderer`,e.name);if(n==null){kr(`Can not initialise: No such renderer \`${e.name}\` found. Did you forget to import it and \`cytoscape.use()\` it?`);return}e.wheelSensitivity!==void 0&&jr(`You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.`);var r=Ff(e);r.cy=t,t._private.renderer=new n(r),this.notify(`init`)},destroyRenderer:function(){var e=this;e.notify(`destroy`);var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on(`render`,e)},offRender:function(e){return this.off(`render`,e)}};If.invalidateDimensions=If.resize;var Lf={collection:function(e,t){return Z(e)?this.$(e):Dt(e)?e.collection():St(e)?(t||={},new mf(this,e,t.unique,t.removed)):new mf(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Lf.elements=Lf.filter=Lf.$;var Rf={},zf=`t`,Bf=`f`;Rf.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],a=t.getContextMeta(i);if(!a.empty){var o=t.getContextStyle(a),s=t.applyContextStyle(a,o,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Rf.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+`-`+t,a=r[i];if(a)return a;for(var o=[],s={},c=0;c<n.length;c++){var l=n[c],u=e[c]===zf,d=t[c]===zf,f=u!==d,p=l.mappedProperties.length>0;if(f||d&&p){var m=void 0;f&&p||f?m=l.properties:p&&(m=l.mappedProperties);for(var h=0;h<m.length;h++){for(var g=m[h],_=g.name,v=!1,y=c+1;y<n.length;y++){var b=n[y];if(t[y]===zf&&(v=b.properties[g.name]!=null,v))break}!s[_]&&!v&&(s[_]=!0,o.push(_))}}}return r[i]=o,o},Rf.getContextMeta=function(e){for(var t=this,n=``,r,i=e._private.styleCxtKey||``,a=0;a<t.length;a++){var o=t[a];o.selector&&o.selector.matches(e)?n+=zf:n+=Bf}return r=t.getPropertiesDiff(i,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Rf.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var i={_private:{key:t}},a=0;a<n.length;a++){var o=n[a];if(t[a]===zf)for(var s=0;s<o.properties.length;s++){var c=o.properties[s];i[c.name]=c}}return r[t]=i,i},Rf.applyContextStyle=function(e,t,n){for(var r=this,i=e.diffPropNames,a={},o=r.types,s=0;s<i.length;s++){var c=i[s],l=t[c],u=n.pstyle(c);if(!l){if(u)l=u.bypass?{name:c,deleteBypassed:!0}:{name:c,delete:!0};else continue}if(u!==l){if(l.mapped===o.fn&&u!=null&&u.mapping!=null&&u.mapping.value===l.value){var d=u.mapping;if((d.fnValue=l.value(n))===d.prevFnValue)continue}var f=a[c]={prev:u};r.applyParsedProperty(n,l),f.next=n.pstyle(c),f.next&&f.next.bypass&&(f.next=f.next.bypassed)}}return{diffProps:a}},Rf.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s=t.group===`nodes`,c=e._private.style;r=Object.keys(c);for(var l=0;l<i.length;l++){var u=i[l];t.styleKeys[u]=[ar,sr]}for(var d=function(e,n){return t.styleKeys[n][0]=lr(e,t.styleKeys[n][0])},f=function(e,n){return t.styleKeys[n][1]=ur(e,t.styleKeys[n][1])},p=function(e,t){d(e,t),f(e,t)},m=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);d(r,t),f(r,t)}},h=2e9,g=function(e){return-128<e&&e<128&&Math.floor(e)!==e?h-(e*1024|0):e},_=0;_<r.length;_++){var v=r[_],y=c[v];if(y!=null){var b=this.properties[v],x=b.type,S=b.groupKey,C=void 0;b.hashOverride==null?y.pfValue!=null&&(C=y.pfValue):C=b.hashOverride(e,y);var w=b.enums==null?y.value:null,T=C!=null,E=T||w!=null,D=y.units;x.number&&E&&!x.multiple?(p(g(T?C:w),S),!T&&D!=null&&m(D,S)):m(y.strValue,S)}}for(var O=[ar,sr],k=0;k<i.length;k++){var A=i[k],j=t.styleKeys[A];O[0]=lr(j[0],O[0]),O[1]=ur(j[1],O[1])}t.styleKey=dr(O[0],O[1]);var M=t.styleKeys;t.labelDimsKey=fr(M.labelDimensions);var N=a(e,[`label`],M.labelDimensions);if(t.labelKey=fr(N),t.labelStyleKey=fr(pr(M.commonLabel,N)),!s){var P=a(e,[`source-label`],M.labelDimensions);t.sourceLabelKey=fr(P),t.sourceLabelStyleKey=fr(pr(M.commonLabel,P));var F=a(e,[`target-label`],M.labelDimensions);t.targetLabelKey=fr(F),t.targetLabelStyleKey=fr(pr(M.commonLabel,F))}if(s){var I=t.styleKeys,L=I.nodeBody,R=I.nodeBorder,z=I.nodeOutline,B=I.backgroundImage,V=I.compound,H=I.pie,U=I.stripe;t.nodeKey=fr([L,R,z,B,V,H,U].filter(function(e){return e!=null}).reduce(pr,[ar,sr])),t.hasPie=H!=null&&H[0]!==ar&&H[1]!==sr,t.hasStripe=U!=null&&U[0]!==ar&&U[1]!==sr}return o!==t.styleKey},Rf.clearStyleHints=function(e){var t=e._private;t.styleCxtKey=``,t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null},Rf.applyParsedProperty=function(e,t){var n=this,r=t,i=e._private.style,a,o=n.types,s=n.properties[r.name].type,c=r.bypass,l=i[r.name],u=l&&l.bypass,d=e._private,f=`mapping`,p=function(e){return e==null?null:e.pfValue==null?e.value:e.pfValue},m=function(){var t=p(l),i=p(r);n.checkTriggers(e,r.name,t,i)};if(t.name===`curve-style`&&e.isEdge()&&(t.value!==`bezier`&&e.isLoop()||t.value===`haystack`&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,`bezier`,c)),r.delete)return i[r.name]=void 0,m(),!0;if(r.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,m(),!0):!1:(m(),!0);if(r.deleteBypass)return l?l.bypass?(i[r.name]=l.bypassed,m(),!0):!1:(m(),!0);var h=function(){jr("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case o.mapData:for(var g=r.field.split(`.`),_=d.data,v=0;v<g.length&&_;v++){var y=g[v];_=_[y]}if(_==null)return h(),!1;var b;if(Q(_)){var x=r.fieldMax-r.fieldMin;b=x===0?0:(_-r.fieldMin)/x}else return jr("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+`: `+_+"` for `"+e.id()+"` is non-numeric)"),!1;if(b<0?b=0:b>1&&(b=1),s.color){var S=r.valueMin[0],C=r.valueMax[0],w=r.valueMin[1],T=r.valueMax[1],E=r.valueMin[2],D=r.valueMax[2],O=r.valueMin[3]==null?1:r.valueMin[3],k=r.valueMax[3]==null?1:r.valueMax[3],A=[Math.round(S+(C-S)*b),Math.round(w+(T-w)*b),Math.round(E+(D-E)*b),Math.round(O+(k-O)*b)];a={bypass:r.bypass,name:r.name,value:A,strValue:`rgb(`+A[0]+`, `+A[1]+`, `+A[2]+`)`}}else if(s.number){var j=r.valueMin+(r.valueMax-r.valueMin)*b;a=this.parse(r.name,j,r.bypass,f)}else return!1;if(!a)return h(),!1;a.mapping=r,r=a;break;case o.data:for(var M=r.field.split(`.`),N=d.data,P=0;P<M.length&&N;P++){var F=M[P];N=N[F]}if(N!=null&&(a=this.parse(r.name,N,r.bypass,f)),!a)return h(),!1;a.mapping=r,r=a;break;case o.fn:var I=r.value,L=r.fnValue==null?I(e):r.fnValue;if(r.prevFnValue=L,L==null)return jr("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(a=this.parse(r.name,L,r.bypass,f),!a)return jr("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;a.mapping=Nr(r),r=a;break;case void 0:break;default:return!1}return c?(u?r.bypassed=l.bypassed:r.bypassed=l,i[r.name]=r):u?l.bypassed=r:i[r.name]=r,m(),!0},Rf.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],c=i[s];c!=null&&(c.bypass?c.bypassed=null:i[s]=null)}}},Rf.update=function(){this._private.cy.mutableElements().updateStyle()},Rf.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle(`transition-property`).value,a=e.pstyle(`transition-duration`).pfValue,o=e.pstyle(`transition-delay`).pfValue;if(i.length>0&&a>0){for(var s={},c=!1,l=0;l<i.length;l++){var u=i[l],d=e.pstyle(u),f=t[u];if(f){var p=f.prev,m=f.next==null?d:f.next,h=!1,g=void 0,_=1e-6;p&&(Q(p.pfValue)&&Q(m.pfValue)?(h=m.pfValue-p.pfValue,g=p.pfValue+_*h):Q(p.value)&&Q(m.value)?(h=m.value-p.value,g=p.value+_*h):St(p.value)&&St(m.value)&&(h=p.value[0]!==m.value[0]||p.value[1]!==m.value[1]||p.value[2]!==m.value[2],g=p.strValue),h&&(s[u]=m.strValue,this.applyBypass(e,u,g),c=!0))}}if(!c)return;r.transitioning=!0,new os(function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle(`transition-timing-function`).value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify(`style`),r.transitioning=!1})}else r.transitioning&&=(this.removeBypasses(e,i),e.emitAndNotify(`style`),!1)},Rf.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);e.removed()||s!=null&&s(n,r,e)&&a(o)},Rf.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify(`zorder`,e)})},Rf.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},Rf.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},Rf.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},Rf.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var Vf={};Vf.applyBypass=function(e,t,n,r){var i=this,a=[],o=!0;if(t===`*`||t===`**`){if(n!==void 0)for(var s=0;s<i.properties.length;s++){var c=i.properties[s].name,l=this.parse(c,n,!0);l&&a.push(l)}}else if(Z(t)){var u=this.parse(t,n,!0);u&&a.push(u)}else if(Ct(t)){var d=t;r=n;for(var f=Object.keys(d),p=0;p<f.length;p++){var m=f[p],h=d[m];if(h===void 0&&(h=d[Bt(m)]),h!==void 0){var g=this.parse(m,h,!0);g&&a.push(g)}}}else return!1;if(a.length===0)return!1;for(var _=!1,v=0;v<e.length;v++){for(var y=e[v],b={},x=void 0,S=0;S<a.length;S++){var C=a[S];if(r){var w=y.pstyle(C.name);x=b[C.name]={prev:w}}_=this.applyParsedProperty(y,Nr(C))||_,r&&(x.next=y.pstyle(C.name))}_&&this.updateStyleHints(y),r&&this.updateTransitions(y,b,o)}return _},Vf.overrideBypass=function(e,t,n){t=zt(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,c=o.mutiple,l=a?a.pfValue==null?a.value:a.pfValue:null;!a||!a.bypass?this.applyBypass(i,t,n):(a.value=n,a.pfValue!=null&&(a.pfValue=n),a.strValue=s?`rgb(`+n.join(`,`)+`)`:c?n.join(` `):``+n,this.updateStyleHints(i)),this.checkTriggers(i,t,l,n)}},Vf.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},Vf.removeBypasses=function(e,t,n){for(var r=!0,i=0;i<e.length;i++){for(var a=e[i],o={},s=0;s<t.length;s++){var c=t[s],l=this.properties[c],u=a.pstyle(l.name);if(u&&u.bypass){var d=this.parse(c,``,!0),f=o[l.name]={prev:u};this.applyParsedProperty(a,d),f.next=a.pstyle(l.name)}}this.updateStyleHints(a),n&&this.updateTransitions(a,o,r)}};var Hf={};Hf.getEmSizeInPixels=function(){var e=this.containerCss(`font-size`);return e==null?1:parseFloat(e)},Hf.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var Uf={};Uf.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},Uf.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},i=0;i<n.properties.length;i++){var a=n.properties[i],o=n.getStylePropertyValue(e,a.name,t);o!=null&&(r[a.name]=o,r[Bt(a.name)]=o)}return r}},Uf.getIndexedStyle=function(e,t,n,r){return e.pstyle(t)[n][r]??e.cy().style().getDefaultProperty(t)[n][0]},Uf.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var i=r.properties[t];i.alias&&(i=i.pointsTo);var a=i.type,o=e.pstyle(i.name);if(o){var s=o.value,c=o.units,l=o.strValue;if(n&&a.number&&s!=null&&Q(s)){var u=e.cy().zoom(),d=function(e){return e*u},f=function(e,t){return d(e)+t},p=St(s);return(p?c.every(function(e){return e!=null}):c!=null)?p?s.map(function(e,t){return f(e,c[t])}).join(` `):f(s,c):p?s.map(function(e){return Z(e)?e:``+d(e)}).join(` `):``+d(s)}if(l!=null)return l}return null}},Uf.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);a!==void 0&&(a=Ct(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},Uf.getPropsList=function(e){var t=this,n=[],r=e,i=t.properties;if(r)for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],c=r[s],l=i[s]||i[zt(s)],u=this.parse(l.name,c);u&&n.push(u)}return n},Uf.getNonDefaultPropertiesHash=function(e,t,n){for(var r=n.slice(),i,a,o,s,c=0,l;c<t.length;c++)if(i=t[c],a=e.pstyle(i,!1),a!=null){if(a.pfValue!=null)r[0]=lr(s,r[0]),r[1]=ur(s,r[1]);else for(o=a.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),r[0]=lr(s,r[0]),r[1]=ur(s,r[1])}return r},Uf.getPropertiesHash=Uf.getNonDefaultPropertiesHash;var Wf={};Wf.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,a=r.style||r.css,o=Object.keys(a);t.selector(i);for(var s=0;s<o.length;s++){var c=o[s],l=a[c];t.css(c,l)}}return t},Wf.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},Wf.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():`core`,style:a})}return e};var Gf={};Gf.appendFromString=function(e){var t=this,n=this,r=``+e,i,a,o;r=r.replace(/[/][*](\s|.)+?[*][/]/g,``);function s(){r=r.length>i.length?r.substr(i.length):``}function c(){a=a.length>o.length?a.substr(o.length):``}for(;!r.match(/^\s*$/);){var l=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){jr(`Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: `+r);break}i=l[0];var u=l[1];if(u!==`core`&&new ku(u).invalid){jr(`Skipping parsing of block: Invalid selector found in string stylesheet: `+u),s();continue}var d=l[2],f=!1;a=d;for(var p=[];!a.match(/^\s*$/);){var m=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){jr(`Skipping parsing of block: Invalid formatting of style property and value definitions found in:`+d),f=!0;break}o=m[0];var h=m[1],g=m[2];if(!t.properties[h]){jr(`Skipping property: Invalid property name in: `+o),c();continue}if(!n.parse(h,g)){jr(`Skipping property: Invalid property definition in: `+o),c();continue}p.push({name:h,val:g}),c()}if(f){s();break}n.selector(u);for(var _=0;_<p.length;_++){var v=p[_];n.css(v.name,v.val)}s()}return n},Gf.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var Kf={};(function(){var e=Wt,t=Kt,n=Jt,r=Yt,i=Xt,a=function(e){return`^`+e+`\\s*\\(\\s*([\\w\\.]+)\\s*\\)$`},o=function(a){var o=e+`|\\w+|`+t+`|`+n+`|`+r+`|`+i;return`^`+a+`\\s*\\(([\\w\\.]+)\\s*\\,\\s*(`+e+`)\\s*\\,\\s*(`+e+`)\\s*,\\s*(`+o+`)\\s*\\,\\s*(`+o+`)\\)$`},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,`^(none)$`,`^(.+)$`];Kf.types={time:{number:!0,min:0,units:`s|ms`,implicitUnits:`ms`},percent:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`},percentages:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`,multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:[`parent`,`origin`]},nodeSize:{number:!0,min:0,enums:[`label`]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:[`horizontal`,`leftward`,`rightward`,`vertical`,`upward`,`downward`,`auto`]},axisDirectionExplicit:{enums:[`leftward`,`rightward`,`upward`,`downward`]},axisDirectionPrimary:{enums:[`horizontal`,`vertical`]},paddingRelativeTo:{enums:[`width`,`height`,`average`,`min`,`max`]},bgWH:{number:!0,min:0,allowPercent:!0,enums:[`auto`],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:[`inner`,`include-padding`],multiple:!0},bgRepeat:{enums:[`repeat`,`repeat-x`,`repeat-y`,`no-repeat`],multiple:!0},bgFit:{enums:[`none`,`contain`,`cover`],multiple:!0},bgCrossOrigin:{enums:[`anonymous`,`use-credentials`,`null`],multiple:!0},bgClip:{enums:[`none`,`node`],multiple:!0},bgContainment:{enums:[`inside`,`over`],multiple:!0},boxSelection:{enums:[`contain`,`overlap`,`none`]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:[`solid`,`linear-gradient`,`radial-gradient`]},bool:{enums:[`yes`,`no`]},bools:{enums:[`yes`,`no`],multiple:!0},lineStyle:{enums:[`solid`,`dotted`,`dashed`]},lineCap:{enums:[`butt`,`round`,`square`]},linePosition:{enums:[`center`,`inside`,`outside`]},lineJoin:{enums:[`round`,`bevel`,`miter`]},borderStyle:{enums:[`solid`,`dotted`,`dashed`,`double`]},curveStyle:{enums:[`bezier`,`unbundled-bezier`,`haystack`,`segments`,`straight`,`straight-triangle`,`taxi`,`round-segments`,`round-taxi`]},radiusType:{enums:[`arc-radius`,`influence-radius`],multiple:!0},fontFamily:{regex:`^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$`},fontStyle:{enums:[`italic`,`normal`,`oblique`]},fontWeight:{enums:[`normal`,`bold`,`bolder`,`lighter`,`100`,`200`,`300`,`400`,`500`,`600`,`800`,`900`,100,200,300,400,500,600,700,800,900]},textDecoration:{enums:[`none`,`underline`,`overline`,`line-through`]},textTransform:{enums:[`none`,`uppercase`,`lowercase`]},textWrap:{enums:[`none`,`wrap`,`ellipsis`]},textOverflowWrap:{enums:[`whitespace`,`anywhere`]},textBackgroundShape:{enums:[`rectangle`,`roundrectangle`,`round-rectangle`,`circle`]},nodeShape:{enums:`rectangle.roundrectangle.round-rectangle.cutrectangle.cut-rectangle.bottomroundrectangle.bottom-round-rectangle.barrel.ellipse.triangle.round-triangle.square.pentagon.round-pentagon.hexagon.round-hexagon.concavehexagon.concave-hexagon.heptagon.round-heptagon.octagon.round-octagon.tag.round-tag.star.diamond.round-diamond.vee.rhomboid.right-rhomboid.polygon`.split(`.`)},overlayShape:{enums:[`roundrectangle`,`round-rectangle`,`ellipse`]},cornerRadius:{number:!0,min:0,units:`px|em`,implicitUnits:`px`,enums:[`auto`]},compoundIncludeLabels:{enums:[`include`,`exclude`]},arrowShape:{enums:[`tee`,`triangle`,`triangle-tee`,`circle-triangle`,`triangle-cross`,`triangle-backcurve`,`vee`,`square`,`circle`,`diamond`,`chevron`,`none`]},arrowFill:{enums:[`filled`,`hollow`]},arrowWidth:{number:!0,units:`%|px|em`,implicitUnits:`px`,enums:[`match-line`]},display:{enums:[`element`,`none`]},visibility:{enums:[`hidden`,`visible`]},zCompoundDepth:{enums:[`bottom`,`orphan`,`auto`,`top`]},zIndexCompare:{enums:[`auto`,`manual`]},valign:{enums:[`top`,`top-inside`,`center`,`bottom`,`bottom-inside`]},halign:{enums:[`left`,`left-inside`,`center`,`right`,`right-inside`]},justification:{enums:[`left`,`center`,`right`,`auto`]},textMetrics:{enums:[`font`,`glyph`]},text:{string:!0},data:{mapping:!0,regex:a(`data`)},layoutData:{mapping:!0,regex:a(`layoutData`)},scratch:{mapping:!0,regex:a(`scratch`)},mapData:{mapping:!0,regex:o(`mapData`)},mapLayoutData:{mapping:!0,regex:o(`mapLayoutData`)},mapScratch:{mapping:!0,regex:o(`mapScratch`)},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:`deg|rad`,implicitUnits:`rad`},textRotation:{number:!0,units:`deg|rad`,implicitUnits:`rad`,enums:[`none`,`autorotate`]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:[`intersection`,`node-position`,`endpoints`]},edgeEndpoint:{number:!0,multiple:!0,units:`%|px|em|deg|rad`,implicitUnits:`px`,enums:[`inside-to-node`,`outside-to-node`,`outside-to-node-or-label`,`outside-to-line`,`outside-to-line-or-label`],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return t[0]!==`deg`&&t[0]!==`rad`&&t[1]!==`deg`&&t[1]!==`rad`;case 1:return Z(e[0])||t[0]===`deg`||t[0]===`rad`;default:return!1}}},easing:{regexes:[`^(spring)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`,`^(cubic-bezier)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`],enums:`linear.ease.ease-in.ease-out.ease-in-out.ease-in-sine.ease-out-sine.ease-in-out-sine.ease-in-quad.ease-out-quad.ease-in-out-quad.ease-in-cubic.ease-out-cubic.ease-in-out-cubic.ease-in-quart.ease-out-quart.ease-in-out-quart.ease-in-quint.ease-out-quint.ease-in-out-quint.ease-in-expo.ease-out-expo.ease-in-out-expo.ease-in-circ.ease-out-circ.ease-in-out-circ`.split(`.`)},gradientDirection:{enums:[`to-bottom`,`to-top`,`to-left`,`to-right`,`to-bottom-right`,`to-bottom-left`,`to-top-right`,`to-top-left`,`to-right-bottom`,`to-left-bottom`,`to-right-top`,`to-left-top`]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return t===1||t===2||t===4}}};var c={zeroNonZero:function(e,t){return(e==null||t==null)&&e!==t||e==0&&t!=0||e!=0&&t==0},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=Nt(e),r=Nt(t);return n&&!r||!n&&r}},l=Kf.types,u=[{name:`label`,type:l.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:`text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any}],d=[{name:`source-label`,type:l.text,triggersBounds:c.any},{name:`source-text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`source-text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`source-text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`source-text-offset`,type:l.size,triggersBounds:c.any}],f=[{name:`target-label`,type:l.text,triggersBounds:c.any},{name:`target-text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`target-text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`target-text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`target-text-offset`,type:l.size,triggersBounds:c.any}],p=[{name:`font-family`,type:l.fontFamily,triggersBounds:c.any},{name:`font-style`,type:l.fontStyle,triggersBounds:c.any},{name:`font-weight`,type:l.fontWeight,triggersBounds:c.any},{name:`font-size`,type:l.size,triggersBounds:c.any},{name:`text-transform`,type:l.textTransform,triggersBounds:c.any},{name:`text-wrap`,type:l.textWrap,triggersBounds:c.any},{name:`text-overflow-wrap`,type:l.textOverflowWrap,triggersBounds:c.any},{name:`text-max-width`,type:l.size,triggersBounds:c.any},{name:`text-outline-width`,type:l.size,triggersBounds:c.any},{name:`line-height`,type:l.positiveNumber,triggersBounds:c.any}],m=[{name:`text-valign`,type:l.valign,triggersBounds:c.any},{name:`text-halign`,type:l.halign,triggersBounds:c.any},{name:`color`,type:l.color},{name:`text-outline-color`,type:l.color},{name:`text-outline-opacity`,type:l.zeroOneNumber},{name:`text-background-color`,type:l.color},{name:`text-background-opacity`,type:l.zeroOneNumber},{name:`text-background-padding`,type:l.size,triggersBounds:c.any},{name:`text-border-opacity`,type:l.zeroOneNumber},{name:`text-border-color`,type:l.color},{name:`text-border-width`,type:l.size,triggersBounds:c.any},{name:`text-border-style`,type:l.borderStyle,triggersBounds:c.any},{name:`text-background-shape`,type:l.textBackgroundShape,triggersBounds:c.any},{name:`text-justification`,type:l.justification},{name:`text-metrics`,type:l.textMetrics},{name:`box-select-labels`,type:l.bool,triggersBounds:c.any}],h=[{name:`events`,type:l.bool,triggersZOrder:c.any},{name:`text-events`,type:l.bool,triggersZOrder:c.any},{name:`box-selection`,type:l.boxSelection,triggersZOrder:c.any}],g=[{name:`display`,type:l.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:c.any,triggersBoundsOfParallelEdges:function(e,t,n){return e!==t&&n.pstyle(`curve-style`).value===`bezier`}},{name:`visibility`,type:l.visibility,triggersZOrder:c.any},{name:`opacity`,type:l.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:`text-opacity`,type:l.zeroOneNumber},{name:`min-zoomed-font-size`,type:l.size},{name:`z-compound-depth`,type:l.zCompoundDepth,triggersZOrder:c.any},{name:`z-index-compare`,type:l.zIndexCompare,triggersZOrder:c.any},{name:`z-index`,type:l.number,triggersZOrder:c.any}],_=[{name:`overlay-padding`,type:l.size,triggersBounds:c.any},{name:`overlay-color`,type:l.color},{name:`overlay-opacity`,type:l.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:`overlay-shape`,type:l.overlayShape,triggersBounds:c.any},{name:`overlay-corner-radius`,type:l.cornerRadius}],v=[{name:`underlay-padding`,type:l.size,triggersBounds:c.any},{name:`underlay-color`,type:l.color},{name:`underlay-opacity`,type:l.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:`underlay-shape`,type:l.overlayShape,triggersBounds:c.any},{name:`underlay-corner-radius`,type:l.cornerRadius}],y=[{name:`transition-property`,type:l.propList},{name:`transition-duration`,type:l.time},{name:`transition-delay`,type:l.time},{name:`transition-timing-function`,type:l.easing}],b=function(e,t){return t.value===`label`?-e.poolIndex():t.pfValue},x=[{name:`height`,type:l.nodeSize,triggersBounds:c.any,hashOverride:b},{name:`width`,type:l.nodeSize,triggersBounds:c.any,hashOverride:b},{name:`shape`,type:l.nodeShape,triggersBounds:c.any},{name:`shape-polygon-points`,type:l.polygonPointList,triggersBounds:c.any},{name:`corner-radius`,type:l.cornerRadius},{name:`background-color`,type:l.color},{name:`background-fill`,type:l.fill},{name:`background-opacity`,type:l.zeroOneNumber},{name:`background-blacken`,type:l.nOneOneNumber},{name:`background-gradient-stop-colors`,type:l.colors},{name:`background-gradient-stop-positions`,type:l.percentages},{name:`background-gradient-direction`,type:l.gradientDirection},{name:`padding`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`padding-relative-to`,type:l.paddingRelativeTo,triggersBounds:c.any},{name:`bounds-expansion`,type:l.boundsExpansion,triggersBounds:c.any}],S=[{name:`border-color`,type:l.color},{name:`border-opacity`,type:l.zeroOneNumber},{name:`border-width`,type:l.size,triggersBounds:c.any},{name:`border-style`,type:l.borderStyle},{name:`border-cap`,type:l.lineCap},{name:`border-join`,type:l.lineJoin},{name:`border-dash-pattern`,type:l.numbers},{name:`border-dash-offset`,type:l.number},{name:`border-position`,type:l.linePosition}],C=[{name:`outline-color`,type:l.color},{name:`outline-opacity`,type:l.zeroOneNumber},{name:`outline-width`,type:l.size,triggersBounds:c.any},{name:`outline-style`,type:l.borderStyle},{name:`outline-offset`,type:l.size,triggersBounds:c.any}],w=[{name:`background-image`,type:l.urls},{name:`background-image-crossorigin`,type:l.bgCrossOrigin},{name:`background-image-opacity`,type:l.zeroOneNumbers},{name:`background-image-containment`,type:l.bgContainment},{name:`background-image-smoothing`,type:l.bools},{name:`background-position-x`,type:l.bgPos},{name:`background-position-y`,type:l.bgPos},{name:`background-width-relative-to`,type:l.bgRelativeTo},{name:`background-height-relative-to`,type:l.bgRelativeTo},{name:`background-repeat`,type:l.bgRepeat},{name:`background-fit`,type:l.bgFit},{name:`background-clip`,type:l.bgClip},{name:`background-width`,type:l.bgWH},{name:`background-height`,type:l.bgWH},{name:`background-offset-x`,type:l.bgPos},{name:`background-offset-y`,type:l.bgPos}],T=[{name:`position`,type:l.position,triggersBounds:c.any},{name:`compound-sizing-wrt-labels`,type:l.compoundIncludeLabels,triggersBounds:c.any},{name:`min-width`,type:l.size,triggersBounds:c.any},{name:`min-width-bias-left`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-width-bias-right`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-height`,type:l.size,triggersBounds:c.any},{name:`min-height-bias-top`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-height-bias-bottom`,type:l.sizeMaybePercent,triggersBounds:c.any}],E=[{name:`line-style`,type:l.lineStyle},{name:`line-color`,type:l.color},{name:`line-fill`,type:l.fill},{name:`line-cap`,type:l.lineCap},{name:`line-opacity`,type:l.zeroOneNumber},{name:`line-dash-pattern`,type:l.numbers},{name:`line-dash-offset`,type:l.number},{name:`line-outline-width`,type:l.size},{name:`line-outline-color`,type:l.color},{name:`line-gradient-stop-colors`,type:l.colors},{name:`line-gradient-stop-positions`,type:l.percentages},{name:`curve-style`,type:l.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelEdges:function(e,t){return e===t?!1:e===`bezier`||t===`bezier`}},{name:`haystack-radius`,type:l.zeroOneNumber,triggersBounds:c.any},{name:`source-endpoint`,type:l.edgeEndpoint,triggersBounds:c.any},{name:`target-endpoint`,type:l.edgeEndpoint,triggersBounds:c.any},{name:`control-point-step-size`,type:l.size,triggersBounds:c.any},{name:`control-point-distances`,type:l.bidirectionalSizes,triggersBounds:c.any},{name:`control-point-weights`,type:l.numbers,triggersBounds:c.any},{name:`segment-distances`,type:l.bidirectionalSizes,triggersBounds:c.any},{name:`segment-weights`,type:l.numbers,triggersBounds:c.any},{name:`segment-radii`,type:l.numbers,triggersBounds:c.any},{name:`radius-type`,type:l.radiusType,triggersBounds:c.any},{name:`taxi-turn`,type:l.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:`taxi-turn-min-distance`,type:l.size,triggersBounds:c.any},{name:`taxi-direction`,type:l.axisDirection,triggersBounds:c.any},{name:`taxi-radius`,type:l.number,triggersBounds:c.any},{name:`edge-distances`,type:l.edgeDistances,triggersBounds:c.any},{name:`arrow-scale`,type:l.positiveNumber,triggersBounds:c.any},{name:`loop-direction`,type:l.angle,triggersBounds:c.any},{name:`loop-sweep`,type:l.angle,triggersBounds:c.any},{name:`source-distance-from-node`,type:l.size,triggersBounds:c.any},{name:`target-distance-from-node`,type:l.size,triggersBounds:c.any}],D=[{name:`ghost`,type:l.bool,triggersBounds:c.any},{name:`ghost-offset-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`ghost-offset-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`ghost-opacity`,type:l.zeroOneNumber}],O=[{name:`selection-box-color`,type:l.color},{name:`selection-box-opacity`,type:l.zeroOneNumber},{name:`selection-box-border-color`,type:l.color},{name:`selection-box-border-width`,type:l.size},{name:`active-bg-color`,type:l.color},{name:`active-bg-opacity`,type:l.zeroOneNumber},{name:`active-bg-size`,type:l.size},{name:`outside-texture-bg-color`,type:l.color},{name:`outside-texture-bg-opacity`,type:l.zeroOneNumber}],k=[];Kf.pieBackgroundN=16,k.push({name:`pie-size`,type:l.sizeMaybePercent}),k.push({name:`pie-hole`,type:l.sizeMaybePercent}),k.push({name:`pie-start-angle`,type:l.angle});for(var A=1;A<=Kf.pieBackgroundN;A++)k.push({name:`pie-`+A+`-background-color`,type:l.color}),k.push({name:`pie-`+A+`-background-size`,type:l.percent}),k.push({name:`pie-`+A+`-background-opacity`,type:l.zeroOneNumber});var j=[];Kf.stripeBackgroundN=16,j.push({name:`stripe-size`,type:l.sizeMaybePercent}),j.push({name:`stripe-direction`,type:l.axisDirectionPrimary});for(var M=1;M<=Kf.stripeBackgroundN;M++)j.push({name:`stripe-`+M+`-background-color`,type:l.color}),j.push({name:`stripe-`+M+`-background-size`,type:l.percent}),j.push({name:`stripe-`+M+`-background-opacity`,type:l.zeroOneNumber});var N=[],P=Kf.arrowPrefixes=[`source`,`mid-source`,`target`,`mid-target`];[{name:`arrow-shape`,type:l.arrowShape,triggersBounds:c.any},{name:`arrow-color`,type:l.color},{name:`arrow-fill`,type:l.arrowFill},{name:`arrow-width`,type:l.arrowWidth}].forEach(function(e){P.forEach(function(t){var n=t+`-`+e.name,r=e.type,i=e.triggersBounds;N.push({name:n,type:r,triggersBounds:i})})},{});var F=Kf.properties=[].concat(h,y,g,_,v,D,m,p,u,d,f,x,S,C,w,k,j,T,E,N,O),I=Kf.propertyGroups={behavior:h,transition:y,visibility:g,overlay:_,underlay:v,ghost:D,commonLabel:m,labelDimensions:p,mainLabel:u,sourceLabel:d,targetLabel:f,nodeBody:x,nodeBorder:S,nodeOutline:C,backgroundImage:w,pie:k,stripe:j,compound:T,edgeLine:E,edgeArrow:N,core:O},L=Kf.propertyGroupNames={};(Kf.propertyGroupKeys=Object.keys(I)).forEach(function(e){L[e]=I[e].map(function(e){return e.name}),I[e].forEach(function(t){return t.groupKey=e})});var R=Kf.aliases=[{name:`content`,pointsTo:`label`},{name:`control-point-distance`,pointsTo:`control-point-distances`},{name:`control-point-weight`,pointsTo:`control-point-weights`},{name:`segment-distance`,pointsTo:`segment-distances`},{name:`segment-weight`,pointsTo:`segment-weights`},{name:`segment-radius`,pointsTo:`segment-radii`},{name:`edge-text-rotation`,pointsTo:`text-rotation`},{name:`padding-left`,pointsTo:`padding`},{name:`padding-right`,pointsTo:`padding`},{name:`padding-top`,pointsTo:`padding`},{name:`padding-bottom`,pointsTo:`padding`}];Kf.propertyNames=F.map(function(e){return e.name});for(var z=0;z<F.length;z++){var B=F[z];F[B.name]=B}for(var V=0;V<R.length;V++){var H=R[V],U=F[H.pointsTo],W={name:H.name,alias:!0,pointsTo:U};F.push(W),F[H.name]=W}})(),Kf.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Kf.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=$t({"selection-box-color":`#ddd`,"selection-box-opacity":.65,"selection-box-border-color":`#aaa`,"selection-box-border-width":1,"active-bg-color":`black`,"active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":`#000`,"outside-texture-bg-opacity":.125,events:`yes`,"text-events":`no`,"text-valign":`top`,"text-halign":`center`,"text-justification":`auto`,"line-height":1,color:`#000`,"box-selection":`contain`,"text-outline-color":`#000`,"text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":`none`,"text-transform":`none`,"text-wrap":`none`,"text-overflow-wrap":`whitespace`,"text-max-width":9999,"text-background-color":`#000`,"text-background-opacity":0,"text-background-shape":`rectangle`,"text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":`solid`,"text-border-color":`#000`,"font-family":`Helvetica Neue, Helvetica, sans-serif`,"font-style":`normal`,"font-weight":`normal`,"font-size":16,"min-zoomed-font-size":0,"text-rotation":`none`,"source-text-rotation":`none`,"target-text-rotation":`none`,visibility:`visible`,display:`element`,opacity:1,"z-compound-depth":`auto`,"z-index-compare":`auto`,"z-index":0,label:``,"text-margin-x":0,"text-margin-y":0,"source-label":``,"source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":``,"target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":`#000`,"overlay-padding":10,"overlay-shape":`round-rectangle`,"overlay-corner-radius":`auto`,"underlay-opacity":0,"underlay-color":`#000`,"underlay-padding":10,"underlay-shape":`round-rectangle`,"underlay-corner-radius":`auto`,"text-metrics":`font`,"transition-property":`none`,"transition-duration":0,"transition-delay":0,"transition-timing-function":`linear`,"box-select-labels":`no`,"background-blacken":0,"background-color":`#999`,"background-fill":`solid`,"background-opacity":1,"background-image":`none`,"background-image-crossorigin":`anonymous`,"background-image-opacity":1,"background-image-containment":`inside`,"background-image-smoothing":`yes`,"background-position-x":`50%`,"background-position-y":`50%`,"background-offset-x":0,"background-offset-y":0,"background-width-relative-to":`include-padding`,"background-height-relative-to":`include-padding`,"background-repeat":`no-repeat`,"background-fit":`none`,"background-clip":`node`,"background-width":`auto`,"background-height":`auto`,"border-color":`#000`,"border-opacity":1,"border-width":0,"border-style":`solid`,"border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":`butt`,"border-join":`miter`,"border-position":`center`,"outline-color":`#999`,"outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":`solid`,height:30,width:30,shape:`ellipse`,"shape-polygon-points":`-1, -1, 1, -1, 1, 1, -1, 1`,"corner-radius":`auto`,"bounds-expansion":0,"background-gradient-direction":`to-bottom`,"background-gradient-stop-colors":`#999`,"background-gradient-stop-positions":`0%`,ghost:`no`,"ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":`width`,position:`origin`,"compound-sizing-wrt-labels":`include`,"min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":`100%`,"pie-hole":0,"pie-start-angle":`0deg`},[{name:`pie-{{i}}-background-color`,value:`black`},{name:`pie-{{i}}-background-size`,value:`0%`},{name:`pie-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=Kf.pieBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"stripe-size":`100%`,"stripe-direction":`horizontal`},[{name:`stripe-{{i}}-background-color`,value:`black`},{name:`stripe-{{i}}-background-size`,value:`0%`},{name:`stripe-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=Kf.stripeBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"line-style":`solid`,"line-color":`#999`,"line-fill":`solid`,"line-cap":`butt`,"line-opacity":1,"line-outline-width":0,"line-outline-color":`#000`,"line-gradient-stop-colors":`#999`,"line-gradient-stop-positions":`0%`,"control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":`arc-radius`,"taxi-turn":`50%`,"taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":`auto`,"edge-distances":`intersection`,"curve-style":`haystack`,"haystack-radius":0,"arrow-scale":1,"loop-direction":`-45deg`,"loop-sweep":`-90deg`,"source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":`outside-to-node`,"target-endpoint":`outside-to-node`,"line-dash-pattern":[6,3],"line-dash-offset":0},[{name:`arrow-shape`,value:`none`},{name:`arrow-color`,value:`#999`},{name:`arrow-fill`,value:`filled`},{name:`arrow-width`,value:1}].reduce(function(e,t){return Kf.arrowPrefixes.forEach(function(n){var r=n+`-`+t.name;e[r]=t.value}),e},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a];n[a]=this.parse(a,o)}}return e.defaultProperties=n,e.defaultProperties},Kf.addDefaultStylesheet=function(){this.selector(`:parent`).css({shape:`rectangle`,padding:10,"background-color":`#eee`,"border-color":`#ccc`,"border-width":1}).selector(`edge`).css({width:3}).selector(`:loop`).css({"curve-style":`bezier`}).selector(`edge:compound`).css({"curve-style":`bezier`,"source-endpoint":`outside-to-line`,"target-endpoint":`outside-to-line`}).selector(`:selected`).css({"background-color":`#0169D9`,"line-color":`#0169D9`,"source-arrow-color":`#0169D9`,"target-arrow-color":`#0169D9`,"mid-source-arrow-color":`#0169D9`,"mid-target-arrow-color":`#0169D9`}).selector(`:parent:selected`).css({"background-color":`#CCE1F9`,"border-color":`#aec8e5`}).selector(`:active`).css({"overlay-color":`black`,"overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var qf={};qf.parse=function(e,t,n,r){var i=this;if(xt(t))return i.parseImplWarn(e,t,n,r);var a=r===`mapping`||r===!0||r===!1||r==null?`dontcare`:r,o=n?`t`:`f`,s=gr(e,``+t,o,a),c=i.propCache=i.propCache||[],l;return(l=c[s])||(l=c[s]=i.parseImplWarn(e,t,n,r)),(n||r===`mapping`)&&(l=Nr(l),l&&(l.value=Nr(l.value))),l},qf.parseImplWarn=function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return!i&&t!=null&&jr(`The style property \`${e}: ${t}\` is invalid`),i&&(i.name===`width`||i.name===`height`)&&t===`label`&&jr("The style value of `label` is deprecated for `"+i.name+"`"),i},qf.parseImpl=function(e,t,n,r){var i=this;e=zt(e);var a=i.properties[e],o=t,s=i.types;if(!a||t===void 0)return null;a.alias&&(a=a.pointsTo,e=a.name);var c=Z(t);c&&(t=t.trim());var l=a.type;if(!l)return null;if(n&&(t===``||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(xt(t))return{name:e,value:t,strValue:`fn`,mapped:s.fn,bypass:n};var u,d;if(!(!c||r||t.length<7||t[1]!==`a`)){if(t.length>=7&&t[0]===`d`&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var f=s.data;return{name:e,value:u,strValue:``+t,mapped:f,field:u[1],bypass:n}}if(t.length>=10&&t[0]===`m`&&(d=new RegExp(s.mapData.regex).exec(t))){if(n||l.multiple)return!1;var p=s.mapData;if(!(l.color||l.number))return!1;var m=this.parse(e,d[4]);if(!m||m.mapped)return!1;var h=this.parse(e,d[5]);if(!h||h.mapped)return!1;if(m.pfValue===h.pfValue||m.strValue===h.strValue)return jr("`"+e+`: `+t+"` is not a valid mapper because the output range is zero; converting to `"+e+`: `+m.strValue+"`"),this.parse(e,m.strValue);if(l.color){var g=m.value,_=h.value;if(g[0]===_[0]&&g[1]===_[1]&&g[2]===_[2]&&(g[3]===_[3]||(g[3]==null||g[3]===1)&&(_[3]==null||_[3]===1)))return!1}return{name:e,value:d,strValue:``+t,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:m.value,valueMax:h.value,bypass:n}}}if(l.multiple&&r!==`multiple`){var v=c?t.split(/\s+/):St(t)?t:[t];if(l.evenMultiple&&v.length%2!=0)return null;for(var y=[],b=[],x=[],S=``,C=!1,w=0;w<v.length;w++){var T=i.parse(e,v[w],n,`multiple`);C||=Z(T.value),y.push(T.value),x.push(T.pfValue==null?T.value:T.pfValue),b.push(T.units),S+=(w>0?` `:``)+T.strValue}return l.validate&&!l.validate(y,b)?null:l.singleEnum&&C?y.length===1&&Z(y[0])?{name:e,value:y[0],strValue:y[0],bypass:n}:null:{name:e,value:y,pfValue:x,strValue:S,bypass:n,units:b}}var E=function(){for(var r=0;r<l.enums.length;r++)if(l.enums[r]===t)return{name:e,value:t,strValue:``+t,bypass:n};return null};if(l.number){var D,O=`px`;if(l.units&&(D=l.units),l.implicitUnits&&(O=l.implicitUnits),!l.unitless){if(c){var k=`px|em`+(l.allowPercent?`|\\%`:``);D&&(k=D);var A=t.match(`^(`+Wt+`)(`+k+`)?$`);A&&(t=A[1],D=A[2]||O)}else(!D||l.implicitUnits)&&(D=O)}if(t=parseFloat(t),isNaN(t)&&l.enums===void 0)return null;if(isNaN(t)&&l.enums!==void 0)return t=o,E();if(l.integer&&!Tt(t)||l.min!==void 0&&(t<l.min||l.strictMin&&t===l.min)||l.max!==void 0&&(t>l.max||l.strictMax&&t===l.max))return null;var j={name:e,value:t,strValue:``+t+(D||``),units:D,bypass:n};return j.pfValue=l.unitless||D!==`px`&&D!==`em`||D===`px`||!D?t:this.getEmSizeInPixels()*t,(D===`ms`||D===`s`)&&(j.pfValue=D===`ms`?t:1e3*t),(D===`deg`||D===`rad`)&&(j.pfValue=D===`rad`?t:Oi(t)),D===`%`&&(j.pfValue=t/100),j}if(l.propList){var M=[],N=``+t;if(N!==`none`){for(var P=N.split(/\s*,\s*|\s+/),F=0;F<P.length;F++){var I=P[F].trim();i.properties[I]?M.push(I):jr("`"+I+"` is not a valid property name")}if(M.length===0)return null}return{name:e,value:M,strValue:M.length===0?`none`:M.join(` `),bypass:n}}if(l.color){var L=an(t);return L?{name:e,value:L,pfValue:L,strValue:`rgb(`+L[0]+`,`+L[1]+`,`+L[2]+`)`,bypass:n}:null}if(l.regex||l.regexes){if(l.enums){var R=E();if(R)return R}for(var z=l.regexes?l.regexes:[l.regex],B=0;B<z.length;B++){var V=new RegExp(z[B]).exec(t);if(V)return{name:e,value:l.singleRegexMatchValue?V[1]:V,strValue:``+t,bypass:n}}return null}return l.string?{name:e,value:``+t,strValue:``+t,bypass:n}:l.enums?E():null};var Jf=function(e){if(!(this instanceof Jf))return new Jf(e);if(!At(e)){kr(`A style must have a core reference`);return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Yf=Jf.prototype;Yf.instanceString=function(){return`style`},Yf.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach(function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1}),this},Yf.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Yf.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},Yf.selector=function(e){var t=e===`core`?null:new ku(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},Yf.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],a=n[i.name];a===void 0&&(a=n[Bt(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else t.length===2&&this.cssRule(t[0],t[1]);return this},Yf.style=Yf.css,Yf.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n),this[r].selector||(this._private.coreStyle[n.name]=n)}return this},Yf.append=function(e){return jt(e)?e.appendToStyle(this):St(e)?this.appendFromJson(e):Z(e)&&this.appendFromString(e),this},Jf.fromJson=function(e,t){var n=new Jf(e);return n.fromJson(t),n},Jf.fromString=function(e,t){return new Jf(e).fromString(t)},[Rf,Vf,Hf,Uf,Wf,Gf,Kf,qf].forEach(function(e){$t(Yf,e)}),Jf.types=Yf.types,Jf.properties=Yf.properties,Jf.propertyGroups=Yf.propertyGroups,Jf.propertyGroupNames=Yf.propertyGroupNames,Jf.propertyGroupKeys=Yf.propertyGroupKeys;var Xf={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=jt(e)?e.generateStyle(this):St(e)?Jf.fromJson(this,e):Z(e)?Jf.fromString(this,e):Jf(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Zf=`single`,Qf={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType??=Zf,e!==void 0)(e===`additive`||e===`single`)&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,r,i,a,o;switch(e.length){case 0:return t;case 1:if(Z(e[0]))return n=e[0],t[n];if(Ct(e[0])){if(!this._private.panningEnabled)return this;i=e[0],a=i.x,o=i.y,Q(a)&&(t.x=a),Q(o)&&(t.y=o),this.emit(`pan viewport`)}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],r=e[1],(n===`x`||n===`y`)&&Q(r)&&(t[n]=r),this.emit(`pan viewport`)}return this.notify(`viewport`),this},panBy:function(e,t){var n=arguments,r=this._private.pan,i,a,o,s,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ct(e)&&(o=n[0],s=o.x,c=o.y,Q(s)&&(r.x+=s),Q(c)&&(r.y+=c),this.emit(`pan viewport`));break;case 2:i=e,a=t,(i===`x`||i===`y`)&&Q(a)&&(r[i]+=a),this.emit(`pan viewport`)}return this.notify(`viewport`),this},gc:function(){this.notify(`gc`)},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit(`pan zoom viewport`),this.notify(`viewport`)}return this},getFitViewport:function(e,t){if(Q(e)&&t===void 0&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n;if(Z(e)){var r=e;e=this.$(r)}else if(Ft(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Dt(e)||(e=this.mutableElements());if(!(Dt(e)&&e.empty())){n||=e.boundingBox();var a=this.width(),o=this.height(),s;if(t=Q(t)?t:0,!isNaN(a)&&!isNaN(o)&&a>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){s=Math.min((a-2*t)/n.w,(o-2*t)/n.h),s=s>this._private.maxZoom?this._private.maxZoom:s,s=s<this._private.minZoom?this._private.minZoom:s;var c={x:(a-s*(n.x1+n.x2))/2,y:(o-s*(n.y1+n.y2))/2};return{zoom:s,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var r=e;e=r.min,t=r.max}return Q(e)&&Q(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Q(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Q(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,r=t.zoom,i,a,o=!1;if(t.zoomingEnabled||(o=!0),Q(e)?a=e:Ct(e)&&(a=e.level,e.position==null?e.renderedPosition!=null&&(i=e.renderedPosition):i=yi(e.position,r,n),i!=null&&!t.panningEnabled&&(o=!0)),a=a>t.maxZoom?t.maxZoom:a,a=a<t.minZoom?t.minZoom:a,o||!Q(a)||a===r||i!=null&&(!Q(i.x)||!Q(i.y)))return null;if(i!=null){var s=n,c=r,l=a;return{zoomed:!0,panned:!0,zoom:l,pan:{x:-l/c*(i.x-s.x)+i.x,y:-l/c*(i.y-s.y)+i.y}}}return{zoomed:!0,panned:!1,zoom:a,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit(`zoom`+(t.panned?` pan`:``)+` viewport`),this.notify(`viewport`),this)},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e||(Q(e.zoom)||(n=!1),Ct(e.pan)||(r=!1),!n&&!r))return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push(`zoom`))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;Q(c.x)&&(t.pan.x=c.x,o=!1),Q(c.y)&&(t.pan.y=c.y,o=!1),o||i.push(`pan`)}return i.length>0&&(i.push(`viewport`),this.emit(i.join(` `)),this.notify(`viewport`)),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit(`pan viewport`),this.notify(`viewport`)),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(Z(e)){var n=e;e=this.mutableElements().filter(n)}else Dt(e)||(e=this.mutableElements());if(e.length!==0){var r=e.boundingBox(),i=this.width(),a=this.height();return t=t===void 0?this._private.zoom:t,{x:(i-t*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled||this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var e=n.window().getComputedStyle(t),r=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-r(`padding-left`)-r(`padding-right`),height:t.clientHeight-r(`padding-top`)-r(`padding-bottom`)}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Qf.centre=Qf.center,Qf.autolockNodes=Qf.autolock,Qf.autoungrabifyNodes=Qf.autoungrabify;var $f={data:ou.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeData:ou.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),scratch:ou.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:ou.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0})};$f.attr=$f.data,$f.removeAttr=$f.removeData;var ep=function(e){var t=this;e=$t({},e);var n=e.container;n&&!Et(n)&&Et(n[0])&&(n=n[0]);var r=n?n._cyreg:null;r||={},r&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=mt!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=$t({name:a?`grid`:`null`},o.layout),o.renderer=$t({name:a?`canvas`:`null`},o.renderer);var s=function(e,t,n){return t===void 0?n===void 0?e:n:t},c=this._private={container:n,ready:!1,options:o,elements:new mf(this),listeners:[],aniEles:new mf(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?a:o.styleEnabled,zoom:Q(o.zoom)?o.zoom:1,pan:{x:Ct(o.pan)&&Q(o.pan.x)?o.pan.x:0,y:Ct(o.pan)&&Q(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var l=function(e,t){if(e.some(It))return os.all(e).then(t);t(e)};c.styleEnabled&&t.setStyle([]);var u=$t({},o,o.renderer);t.initRenderer(u);var d=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),e!=null&&(Ct(e)||St(e))&&t.add(e),t.one(`layoutready`,function(e){t.notifications(!0),t.emit(e),t.one(`load`,n),t.emitAndNotify(`load`)}).one(`layoutstop`,function(){t.one(`done`,r),t.emit(`done`)});var a=$t({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};l([o.style,o.elements],function(e){var n=e[0],a=e[1];c.styleEnabled&&t.style().append(n),d(a,function(){t.startAnimationLoop(),c.ready=!0,xt(o.ready)&&t.on(`ready`,o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on(`ready`,n)}r&&(r.readies=[]),t.emit(`ready`)},o.done)})},tp=ep.prototype;$t(tp,{instanceString:function(){return`core`},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit(`ready`,[],e):this.on(`ready`,e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit(`destroy`),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(this._private.container==null)return mt;var e=this._private.container.ownerDocument;return e===void 0||e==null?mt:e.defaultView||mt},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!Et(e)&&Et(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer($t({},r,r.renderer,{name:r.renderer.name===`null`?`canvas`:r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit(`mount`),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:`null`}),e.emit(`unmount`),e},options:function(){return Nr(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),i=function(e){return t.getElementById(e.id())};if(Ct(e)){if(t.startBatch(),e.elements){var a={},o=function(e,n){for(var r=[],i=[],o=0;o<e.length;o++){var s=e[o];if(!s.data.id){jr(`cy.json() cannot handle elements without an ID attribute`);continue}var c=``+s.data.id,l=t.getElementById(c);a[c]=!0,l.length===0?(n&&(s.group=n),r.push(s)):i.push({ele:l,json:s})}t.add(r);for(var u=0;u<i.length;u++){var d=i[u],f=d.ele,p=d.json;f.json(p)}};if(St(e.elements))o(e.elements);else for(var s=[`nodes`,`edges`],c=0;c<s.length;c++){var l=s[c],u=e.elements[l];St(u)&&o(u,l)}var d=t.collection();r.filter(function(e){return!a[e.id()]}).forEach(function(e){e.isParent()?d.merge(e):e.remove()}),d.forEach(function(e){return e.children().move({parent:null})}),d.forEach(function(e){return i(e).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var f=[`minZoom`,`maxZoom`,`zoomingEnabled`,`userZoomingEnabled`,`panningEnabled`,`userPanningEnabled`,`boxSelectionEnabled`,`autolock`,`autoungrabify`,`autounselectify`,`multiClickDebounceTime`],p=0;p<f.length;p++){var m=f[p];e[m]!=null&&t[m](e[m])}return t.endBatch(),this}var h=!!e,g={};h?g.elements=this.elements().map(function(e){return e.json()}):(g.elements={},r.forEach(function(e){var t=e.group();g.elements[t]||(g.elements[t]=[]),g.elements[t].push(e.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=Nr(t.data());var _=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=Nr(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=Nr(_.renderer),g.hideEdgesOnViewport=_.hideEdgesOnViewport,g.textureOnViewport=_.textureOnViewport,g.wheelSensitivity=_.wheelSensitivity,g.motionBlur=_.motionBlur,g.multiClickDebounceTime=_.multiClickDebounceTime,g}}),tp.$id=tp.getElementById,[gf,Of,jf,Mf,Nf,Pf,If,Lf,Xf,Qf,$f].forEach(function(e){$t(tp,e)});var np={fit:!0,directed:!1,direction:`downward`,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},rp={maximal:!1,acyclic:!1},ip=function(e){return e.scratch(`breadthfirst`)},ap=function(e,t){return e.scratch(`breadthfirst`,t)};function op(e){this.options=$t({},np,rp,e)}op.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(e){return e.isChildless()}),i=n,a=e.directed,o=e.acyclic||e.maximal||e.maximalAdjustments>0,s=!!e.boundingBox,c=zi(s?e.boundingBox:structuredClone(t.extent())),l;if(Dt(e.roots))l=e.roots;else if(St(e.roots)){for(var u=[],d=0;d<e.roots.length;d++){var f=e.roots[d],p=t.getElementById(f);u.push(p)}l=t.collection(u)}else if(Z(e.roots))l=t.$(e.roots);else if(a)l=r.roots();else{var m=n.components();l=t.collection();for(var h=function(){var e=m[g],t=e.maxDegree(!1),n=e.filter(function(e){return e.degree(!1)===t});l=l.add(n)},g=0;g<m.length;g++)h()}var _=[],v={},y=function(e,t){_[t]??(_[t]=[]);var n=_[t].length;_[t].push(e),ap(e,{index:n,depth:t})},b=function(e,t){var n=ip(e),r=n.depth,i=n.index;_[r][i]=null,e.isChildless()&&y(e,t)};i.bfs({roots:l,directed:e.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();a.isChildless()&&y(a,i),v[o]=!0}});for(var x=[],S=0;S<r.length;S++){var C=r[S];v[C.id()]||x.push(C)}var w=function(e){for(var t=_[e],n=0;n<t.length;n++){var r=t[n];if(r==null){t.splice(n,1),n--;continue}ap(r,{depth:e,index:n})}},T=function(t,r){for(var i=ip(t),a=t.incomers().filter(function(e){return e.isNode()&&n.has(e)}),o=-1,s=t.id(),c=0;c<a.length;c++){var l=a[c],u=ip(l);o=Math.max(o,u.depth)}if(i.depth<=o){if(!e.acyclic&&r[s])return null;var d=o+1;return b(t,d),r[s]=d,!0}return!1};if(a&&o){var E=[],D={},O=function(e){return E.push(e)},k=function(){return E.shift()};for(r.forEach(function(e){return E.push(e)});E.length>0;){var A=k(),j=T(A,D);if(j)A.outgoers().filter(function(e){return e.isNode()&&n.has(e)}).forEach(O);else if(j===null){jr("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(e.avoidOverlap)for(var N=0;N<r.length;N++){var P=r[N].layoutDimensions(e),F=P.w,I=P.h;M=Math.max(M,F,I)}var L={},R=function(e){if(L[e.id()])return L[e.id()];for(var t=ip(e).depth,n=e.neighborhood(),i=0,a=0,o=0;o<n.length;o++){var s=n[o];if(!(s.isEdge()||s.isParent()||!r.has(s))){var c=ip(s);if(c!=null){var l=c.index,u=c.depth;if(l!=null&&u!=null){var d=_[u].length;u<t&&(i+=l/d,a++)}}}}return a=Math.max(1,a),i/=a,a===0&&(i=0),L[e.id()]=i,i},z=function(e,t){var n=R(e)-R(t);return n===0?Zt(e.id(),t.id()):n};e.depthSort!==void 0&&(z=e.depthSort);for(var B=_.length,V=0;V<B;V++)_[V].sort(z),w(V);for(var H=[],U=0;U<x.length;U++)H.push(x[U]);H.length&&(_.unshift(H),B=_.length,function(){for(var e=0;e<B;e++)w(e)}());for(var W=0,G=0;G<B;G++)W=Math.max(_[G].length,W);var K={x:c.x1+c.w/2,y:c.y1+c.h/2},ee=r.reduce(function(t,n){return function(e){return{w:t.w===-1?e.w:(t.w+e.w)/2,h:t.h===-1?e.h:(t.h+e.h)/2}}(n.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),q=Math.max(B===1?0:s?(c.h-e.padding*2-ee.h)/(B-1):(c.h-e.padding*2-ee.h)/(B+1),M),J=_.reduce(function(e,t){return Math.max(e,t.length)},0),te=function(t){var n=ip(t),r=n.depth,i=n.index;if(e.circle){var a=Math.min(c.w/2/B,c.h/2/B);a=Math.max(a,M);var o=a*r+a-(B>0&&_[0].length<=3?a/2:0),l=2*Math.PI/_[r].length*i;return r===0&&_[0].length===1&&(o=1),{x:K.x+o*Math.cos(l),y:K.y+o*Math.sin(l)}}var u=_[r].length,d=Math.max(u===1?0:s?(c.w-e.padding*2-ee.w)/((e.grid?J:u)-1):(c.w-e.padding*2-ee.w)/((e.grid?J:u)+1),M);return{x:K.x+(i+1-(u+1)/2)*d,y:K.y+(r+1-(B+1)/2)*q}},Y={downward:0,leftward:90,upward:180,rightward:-90};return Object.keys(Y).indexOf(e.direction)===-1&&kr(`Invalid direction '${e.direction}' specified for breadthfirst layout. Valid values are: ${Object.keys(Y).join(`, `)}`),n.nodes().layoutPositions(this,e,function(t){return br(te(t),c,Y[e.direction])}),this};var sp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cp(e){this.options=$t({},sp,e)}cp.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,a=r.nodes().not(`:parent`);t.sort&&(a=a.sort(t.sort));for(var o=zi(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},c=(t.sweep===void 0?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),l,u=0,d=0;d<a.length;d++){var f=a[d].layoutDimensions(t),p=f.w,m=f.h;u=Math.max(u,p,m)}if(l=Q(t.radius)?t.radius:a.length<=1?0:Math.min(o.h,o.w)/2-u,a.length>1&&t.avoidOverlap){u*=1.75;var h=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),_=Math.sqrt(u*u/(h*h+g*g));l=Math.max(_,l)}return r.nodes().layoutPositions(this,t,function(e,n){var r=t.startAngle+n*c*(i?1:-1),a=l*Math.cos(r),o=l*Math.sin(r);return{x:s.x+a,y:s.y+o}}),this};var lp={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function up(e){this.options=$t({},lp,e)}up.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,r=e.cy,i=t.eles,a=i.nodes().not(`:parent`),o=zi(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},c=[],l=0,u=0;u<a.length;u++){var d=a[u],f=void 0;f=t.concentric(d),c.push({value:f,node:d}),d._private.scratch.concentric=f}a.updateStyle();for(var p=0;p<a.length;p++){var m=a[p].layoutDimensions(t);l=Math.max(l,m.w,m.h)}c.sort(function(e,t){return t.value-e.value});for(var h=t.levelWidth(a),g=[[]],_=g[0],v=0;v<c.length;v++){var y=c[v];_.length>0&&Math.abs(_[0].value-y.value)>=h&&(_=[],g.push(_)),_.push(y)}var b=l+t.minNodeSpacing;if(!t.avoidOverlap){var x=g.length>0&&g[0].length>1,S=(Math.min(o.w,o.h)/2-b)/(g.length+x?1:0);b=Math.min(b,S)}for(var C=0,w=0;w<g.length;w++){var T=g[w],E=T.dTheta=(t.sweep===void 0?2*Math.PI-2*Math.PI/T.length:t.sweep)/Math.max(1,T.length-1);if(T.length>1&&t.avoidOverlap){var D=Math.cos(E)-Math.cos(0),O=Math.sin(E)-Math.sin(0),k=Math.sqrt(b*b/(D*D+O*O));C=Math.max(k,C)}T.r=C,C+=b}if(t.equidistant){for(var A=0,j=0,M=0;M<g.length;M++){var N=g[M].r-j;A=Math.max(A,N)}j=0;for(var P=0;P<g.length;P++){var F=g[P];P===0&&(j=F.r),F.r=j,j+=A}}for(var I={},L=0;L<g.length;L++)for(var R=g[L],z=R.dTheta,B=R.r,V=0;V<R.length;V++){var H=R[V],U=t.startAngle+(n?1:-1)*z*V,W={x:s.x+B*Math.cos(U),y:s.y+B*Math.sin(U)};I[H.node.id()]=W}return i.nodes().layoutPositions(this,t,function(e){return I[e.id()]}),this};var dp,fp={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function pp(e){this.options=$t({},fp,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(e){var n=e.source().data(`id`),r=e.target().data(`id`),i=t.some(function(e){return e.data(`id`)===n}),a=t.some(function(e){return e.data(`id`)===r});return!i||!a});this.options.eles=this.options.eles.not(n)}pp.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:`layoutstart`,layout:n}),dp=!0===e.debug;var r=mp(t,n,e);dp&&_p(r),e.randomize&&vp(r);var i=ir(),a=function(){bp(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter||(xp(r,e),r.temperature*=e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(e.animate===!0||e.animate===!1)a(),n.one(`layoutstop`,e.stop),n.emit({type:`layoutstop`,layout:n});else{var t=e.eles.nodes(),i=yp(r,e,t);t.layoutPositions(n,e,i)}},c=0,l=!0;if(e.animate===!0){var u=function(){for(var t=0;l&&t<e.refresh;)l=o(c),c++,t++;l?(ir()-i>=e.animationThreshold&&a(),rr(u)):(Np(r,e),s())};u()}else{for(;l;)l=o(c),c++;Np(r,e),s()}return this},pp.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit(`layoutstop`),this},pp.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var mp=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=zi(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),c={},l=0;l<s.length;l++)for(var u=s[l],d=0;d<u.length;d++){var f=u[d];c[f.id()]=l}for(var l=0;l<o.nodeSize;l++){var p=i[l],m=p.layoutDimensions(n),h={};h.isLocked=p.locked(),h.id=p.data(`id`),h.parentId=p.data(`parent`),h.cmptId=c[p.id()],h.children=[],h.positionX=p.position(`x`),h.positionY=p.position(`y`),h.offsetX=0,h.offsetY=0,h.height=m.w,h.width=m.h,h.maxX=h.positionX+h.width/2,h.minX=h.positionX-h.width/2,h.maxY=h.positionY+h.height/2,h.minY=h.positionY-h.height/2,h.padLeft=parseFloat(p.style(`padding`)),h.padRight=parseFloat(p.style(`padding`)),h.padTop=parseFloat(p.style(`padding`)),h.padBottom=parseFloat(p.style(`padding`)),h.nodeRepulsion=xt(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,o.layoutNodes.push(h),o.idToIndex[h.id]=l}for(var g=[],_=0,v=-1,y=[],l=0;l<o.nodeSize;l++){var p=o.layoutNodes[l],b=p.parentId;b==null?(g[++v]=p.id,y.push(p.id)):o.layoutNodes[o.idToIndex[b]].children.push(p.id)}for(o.graphSet.push(y);_<=v;){var x=g[_++],S=o.idToIndex[x],f=o.layoutNodes[S],C=f.children;if(C.length>0){o.graphSet.push(C);for(var l=0;l<C.length;l++)g[++v]=C[l]}}for(var l=0;l<o.graphSet.length;l++)for(var w=o.graphSet[l],d=0;d<w.length;d++){var T=o.idToIndex[w[d]];o.indexToGraph[T]=l}for(var l=0;l<o.edgeSize;l++){var E=r[l],D={};D.id=E.data(`id`),D.sourceId=E.data(`source`),D.targetId=E.data(`target`);var O=xt(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,k=xt(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,A=o.idToIndex[D.sourceId],j=o.idToIndex[D.targetId];if(o.indexToGraph[A]!=o.indexToGraph[j]){for(var M=hp(D.sourceId,D.targetId,o),N=o.graphSet[M],P=0,h=o.layoutNodes[A];N.indexOf(h.id)===-1;)h=o.layoutNodes[o.idToIndex[h.parentId]],P++;for(h=o.layoutNodes[j];N.indexOf(h.id)===-1;)h=o.layoutNodes[o.idToIndex[h.parentId]],P++;O*=P*n.nestingFactor}D.idealLength=O,D.elasticity=k,o.layoutEdges.push(D)}return o},hp=function(e,t,n){var r=gp(e,t,0,n);return 2>r.count?0:r.graph},gp=function(e,t,n,r){var i=r.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var a=0,o=0;o<i.length;o++){var s=i[o],c=r.idToIndex[s],l=r.layoutNodes[c].children;if(l.length!==0){var u=r.indexToGraph[r.idToIndex[l[0]]],d=gp(e,t,u,r);if(d.count!==0){if(d.count===1){if(a++,a===2)break}else return d}}}return{count:a,graph:n}},_p,vp=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];a.children.length===0&&!a.isLocked&&(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},yp=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(t){var n=e.layoutNodes[e.idToIndex[t.data(`id`)]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data(`id`)]];if(t.boundingBox){var s=i.w===0?.5:(o.positionX-i.x1)/i.w,c=i.h===0?.5:(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+c*r.h}}return{x:o.positionX,y:o.positionY}}},bp=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=yp(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one(`layoutready`,n.ready),r.emit({type:`layoutready`,layout:this}))},xp=function(e,t,n){Sp(e,t),Dp(e),Op(e,t),kp(e),Ap(e)},Sp=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++){var c=e.layoutNodes[e.idToIndex[r[s]]];wp(o,c,e,t)}},Cp=function(e){return-e+2*e*Math.random()},wp=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,a=t.positionY-e.positionY,o=1;i===0&&a===0&&(i=Cp(o),a=Cp(o));var s=Tp(e,t,i,a);if(s>0)var c=r.nodeOverlap*s,l=Math.sqrt(i*i+a*a),u=c*i/l,d=c*a/l;else var f=Ep(e,i,a),p=Ep(t,-1*i,-1*a),m=p.x-f.x,h=p.y-f.y,g=m*m+h*h,l=Math.sqrt(g),c=(e.nodeRepulsion+t.nodeRepulsion)/g,u=c*m/l,d=c*h/l;e.isLocked||(e.offsetX-=u,e.offsetY-=d),t.isLocked||(t.offsetX+=u,t.offsetY+=d)}},Tp=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},Ep=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,c=a/o,l={};return t===0&&0<n||t===0&&0>n?(l.x=r,l.y=i+a/2,l):0<t&&-1*c<=s&&s<=c?(l.x=r+o/2,l.y=i+o*n/2/t,l):0>t&&-1*c<=s&&s<=c?(l.x=r-o/2,l.y=i-o*n/2/t,l):0<n&&(s<=-1*c||s>=c)?(l.x=r+a*t/2/n,l.y=i+a/2,l):0>n&&(s<=-1*c||s>=c)?(l.x=r-a*t/2/n,l.y=i-a/2,l):l},Dp=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],c=s.positionX-a.positionX,l=s.positionY-a.positionY;if(c!==0||l!==0){var u=Ep(a,c,l),d=Ep(s,-1*c,-1*l),f=d.x-u.x,p=d.y-u.y,m=Math.sqrt(f*f+p*p),h=(r.idealLength-m)**2/r.elasticity;if(m!==0)var g=h*f/m,_=h*p/m;else var g=0,_=0;a.isLocked||(a.offsetX+=g,a.offsetY+=_),s.isLocked||(s.offsetX-=g,s.offsetY-=_)}}},Op=function(e,t){if(t.gravity!==0)for(var n=1,r=0;r<e.graphSet.length;r++){var i=e.graphSet[r],a=i.length;if(r===0)var o=e.clientHeight/2,s=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[i[0]]],l=e.layoutNodes[e.idToIndex[c.parentId]],o=l.positionX,s=l.positionY;for(var u=0;u<a;u++){var d=e.layoutNodes[e.idToIndex[i[u]]];if(!d.isLocked){var f=o-d.positionX,p=s-d.positionY,m=Math.sqrt(f*f+p*p);if(m>n){var h=t.gravity*f/m,g=t.gravity*p/m;d.offsetX+=h,d.offsetY+=g}}}}},kp=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],c=s.children;if(0<c.length&&!s.isLocked){for(var l=s.offsetX,u=s.offsetY,d=0;d<c.length;d++){var f=e.layoutNodes[e.idToIndex[c[d]]];f.offsetX+=l,f.offsetY+=u,n[++i]=c[d]}s.offsetX=0,s.offsetY=0}}},Ap=function(e,t){for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&(r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];if(!(0<r.children.length||r.isLocked)){var i=jp(r.offsetX,r.offsetY,e.temperature);r.positionX+=i.x,r.positionY+=i.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,Mp(r,e)}}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&!r.isLocked&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY)}},jp=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},Mp=function(e,t){var n=e.parentId;if(n!=null){var r=t.layoutNodes[t.idToIndex[n]],i=!1;if((r.maxX==null||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(r.minX==null||e.minX-r.padLeft<r.minX)&&(r.minX=e.minX-r.padLeft,i=!0),(r.maxY==null||e.maxY+r.padBottom>r.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(r.minY==null||e.minY-r.padTop<r.minY)&&(r.minY=e.minY-r.padTop,i=!0),i)return Mp(r,t)}},Np=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}for(var s=0,i=0;i<r.length;i++){var c=r[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var l=0;l<c.length;l++){var u=c[l];c.x1=Math.min(c.x1,u.positionX-u.width/2),c.x2=Math.max(c.x2,u.positionX+u.width/2),c.y1=Math.min(c.y1,u.positionY-u.height/2),c.y2=Math.max(c.y2,u.positionY+u.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,s+=c.w*c.h}}r.sort(function(e,t){return t.w*t.h-e.w*e.h});for(var d=0,f=0,p=0,m=0,h=Math.sqrt(s)*e.clientWidth/e.clientHeight,i=0;i<r.length;i++){var c=r[i];if(c){for(var l=0;l<c.length;l++){var u=c[l];u.isLocked||(u.positionX+=d-c.x1,u.positionY+=f-c.y1)}d+=c.w+t.componentSpacing,p+=c.w+t.componentSpacing,m=Math.max(m,c.h),p>h&&(f+=m+t.componentSpacing,d=0,p=0,m=0)}}},Pp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Fp(e){this.options=$t({},Pp,e)}Fp.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(`:parent`);t.sort&&(i=i.sort(t.sort));var a=zi(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(a.h===0||a.w===0)r.nodes().layoutPositions(this,t,function(e){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),c=Math.round(s),l=Math.round(a.w/a.h*s),u=function(e){if(e==null)return Math.min(c,l);Math.min(c,l)==c?c=e:l=e},d=function(e){if(e==null)return Math.max(c,l);Math.max(c,l)==c?c=e:l=e},f=t.rows,p=t.cols==null?t.columns:t.cols;if(f!=null&&p!=null)c=f,l=p;else if(f!=null&&p==null)c=f,l=Math.ceil(o/c);else if(f==null&&p!=null)l=p,c=Math.ceil(o/l);else if(l*c>o){var m=u(),h=d();(m-1)*h>=o?u(m-1):(h-1)*m>=o&&d(h-1)}else for(;l*c<o;){var g=u(),_=d();(_+1)*g>=o?d(_+1):u(g+1)}var v=a.w/l,y=a.h/c;if(t.condense&&(v=0,y=0),t.avoidOverlap)for(var b=0;b<i.length;b++){var x=i[b],S=x._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var C=x.layoutDimensions(t),w=t.avoidOverlapPadding,T=C.w+w,E=C.h+w;v=Math.max(v,T),y=Math.max(y,E)}for(var D={},O=function(e,t){return!!D[`c-`+e+`-`+t]},k=function(e,t){D[`c-`+e+`-`+t]=!0},A=0,j=0,M=function(){j++,j>=l&&(j=0,A++)},N={},P=0;P<i.length;P++){var F=i[P],I=t.position(F);if(I&&(I.row!==void 0||I.col!==void 0)){var L={row:I.row,col:I.col};if(L.col===void 0)for(L.col=0;O(L.row,L.col);)L.col++;else if(L.row===void 0)for(L.row=0;O(L.row,L.col);)L.row++;N[F.id()]=L,k(L.row,L.col)}}i.layoutPositions(this,t,function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=N[e.id()];if(i)n=i.col*v+v/2+a.x1,r=i.row*y+y/2+a.y1;else{for(;O(A,j);)M();n=j*v+v/2+a.x1,r=A*y+y/2+a.y1,k(A,j),M()}return{x:n,y:r}})}return this};var Ip={ready:function(){},stop:function(){}};function Lp(e){this.options=$t({},Ip,e)}Lp.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit(`layoutstart`),t.nodes().positions(function(){return{x:0,y:0}}),n.one(`layoutready`,e.ready),n.emit(`layoutready`),n.one(`layoutstop`,e.stop),n.emit(`layoutstop`),this},Lp.prototype.stop=function(){return this};var Rp={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function zp(e){this.options=$t({},Rp,e)}zp.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=xt(e.positions);function r(t){return e.positions==null?vi(t.position()):n?e.positions(t):e.positions[t._private.data.id]??null}return t.layoutPositions(this,e,function(e,t){var n=r(e);return e.locked()||n==null?!1:n}),this};var Bp={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Vp(e){this.options=$t({},Bp,e)}Vp.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=zi(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),this};var Hp=[{name:`breadthfirst`,impl:op},{name:`circle`,impl:cp},{name:`concentric`,impl:up},{name:`cose`,impl:pp},{name:`grid`,impl:Fp},{name:`null`,impl:Lp},{name:`preset`,impl:zp},{name:`random`,impl:Vp}];function Up(e){this.options=e,this.notifications=0}var Wp=function(){},Gp=function(){throw Error(`A headless instance can not render images`)};Up.prototype={recalculateRenderedStyle:Wp,notify:function(){this.notifications++},init:Wp,isHeadless:function(){return!0},png:Gp,jpg:Gp};var Kp={};Kp.arrowShapeWidth=.3,Kp.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,c=i.x+n/2+o,l=i.y-n/2-o,u=i.y+n/2+o;return s<=e&&e<=c&&l<=t&&t<=u},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r),s=a*n,c=o*n;return{x:s+i.x,y:c+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],c=e[o+1];a.push(r(s,c,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).pfValue*2},s=function(r,s){Z(s)&&(s=e[s]),e[r]=$t({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){return sa(e,t,a(i(this.points,n+2*s,r,o)))},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl(`polygon`)(e,o)},spacing:function(e){return 0},gap:o},s)};s(`none`,{collide:Er,roughCollide:Er,draw:Or,spacing:Dr,gap:Dr}),s(`triangle`,{points:[-.15,-.3,0,0,.15,-.3]}),s(`arrow`,`triangle`),s(`triangle-backcurve`,{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var c=i(this.points,n,a,o),l=this.controlPoint,u=r(l[0],l[1],n,a,o);t.arrowShapeImpl(this.name)(e,c,u)},gap:function(e){return o(e)*.8}}),s(`triangle-tee`,{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,o,s,c){var l=a(i(this.points,n+2*c,r,o)),u=a(i(this.pointsTee,n+2*c,r,o));return sa(e,t,l)||sa(e,t,u)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),c=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,c)}}),s(`circle-triangle`,{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,c){var l=o,u=(l.x-e)**2+(l.y-t)**2<=((n+2*c)*this.radius)**2;return sa(e,t,a(i(this.points,n+2*c,r,o)))||u},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`triangle-cross`,{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e,i=3,a=5;return n[i]=n[i]-r,n[a]=n[a]-r,n},collide:function(e,t,n,r,o,s,c){var l=a(i(this.points,n+2*c,r,o)),u=a(i(this.crossLinePts(n,s),n+2*c,r,o));return sa(e,t,l)||sa(e,t,u)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),c=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,c)}}),s(`vee`,{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return o(e)*.525}}),s(`circle`,{radius:.15,collide:function(e,t,n,r,i,a,o){var s=i;return(s.x-e)**2+(s.y-t)**2<=((n+2*o)*this.radius)**2},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`tee`,{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s(`square`,{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s(`diamond`,{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}}),s(`chevron`,{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return .95*e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}})};var qp={};qp.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),c=n.zoom();return[((e-i)/o-s.x)/c,((t-a)/o-s.y)/c]},qp.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i={left:r(`padding-left`),right:r(`padding-right`),top:r(`padding-top`),bottom:r(`padding-bottom`)},a={left:r(`border-left-width`),right:r(`border-right-width`),top:r(`border-top-width`),bottom:r(`border-bottom-width`)},o=e.clientWidth,s=e.clientHeight,c=i.left+i.right,l=i.top+i.bottom,u=a.left+a.right,d=t.width/(o+u),f=o-c,p=s-l,m=t.left+i.left+a.left,h=t.top+i.top+a.top;return this.containerBB=[m,h,f,p,d]},qp.invalidateContainerClientCoordsCache=function(){this.containerBB=null},qp.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},qp.findNearestElements=function(e,t,n,r){var i=this,a=this,o=a.getCachedZSortedEles(),s=[],c=a.cy.zoom(),l=a.cy.hasCompoundNodes(),u=(r?24:8)/c,d=(r?8:2)/c,f=(r?8:2)/c,p=1/0,m,h;n&&(o=o.interactive);function g(e,t){if(e.isNode()){if(h)return;h=e,s.push(e)}if(e.isEdge()&&(t==null||t<p)){if(m){if(m.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value&&m.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value){for(var n=0;n<s.length;n++)if(s[n].isEdge()){s[n]=e,m=e,p=t??p;break}}}else s.push(e),m=e,p=t??p}}function _(n){var r=n.outerWidth()+2*d,o=n.outerHeight()+2*d,s=r/2,c=o/2,l=n.position(),u=n.pstyle(`corner-radius`).value===`auto`?`auto`:n.pstyle(`corner-radius`).pfValue,f=n._private.rscratch;if(l.x-s<=e&&e<=l.x+s&&l.y-c<=t&&t<=l.y+c&&a.nodeShapes[i.getNodeShape(n)].checkPoint(e,t,0,r,o,l.x,l.y,u,f))return g(n,0),!0}function v(n){var r=n._private,o=r.rscratch,c=n.pstyle(`width`).pfValue,d=n.pstyle(`arrow-scale`).value,f=c/2+u,p=f*f,m=f*2,h=r.source,v=r.target,y;if(o.edgeType===`segments`||o.edgeType===`straight`||o.edgeType===`haystack`){for(var b=o.allpts,x=0;x+3<b.length;x+=2)if(ta(e,t,b[x],b[x+1],b[x+2],b[x+3],m)&&p>(y=oa(e,t,b[x],b[x+1],b[x+2],b[x+3])))return g(n,y),!0}else if(o.edgeType===`bezier`||o.edgeType===`multibezier`||o.edgeType===`self`||o.edgeType===`compound`){for(var b=o.allpts,x=0;x+5<o.allpts.length;x+=4)if(na(e,t,b[x],b[x+1],b[x+2],b[x+3],b[x+4],b[x+5],m)&&p>(y=aa(e,t,b[x],b[x+1],b[x+2],b[x+3],b[x+4],b[x+5])))return g(n,y),!0}for(var h=h||r.source,v=v||r.target,S=i.getArrowWidth(c,d),C=[{name:`source`,x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:`target`,x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:`mid-source`,x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:`mid-target`,x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}],x=0;x<C.length;x++){var w=C[x],T=a.arrowShapes[n.pstyle(w.name+`-arrow-shape`).value],E=n.pstyle(`width`).pfValue;if(T.roughCollide(e,t,S,w.angle,{x:w.x,y:w.y},E,u)&&T.collide(e,t,S,w.angle,{x:w.x,y:w.y},E,u))return g(n),!0}l&&s.length>0&&(_(h),_(v))}function y(e,t,n){return Hr(e,t,n)}function b(n,r){var i=n._private,a=f,o=r?r+`-`:``;n.boundingBox();var s=i.labelBounds[r||`main`],c=n.pstyle(o+`label`).value;if(n.pstyle(`text-events`).strValue===`yes`&&c){var l=y(i.rscratch,`labelX`,r),u=y(i.rscratch,`labelY`,r),d=y(i.rscratch,`labelAngle`,r),p=n.pstyle(o+`text-margin-x`).pfValue,m=n.pstyle(o+`text-margin-y`).pfValue,h=s.x1-a-p,_=s.x2+a-p,v=s.y1-a-m,b=s.y2+a-m;if(d){var x=Math.cos(d),S=Math.sin(d),C=function(e,t){return e-=l,t-=u,{x:e*x-t*S+l,y:e*S+t*x+u}},w=C(h,v),T=C(h,b),E=C(_,v),D=C(_,b);if(sa(e,t,[w.x+p,w.y+m,E.x+p,E.y+m,D.x+p,D.y+m,T.x+p,T.y+m]))return g(n),!0}else if(Ji(s,e,t))return g(n),!0}}for(var x=o.length-1;x>=0;x--){var S=o[x];S.isNode()?_(S)||b(S):v(S)||b(S)||b(S,`source`)||b(S,`target`)}return s},qp.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),c=Math.max(e,n),l=Math.min(t,r),u=Math.max(t,r);e=s,n=c,t=l,r=u;var d=zi({x1:e,y1:t,x2:n,y2:r}),f=[{x:d.x1,y:d.y1},{x:d.x2,y:d.y1},{x:d.x2,y:d.y2},{x:d.x1,y:d.y2}],p=[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]],[f[3],f[0]]];function m(e,t,n){return Hr(e,t,n)}function h(e,t){var n=e._private,r=a,i=``;e.boundingBox();var o=n.labelBounds.main;if(!o)return null;var s=m(n.rscratch,`labelX`,t),c=m(n.rscratch,`labelY`,t),l=m(n.rscratch,`labelAngle`,t),u=e.pstyle(i+`text-margin-x`).pfValue,d=e.pstyle(i+`text-margin-y`).pfValue,f=o.x1-r-u,p=o.x2+r-u,h=o.y1-r-d,g=o.y2+r-d;if(l){var _=Math.cos(l),v=Math.sin(l),y=function(e,t){return e-=s,t-=c,{x:e*_-t*v+s,y:e*v+t*_+c}};return[y(f,h),y(p,h),y(p,g),y(f,g)]}return[{x:f,y:h},{x:p,y:h},{x:p,y:g},{x:f,y:g}]}function g(e,t,n,r){function i(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}for(var _=0;_<i.length;_++){var v=i[_];if(v.isNode()){var y=v,b=y.pstyle(`text-events`).strValue===`yes`,x=y.pstyle(`box-selection`).strValue,S=y.pstyle(`box-select-labels`).strValue===`yes`;if(x===`none`)continue;var C=(x===`overlap`||S)&&b,w=y.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:C});if(x===`contain`){var T=!1;if(S&&b){var E=h(y);E&&ka(E,f)&&(o.push(y),T=!0)}!T&&Xi(d,w)&&o.push(y)}else if(x===`overlap`&&qi(d,w)){var D=y.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(ka([{x:D.x1,y:D.y1},{x:D.x2,y:D.y1},{x:D.x2,y:D.y2},{x:D.x1,y:D.y2}],f))o.push(y);else{var O=h(y);O&&ka(O,f)&&o.push(y)}}}else{var k=v,A=k._private,j=A.rscratch,M=k.pstyle(`box-selection`).strValue;if(M===`none`)continue;if(M===`contain`){if(j.startX!=null&&j.startY!=null&&!Ji(d,j.startX,j.startY)||j.endX!=null&&j.endY!=null&&!Ji(d,j.endX,j.endY))continue;if(j.edgeType===`bezier`||j.edgeType===`multibezier`||j.edgeType===`self`||j.edgeType===`compound`||j.edgeType===`segments`||j.edgeType===`haystack`){for(var N=A.rstyle.bezierPts||A.rstyle.linePts||A.rstyle.haystackPts,P=!0,F=0;F<N.length;F++)if(!Yi(d,N[F])){P=!1;break}P&&o.push(k)}else j.edgeType===`straight`&&o.push(k)}else if(M===`overlap`){var I=!1;if(j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(Ji(d,j.startX,j.startY)||Ji(d,j.endX,j.endY)))o.push(k),I=!0;else if(!I&&j.edgeType===`haystack`){for(var L=A.rstyle.haystackPts,R=0;R<L.length;R++)if(Yi(d,L[R])){o.push(k),I=!0;break}}if(!I){var z=A.rstyle.bezierPts||A.rstyle.linePts||A.rstyle.haystackPts;if((!z||z.length<2)&&j.edgeType===`straight`&&j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(z=[{x:j.startX,y:j.startY},{x:j.endX,y:j.endY}]),!z||z.length<2)continue;for(var B=0;B<z.length-1;B++){for(var V=z[B],H=z[B+1],U=0;U<p.length;U++){var W=ct(p[U],2),G=W[0],K=W[1];if(g(V,H,G,K)){o.push(k),I=!0;break}}if(I)break}}}}}return o};var Jp={};Jp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType===`haystack`,r=t.edgeType===`bezier`,i=t.edgeType===`multibezier`,a=t.edgeType===`segments`,o=t.edgeType===`compound`,s=t.edgeType===`self`,c,l,u,d,f,p,m,h;if(n?(u=t.haystackPts[0],d=t.haystackPts[1],f=t.haystackPts[2],p=t.haystackPts[3]):(u=t.arrowStartX,d=t.arrowStartY,f=t.arrowEndX,p=t.arrowEndY),m=t.midX,h=t.midY,a)c=u-t.segpts[0],l=d-t.segpts[1];else if(i||o||s||r){var g=t.allpts,_=Fi(g[0],g[2],g[4],.1),v=Fi(g[1],g[3],g[5],.1);c=u-_,l=d-v}else c=u-m,l=d-h;t.srcArrowAngle=ki(c,l);var m=t.midX,h=t.midY;if(n&&(m=(u+f)/2,h=(d+p)/2),c=f-u,l=p-d,a){var g=t.allpts;if(g.length/2%2==0){var y=g.length/2,b=y-2;c=g[y]-g[b],l=g[y+1]-g[b+1]}else if(t.isRound)c=t.midVector[1],l=-t.midVector[0];else{var y=g.length/2-1,b=y-2;c=g[y]-g[b],l=g[y+1]-g[b+1]}}else if(i||o||s){var g=t.allpts,x=t.ctrlpts,S,C,w,T;if(x.length/2%2==0){var E=g.length/2-1,D=E+2,O=D+2;S=Fi(g[E],g[D],g[O],0),C=Fi(g[E+1],g[D+1],g[O+1],0),w=Fi(g[E],g[D],g[O],1e-4),T=Fi(g[E+1],g[D+1],g[O+1],1e-4)}else{var D=g.length/2-1,E=D-2,O=D+2;S=Fi(g[E],g[D],g[O],.4999),C=Fi(g[E+1],g[D+1],g[O+1],.4999),w=Fi(g[E],g[D],g[O],.5),T=Fi(g[E+1],g[D+1],g[O+1],.5)}c=w-S,l=T-C}if(t.midtgtArrowAngle=ki(c,l),t.midDispX=c,t.midDispY=l,c*=-1,l*=-1,a){var g=t.allpts;if(g.length/2%2!=0&&!t.isRound){var y=g.length/2-1,k=y+2;c=-(g[k]-g[y]),l=-(g[k+1]-g[y+1])}}if(t.midsrcArrowAngle=ki(c,l),a)c=f-t.segpts[t.segpts.length-2],l=p-t.segpts[t.segpts.length-1];else if(i||o||s||r){var g=t.allpts,A=g.length,_=Fi(g[A-6],g[A-4],g[A-2],.9),v=Fi(g[A-5],g[A-3],g[A-1],.9);c=f-_,l=p-v}else c=f-m,l=p-h;t.tgtArrowAngle=ki(c,l)},Jp.getArrowWidth=Jp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+`, `+t];return r||(r=Math.max((e*13.37)**.9,29)*t,n[e+`, `+t]=r,r)};var Yp,Xp,Zp={},Qp={},$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},hm=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},gm=function(e,t,n,r,i){if(e===pm?hm(Qp,Zp):mm(t,e,Zp),mm(t,n,Qp),$p=Zp.nx*Qp.ny-Zp.ny*Qp.nx,em=Zp.nx*Qp.nx-Zp.ny*-Qp.ny,rm=Math.asin(Math.max(-1,Math.min(1,$p))),Math.abs(rm)<1e-6){Yp=t.x,Xp=t.y,am=sm=0;return}tm=1,nm=!1,em<0?rm<0?rm=Math.PI+rm:(rm=Math.PI-rm,tm=-1,nm=!0):rm>0&&(tm=-1,nm=!0),sm=t.radius===void 0?r:t.radius,im=rm/2,cm=Math.min(Zp.len/2,Qp.len/2),i?(om=Math.abs(Math.cos(im)*sm/Math.sin(im)),om>cm?(om=cm,am=Math.abs(om*Math.sin(im)/Math.cos(im))):am=sm):(om=Math.min(cm,sm),am=Math.abs(om*Math.sin(im)/Math.cos(im))),dm=t.x+Qp.nx*om,fm=t.y+Qp.ny*om,Yp=dm-Qp.ny*am*tm,Xp=fm+Qp.nx*am*tm,lm=t.x+Zp.nx*om,um=t.y+Zp.ny*om,pm=t};function _m(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function vm(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(gm(e,t,n,r,i),{cx:Yp,cy:Xp,radius:am,startX:lm,startY:um,stopX:dm,stopY:fm,startAngle:Zp.ang+Math.PI/2*tm,endAngle:Qp.ang-Math.PI/2*tm,counterClockwise:nm})}var ym=.01,bm=Math.sqrt(2*ym),xm={};xm.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,i=t.vectorNormInverse,a,o=e.pstyle(`source-endpoint`),s=e.pstyle(`target-endpoint`),c=o.units!=null&&s.units!=null,l=function(e,t,n,r){var i=r-t,a=n-e,o=Math.sqrt(a*a+i*i);return{x:-i/o,y:a/o}};switch(e.pstyle(`edge-distances`).value){case`node-position`:a=n;break;case`intersection`:a=r;break;case`endpoints`:if(c){var u=ct(this.manualEndptToPx(e.source()[0],o),2),d=u[0],f=u[1],p=ct(this.manualEndptToPx(e.target()[0],s),2),m=p[0],h=p[1],g={x1:d,y1:f,x2:m,y2:h};i=l(d,f,m,h),a=g}else jr(`Edge ${e.id()} has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).`),a=r}return{midptPts:a,vectorNormInverse:i}},xm.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var o=r.source,s=r.target,c=o.position(),l=s.position(),u=o.width(),d=s.width(),f=o.height(),p=s.height(),m=n.pstyle(`haystack-radius`).value/2;i.haystackPts=i.allpts=[i.source.x*u*m+c.x,i.source.y*f*m+c.y,i.target.x*d*m+l.x,i.target.y*p*m+l.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType=`haystack`,i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},xm.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle(`segment-weights`),i=e.pstyle(`segment-distances`),a=e.pstyle(`segment-radii`),o=e.pstyle(`radius-type`),s=Math.min(r.pfValue.length,i.pfValue.length),c=a.pfValue[a.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];n.edgeType=`segments`,n.segpts=[],n.radii=[],n.isArcRadius=[];for(var u=0;u<s;u++){var d=r.pfValue[u],f=i.pfValue[u],p=1-d,m=d,h=this.findMidptPtsEtc(e,t),g=h.midptPts,_=h.vectorNormInverse,v={x:g.x1*p+g.x2*m,y:g.y1*p+g.y2*m};n.segpts.push(v.x+_.x*f,v.y+_.y*f),n.radii.push(a.pfValue[u]===void 0?c:a.pfValue[u]),n.isArcRadius.push((o.pfValue[u]===void 0?l:o.pfValue[u])===`arc-radius`)}},xm.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle(`control-point-distances`),c=s?s.pfValue[0]:void 0,l=e.pstyle(`loop-direction`).pfValue,u=e.pstyle(`loop-sweep`).pfValue,d=e.pstyle(`control-point-step-size`).pfValue;i.edgeType=`self`;var f=n,p=d;r&&(f=0,p=c);var m=l-Math.PI/2,h=m-u/2,g=m+u/2,_=String(l+`_`+u);f=a[_]===void 0?a[_]=0:++a[_],i.ctrlpts=[o.x+Math.cos(h)*1.4*p*(f/3+1),o.y+Math.sin(h)*1.4*p*(f/3+1),o.x+Math.cos(g)*1.4*p*(f/3+1),o.y+Math.sin(g)*1.4*p*(f/3+1)]},xm.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType=`compound`;var a=t.srcPos,o=t.tgtPos,s=t.srcW,c=t.srcH,l=t.tgtW,u=t.tgtH,d=e.pstyle(`control-point-step-size`).pfValue,f=e.pstyle(`control-point-distances`),p=f?f.pfValue[0]:void 0,m=n,h=d;r&&(m=0,h=p);var g=50,_={x:a.x-s/2,y:a.y-c/2},v={x:o.x-l/2,y:o.y-u/2},y={x:Math.min(_.x,v.x),y:Math.min(_.y,v.y)},b=.5,x=Math.max(b,Math.log(s*ym)),S=Math.max(b,Math.log(l*ym));i.ctrlpts=[y.x,y.y-(1+g**1.12/100)*h*(m/3+1)*x,y.x-(1+g**1.12/100)*h*(m/3+1)*S,y.y]},xm.findStraightEdgePoints=function(e){e._private.rscratch.edgeType=`straight`},xm.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=e.pstyle(`control-point-step-size`).pfValue,s=e.pstyle(`control-point-distances`),c=e.pstyle(`control-point-weights`),l=s&&c?Math.min(s.value.length,c.value.length):1,u=s?s.pfValue[0]:void 0,d=c.value[0],f=r;a.edgeType=f?`multibezier`:`bezier`,a.ctrlpts=[];for(var p=0;p<l;p++){var m=(.5-t.eles.length/2+n)*o*(i?-1:1),h=void 0,g=ji(m);f&&(u=s?s.pfValue[p]:o,d=c.value[p]),h=r?u:u===void 0?void 0:g*u;var _=h===void 0?m:h,v=1-d,y=d,b=this.findMidptPtsEtc(e,t),x=b.midptPts,S=b.vectorNormInverse,C={x:x.x1*v+x.x2*y,y:x.y1*v+x.y2*y};a.ctrlpts.push(C.x+S.x*_,C.y+S.y*_)}},xm.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType=`segments`;var r=`vertical`,i=`horizontal`,a=`leftward`,o=`rightward`,s=`downward`,c=`upward`,l=`auto`,u=t.posPts,d=t.srcW,f=t.srcH,p=t.tgtW,m=t.tgtH,h=e.pstyle(`edge-distances`).value!==`node-position`,g=e.pstyle(`taxi-direction`).value,_=g,v=e.pstyle(`taxi-turn`),y=v.units===`%`,b=v.pfValue,x=b<0,S=e.pstyle(`taxi-turn-min-distance`).pfValue,C=h?(d+p)/2:0,w=h?(f+m)/2:0,T=u.x2-u.x1,E=u.y2-u.y1,D=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},O=D(T,C),k=D(E,w),A=!1;_===l?g=Math.abs(O)>Math.abs(k)?i:r:_===c||_===s?(g=r,A=!0):(_===a||_===o)&&(g=i,A=!0);var j=g===r,M=j?k:O,N=j?E:T,P=ji(N),F=!1;!(A&&(y||x))&&(_===s&&N<0||_===c&&N>0||_===a&&N>0||_===o&&N<0)&&(P*=-1,M=P*Math.abs(M),F=!0);var I=y?(b<0?1+b:b)*M:(b<0?M:0)+b*P,L=function(e){return Math.abs(e)<S||Math.abs(e)>=Math.abs(M)},R=L(I),z=L(Math.abs(M)-Math.abs(I));if((R||z)&&!F){if(j){var B=Math.abs(N)<=f/2,V=Math.abs(T)<=p/2;if(B){var H=(u.x1+u.x2)/2;n.segpts=[H,u.y1,H,u.y2]}else if(V){var U=(u.y1+u.y2)/2;n.segpts=[u.x1,U,u.x2,U]}else n.segpts=[u.x1,u.y2]}else{var W=Math.abs(N)<=d/2,G=Math.abs(E)<=m/2;if(W){var K=(u.y1+u.y2)/2;n.segpts=[u.x1,K,u.x2,K]}else if(G){var ee=(u.x1+u.x2)/2;n.segpts=[ee,u.y1,ee,u.y2]}else n.segpts=[u.x2,u.y1]}}else if(j){var q=u.y1+I+(h?f/2*P:0);n.segpts=[u.x1,q,u.x2,q]}else{var J=u.x1+I+(h?d/2*P:0);n.segpts=[J,u.y1,J,u.y2]}if(n.isRound){var te=e.pstyle(`taxi-radius`).value,Y=e.pstyle(`radius-type`).value[0]===`arc-radius`;n.radii=Array(n.segpts.length/2).fill(te),n.isArcRadius=Array(n.segpts.length/2).fill(Y)}},xm.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType===`bezier`){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,c=t.tgtH,l=t.srcShape,u=t.tgtShape,d=t.srcCornerRadius,f=t.tgtCornerRadius,p=t.srcRs,m=t.tgtRs,h=!Q(n.startX)||!Q(n.startY),g=!Q(n.arrowStartX)||!Q(n.arrowStartY),_=!Q(n.endX)||!Q(n.endY),v=!Q(n.arrowEndX)||!Q(n.arrowEndY),y=3*(this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth),b=Mi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=b<y,S=Mi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),C=S<y,w=!1;if(h||g||x){w=!0;var T={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(T.x*T.x+T.y*T.y),D={x:T.x/E,y:T.y/E},O=Math.max(a,o),k={x:n.ctrlpts[0]+D.x*2*O,y:n.ctrlpts[1]+D.y*2*O},A=l.intersectLine(r.x,r.y,a,o,k.x,k.y,0,d,p);x?(n.ctrlpts[0]=n.ctrlpts[0]+D.x*(y-b),n.ctrlpts[1]=n.ctrlpts[1]+D.y*(y-b)):(n.ctrlpts[0]=A[0]+D.x*y,n.ctrlpts[1]=A[1]+D.y*y)}if(_||v||C){w=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},M=Math.sqrt(j.x*j.x+j.y*j.y),N={x:j.x/M,y:j.y/M},P=Math.max(a,o),F={x:n.ctrlpts[0]+N.x*2*P,y:n.ctrlpts[1]+N.y*2*P},I=u.intersectLine(i.x,i.y,s,c,F.x,F.y,0,f,m);C?(n.ctrlpts[0]=n.ctrlpts[0]+N.x*(y-S),n.ctrlpts[1]=n.ctrlpts[1]+N.y*(y-S)):(n.ctrlpts[0]=I[0]+N.x*y,n.ctrlpts[1]=I[1]+N.y*y)}w&&this.findEndpoints(e)}},xm.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType===`multibezier`||t.edgeType===`bezier`||t.edgeType===`self`||t.edgeType===`compound`){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,i;t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,i=.5,t.midX=Fi(t.allpts[r],t.allpts[r+2],t.allpts[r+4],i),t.midY=Fi(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],i))}else if(t.edgeType===`straight`)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType===`segments`){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var a=2;a+3<t.allpts.length;a+=2){var o=t.radii[a/2-1],s=t.isArcRadius[a/2-1];t.roundCorners.push(vm({x:t.allpts[a-2],y:t.allpts[a-1]},{x:t.allpts[a],y:t.allpts[a+1],radius:o},{x:t.allpts[a+2],y:t.allpts[a+3]},o,s))}}if(t.segpts.length%4==0){var c=t.segpts.length/2,l=c-2;t.midX=(t.segpts[l]+t.segpts[c])/2,t.midY=(t.segpts[l+1]+t.segpts[c+1])/2}else{var u=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[u],t.midY=t.segpts[u+1];else{var d={x:t.segpts[u],y:t.segpts[u+1]},f=t.roundCorners[u/2];if(f.radius===0){var p={x:t.segpts[u+2],y:t.segpts[u+3]};t.midX=d.x,t.midY=d.y,t.midVector=[d.y-p.y,p.x-d.x]}else{var m=[d.x-f.cx,d.y-f.cy],h=f.radius/Math.sqrt(m[0]**2+m[1]**2);m=m.map(function(e){return e*h}),t.midX=f.cx+m[0],t.midY=f.cy+m[1],t.midVector=m}}}}},xm.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Q(t.startX)&&Q(t.startY)&&Q(t.endX)&&Q(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,jr("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},xm.findEdgeControlPoints=function(e){var t=this;if(e&&e.length!==0){for(var n=this,r=n.cy.hasCompoundNodes(),i=new Wr,a=function(e,t){return[].concat(lt(e),[+!!t]).join(`-`)},o=[],s=[],c=0;c<e.length;c++){var l=e[c],u=l._private,d=l.pstyle(`curve-style`).value;if(!l.removed()&&l.takesUpSpace()){if(d===`haystack`){s.push(l);continue}var f=d===`unbundled-bezier`||Ut(d,`segments`)||d===`straight`||d===`straight-triangle`||Ut(d,`taxi`),p=d===`unbundled-bezier`||d===`bezier`,m=u.source,h=u.target,g=[m.poolIndex(),h.poolIndex()].sort(),_=a(g,f),v=i.get(_);v??(v={eles:[]},o.push({pairId:g,edgeIsUnbundled:f}),i.set(_,v)),v.eles.push(l),f&&(v.hasUnbundled=!0),p&&(v.hasBezier=!0)}}for(var y=function(){var e=o[b],s=e.pairId,c=e.edgeIsUnbundled,l=a(s,c),u=i.get(l),d;if(!u.hasUnbundled){var f=u.eles[0].parallelEdges().filter(function(e){return e.isBundledBezier()});Br(u.eles),f.forEach(function(e){return u.eles.push(e)}),u.eles.sort(function(e,t){return e.poolIndex()-t.poolIndex()})}var p=u.eles[0],m=p.source(),h=p.target();if(m.poolIndex()>h.poolIndex()){var g=m;m=h,h=g}var _=u.srcPos=m.position(),v=u.tgtPos=h.position(),y=u.srcW=m.outerWidth(),x=u.srcH=m.outerHeight(),S=u.tgtW=h.outerWidth(),C=u.tgtH=h.outerHeight(),w=u.srcShape=n.nodeShapes[t.getNodeShape(m)],T=u.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=u.srcCornerRadius=m.pstyle(`corner-radius`).value===`auto`?`auto`:m.pstyle(`corner-radius`).pfValue,D=u.tgtCornerRadius=h.pstyle(`corner-radius`).value===`auto`?`auto`:h.pstyle(`corner-radius`).pfValue,O=u.tgtRs=h._private.rscratch,k=u.srcRs=m._private.rscratch;u.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var A=0;A<u.eles.length;A++){var j=u.eles[A],M=j[0]._private.rscratch,N=j.pstyle(`curve-style`).value,P=N===`unbundled-bezier`||Ut(N,`segments`)||Ut(N,`taxi`),F=!m.same(j.source());if(!u.calculatedIntersection&&m!==h&&(u.hasBezier||u.hasUnbundled)){u.calculatedIntersection=!0;var I=w.intersectLine(_.x,_.y,y,x,v.x,v.y,0,E,k),L=u.srcIntn=I,R=T.intersectLine(v.x,v.y,S,C,_.x,_.y,0,D,O),z=u.tgtIntn=R,B=u.intersectionPts={x1:I[0],x2:R[0],y1:I[1],y2:R[1]},V=u.posPts={x1:_.x,x2:v.x,y1:_.y,y2:v.y},H=R[1]-I[1],U=R[0]-I[0],W=Math.sqrt(U*U+H*H);Q(W)&&W>=bm||(W=Math.sqrt(Math.max(U*U,ym)+Math.max(H*H,ym)));var G=u.vector={x:U,y:H},K=u.vectorNorm={x:G.x/W,y:G.y/W},ee={x:-K.y,y:K.x};u.nodesOverlap=!Q(W)||T.checkPoint(I[0],I[1],0,S,C,v.x,v.y,D,O)||w.checkPoint(R[0],R[1],0,y,x,_.x,_.y,E,k),u.vectorNormInverse=ee,d={nodesOverlap:u.nodesOverlap,dirCounts:u.dirCounts,calculatedIntersection:!0,hasBezier:u.hasBezier,hasUnbundled:u.hasUnbundled,eles:u.eles,srcPos:v,srcRs:O,tgtPos:_,tgtRs:k,srcW:S,srcH:C,tgtW:y,tgtH:x,srcIntn:z,tgtIntn:L,srcShape:T,tgtShape:w,posPts:{x1:V.x2,y1:V.y2,x2:V.x1,y2:V.y1},intersectionPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},vector:{x:-G.x,y:-G.y},vectorNorm:{x:-K.x,y:-K.y},vectorNormInverse:{x:-ee.x,y:-ee.y}}}var q=F?d:u;M.nodesOverlap=q.nodesOverlap,M.srcIntn=q.srcIntn,M.tgtIntn=q.tgtIntn,M.isRound=N.startsWith(`round`),r&&(m.isParent()||m.isChild()||h.isParent()||h.isChild())&&(m.parents().anySame(h)||h.parents().anySame(m)||m.same(h)&&m.isParent())?t.findCompoundLoopPoints(j,q,A,P):m===h?t.findLoopPoints(j,q,A,P):N.endsWith(`segments`)?t.findSegmentsPoints(j,q):N.endsWith(`taxi`)?t.findTaxiPoints(j,q):N===`straight`||!P&&u.eles.length%2==1&&A===Math.floor(u.eles.length/2)?t.findStraightEdgePoints(j):t.findBezierPoints(j,q,A,P,F),t.findEndpoints(j),t.tryToCorrectInvalidPoints(j,q),t.checkForInvalidEdgeWarning(j),t.storeAllpts(j),t.storeEdgeProjections(j),t.calculateArrowAngles(j),t.recalculateEdgeLabelProjections(j),t.calculateLabelAngles(j)}},b=0;b<o.length;b++)y();this.findHaystackPoints(s)}};function Sm(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}xm.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(this.recalculateRenderedStyle(e),t.edgeType===`segments`)return Sm(t.segpts)},xm.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n===`bezier`||n===`multibezier`||n===`self`||n===`compound`)return Sm(t.ctrlpts)},xm.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Cm={};Cm.manualEndptToPx=function(e,t){var n=this,r=e.position(),i=e.outerWidth(),a=e.outerHeight(),o=e._private.rscratch;if(t.value.length===2){var s=[t.pfValue[0],t.pfValue[1]];return t.units[0]===`%`&&(s[0]*=i),t.units[1]===`%`&&(s[1]*=a),s[0]+=r.x,s[1]+=r.y,s}var c=t.pfValue[0];c=-Math.PI/2+c;var l=2*Math.max(i,a),u=[r.x+Math.cos(c)*l,r.y+Math.sin(c)*l];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,i,a,u[0],u[1],0,e.pstyle(`corner-radius`).value===`auto`?`auto`:e.pstyle(`corner-radius`).pfValue,o)},Cm.findEndpoints=function(e){var t,n,r=this,i,a=e.source()[0],o=e.target()[0],s=a.position(),c=o.position(),l=e.pstyle(`target-arrow-shape`).value,u=e.pstyle(`source-arrow-shape`).value,d=e.pstyle(`target-distance-from-node`).pfValue,f=e.pstyle(`source-distance-from-node`).pfValue,p=a._private.rscratch,m=o._private.rscratch,h=e.pstyle(`curve-style`).value,g=e._private.rscratch,_=g.edgeType,v=Ut(h,`taxi`),y=_===`self`||_===`compound`,b=_===`bezier`||_===`multibezier`||y,x=_!==`bezier`,S=_===`straight`||_===`segments`,C=_===`segments`,w=b||x||S,T=y||v,E=e.pstyle(`source-endpoint`),D=T?`outside-to-node`:E.value,O=a.pstyle(`corner-radius`).value===`auto`?`auto`:a.pstyle(`corner-radius`).pfValue,k=e.pstyle(`target-endpoint`),A=T?`outside-to-node`:k.value,j=o.pstyle(`corner-radius`).value===`auto`?`auto`:o.pstyle(`corner-radius`).pfValue;g.srcManEndpt=E,g.tgtManEndpt=k;var M,N,P,F,I=((k==null||(t=k.pfValue)==null?void 0:t.length)===2?k.pfValue:null)??[0,0],L=((E==null||(n=E.pfValue)==null?void 0:n.length)===2?E.pfValue:null)??[0,0];if(b){var R=[g.ctrlpts[0],g.ctrlpts[1]];M=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:R,N=R}else if(S){var z=C?g.segpts.slice(0,2):[c.x+I[0],c.y+I[1]];M=C?g.segpts.slice(g.segpts.length-2):[s.x+L[0],s.y+L[1]],N=z}if(A===`inside-to-node`)i=[c.x,c.y];else if(k.units)i=this.manualEndptToPx(o,k);else if(A===`outside-to-line`)i=g.tgtIntn;else if(A===`outside-to-node`||A===`outside-to-node-or-label`?P=M:(A===`outside-to-line`||A===`outside-to-line-or-label`)&&(P=[s.x,s.y]),i=r.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),P[0],P[1],0,j,m),A===`outside-to-node-or-label`||A===`outside-to-line-or-label`){var B=o._private.rscratch,V=B.labelWidth,H=B.labelHeight,U=B.labelX,W=B.labelY,G=V/2,K=H/2,ee=o.pstyle(`text-valign`).value;ee=Xu(ee),ee===`top`?W-=K:ee===`bottom`&&(W+=K);var q=o.pstyle(`text-halign`).value;q=Yu(q),q===`left`?U-=G:q===`right`&&(U+=G);var J=va(P[0],P[1],[U-G,W-K,U+G,W-K,U+G,W+K,U-G,W+K],c.x,c.y);if(J.length>0){var te=s,Y=Ni(te,xi(i)),ne=Ni(te,xi(J)),re=Y;ne<Y&&(i=J,re=ne),J.length>2&&Ni(te,{x:J[2],y:J[3]})<re&&(i=[J[2],J[3]])}}var ie=ba(i,M,r.arrowShapes[l].spacing(e)+d),ae=ba(i,M,r.arrowShapes[l].gap(e)+d);if(g.endX=ae[0],g.endY=ae[1],g.arrowEndX=ie[0],g.arrowEndY=ie[1],D===`inside-to-node`)i=[s.x,s.y];else if(E.units)i=this.manualEndptToPx(a,E);else if(D===`outside-to-line`)i=g.srcIntn;else if(D===`outside-to-node`||D===`outside-to-node-or-label`?F=N:(D===`outside-to-line`||D===`outside-to-line-or-label`)&&(F=[c.x,c.y]),i=r.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),F[0],F[1],0,O,p),D===`outside-to-node-or-label`||D===`outside-to-line-or-label`){var oe=a._private.rscratch,se=oe.labelWidth,ce=oe.labelHeight,le=oe.labelX,ue=oe.labelY,de=se/2,fe=ce/2,pe=a.pstyle(`text-valign`).value;pe=Xu(pe),pe===`top`?ue-=fe:pe===`bottom`&&(ue+=fe);var me=a.pstyle(`text-halign`).value;me=Yu(me),me===`left`?le-=de:me===`right`&&(le+=de);var he=va(F[0],F[1],[le-de,ue-fe,le+de,ue-fe,le+de,ue+fe,le-de,ue+fe],s.x,s.y);if(he.length>0){var ge=c,_e=Ni(ge,xi(i)),ve=Ni(ge,xi(he)),ye=_e;ve<_e&&(i=[he[0],he[1]],ye=ve),he.length>2&&Ni(ge,{x:he[2],y:he[3]})<ye&&(i=[he[2],he[3]])}}var be=ba(i,N,r.arrowShapes[u].spacing(e)+f),xe=ba(i,N,r.arrowShapes[u].gap(e)+f);g.startX=xe[0],g.startY=xe[1],g.arrowStartX=be[0],g.arrowStartY=be[1],w&&(g.badLine=!Q(g.startX)||!Q(g.startY)||!Q(g.endX)||!Q(g.endY))},Cm.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},Cm.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var wm={};function Tm(e,t,n){for(var r=function(e,t,n,r){return Fi(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}wm.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r===`multibezier`||r===`bezier`||r===`self`||r===`compound`){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)Tm(this,e,n.allpts.slice(i,i+6))}else if(r===`segments`)for(var a=t.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]});else if(r===`haystack`){var o=n.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth},wm.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Em={};Em.recalculateNodeLabelProjection=function(e){var t=e.pstyle(`label`).strValue;if(!Nt(t)){var n,r,i=e._private,a=e.width(),o=e.height(),s=e.padding(),c=e.position(),l=e.pstyle(`text-halign`).strValue,u=e.pstyle(`text-valign`).strValue,d=i.rscratch,f=i.rstyle;switch(l){case`left`:n=c.x-a/2-s;break;case`left-inside`:n=c.x-a/2+s;break;case`right`:n=c.x+a/2+s;break;case`right-inside`:n=c.x+a/2-s;break;default:n=c.x}switch(u){case`top`:r=c.y-o/2-s;break;case`top-inside`:r=c.y-o/2+s;break;case`bottom`:r=c.y+o/2+s;break;case`bottom-inside`:r=c.y+o/2-s;break;default:r=c.y}d.labelX=n,d.labelY=r,f.labelX=n,f.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var Dm=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n*=-1),n},Om=function(e,t){return Dm(t.x-e.x,t.y-e.y)},km=function(e,t,n,r){var i=Ri(0,r-.001,1),a=Ri(0,r+.001,1);return Om(Ii(e,t,n,i),Ii(e,t,n,a))};Em.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle(`label`).strValue,source:e.pstyle(`source-label`).strValue,target:e.pstyle(`target-label`).strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){Ur(n.rscratch,e,t,r),Ur(n.rstyle,e,t,r)};o(`labelX`,null,t.x),o(`labelY`,null,t.y),o(`labelAutoAngle`,null,Dm(r.midDispX,r.midDispY));var s=function(){if(s.cache)return s.cache;for(var e=[],t=0;t+5<r.allpts.length;t+=4){var a={x:r.allpts[t],y:r.allpts[t+1]},o={x:r.allpts[t+2],y:r.allpts[t+3]},c={x:r.allpts[t+4],y:r.allpts[t+5]};e.push({p0:a,p1:o,p2:c,startDist:0,length:0,segments:[]})}var l=n.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(e,t,n,r,i){var a=Mi(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var f=0;f<e.length;f++){var p=e[f],m=e[f-1];m&&(p.startDist=m.startDist+m.length),d(p,p.p0,l[f*u],0,i.bezierProjPcts[0]);for(var h=0;h<u-1;h++)d(p,l[f*u+h],l[f*u+h+1],i.bezierProjPcts[h],i.bezierProjPcts[h+1]);d(p,l[f*u+u-1],p.p2,i.bezierProjPcts[u-1],1)}return s.cache=e},c=function(n){var i,c=n===`source`;if(a[n]){var l=e.pstyle(n+`-text-offset`).pfValue;switch(r.edgeType){case`self`:case`compound`:case`bezier`:case`multibezier`:for(var u=s(),d,f=0,p=0,m=0;m<u.length;m++){for(var h=u[c?m:u.length-1-m],g=0;g<h.segments.length;g++){var _=h.segments[c?g:h.segments.length-1-g],v=m===u.length-1&&g===h.segments.length-1;if(f=p,p+=_.length,p>=l||v){d={cp:h,segment:_};break}}if(d)break}var y=d.cp,b=d.segment,x=(l-f)/b.length,S=b.t1-b.t0,C=c?b.t0+S*x:b.t1-S*x;C=Ri(0,C,1),t=Ii(y.p0,y.p1,y.p2,C),i=km(y.p0,y.p1,y.p2,C);break;case`straight`:case`segments`:case`haystack`:for(var w=0,T,E,D,O,k=r.allpts.length,A=0;A+3<k&&(c?(D={x:r.allpts[A],y:r.allpts[A+1]},O={x:r.allpts[A+2],y:r.allpts[A+3]}):(D={x:r.allpts[k-2-A],y:r.allpts[k-1-A]},O={x:r.allpts[k-4-A],y:r.allpts[k-3-A]}),T=Mi(D,O),E=w,w+=T,!(w>=l));A+=2);var j=(l-E)/T;j=Ri(0,j,1),t=Li(D,O,j),i=Om(D,O)}o(`labelX`,n,t.x),o(`labelY`,n,t.y),o(`labelAutoAngle`,n,i)}};c(`source`),c(`target`),this.applyLabelDimensions(e)}},Em.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,`source`),this.applyPrefixedLabelDimensions(e,`target`))},Em.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=hr(r,e._private.labelDimsKey);if(Hr(n.rscratch,`prefixedLabelDimsKey`,t)!==i){Ur(n.rscratch,`prefixedLabelDimsKey`,t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle(`line-height`).pfValue,s=e.pstyle(`font-size`).pfValue,c=e.pstyle(`text-wrap`).strValue,l=Hr(n.rscratch,`labelWrapCachedLines`,t)||[],u=c===`wrap`?Math.max(l.length,1):1,d=s*o,f=a.width,p=a.height+(u-1)*(o-1)*s;Ur(n.rstyle,`labelWidth`,t,f),Ur(n.rscratch,`labelWidth`,t,f),Ur(n.rstyle,`labelHeight`,t,p),Ur(n.rscratch,`labelHeight`,t,p),Ur(n.rscratch,`labelLineHeight`,t,d),Ur(n.rscratch,`labelActualDescent`,t,a.labelActualDescent)}},Em.getLabelText=function(e,t){var n=e._private,r=t?t+`-`:``,i=e.pstyle(r+`label`).strValue,a=e.pstyle(`text-transform`).value,o=function(e,r){return r?(Ur(n.rscratch,e,t,r),r):Hr(n.rscratch,e,t)};if(!i)return``;a==`none`||(a==`uppercase`?i=i.toUpperCase():a==`lowercase`&&(i=i.toLowerCase()));var s=e.pstyle(`text-wrap`).value;if(s===`wrap`){var c=o(`labelKey`);if(c!=null&&o(`labelWrapKey`)===c)return o(`labelWrapCachedText`);for(var l=``,u=i.split(`
|
|
14
|
+
`),d=e.pstyle(`text-max-width`).pfValue,f=e.pstyle(`text-overflow-wrap`).value===`anywhere`,p=[],m=/[\s\u200b]+|$/g,h=0;h<u.length;h++){var g=u[h],_=this.calculateLabelDimensions(e,g).width;if(f&&(g=g.split(``).join(l)),_>d){var v=g.matchAll(m),y=``,b=0,x=nt(v),S;try{for(x.s();!(S=x.n()).done;){var C=S.value,w=C[0],T=g.substring(b,C.index);b=C.index+w.length;var E=y.length===0?T:y+T+w;this.calculateLabelDimensions(e,E).width<=d?y+=T+w:(y&&p.push(y),y=T+w)}}catch(e){x.e(e)}finally{x.f()}y.match(/^[\s\u200b]+$/)||p.push(y)}else p.push(g)}o(`labelWrapCachedLines`,p),i=o(`labelWrapCachedText`,p.join(`
|
|
15
|
+
`)),o(`labelWrapKey`,c)}else if(s===`ellipsis`){var D=e.pstyle(`text-max-width`).pfValue,O=``,k=`…`,A=!1;if(this.calculateLabelDimensions(e,i).width<D)return i;for(var j=0;j<i.length&&!(this.calculateLabelDimensions(e,O+i[j]+k).width>D);j++)O+=i[j],j===i.length-1&&(A=!0);return A||(O+=k),O}return i},Em.getLabelJustification=function(e){var t=e.pstyle(`text-justification`).strValue,n=e.pstyle(`text-halign`).strValue;return t===`auto`?e.isNode()?Zu(n):`center`:t},Em.calculateLabelDimensions=function(e,t){var n=this.cy.window().document,r=0,i=e.pstyle(`font-style`).strValue,a=e.pstyle(`font-size`).pfValue,o=e.pstyle(`font-family`).strValue,s=e.pstyle(`font-weight`).strValue,c=e.pstyle(`text-metrics`).strValue||`font`,l=this.labelCalcCanvas,u=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=n.createElement(`canvas`),u=this.labelCalcCanvasContext=l.getContext(`2d`);var d=l.style;d.position=`absolute`,d.left=`-9999px`,d.top=`-9999px`,d.zIndex=`-1`,d.visibility=`hidden`,d.pointerEvents=`none`}u.font=`${i} ${s} ${a}px ${o}`;for(var f=0,p=0,m=t.split(`
|
|
16
|
+
`),h=m.length,g=0,_=0,v=0;v<h;v++){var y=m[v],b=u.measureText(y),x=Math.ceil(b.width),S=a;c===`glyph`&&(v===0&&(_=b.actualBoundingBoxAscent),v===h-1&&(g=b.actualBoundingBoxDescent)),f=Math.max(x,f),p+=S}return c===`glyph`&&(p-=a-_-g),f+=r,p+=r,{width:f,height:p,labelActualAscent:_,labelActualDescent:g}},Em.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+`-`:``,a=e.pstyle(i+`text-rotation`),o=a.strValue;return o===`none`?0:r&&o===`autorotate`?n.labelAutoAngle:o===`autorotate`?0:a.pfValue},Em.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,`source`),r.targetLabelAngle=t.calculateLabelAngle(e,`target`))};var Am={},jm=28,Mm=!1;Am.getNodeShape=function(e){var t=this,n=e.pstyle(`shape`).value;if(n===`cutrectangle`&&(e.width()<jm||e.height()<jm))return Mm||=(jr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),!0),`rectangle`;if(e.isParent())return n===`rectangle`||n===`roundrectangle`||n===`round-rectangle`||n===`cutrectangle`||n===`cut-rectangle`||n===`barrel`?n:`rectangle`;if(n===`polygon`){var r=e.pstyle(`shape-polygon-points`).value;return t.nodeShapes.makePolygon(r).name}return n};var Nm={};Nm.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r]._private.rstyle;i.clean=!1,i.cleanConnected=!1}};n.binder(e).on(`bounds.* dirty.*`,function(e){var t=e.target;r(t)}).on(`style.* background.*`,function(e){var t=e.target;r(t,!1)});var i=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var o=0;o<t.length;o++){var s=t[o],c=s._private.rstyle;s.isNode()&&!c.cleanConnected&&(r(s.connectedEdges()),c.cleanConnected=!0)}if(a)for(var l=0;l<a.length;l++){var u=a[l];u(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},Nm.onUpdateEleCalcs=function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},Nm.recalculateRenderedStyle=function(e,t){var n=function(e){return e._private.rstyle.cleanConnected};if(e.length!==0){var r=[],i=[];if(!this.destroyed){t===void 0&&(t=!0);for(var a=0;a<e.length;a++){var o=e[a],s=o._private,c=s.rstyle;o.isEdge()&&(!n(o.source())||!n(o.target()))&&(c.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(e){return!e._private.rstyle.clean&&e.isBundledBezier()})&&(c.clean=!1),!(t&&c.clean||o.removed())&&o.pstyle(`display`).value!==`none`&&(s.group===`nodes`?i.push(o):r.push(o),c.clean=!0)}for(var l=0;l<i.length;l++){var u=i[l],d=u._private.rstyle,f=u.position();this.recalculateNodeLabelProjection(u),d.nodeX=f.x,d.nodeY=f.y,d.nodeW=u.pstyle(`width`).pfValue,d.nodeH=u.pstyle(`height`).pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var m=r[p]._private,h=m.rstyle,g=m.rscratch;h.srcX=g.arrowStartX,h.srcY=g.arrowStartY,h.tgtX=g.arrowEndX,h.tgtY=g.arrowEndY,h.midX=g.midX,h.midY=g.midY,h.labelAngle=g.labelAngle,h.sourceLabelAngle=g.sourceLabelAngle,h.targetLabelAngle=g.targetLabelAngle}}}};var Pm={};Pm.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],i=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):i.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},Pm.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Pm.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Kd),t.interactive=t.filter(function(e){return e.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var Fm={};[qp,Jp,xm,Cm,wm,Em,Am,Nm,Pm].forEach(function(e){$t(Fm,e)});var Im={};Im.getCachedImage=function(e,t,n){var r=this,i=r.imageCache=r.imageCache||{},a=i[e];if(a)return a.image.complete||a.image.addEventListener(`load`,n),a.image;a=i[e]=i[e]||{};var o=a.image=new Image;o.addEventListener(`load`,n),o.addEventListener(`error`,function(){o.error=!0});var s=`data:`;return e.substring(0,s.length).toLowerCase()!==s&&(t=t===`null`?null:t,o.crossOrigin=t),o.src=e,o};var Lm=function(e,t){var n=e[0];n&&n._private.grabbed!==t&&(n._private.grabbed=t,e.updateStyle(!1))},Rm=function(e){Lm(e,!0)},zm=function(e){Lm(e,!1)},Bm={};Bm.registerBinding=function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var a=[],o=0;o<e.length;o++){var s=e[o];if(s!==void 0){var c=this.binder(s);a.push(c.on.apply(c,i))}}return a}var c=this.binder(e);return c.on.apply(c,i)},Bm.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||Pt(e);if(t.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener(`test`,null,a)}catch{}t.supportsPassiveEvents=i}var o=function(n,i,a){var o=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(o[2]={capture:a??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:o}),(e.addEventListener||e.on).apply(e,o),this};return{on:o,addEventListener:o,addListener:o,bind:o}},Bm.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},Bm.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},Bm.load=function(){var e=this,t=e.cy.window(),n=function(e){return e.selected()},r=function(e){var t=e.getRootNode();if(t&&t.nodeType===11&&t.host!==void 0)return t},i=function(t,n,r,i){t??=e.cy;for(var a=0;a<n.length;a++){var o=n[a];t.emit({originalEvent:r,type:o,position:i})}},a=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){var t=n[i];if(t.isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},s=function(e){e[0]._private.rscratch.inDragLayer=!0},c=function(e){e[0]._private.rscratch.inDragLayer=!1},l=function(e){e[0]._private.rscratch.isGrabTarget=!0},u=function(e){e[0]._private.rscratch.isGrabTarget=!1},d=function(e,t){var n=t.addToList;!n.has(e)&&e.grabbable()&&!e.locked()&&(n.merge(e),Rm(e))},f=function(e,t){if(e.cy().hasCompoundNodes()&&(t.inDragLayer!=null||t.addToList!=null)){var n=e.descendants();t.inDragLayer&&(n.forEach(s),n.connectedEdges().forEach(s)),t.addToList&&d(n,t)}},p=function(t,n){n||={};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(s),t.neighborhood().stdFilter(function(e){return!r||e.isEdge()}).forEach(s)),n.addToList&&t.forEach(function(e){d(e,n)}),f(t,n),g(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},m=p,h=function(t){t&&(e.getCachedZSortedEles().forEach(function(e){zm(e),c(e),u(e)}),e.updateCachedGrabbedEles())},g=function(e,t){if((t.inDragLayer!=null||t.addToList!=null)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(s),r.forEach(s)),t.addToList&&r.forEach(function(e){d(e,t)})}}},_=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},v=typeof MutationObserver<`u`,y=typeof ResizeObserver<`u`;v?(e.removeObserver=new MutationObserver(function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r){for(var i=0;i<r.length;i++)if(r[i]===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,`DOMNodeRemoved`,function(t){e.destroy()});var b=$n(function(){e.cy.resize()},100);v&&(e.styleObserver=new MutationObserver(b),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,`resize`,b),y&&(e.resizeObserver=new ResizeObserver(b),e.resizeObserver.observe(e.container));var x=function(e,t){for(;e!=null;)t(e),e=e.parentNode},S=function(){e.invalidateContainerClientCoordsCache()};x(e.container,function(t){e.registerBinding(t,`transitionend`,S),e.registerBinding(t,`animationend`,S),e.registerBinding(t,`scroll`,S)}),e.registerBinding(e.container,`contextmenu`,function(e){e.preventDefault()});var C=function(){return e.selection[4]!==0},w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],a=n[2],o=n[3],s=t.touches?t.touches:[t],c=!1,l=0;l<s.length;l++){var u=s[l];if(r<=u.clientX&&u.clientX<=r+a&&i<=u.clientY&&u.clientY<=i+o){c=!0;break}}if(!c)return!1;for(var d=e.container,f=t.target.parentNode,p=!1;f;){if(f===d){p=!0;break}f=f.parentNode}return!!p};e.registerBinding(e.container,`mousedown`,function(t){if(w(t)&&(e.hoverData.which!==1||t.which===1)){t.preventDefault(),_(),e.hoverData.capture=!0,e.hoverData.which=t.which;var n=e.cy,r=[t.clientX,t.clientY],a=e.projectIntoViewport(r[0],r[1]),o=e.selection,s=e.findNearestElements(a[0],a[1],!0,!1),c=s[0],u=e.dragData.possibleDragElements;e.hoverData.mdownPos=a,e.hoverData.mdownGPos=r;var d=function(e){return{originalEvent:t,type:e,position:{x:a[0],y:a[1]}}},f=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var t=e.hoverData.down;t?t.emit(d(`taphold`)):n.emit(d(`taphold`))}},e.tapholdDuration)};if(t.which==3){e.hoverData.cxtStarted=!0;var h={originalEvent:t,type:`cxttapstart`,position:{x:a[0],y:a[1]}};c?(c.activate(),c.emit(h),e.hoverData.down=c):n.emit(h),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(t.which==1){if(c&&c.activate(),c!=null&&e.nodeIsGrabbable(c)){var g=function(e){e.emit(d(`grab`))};if(l(c),!c.selected())u=e.dragData.possibleDragElements=n.collection(),m(c,{addToList:u}),c.emit(d(`grabon`)).emit(d(`grab`));else{u=e.dragData.possibleDragElements=n.collection();var v=n.$(function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)});p(v,{addToList:u}),c.emit(d(`grabon`)),v.forEach(g)}e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0)}e.hoverData.down=c,e.hoverData.downs=s,e.hoverData.downTime=new Date().getTime(),i(c,[`mousedown`,`tapstart`,`vmousedown`],t,{x:a[0],y:a[1]}),c==null?(o[4]=1,e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint(`select`,!0),e.redraw()):c.pannable()&&(o[4]=1),f()}o[0]=o[2]=a[0],o[1]=o[3]=a[1]}},!1);var T=r(e.container);e.registerBinding([t,T],`mousemove`,function(t){if(e.hoverData.capture||w(t)){var n=!1,r=e.cy,s=r.zoom(),c=[t.clientX,t.clientY],l=e.projectIntoViewport(c[0],c[1]),u=e.hoverData.mdownPos,d=e.hoverData.mdownGPos,f=e.selection,m=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(m=e.findNearestElement(l[0],l[1],!0,!1));var g=e.hoverData.last,_=e.hoverData.down,v=[l[0]-f[2],l[1]-f[3]],y=e.dragData.possibleDragElements,b;if(d){var x=c[0]-d[0],S=x*x,C=c[1]-d[1],T=S+C*C;e.hoverData.isOverThresholdDrag=b=T>=e.desktopTapThreshold2}var E=a(t);b&&(e.hoverData.tapholdCancelled=!0);var D=function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];t.length===0?(t.push(v[0]),t.push(v[1])):(t[0]+=v[0],t[1]+=v[1])};n=!0,i(m,[`mousemove`,`vmousemove`,`tapdrag`],t,{x:l[0],y:l[1]});var O=function(e){return{originalEvent:t,type:e,position:{x:l[0],y:l[1]}}},k=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||r.emit(O(`boxstart`)),f[4]=1,e.hoverData.selecting=!0,e.redrawHint(`select`,!0),e.redraw()};if(e.hoverData.which===3){if(b){var A=O(`cxtdrag`);_?_.emit(A):r.emit(A),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||m!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(O(`cxtdragout`)),e.hoverData.cxtOver=m,m&&m.emit(O(`cxtdragover`)))}}else if(e.hoverData.dragging){if(n=!0,r.panningEnabled()&&r.userPanningEnabled()){var j;if(e.hoverData.justStartedPan){var M=e.hoverData.mdownPos;j={x:(l[0]-M[0])*s,y:(l[1]-M[1])*s},e.hoverData.justStartedPan=!1}else j={x:v[0]*s,y:v[1]*s};r.panBy(j),r.emit(O(`dragpan`)),e.hoverData.dragged=!0}l=e.projectIntoViewport(t.clientX,t.clientY)}else if(f[4]==1&&(_==null||_.pannable()))b&&(!e.hoverData.dragging&&r.boxSelectionEnabled()&&(E||!r.panningEnabled()||!r.userPanningEnabled())?k():!e.hoverData.selecting&&r.panningEnabled()&&r.userPanningEnabled()&&o(_,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=xi(u),e.redrawHint(`select`,!0),e.redraw()),_&&_.pannable()&&_.active()&&_.unactivate());else{if(_&&_.pannable()&&_.active()&&_.unactivate(),(!_||!_.grabbed())&&m!=g&&(g&&i(g,[`mouseout`,`tapdragout`],t,{x:l[0],y:l[1]}),m&&i(m,[`mouseover`,`tapdragover`],t,{x:l[0],y:l[1]}),e.hoverData.last=m),_){if(b){if(r.boxSelectionEnabled()&&E)_&&_.grabbed()&&(h(y),_.emit(O(`freeon`)),y.emit(O(`free`)),e.dragData.didDrag&&(_.emit(O(`dragfreeon`)),y.emit(O(`dragfree`)))),k();else if(_&&_.grabbed()&&e.nodeIsDraggable(_)){var N=!e.dragData.didDrag;N&&e.redrawHint(`eles`,!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||p(y,{inDragLayer:!0});var P={x:0,y:0};if(Q(v[0])&&Q(v[1])&&(P.x+=v[0],P.y+=v[1],N)){var F=e.hoverData.dragDelta;F&&Q(F[0])&&Q(F[1])&&(P.x+=F[0],P.y+=F[1])}e.hoverData.draggingEles=!0,y.silentShift(P).emit(O(`position`)).emit(O(`drag`)),e.redrawHint(`drag`,!0),e.redraw()}}else D()}n=!0}if(f[2]=l[0],f[3]=l[1],n)return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1}},!1);var E,D,O;e.registerBinding(t,`mouseup`,function(t){if(!(e.hoverData.which===1&&t.which!==1&&e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var r=e.cy,o=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,c=e.findNearestElement(o[0],o[1],!0,!1),l=e.dragData.possibleDragElements,u=e.hoverData.down,d=a(t);e.data.bgActivePosistion&&(e.redrawHint(`select`,!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,u&&u.unactivate();var f=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(e.hoverData.which===3){var p=f(`cxttapend`);if(u?u.emit(p):r.emit(p),!e.hoverData.cxtDragged){var m=f(`cxttap`);u?u.emit(m):r.emit(m)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(i(c,[`mouseup`,`tapend`,`vmouseup`],t,{x:o[0],y:o[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(i(u,[`click`,`tap`,`vclick`],t,{x:o[0],y:o[1]}),D=!1,t.timeStamp-O<=r.multiClickDebounceTime()?(E&&clearTimeout(E),D=!0,O=null,i(u,[`dblclick`,`dbltap`,`vdblclick`],t,{x:o[0],y:o[1]})):(E=setTimeout(function(){D||i(u,[`oneclick`,`onetap`,`voneclick`],t,{x:o[0],y:o[1]})},r.multiClickDebounceTime()),O=t.timeStamp)),u==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(t)&&(r.$(n).unselect([`tapunselect`]),l.length>0&&e.redrawHint(`eles`,!0),e.dragData.possibleDragElements=l=r.collection()),c==u&&!e.dragData.didDrag&&!e.hoverData.selecting&&c!=null&&c._private.selectable&&(e.hoverData.dragging||(r.selectionType()===`additive`||d?c.selected()?c.unselect([`tapunselect`]):c.select([`tapselect`]):d||(r.$(n).unmerge(c).unselect([`tapunselect`]),c.select([`tapselect`]))),e.redrawHint(`eles`,!0)),e.hoverData.selecting){var g=r.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint(`select`,!0),g.length>0&&e.redrawHint(`eles`,!0),r.emit(f(`boxend`)),r.selectionType()===`additive`||d||r.$(n).unmerge(g).unselect(),g.emit(f(`box`)).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(f(`boxselect`)),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint(`select`,!0),e.redrawHint(`eles`,!0),e.redraw()),!s[4]){e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0);var _=u&&u.grabbed();h(l),_&&(u.emit(f(`freeon`)),l.emit(f(`free`)),e.dragData.didDrag&&(u.emit(f(`dragfreeon`)),l.emit(f(`dragfree`))))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}},!1);var k=[],A=4,j,M=1e5,N=function(e){for(var t=Math.abs(e[0]),n=1;n<e.length;n++)if(Math.abs(e[n])!==t)return!1;return!0},P=function(t){var n=!1,r=t.deltaY;if(r??(t.wheelDeltaY==null?t.wheelDelta!=null&&(r=t.wheelDelta/4):r=t.wheelDeltaY/4),r!==0){if(j==null){if(k.length>=A){j=!1;var i=k;if(i[0]>=5){var a=N(i)?i[0]:Di(i);a>1&&(j=!0,M=a)}}else k.push(Math.abs(r)),n=!0}else j&&(M=Math.min(Math.abs(r),M));if(!e.scrollingPage){var o=e.cy,s=o.zoom(),c=o.pan(),l=e.projectIntoViewport(t.clientX,t.clientY),u=[l[0]*s+c.x,l[1]*s+c.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C()){t.preventDefault();return}if(o.panningEnabled()&&o.userPanningEnabled()&&o.zoomingEnabled()&&o.userZoomingEnabled()){t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint(`eles`,!0),e.redraw()},150);var d;n&&Math.abs(r)>5&&(r=ji(r)*5),d=r/-250,j&&(d/=M,d*=3),d*=e.wheelSensitivity,t.deltaMode===1&&(d*=33);var f=o.zoom()*10**d;t.type===`gesturechange`&&(f=e.gestureStartZoom*t.scale),o.zoom({level:f,renderedPosition:{x:u[0],y:u[1]}}),o.emit({type:t.type===`gesturechange`?`pinchzoom`:`scrollzoom`,originalEvent:t,position:{x:l[0],y:l[1]}})}}}};e.registerBinding(e.container,`wheel`,P,!0),e.registerBinding(t,`scroll`,function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,`gesturestart`,function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()},!0),e.registerBinding(e.container,`gesturechange`,function(t){e.hasTouchStarted||P(t)},!0),e.registerBinding(e.container,`mouseout`,function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:`mouseout`,position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,`mouseover`,function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:`mouseover`,position:{x:n[0],y:n[1]}})},!1);var F,I,L,R,z,B,V,H,U,W,G,K,ee,q=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},J=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)},te;e.registerBinding(e.container,`touchstart`,te=function(t){if(e.hasTouchStarted=!0,w(t)){_(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,r=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);r[0]=o[0],r[1]=o[1]}if(t.touches[1]){var o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);r[2]=o[0],r[3]=o[1]}if(t.touches[2]){var o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);r[4]=o[0],r[5]=o[1]}var s=function(e){return{originalEvent:t,type:e,position:{x:r[0],y:r[1]}}};if(t.touches[1]){e.touchData.singleTouchMoved=!0,h(e.dragData.touchDragEles);var c=e.findContainerClientCoords();U=c[0],W=c[1],G=c[2],K=c[3],F=t.touches[0].clientX-U,I=t.touches[0].clientY-W,L=t.touches[1].clientX-U,R=t.touches[1].clientY-W,ee=0<=F&&F<=G&&0<=L&&L<=G&&0<=I&&I<=K&&0<=R&&R<=K;var u=n.pan(),d=n.zoom();z=q(F,I,L,R),B=J(F,I,L,R),V=[(F+L)/2,(I+R)/2],H=[(V[0]-u.x)/d,(V[1]-u.y)/d];var f=200,g=f*f;if(B<g&&!t.touches[2]){var v=e.findNearestElement(r[0],r[1],!0,!0),y=e.findNearestElement(r[2],r[3],!0,!0);v&&v.isNode()?(v.activate().emit(s(`cxttapstart`)),e.touchData.start=v):y&&y.isNode()?(y.activate().emit(s(`cxttapstart`)),e.touchData.start=y):n.emit(s(`cxttapstart`)),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(!t.touches[1]&&t.touches[0]){var b=e.findNearestElements(r[0],r[1],!0,!0),x=b[0];if(x!=null&&(x.activate(),e.touchData.start=x,e.touchData.starts=b,e.nodeIsGrabbable(x))){var S=e.dragData.touchDragEles=n.collection(),C=null;e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0),x.selected()?(C=n.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),p(C,{addToList:S})):m(x,{addToList:S}),l(x),x.emit(s(`grabon`)),C?C.forEach(function(e){e.emit(s(`grab`))}):x.emit(s(`grab`))}i(x,[`touchstart`,`tapstart`,`vmousedown`],t,{x:r[0],y:r[1]}),x??(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint(`select`,!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&i(e.touchData.start,[`taphold`],t,{x:r[0],y:r[1]})},e.tapholdDuration)}if(t.touches.length>=1){for(var T=e.touchData.startPosition=[null,null,null,null,null,null],E=0;E<r.length;E++)T[E]=a[E]=r[E];var D=t.touches[0];e.touchData.startGPosition=[D.clientX,D.clientY]}}},!1);var Y;e.registerBinding(t,`touchmove`,Y=function(t){var n=e.touchData.capture;if(n||w(t)){var r=e.selection,a=e.cy,s=e.touchData.now,c=e.touchData.earlier,l=a.zoom();if(t.touches[0]){var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=u[0],s[1]=u[1]}if(t.touches[1]){var u=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=u[0],s[3]=u[1]}if(t.touches[2]){var u=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=u[0],s[5]=u[1]}var d=function(e){return{originalEvent:t,type:e,position:{x:s[0],y:s[1]}}},f=e.touchData.startGPosition,m;if(n&&t.touches[0]&&f){for(var g=[],_=0;_<s.length;_++)g[_]=s[_]-c[_];var v=t.touches[0].clientX-f[0],y=v*v,b=t.touches[0].clientY-f[1];m=y+b*b>=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-U,S=t.touches[0].clientY-W,C=t.touches[1].clientX-U,T=t.touches[1].clientY-W,E=J(x,S,C,T),D=E/B,O=150,k=O*O,A=1.5;if(D>=A*A||E>=k){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var j=d(`cxttapend`);e.touchData.start?(e.touchData.start.unactivate().emit(j),e.touchData.start=null):a.emit(j)}}if(n&&e.touchData.cxt){var j=d(`cxtdrag`);e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0),e.touchData.start?e.touchData.start.emit(j):a.emit(j),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var M=e.findNearestElement(s[0],s[1],!0,!0);(!e.touchData.cxtOver||M!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(d(`cxtdragout`)),e.touchData.cxtOver=M,M&&M.emit(d(`cxtdragover`)))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit(d(`boxstart`)),e.touchData.selecting=!0,e.touchData.didSelect=!0,r[4]=1,!r||r.length===0||r[0]===void 0?(r[0]=(s[0]+s[2]+s[4])/3,r[1]=(s[1]+s[3]+s[5])/3,r[2]=(s[0]+s[2]+s[4])/3+1,r[3]=(s[1]+s[3]+s[5])/3+1):(r[2]=(s[0]+s[2]+s[4])/3,r[3]=(s[1]+s[3]+s[5])/3),e.redrawHint(`select`,!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var N=e.dragData.touchDragEles;if(N){e.redrawHint(`drag`,!0);for(var P=0;P<N.length;P++){var V=N[P]._private;V.grabbed=!1,V.rscratch.inDragLayer=!1}}var G=e.touchData.start,x=t.touches[0].clientX-U,S=t.touches[0].clientY-W,C=t.touches[1].clientX-U,T=t.touches[1].clientY-W,K=q(x,S,C,T),te=K/z;if(ee){var Y=x-F,ne=S-I,re=C-L,ie=T-R,ae=(Y+re)/2,oe=(ne+ie)/2,se=a.zoom(),ce=se*te,le=a.pan(),ue=H[0]*se+le.x,de=H[1]*se+le.y,fe={x:-ce/se*(ue-le.x-ae)+ue,y:-ce/se*(de-le.y-oe)+de};if(G&&G.active()){var N=e.dragData.touchDragEles;h(N),e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0),G.unactivate().emit(d(`freeon`)),N&&N.emit(d(`free`)),e.dragData.didDrag&&(G.emit(d(`dragfreeon`)),N&&N.emit(d(`dragfree`)))}a.viewport({zoom:ce,pan:fe,cancelOnFailedZoom:!0}),a.emit(d(`pinchzoom`)),z=K,F=x,I=S,L=C,R=T,e.pinching=!0}if(t.touches[0]){var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=u[0],s[1]=u[1]}if(t.touches[1]){var u=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=u[0],s[3]=u[1]}if(t.touches[2]){var u=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=u[0],s[5]=u[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var pe=e.touchData.start,me=e.touchData.last,M;if(!e.hoverData.draggingEles&&!e.swipePanning&&(M=e.findNearestElement(s[0],s[1],!0,!0)),n&&pe!=null&&t.preventDefault(),n&&pe!=null&&e.nodeIsDraggable(pe)){if(m){var N=e.dragData.touchDragEles,he=!e.dragData.didDrag;he&&p(N,{inDragLayer:!0}),e.dragData.didDrag=!0;var ge={x:0,y:0};if(Q(g[0])&&Q(g[1])&&(ge.x+=g[0],ge.y+=g[1],he)){e.redrawHint(`eles`,!0);var _e=e.touchData.dragDelta;_e&&Q(_e[0])&&Q(_e[1])&&(ge.x+=_e[0],ge.y+=_e[1])}e.hoverData.draggingEles=!0,N.silentShift(ge).emit(d(`position`)).emit(d(`drag`)),e.redrawHint(`drag`,!0),e.touchData.startPosition[0]==c[0]&&e.touchData.startPosition[1]==c[1]&&e.redrawHint(`eles`,!0),e.redraw()}else{var _e=e.touchData.dragDelta=e.touchData.dragDelta||[];_e.length===0?(_e.push(g[0]),_e.push(g[1])):(_e[0]+=g[0],_e[1]+=g[1])}}if(i(pe||M,[`touchmove`,`tapdrag`,`vmousemove`],t,{x:s[0],y:s[1]}),(!pe||!pe.grabbed())&&M!=me&&(me&&me.emit(d(`tapdragout`)),M&&M.emit(d(`tapdragover`))),e.touchData.last=M,n)for(var P=0;P<s.length;P++)s[P]&&e.touchData.startPosition[P]&&m&&(e.touchData.singleTouchMoved=!0);if(n&&(pe==null||pe.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){o(pe,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=xi(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:g[0]*l,y:g[1]*l}),a.emit(d(`dragpan`))):m&&(e.swipePanning=!0,a.panBy({x:v*l,y:b*l}),a.emit(d(`dragpan`)),pe&&(pe.unactivate(),e.redrawHint(`select`,!0),e.touchData.start=null)));var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=u[0],s[1]=u[1]}}for(var _=0;_<s.length;_++)c[_]=s[_];n&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0),e.redraw())}},!1);var ne;e.registerBinding(t,`touchcancel`,ne=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()});var re,ie,ae,oe;if(e.registerBinding(t,`touchend`,re=function(t){var r=e.touchData.start;if(e.touchData.capture)t.touches.length===0&&(e.touchData.capture=!1),t.preventDefault();else return;var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o=e.cy,s=o.zoom(),c=e.touchData.now,l=e.touchData.earlier;if(t.touches[0]){var u=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);c[0]=u[0],c[1]=u[1]}if(t.touches[1]){var u=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);c[2]=u[0],c[3]=u[1]}if(t.touches[2]){var u=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);c[4]=u[0],c[5]=u[1]}var d=function(e){return{originalEvent:t,type:e,position:{x:c[0],y:c[1]}}};r&&r.unactivate();var f;if(e.touchData.cxt){if(f=d(`cxttapend`),r?r.emit(f):o.emit(f),!e.touchData.cxtDragged){var p=d(`cxttap`);r?r.emit(p):o.emit(p)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!t.touches[2]&&o.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var m=o.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint(`select`,!0),o.emit(d(`boxend`)),m.emit(d(`box`)).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(d(`boxselect`)),m.nonempty()&&e.redrawHint(`eles`,!0),e.redraw()}if(r?.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);else if(!t.touches[1]&&!t.touches[0]&&!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var g=e.dragData.touchDragEles;if(r!=null){var _=r._private.grabbed;h(g),e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0),_&&(r.emit(d(`freeon`)),g.emit(d(`free`)),e.dragData.didDrag&&(r.emit(d(`dragfreeon`)),g.emit(d(`dragfree`)))),i(r,[`touchend`,`tapend`,`vmouseup`,`tapdragout`],t,{x:c[0],y:c[1]}),r.unactivate(),e.touchData.start=null}else i(e.findNearestElement(c[0],c[1],!0,!0),[`touchend`,`tapend`,`vmouseup`,`tapdragout`],t,{x:c[0],y:c[1]});var v=e.touchData.startPosition[0]-c[0],y=v*v,b=e.touchData.startPosition[1]-c[1],x=(y+b*b)*s*s;e.touchData.singleTouchMoved||(r||o.$(`:selected`).unselect([`tapunselect`]),i(r,[`tap`,`vclick`],t,{x:c[0],y:c[1]}),ie=!1,t.timeStamp-oe<=o.multiClickDebounceTime()?(ae&&clearTimeout(ae),ie=!0,oe=null,i(r,[`dbltap`,`vdblclick`],t,{x:c[0],y:c[1]})):(ae=setTimeout(function(){ie||i(r,[`onetap`,`voneclick`],t,{x:c[0],y:c[1]})},o.multiClickDebounceTime()),oe=t.timeStamp)),r!=null&&!e.dragData.didDrag&&r._private.selectable&&x<e.touchTapThreshold2&&!e.pinching&&(o.selectionType()===`single`?(o.$(n).unmerge(r).unselect([`tapunselect`]),r.select([`tapselect`])):r.selected()?r.unselect([`tapunselect`]):r.select([`tapselect`]),e.redrawHint(`eles`,!0)),e.touchData.singleTouchMoved=!0}for(var S=0;S<c.length;S++)l[S]=c[S];e.dragData.didDrag=!1,t.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),t.touches.length<2&&(t.touches.length===1&&(e.touchData.startGPosition=[t.touches[0].clientX,t.touches[0].clientY]),e.pinching=!1,e.redrawHint(`eles`,!0),e.redraw())},!1),typeof TouchEvent>`u`){var se=[],ce=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},le=function(e){return{event:e,touch:ce(e)}},ue=function(e){se.push(le(e))},de=function(e){for(var t=0;t<se.length;t++)if(se[t].event.pointerId===e.pointerId){se.splice(t,1);return}},fe=function(e){var t=se.filter(function(t){return t.event.pointerId===e.pointerId})[0];t.event=e,t.touch=ce(e)},pe=function(e){e.touches=se.map(function(e){return e.touch})},me=function(e){return e.pointerType===`mouse`||e.pointerType===4};e.registerBinding(e.container,`pointerdown`,function(e){me(e)||(e.preventDefault(),ue(e),pe(e),te(e))}),e.registerBinding(e.container,`pointerup`,function(e){me(e)||(de(e),pe(e),re(e))}),e.registerBinding(e.container,`pointercancel`,function(e){me(e)||(de(e),pe(e),ne(e))}),e.registerBinding(e.container,`pointermove`,function(e){me(e)||(e.preventDefault(),fe(e),pe(e),Y(e))})}};var Vm={};Vm.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(`polygon`,e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o,s){return va(i,a,this.points,e,t,n/2,r/2,o)},checkPoint:function(e,t,n,r,i,a,o,s){return ca(e,t,this.points,a,o,r,i,[0,-1],n)},hasMiterBounds:e!==`rectangle`,miterBounds:function(e,t,n,r,i,a){return $i(this.points,e,t,n,r,i)}}},Vm.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:`ellipse`,draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o,s){return fa(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o,s){return pa(e,t,r,i,a,o,n)}}},Vm.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(e,n,r,i,a,o,s){if(o[s]!==void 0&&o[s+`-cx`]===e&&o[s+`-cy`]===n&&o[s+`-w`]===r&&o[s+`-h`]===i&&o[s+`-corner-radius`]===a)return o[s];o[s]=Array(t.length/2),o[s+`-cx`]=e,o[s+`-cy`]=n,o[s+`-w`]=r,o[s+`-h`]=i,o[s+`-corner-radius`]=a;var c=r/2,l=i/2;a=a===`auto`?Ta(r,i):a;for(var u=Array(t.length/2),d=0;d<t.length/2;d++)u[d]={x:e+c*t[d*2],y:n+l*t[d*2+1]};var f,p,m,h,g=u.length;for(p=u[g-1],f=0;f<g;f++)m=u[f%g],h=u[(f+1)%g],o[s][f]=vm(p,m,h,a),p=m,m=h;return o[s]},draw:function(e,t,n,r,i,a,o){this.renderer.nodeShapeImpl(`round-polygon`,e,t,n,r,i,this.points,this.getOrCreateCorners(t,n,r,i,a,o,`drawCorners`))},intersectLine:function(e,t,n,r,i,a,o,s,c){return ya(i,a,this.points,e,t,n,r,o,this.getOrCreateCorners(e,t,n,r,s,c,`corners`))},checkPoint:function(e,t,n,r,i,a,o,s,c){return la(e,t,this.points,a,o,r,i,this.getOrCreateCorners(a,o,r,i,s,c,`corners`))}}},Vm.generateRoundRectangle=function(){return this.nodeShapes[`round-rectangle`]=this.nodeShapes.roundrectangle={renderer:this,name:`round-rectangle`,points:xa(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,this.points,a)},intersectLine:function(e,t,n,r,i,a,o,s){return ea(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){var c=r/2,l=i/2;s=s===`auto`?wa(r,i):s,s=Math.min(c,l,s);var u=s*2;return!!(ca(e,t,this.points,a,o,r,i-u,[0,-1],n)||ca(e,t,this.points,a,o,r-u,i,[0,-1],n)||pa(e,t,u,u,a-c+s,o-l+s,n)||pa(e,t,u,u,a+c-s,o-l+s,n)||pa(e,t,u,u,a+c-s,o+l-s,n)||pa(e,t,u,u,a-c+s,o+l-s,n))}}},Vm.generateCutRectangle=function(){return this.nodeShapes[`cut-rectangle`]=this.nodeShapes.cutrectangle={renderer:this,name:`cut-rectangle`,cornerLength:Ea(),points:xa(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,null,a)},generateCutTrianglePts:function(e,t,n,r,i){var a=i===`auto`?this.cornerLength:i,o=t/2,s=e/2,c=n-s,l=n+s,u=r-o,d=r+o;return{topLeft:[c,u+a,c+a,u,c+a,u+a],topRight:[l-a,u,l,u+a,l-a,u+a],bottomRight:[l,d-a,l-a,d,l-a,d-a],bottomLeft:[c+a,d,c,d-a,c+a,d-a]}},intersectLine:function(e,t,n,r,i,a,o,s){var c=this.generateCutTrianglePts(n+2*o,r+2*o,e,t,s);return va(i,a,[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]),e,t)},checkPoint:function(e,t,n,r,i,a,o,s){var c=s===`auto`?this.cornerLength:s;if(ca(e,t,this.points,a,o,r,i-2*c,[0,-1],n)||ca(e,t,this.points,a,o,r-2*c,i,[0,-1],n))return!0;var l=this.generateCutTrianglePts(r,i,a,o);return sa(e,t,l.topLeft)||sa(e,t,l.topRight)||sa(e,t,l.bottomRight)||sa(e,t,l.bottomLeft)}}},Vm.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:`barrel`,points:xa(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o,s){var c=this.generateBarrelBezierPts(n+2*o,r+2*o,e,t),l=function(e){var t=Ii({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=Ii({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=Ii({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]};return va(i,a,[].concat(l(c.topLeft),l(c.topRight),l(c.bottomRight),l(c.bottomLeft)),e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,a=e/2,o=n-a,s=n+a,c=r-i,l=r+i,u=Oa(e,t),d=u.heightOffset,f=u.widthOffset,p=u.ctrlPtOffsetPct*e,m={topLeft:[o,c+d,o+p,c,o+f,c],topRight:[s-f,c,s-p,c,s,c+d],bottomRight:[s,l-d,s-p,l,s-f,l],bottomLeft:[o+f,l,o+p,l,o,l-d]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,t,n,r,i,a,o,s){var c=Oa(r,i),l=c.heightOffset,u=c.widthOffset;if(ca(e,t,this.points,a,o,r,i-2*l,[0,-1],n)||ca(e,t,this.points,a,o,r-2*u,i,[0,-1],n))return!0;for(var d=this.generateBarrelBezierPts(r,i,a,o),f=function(e,t,n){var r=n[4],i=n[2],a=n[0],o=n[5],s=n[1];if(Math.min(r,a)<=e&&e<=Math.max(r,a)&&Math.min(o,s)<=t&&t<=Math.max(o,s)){var c=Da(r,i,a),l=ra(c[0],c[1],c[2],e).filter(function(e){return 0<=e&&e<=1});if(l.length>0)return l[0]}return null},p=Object.keys(d),m=0;m<p.length;m++){var h=d[p[m]],g=f(e,t,h);if(g!=null){var _=h[5],v=h[3],y=h[1],b=Fi(_,v,y,g);if(h.isTop&&b<=t||h.isBottom&&t<=b)return!0}}return!1}}},Vm.generateBottomRoundrectangle=function(){return this.nodeShapes[`bottom-round-rectangle`]=this.nodeShapes.bottomroundrectangle={renderer:this,name:`bottom-round-rectangle`,points:xa(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,this.points,a)},intersectLine:function(e,t,n,r,i,a,o,s){var c=e-(n/2+o),l=t-(r/2+o),u=l,d=ga(i,a,e,t,c,l,e+(n/2+o),u,!1);return d.length>0?d:ea(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){s=s===`auto`?wa(r,i):s;var c=2*s;if(ca(e,t,this.points,a,o,r,i-c,[0,-1],n)||ca(e,t,this.points,a,o,r-c,i,[0,-1],n))return!0;var l=r/2+2*n,u=i/2+2*n;return!!(sa(e,t,[a-l,o-u,a-l,o,a+l,o,a+l,o-u])||pa(e,t,c,c,a+r/2-s,o+i/2-s,n)||pa(e,t,c,c,a-r/2+s,o+i/2-s,n))}}},Vm.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon(`triangle`,xa(3,0)),this.generateRoundPolygon(`round-triangle`,xa(3,0)),this.generatePolygon(`rectangle`,xa(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon(`diamond`,n),this.generateRoundPolygon(`round-diamond`,n),this.generatePolygon(`pentagon`,xa(5,0)),this.generateRoundPolygon(`round-pentagon`,xa(5,0)),this.generatePolygon(`hexagon`,xa(6,0)),this.generateRoundPolygon(`round-hexagon`,xa(6,0)),this.generatePolygon(`heptagon`,xa(7,0)),this.generateRoundPolygon(`round-heptagon`,xa(7,0)),this.generatePolygon(`octagon`,xa(8,0)),this.generateRoundPolygon(`round-octagon`,xa(8,0));var r=Array(20),i=Ca(5,0),a=Ca(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<a.length/2;s++)a[s*2]*=o,a[s*2+1]*=o;for(var s=0;s<5;s++)r[s*4]=i[s*2],r[s*4+1]=i[s*2+1],r[s*4+2]=a[s*2],r[s*4+3]=a[s*2+1];r=Sa(r),this.generatePolygon(`star`,r),this.generatePolygon(`vee`,[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon(`rhomboid`,[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon(`right-rhomboid`,[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon(`concave-hexagon`,[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon(`tag`,c),this.generateRoundPolygon(`round-tag`,c),e.makePolygon=function(e){var n=`polygon-`+e.join(`$`),r;return(r=this[n])?r:t.generatePolygon(n,e)}};var Hm={};Hm.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},Hm.redraw=function(e){e||=Lr();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},Hm.beforeRender=function(e,t){if(!this.destroyed){t??kr(`Priority is not optional for beforeRender`);var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(e,t){return t.priority-e.priority})}};var Um=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};Hm.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function(r){if(!e.destroyed){if(!t.batching()){if(e.requestedFrame&&!e.skipFrame){Um(e,!0,r);var i=ir();e.render(e.renderOptions);var a=e.lastDrawTime=ir();e.averageRedrawTime===void 0&&(e.averageRedrawTime=a-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var o=a-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else Um(e,!1,r)}e.skipFrame=!1,rr(n)}};rr(n)}};var Wm=function(e){this.init(e)},Gm=Wm.prototype;Gm.clientFunctions=[`redrawHint`,`render`,`renderTo`,`matchCanvasSize`,`nodeShapeImpl`,`arrowShapeImpl`],Gm.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var i=r.document,a=i.head,o=`__________cytoscape_stylesheet`,s=`__________cytoscape_container`,c=i.getElementById(o)!=null;if(n.className.indexOf(s)<0&&(n.className=(n.className||``)+` `+s),!c){var l=i.createElement(`style`);l.id=o,l.textContent=`.`+s+` { position: relative; }`,a.insertBefore(l,a.children[0])}r.getComputedStyle(n).getPropertyValue(`position`)===`static`&&jr(`A Cytoscape container has style position:static and so can not use UI extensions properly`)}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Q(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},Gm.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e===`init`){n.load();return}if(e===`destroy`){n.destroy();return}(e===`add`||e===`remove`||e===`move`&&r.hasCompoundNodes()||e===`load`||e===`zorder`||e===`mount`)&&n.invalidateCachedZSortedEles(),e===`viewport`&&n.redrawHint(`select`,!0),e===`gc`&&n.redrawHint(`gc`,!0),(e===`load`||e===`resize`||e===`mount`)&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint(`eles`,!0),n.redrawHint(`drag`,!0),this.startRenderLoop(),this.redraw()}},Gm.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}},Gm.isHeadless=function(){return!1},[Kp,Fm,Im,Bm,Vm,Hm].forEach(function(e){$t(Gm,e)});var Km=1e3/60,qm={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=$n(function(){n.redrawHint(`eles`,!0),n.redrawHint(`drag`,!0),n.redraw()},e.deqRedrawThreshold),i=function(i,a){var o=ir(),s=n.averageRedrawTime,c=n.lastRedrawTime,l=[],u=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var f=ir(),p=f-o,m=f-a;if(c<Km){var h=Km-(i?s:0);if(m>=e.deqFastCost*h)break}else if(i){if(p>=e.deqCost*c||p>=e.deqAvgCost*s)break}else if(m>=e.deqNoDrawCost*Km)break;var g=e.deq(t,d,u);if(g.length>0)for(var _=0;_<g.length;_++)l.push(g[_]);else break}l.length>0&&(e.onDeqd(t,l),!i&&e.shouldRedraw(t,l,d,u)&&r())},a=e.priority||Or;n.beforeRender(i,a(t))}}}},Jm=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Er;$e(this,e),this.idsByKey=new Wr,this.keyForId=new Wr,this.cachesByLvl=new Wr,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return tt(e,[{key:`getIdsFor`,value:function(e){e??kr(`Can not get id list for null key`);var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new qr,t.set(e,n)),n}},{key:`addIdForKey`,value:function(e,t){e!=null&&this.getIdsFor(e).add(t)}},{key:`deleteIdForKey`,value:function(e,t){e!=null&&this.getIdsFor(e).delete(t)}},{key:`getNumberOfIdsForKey`,value:function(e){return e==null?0:this.getIdsFor(e).size}},{key:`updateKeyMappingFor`,value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:`deleteKeyMappingFor`,value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:`keyHasChangedFor`,value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:`isInvalid`,value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:`getCachesAt`,value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Wr,t.set(e,r),n.push(e)),r}},{key:`getCache`,value:function(e,t){return this.getCachesAt(t).get(e)}},{key:`get`,value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return r!=null&&this.updateKeyMappingFor(e),r}},{key:`getForCachedKey`,value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:`hasCache`,value:function(e,t){return this.getCachesAt(t).has(e)}},{key:`has`,value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:`setCache`,value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:`set`,value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:`deleteCache`,value:function(e,t){this.getCachesAt(t).delete(e)}},{key:`delete`,value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:`invalidateKey`,value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:`invalidate`,value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||this.getNumberOfIdsForKey(n)===0}}])}(),Ym=25,Xm=50,Zm=-4,Qm=3,$m=7.99,eh=8,th=1024,nh=1024,rh=1024,ih=.2,ah=.8,oh=10,sh=.15,ch=.1,lh=.9,uh=.9,dh=100,fh=1,ph={dequeue:`dequeue`,downscale:`downscale`,highQuality:`highQuality`},mh=Rr({getKey:null,doesEleInvalidateKey:Er,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Tr,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),hh=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=mh(t);$t(n,r),n.lookup=new Jm(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},gh=hh.prototype;gh.reasons=ph,gh.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},gh.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},gh.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new ii(function(e,t){return t.reqs-e.reqs})},gh.getElementKeyToQueue=function(){var e=this;return e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{}},gh.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),c=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(r??=Math.ceil(Ai(s*n)),r<Zm)r=Zm;else if(s>=$m||r>Qm)return null;var l=2**r,u=t.h*l,d=t.w*l,f=o.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,f))return null;var p=c.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var m=u<=Ym?Ym:u<=Xm?Xm:Math.ceil(u/Xm)*Xm;if(u>rh||d>nh)return null;var h=a.getTextureQueue(m),g=h[h.length-2],_=function(){return a.recycleTexture(m,d)||a.addTexture(m,d)};g||=h[h.length-1],g||=_(),g.width-g.usedWidth<d&&(g=_());for(var v=function(e){return e&&e.scaledLabelShown===f},y=i&&i===ph.dequeue,b=i&&i===ph.highQuality,x=i&&i===ph.downscale,S,C=r+1;C<=Qm;C++){var w=c.get(e,C);if(w){S=w;break}}var T=S&&S.level===r+1?S:null,E=function(){g.context.drawImage(T.texture.canvas,T.x,0,T.width,T.height,g.usedWidth,0,d,u)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,m),v(T))E();else if(v(S)){if(b){for(var D=S.level;D>r;D--)T=a.getElement(e,t,n,D,ph.downscale);E()}else return a.queueElement(e,S.level-1),S}else{var O;if(!y&&!b&&!x)for(var k=r-1;k>=Zm;k--){var A=c.get(e,k);if(A){O=A;break}}if(v(O))return a.queueElement(e,r),O;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,e,t,f,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:l,width:d,height:u,scaledLabelShown:f},g.usedWidth+=Math.ceil(d+eh),g.eleCaches.push(p),c.set(e,r,p),a.checkTextureFullness(g),p},gh.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},gh.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=Zm;i<=Qm;i++){var a=n.getForCachedKey(e,i);a&&r.push(a)}if(n.invalidate(e))for(var o=0;o<r.length;o++){var s=r[o],c=s.texture;c.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(c)}t.removeFromQueue(e)}},gh.checkTextureUtility=function(e){e.invalidatedWidth>=ih*e.width&&this.retireTexture(e)},gh.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>ah&&e.fullnessChecks>=oh?zr(t,e):e.fullnessChecks++},gh.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),i=this.lookup;zr(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o<a.length;o++){var s=a[o];i.deleteCache(s.key,s.level)}Br(a),t.getRetiredTextureQueue(n).push(e)},gh.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),i={};return r.push(i),i.eleCaches=[],i.height=e,i.width=Math.max(th,t),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=n.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext(`2d`),i},gh.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),i=n.getRetiredTextureQueue(e),a=0;a<i.length;a++){var o=i[a];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Br(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),zr(i,o),r.push(o),o}},gh.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementKeyToQueue(),a=this.getKey(e),o=i[a];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,r.updateItem(o);else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:a};r.push(s),i[a]=s}},gh.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o<fh&&n.size()>0;o++){var s=n.pop(),c=s.key,l=s.eles[0],u=a.hasCache(l,s.level);if(r[c]=null,!u){i.push(s);var d=t.getBoundingBox(l);t.getElement(l,d,e,s.level,ph.dequeue)}}return i},gh.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=this.getKey(e),a=r[i];a!=null&&(a.eles.length===1?(a.reqs=wr,n.updateItem(a),n.pop(),r[i]=null):a.eles.unmerge(e))},gh.onDequeue=function(e){this.onDequeues.push(e)},gh.offDequeue=function(e){zr(this.onDequeues,e)},gh.setupDequeueing=qm.setupDequeueing({deqRedrawThreshold:dh,deqCost:sh,deqAvgCost:ch,deqNoDrawCost:lh,deqFastCost:uh,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var r=e.onDequeues[n];r(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var a=t[i].eles,o=0;o<a.length;o++)if(qi(a[o].boundingBox(),r))return!0;return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var _h=1,vh=-4,yh=2,bh=3.99,xh=50,Sh=50,Ch=.15,wh=.1,Th=.9,Eh=.9,Dh=1,Oh=250,kh=16e6,Ah=32767,jh=!0,Mh=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=ir()-2*Oh,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=$n(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Sh),n.beforeRender(function(e,n){t.skipping=n-t.lastInvalidationTime<=Oh},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new ii(function(e,t){return t.reqs-e.reqs}),t.setupDequeueing()},Nh=Mh.prototype,Ph=0,Fh=2**53-1;Nh.makeLayer=function(e,t){var n=2**t,r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),a=this.renderer.makeOffscreenCanvas(r,i),o={id:Ph=++Ph%Fh,bb:e,level:t,width:r,height:i,canvas:a,context:a.getContext(`2d`),eles:[],elesQueue:[],reqs:0},s=o.context,c=-o.bb.x1,l=-o.bb.y1;return s.scale(n,n),s.translate(c,l),o},Nh.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),a=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Ai(i*t)),n<vh)n=vh;else if(i>=bh||n>yh)return null}r.validateLayersElesOrdering(n,e);var o=r.layersByLevel,s=2**n,c=o[n]=o[n]||[],l,u=r.levelIsComplete(n,e),d,f=function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return d=o[t],!0},i=function(e){if(!d)for(var r=n+e;vh<=r&&r<=yh&&!t(r);r+=e);};i(1),i(-1);for(var a=c.length-1;a>=0;a--){var s=c[a];s.invalid&&zr(c,s)}};if(!u)f();else return c;var p=function(){if(!l){l=zi();for(var t=0;t<e.length;t++)Hi(l,e[t].boundingBox())}return l},m=function(e){e||={};var t=e.after;p();var i=Math.ceil(l.w*s),a=Math.ceil(l.h*s);if(i>Ah||a>Ah||i*a>kh)return null;var o=r.makeLayer(l,n);if(t!=null){var u=c.indexOf(t)+1;c.splice(u,0,o)}else(e.insert===void 0||e.insert)&&c.unshift(o);return o};if(r.skipping&&!a)return null;for(var h=null,g=e.length/_h,_=!a,v=0;v<e.length;v++){var y=e[v],b=y._private.rscratch,x=b.imgLayerCaches=b.imgLayerCaches||{},S=x[n];if(S){h=S;continue}if((!h||h.eles.length>=g||!Xi(h.bb,y.boundingBox()))&&(h=m({insert:!0,after:h}),!h))return null;d||_?r.queueLayer(h,y):r.drawEleInLayer(h,y,n,t),h.eles.push(y),x[n]=h}return d||(_?null:c)},Nh.getEleLevelForLayerLevel=function(e,t){return e},Nh.drawEleInLayer=function(e,t,n,r){var i=this,a=this.renderer,o=e.context,s=t.boundingBox();s.w!==0&&s.h!==0&&t.visible()&&(n=i.getEleLevelForLayerLevel(n,r),a.setImgSmoothing(o,!1),a.drawCachedElement(o,t,null,null,n,jh),a.setImgSmoothing(o,!0))},Nh.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||n.length===0)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0||a.invalid)return!1;r+=a.eles.length}return r===t.length},Nh.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,o=0;o<t.length;o++)if(i.eles[0]===t[o]){a=o;break}if(a<0){this.invalidateLayer(i);continue}for(var s=a,o=0;o<i.eles.length;o++)if(i.eles[o]!==t[s+o]){this.invalidateLayer(i);break}}},Nh.updateElementsInLayers=function(e,t){for(var n=this,r=Ot(e[0]),i=0;i<e.length;i++)for(var a=r?null:e[i],o=r?e[i]:e[i].ele,s=o._private.rscratch,c=s.imgLayerCaches=s.imgLayerCaches||{},l=vh;l<=yh;l++){var u=c[l];u&&(a&&n.getEleLevelForLayerLevel(u.level)!==a.level||t(u,o,a))}},Nh.haveLayers=function(){for(var e=this,t=!1,n=vh;n<=yh;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},Nh.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=ir(),e.length!==0&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},Nh.invalidateLayer=function(e){if(this.lastInvalidationTime=ir(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];zr(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var a=n[i]._private.rscratch.imgLayerCaches;a&&(a[t]=null)}}},Nh.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(e,n,r){var i=e.replacement;if(i||(i=e.replacement=t.makeLayer(e.bb,e.level),i.replaces=e,i.eles=e.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])})},Nh.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Nh.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Nh.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<Dh&&n.size()!==0;){var a=n.peek();if(a.replacement){n.pop();continue}if(a.replaces&&a!==a.replaces.replacement){n.pop();continue}if(a.invalid){n.pop();continue}var o=a.elesQueue.shift();o&&(t.drawEleInLayer(a,o,a.level,e),i++),r.length===0&&r.push(!0),a.elesQueue.length===0&&(n.pop(),a.reqs=0,a.replaces&&t.applyLayerReplacement(a),t.requestRedraw())}return r},Nh.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,i=n.indexOf(r);if(!(i<0||r.invalid)){n[i]=e;for(var a=0;a<e.eles.length;a++){var o=e.eles[a]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[e.level]=e)}t.requestRedraw()}},Nh.requestRedraw=$n(function(){var e=this.renderer;e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0),e.redraw()},100),Nh.setupDequeueing=qm.setupDequeueing({deqRedrawThreshold:xh,deqCost:Ch,deqAvgCost:wh,deqNoDrawCost:Th,deqFastCost:Eh,deq:function(e,t){return e.dequeue(t)},onDeqd:Or,shouldRedraw:Tr,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Ih={},Lh;function Rh(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function zh(e,t,n){for(var r,i=0;i<t.length;i++){var a=t[i];i===0&&(r=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Bh(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var a=r[i];e.lineTo(a.x,a.y)}var o=n,s=n[0];e.moveTo(s.x,s.y);for(var i=1;i<o.length;i++){var a=o[i];e.lineTo(a.x,a.y)}e.closePath&&e.closePath()}function Vh(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,Math.PI*2,!1);var a=t,o=a[0];e.moveTo(o.x,o.y);for(var s=0;s<a.length;s++){var c=a[s];e.lineTo(c.x,c.y)}e.closePath&&e.closePath()}function Hh(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}Ih.arrowShapeImpl=function(e){return(Lh||={polygon:Rh,"triangle-backcurve":zh,"triangle-tee":Bh,"circle-triangle":Vh,"triangle-cross":Bh,circle:Hh})[e]};var Uh={};Uh.drawElement=function(e,t,n,r,i,a){var o=this;t.isNode()?o.drawNode(e,t,n,r,i,a):o.drawEdge(e,t,n,r,i,a)},Uh.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},Uh.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},Uh.drawCachedElementPortion=function(e,t,n,r,i,a,o,s){var c=this,l=n.getBoundingBox(t);if(l.w!==0&&l.h!==0){var u=n.getElement(t,l,r,i,a);if(u!=null){var d=s(c,t);if(d===0)return;var f=o(c,t),p=l.x1,m=l.y1,h=l.w,g=l.h,_,v,y,b,x;if(f!==0){var S=n.getRotationPoint(t);y=S.x,b=S.y,e.translate(y,b),e.rotate(f),x=c.getImgSmoothing(e),x||c.setImgSmoothing(e,!0);var C=n.getRotationOffset(t);_=C.x,v=C.y}else _=p,v=m;var w;d!==1&&(w=e.globalAlpha,e.globalAlpha=w*d),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,_,v,h,g),d!==1&&(e.globalAlpha=w),f!==0&&(e.rotate(-f),e.translate(-y,-b),x||c.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var Wh=function(){return 0},Gh=function(e,t){return e.getTextAngle(t,null)},Kh=function(e,t){return e.getTextAngle(t,`source`)},qh=function(e,t){return e.getTextAngle(t,`target`)},Jh=function(e,t){return t.effectiveOpacity()},Yh=function(e,t){return t.pstyle(`text-opacity`).pfValue*t.effectiveOpacity()};Uh.drawCachedElement=function(e,t,n,r,i,a){var o=this,s=o.data,c=s.eleTxrCache,l=s.lblTxrCache,u=s.slbTxrCache,d=s.tlbTxrCache,f=t.boundingBox(),p=a===!0?c.reasons.highQuality:null;if(f.w!==0&&f.h!==0&&t.visible()&&(!r||qi(f,r))){var m=t.isEdge(),h=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t),o.drawCachedElementPortion(e,t,c,n,i,p,Wh,Jh),(!m||!h)&&o.drawCachedElementPortion(e,t,l,n,i,p,Gh,Yh),m&&!h&&(o.drawCachedElementPortion(e,t,u,n,i,p,Kh,Yh),o.drawCachedElementPortion(e,t,d,n,i,p,qh,Yh)),o.drawElementOverlay(e,t)}},Uh.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var i=t[r];n.drawElement(e,i)}},Uh.drawCachedElements=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];i.drawCachedElement(e,o,n,r)}},Uh.drawCachedNodes=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];o.isNode()&&i.drawCachedElement(e,o,n,r)}},Uh.drawLayeredElements=function(e,t,n,r){var i=this,a=i.data.lyrTxrCache.getLayers(t,n);if(a)for(var o=0;o<a.length;o++){var s=a[o],c=s.bb;c.w!==0&&c.h!==0&&e.drawImage(s.canvas,c.x1,c.y1,c.w,c.h)}else i.drawCachedElements(e,t,n,r)};var Xh={};Xh.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=t._private.rscratch;if((!a||t.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var c;n&&(c=n,e.translate(-c.x1,-c.y1));var l=a?t.pstyle(`opacity`).value:1,u=a?t.pstyle(`line-opacity`).value:1,d=t.pstyle(`curve-style`).value,f=t.pstyle(`line-style`).value,p=t.pstyle(`width`).pfValue,m=t.pstyle(`line-cap`).value,h=t.pstyle(`line-outline-width`).value,g=t.pstyle(`line-outline-color`).value,_=l*u,v=l*u,y=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;d===`straight-triangle`?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=m,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,f),e.lineCap=`butt`)},b=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;if(e.lineWidth=p+h,e.lineCap=m,h>0)o.colorStrokeStyle(e,g[0],g[1],g[2],n);else{e.lineCap=`butt`;return}d===`straight-triangle`?o.drawEdgeTrianglePath(t,e,s.allpts):(o.drawEdgePath(t,e,s.allpts,f),e.lineCap=`butt`)},x=function(){i&&o.drawEdgeOverlay(e,t)},S=function(){i&&o.drawEdgeUnderlay(e,t)},C=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;o.drawArrowheads(e,t,n)},w=function(){o.drawElementText(e,t,null,r)};if(e.lineJoin=`round`,t.pstyle(`ghost`).value===`yes`){var T=t.pstyle(`ghost-offset-x`).pfValue,E=t.pstyle(`ghost-offset-y`).pfValue,D=_*t.pstyle(`ghost-opacity`).value;e.translate(T,E),y(D),C(D),e.translate(-T,-E)}else b();S(),y(),C(),x(),w(),n&&e.translate(c.x1,c.y1)}};var Zh=function(e){if(![`overlay`,`underlay`].includes(e))throw Error(`Invalid state`);return function(t,n){if(n.visible()){var r=n.pstyle(`${e}-opacity`).value;if(r!==0){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle(`${e}-padding`).pfValue,c=n.pstyle(`${e}-color`).value;t.lineWidth=s,t.lineCap=o.edgeType===`self`&&!a?`butt`:`round`,i.colorStrokeStyle(t,c[0],c[1],c[2],r),i.drawEdgePath(n,t,o.allpts,`solid`)}}}};Xh.drawEdgeOverlay=Zh(`overlay`),Xh.drawEdgeUnderlay=Zh(`underlay`),Xh.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,o,s=!1,c=this.usePaths(),l=e.pstyle(`line-dash-pattern`).pfValue,u=e.pstyle(`line-dash-offset`).pfValue;if(c){var d=n.join(`$`);i.pathCacheKey&&i.pathCacheKey===d?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=d,i.pathCache=o)}if(a.setLineDash)switch(r){case`dotted`:a.setLineDash([1,1]);break;case`dashed`:a.setLineDash(l),a.lineDashOffset=u;break;case`solid`:a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case`bezier`:case`self`:case`compound`:case`multibezier`:for(var f=2;f+3<n.length;f+=4)t.quadraticCurveTo(n[f],n[f+1],n[f+2],n[f+3]);break;case`straight`:case`haystack`:for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1]);break;case`segments`:if(i.isRound){var m=nt(i.roundCorners),h;try{for(m.s();!(h=m.n()).done;){var g=h.value;_m(t,g)}}catch(e){m.e(e)}finally{m.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var _=2;_+1<n.length;_+=2)t.lineTo(n[_],n[_+1])}t=a,c?t.stroke(o):t.stroke(),t.setLineDash&&t.setLineDash([])},Xh.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle(`width`).pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=[a[1]/o,-a[0]/o],c=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-c[0],n[i+1]-c[1]),t.lineTo(n[i]+c[0],n[i+1]+c[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},Xh.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i=r.edgeType===`haystack`;i||this.drawArrowhead(e,t,`source`,r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,`mid-target`,r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,`mid-source`,r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,`target`,r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Xh.drawArrowhead=function(e,t,n,r,i,a,o){if(!(isNaN(r)||r==null||isNaN(i)||i==null||isNaN(a)||a==null)){var s=this,c=t.pstyle(n+`-arrow-shape`).value;if(c!==`none`){var l=t.pstyle(n+`-arrow-fill`).value===`hollow`?`both`:`filled`,u=t.pstyle(n+`-arrow-fill`).value,d=t.pstyle(`width`).pfValue,f=t.pstyle(n+`-arrow-width`),p=f.value===`match-line`?d:f.pfValue;f.units===`%`&&(p*=d);var m=t.pstyle(`opacity`).value;o===void 0&&(o=m);var h=e.globalCompositeOperation;(o!==1||u===`hollow`)&&(e.globalCompositeOperation=`destination-out`,s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,l,d,c,p,r,i,a),e.globalCompositeOperation=h);var g=t.pstyle(n+`-arrow-color`).value;s.colorFillStyle(e,g[0],g[1],g[2],o),s.colorStrokeStyle(e,g[0],g[1],g[2],o),s.drawArrowShape(t,e,u,d,c,p,r,i,a)}}},Xh.drawArrowShape=function(e,t,n,r,i,a,o,s,c){var l=this,u=this.usePaths()&&i!==`triangle-cross`,d=!1,f,p=t,m={x:o,y:s},h=e.pstyle(`arrow-scale`).value,g=this.getArrowWidth(r,h),_=l.arrowShapes[i];if(u){var v=l.arrowPathCache=l.arrowPathCache||[],y=hr(i),b=v[y];b==null?(f=t=new Path2D,v[y]=f):(f=t=b,d=!0)}d||(t.beginPath&&t.beginPath(),u?_.draw(t,1,0,{x:0,y:0},1):_.draw(t,g,c,m,r),t.closePath&&t.closePath()),t=p,u&&(t.translate(o,s),t.rotate(c),t.scale(g,g)),(n===`filled`||n===`both`)&&(u?t.fill(f):t.fill()),(n===`hollow`||n===`both`)&&(t.lineWidth=a/(u?g:1),t.lineJoin=`miter`,u?t.stroke(f):t.stroke()),u&&(t.scale(1/g,1/g),t.rotate(-c),t.translate(-o,-s))};var Qh={};Qh.safeDrawImage=function(e,t,n,r,i,a,o,s,c,l){if(!(i<=0||a<=0||c<=0||l<=0))try{e.drawImage(t,n,r,i,a,o,s,c,l)}catch(e){jr(e)}},Qh.drawInscribedImage=function(e,t,n,r,i){var a=this,o=n.position(),s=o.x,c=o.y,l=n.cy().style(),u=l.getIndexedStyle.bind(l),d=u(n,`background-fit`,`value`,r),f=u(n,`background-repeat`,`value`,r),p=n.width(),m=n.height(),h=n.padding()*2,g=p+(u(n,`background-width-relative-to`,`value`,r)===`inner`?0:h),_=m+(u(n,`background-height-relative-to`,`value`,r)===`inner`?0:h),v=n._private.rscratch,y=u(n,`background-clip`,`value`,r)===`node`,b=u(n,`background-image-opacity`,`value`,r)*i,x=u(n,`background-image-smoothing`,`value`,r),S=n.pstyle(`corner-radius`).value;S!==`auto`&&(S=n.pstyle(`corner-radius`).pfValue);var C=t.width||t.cachedW,w=t.height||t.cachedH;(C==null||w==null)&&(document.body.appendChild(t),C=t.cachedW=t.width||t.offsetWidth,w=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var T=C,E=w;if(u(n,`background-width`,`value`,r)!==`auto`&&(T=u(n,`background-width`,`units`,r)===`%`?u(n,`background-width`,`pfValue`,r)*g:u(n,`background-width`,`pfValue`,r)),u(n,`background-height`,`value`,r)!==`auto`&&(E=u(n,`background-height`,`units`,r)===`%`?u(n,`background-height`,`pfValue`,r)*_:u(n,`background-height`,`pfValue`,r)),T!==0&&E!==0){if(d===`contain`){var D=Math.min(g/T,_/E);T*=D,E*=D}else if(d===`cover`){var D=Math.max(g/T,_/E);T*=D,E*=D}var O=s-g/2,k=u(n,`background-position-x`,`units`,r),A=u(n,`background-position-x`,`pfValue`,r);O+=k===`%`?(g-T)*A:A;var j=u(n,`background-offset-x`,`units`,r),M=u(n,`background-offset-x`,`pfValue`,r);O+=j===`%`?(g-T)*M:M;var N=c-_/2,P=u(n,`background-position-y`,`units`,r),F=u(n,`background-position-y`,`pfValue`,r);N+=P===`%`?(_-E)*F:F;var I=u(n,`background-offset-y`,`units`,r),L=u(n,`background-offset-y`,`pfValue`,r);N+=I===`%`?(_-E)*L:L,v.pathCache&&(O-=s,N-=c,s=0,c=0);var R=e.globalAlpha;e.globalAlpha=b;var z=a.getImgSmoothing(e),B=!1;x===`no`&&z?(a.setImgSmoothing(e,!1),B=!0):x===`yes`&&!z&&(a.setImgSmoothing(e,!0),B=!0),f===`no-repeat`?(y&&(e.save(),v.pathCache?e.clip(v.pathCache):(a.nodeShapes[a.getNodeShape(n)].draw(e,s,c,g,_,S,v),e.clip())),a.safeDrawImage(e,t,0,0,C,w,O,N,T,E),y&&e.restore()):(e.fillStyle=e.createPattern(t,f),a.nodeShapes[a.getNodeShape(n)].draw(e,s,c,g,_,S,v),e.translate(O,N),e.fill(),e.translate(-O,-N)),e.globalAlpha=R,B&&a.setImgSmoothing(e,z)}};var $h={};$h.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio();t=2**Math.ceil(Ai(n*r))}return!(e.pstyle(`font-size`).pfValue*t<e.pstyle(`min-zoomed-font-size`).pfValue)},$h.drawElementText=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(r==null){if(a&&!o.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var s=t.pstyle(`label`);if(!s||!s.value)return;var c=o.getLabelJustification(t),l=t.pstyle(`text-metrics`).strValue===`glyph`;e.textAlign=c,e.textBaseline=l?`alphabetic`:`bottom`}else{var u=t.element()._private.rscratch.badLine,d=t.pstyle(`label`),f=t.pstyle(`source-label`),p=t.pstyle(`target-label`);if(u||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;e.textAlign=`center`,e.textBaseline=`bottom`}var m=!n,h;n&&(h=n,e.translate(-h.x1,-h.y1)),i==null?(o.drawText(e,t,null,m,a),t.isEdge()&&(o.drawText(e,t,`source`,m,a),o.drawText(e,t,`target`,m,a))):o.drawText(e,t,i,m,a),n&&e.translate(h.x1,h.y1)},$h.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},$h.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle(`font-style`).strValue,i=t.pstyle(`font-size`).pfValue+`px`,a=t.pstyle(`font-family`).strValue,o=t.pstyle(`font-weight`).strValue,s=n?t.effectiveOpacity()*t.pstyle(`text-opacity`).value:1,c=t.pstyle(`text-outline-opacity`).value*s,l=t.pstyle(`color`).value,u=t.pstyle(`text-outline-color`).value;e.font=r+` `+o+` `+i+` `+a,e.lineJoin=`round`,this.colorFillStyle(e,l[0],l[1],l[2],s),this.colorStrokeStyle(e,u[0],u[1],u[2],c)};function eg(e,t,n,r,i){var a=Math.min(r,i)/2,o=t+r/2,s=n+i/2;e.beginPath(),e.arc(o,s,a,0,Math.PI*2),e.closePath()}function tg(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}$h.getTextAngle=function(e,t){var n,r=e._private.rscratch,i=t?t+`-`:``,a=e.pstyle(i+`text-rotation`);if(a.strValue===`autorotate`){var o=Hr(r,`labelAngle`,t);n=e.isEdge()?o:0}else n=a.strValue===`none`?0:a.pfValue;return n},$h.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||o!==0&&t.pstyle(`text-opacity`).value!==0){n===`main`&&(n=null);var s=Hr(a,`labelX`,n),c=Hr(a,`labelY`,n),l,u,d=this.getLabelText(t,n);if(d!=null&&d!==``&&!isNaN(s)&&!isNaN(c)){this.setupTextStyle(e,t,i);var f=n?n+`-`:``,p=Hr(a,`labelWidth`,n),m=Hr(a,`labelHeight`,n),h=Hr(a,`labelActualDescent`,n),g=t.pstyle(f+`text-margin-x`).pfValue,_=t.pstyle(f+`text-margin-y`).pfValue,v=t.isEdge(),y=t.pstyle(`text-halign`).value,b=t.pstyle(`text-valign`).value;v&&(y=`center`,b=`center`),s+=g,c+=_;var x=r?this.getTextAngle(t,n):0;x!==0&&(l=s,u=c,e.translate(l,u),e.rotate(x),s=0,c=0);var S=Yu(y),C=Xu(b);switch(C){case`top`:break;case`center`:c+=m/2;break;case`bottom`:c+=m}var w=t.pstyle(`text-background-opacity`).value,T=t.pstyle(`text-border-opacity`).value,E=t.pstyle(`text-border-width`).pfValue,D=t.pstyle(`text-background-padding`).pfValue,O=t.pstyle(`text-background-shape`).strValue,k=O===`round-rectangle`||O===`roundrectangle`,A=O===`circle`,j=2;if(w>0||E>0&&T>0){var M=e.fillStyle,N=e.strokeStyle,P=e.lineWidth,F=t.pstyle(`text-background-color`).value,I=t.pstyle(`text-border-color`).value,L=t.pstyle(`text-border-style`).value,R=w>0,z=E>0&&T>0,B=s-D;switch(S){case`left`:B-=p;break;case`center`:B-=p/2}var V=c-m-D,H=p+2*D,U=m+2*D;if(R&&(e.fillStyle=`rgba(${F[0]},${F[1]},${F[2]},${w*o})`),z&&(e.strokeStyle=`rgba(${I[0]},${I[1]},${I[2]},${T*o})`,e.lineWidth=E,e.setLineDash))switch(L){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash([4,2]);break;case`double`:e.lineWidth=E/4,e.setLineDash([]);break;default:e.setLineDash([])}if(k?(e.beginPath(),tg(e,B,V,H,U,j)):A?(e.beginPath(),eg(e,B,V,H,U)):(e.beginPath(),e.rect(B,V,H,U)),R&&e.fill(),z&&e.stroke(),z&&L===`double`){var W=E/2;e.beginPath(),k?tg(e,B+W,V+W,H-2*W,U-2*W,j):e.rect(B+W,V+W,H-2*W,U-2*W),e.stroke()}e.fillStyle=M,e.strokeStyle=N,e.lineWidth=P,e.setLineDash&&e.setLineDash([])}var G=2*t.pstyle(`text-outline-width`).pfValue;if(G>0&&(e.lineWidth=G),c-=h,t.pstyle(`text-wrap`).value===`wrap`){var K=Hr(a,`labelWrapCachedLines`,n),ee=Hr(a,`labelLineHeight`,n),q=p/2,J=this.getLabelJustification(t);switch(J===`auto`||(S===`left`?J===`left`?s+=-p:J===`center`&&(s+=-q):S===`center`?J===`left`?s+=-q:J===`right`&&(s+=q):S===`right`&&(J===`center`?s+=q:J===`right`&&(s+=p))),C){case`top`:c-=(K.length-1)*ee;break;case`center`:case`bottom`:c-=(K.length-1)*ee}for(var te=0;te<K.length;te++)G>0&&e.strokeText(K[te],s,c),e.fillText(K[te],s,c),c+=ee}else G>0&&e.strokeText(d,s,c),e.fillText(d,s,c);x!==0&&(e.rotate(-x),e.translate(-l,-u))}}};var ng={};ng.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,c,l=t._private,u=l.rscratch,d=t.position();if(Q(d.x)&&Q(d.y)&&(!a||t.visible())){var f=a?t.effectiveOpacity():1,p=o.usePaths(),m,h=!1,g=t.padding();s=t.width()+2*g,c=t.height()+2*g;var _;n&&(_=n,e.translate(-_.x1,-_.y1));for(var v=t.pstyle(`background-image`).value,y=Array(v.length),b=Array(v.length),x=0,S=0;S<v.length;S++){var C=v[S];if(y[S]=C!=null&&C!==`none`){var w=t.cy().style().getIndexedStyle(t,`background-image-crossorigin`,`value`,S);x++,b[S]=o.getCachedImage(C,w,function(){l.backgroundTimestamp=Date.now(),t.emitAndNotify(`background`)})}}var T=t.pstyle(`background-blacken`).value,E=t.pstyle(`border-width`).pfValue,D=t.pstyle(`background-opacity`).value*f,O=t.pstyle(`border-color`).value,k=t.pstyle(`border-style`).value,A=t.pstyle(`border-join`).value,j=t.pstyle(`border-cap`).value,M=t.pstyle(`border-position`).value,N=t.pstyle(`border-dash-pattern`).pfValue,P=t.pstyle(`border-dash-offset`).pfValue,F=t.pstyle(`border-opacity`).value*f,I=t.pstyle(`outline-width`).pfValue,L=t.pstyle(`outline-color`).value,R=t.pstyle(`outline-style`).value,z=t.pstyle(`outline-opacity`).value*f,B=t.pstyle(`outline-offset`).value,V=t.pstyle(`corner-radius`).value;V!==`auto`&&(V=t.pstyle(`corner-radius`).pfValue);var H=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D;o.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;o.colorStrokeStyle(e,O[0],O[1],O[2],t)},W=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(e,L[0],L[1],L[2],t)},G=function(e,t,n,r){var i=o.nodePathCache=o.nodePathCache||[],a=gr(n===`polygon`?n+`,`+r.join(`,`):n,``+t,``+e,``+V),s=i[a],c,l=!1;return s==null?(c=new Path2D,i[a]=u.pathCache=c):(c=s,l=!0,u.pathCache=c),{path:c,cacheHit:l}},K=t.pstyle(`shape`).strValue,ee=t.pstyle(`shape-polygon-points`).pfValue;if(p){e.translate(d.x,d.y);var q=G(s,c,K,ee);m=q.path,h=q.cacheHit}var J=function(){if(!h){var n=d;p&&(n={x:0,y:0}),o.nodeShapes[o.getNodeShape(t)].draw(m||e,n.x,n.y,s,c,V,u)}p?e.fill(m):e.fill()},te=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=l.backgrounding,a=0,s=0;s<b.length;s++){var c=t.cy().style().getIndexedStyle(t,`background-image-containment`,`value`,s);if(r&&c===`over`||!r&&c===`inside`){a++;continue}y[s]&&b[s].complete&&!b[s].error&&(a++,o.drawInscribedImage(e,b[s],t,s,n))}l.backgrounding=a!==x,i!==l.backgrounding&&t.updateStyle(!1)},Y=function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasPie(t)&&(o.drawPie(e,t,r),n&&(p||o.nodeShapes[o.getNodeShape(t)].draw(e,d.x,d.y,s,c,V,u)))},ne=function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasStripe(t)&&(e.save(),p?e.clip(u.pathCache):(o.nodeShapes[o.getNodeShape(t)].draw(e,d.x,d.y,s,c,V,u),e.clip()),o.drawStripe(e,t,r),e.restore(),n&&(p||o.nodeShapes[o.getNodeShape(t)].draw(e,d.x,d.y,s,c,V,u)))},re=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,n=(T>0?T:-T)*t,r=T>0?0:255;T!==0&&(o.colorFillStyle(e,r,r,r,n),p?e.fill(m):e.fill())},ie=function(){if(E>0){if(e.lineWidth=E,e.lineCap=j,e.lineJoin=A,e.setLineDash)switch(k){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash(N),e.lineDashOffset=P;break;case`solid`:case`double`:e.setLineDash([])}if(M!==`center`){if(e.save(),e.lineWidth*=2,M===`inside`)p?e.clip(m):e.clip();else{var t=new Path2D;t.rect(-s/2-E,-c/2-E,s+2*E,c+2*E),t.addPath(m),e.clip(t,`evenodd`)}p?e.stroke(m):e.stroke(),e.restore()}else p?e.stroke(m):e.stroke();if(k===`double`){e.lineWidth=E/3;var n=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,p?e.stroke(m):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},ae=function(){if(I>0){if(e.lineWidth=I,e.lineCap=`butt`,e.setLineDash)switch(R){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash([4,2]);break;case`solid`:case`double`:e.setLineDash([])}var n=d;p&&(n={x:0,y:0});var r=o.getNodeShape(t),i=E;M===`inside`&&(i=0),M===`outside`&&(i*=2);var a=(s+i+(I+B))/s,l=(c+i+(I+B))/c,u=s*a,f=c*l,m=o.nodeShapes[r].points,h;if(p&&(h=G(u,f,r,m).path),r===`ellipse`)o.drawEllipsePath(h||e,n.x,n.y,u,f);else if([`round-diamond`,`round-heptagon`,`round-hexagon`,`round-octagon`,`round-pentagon`,`round-polygon`,`round-triangle`,`round-tag`].includes(r)){var g=0,_=0,v=0;r===`round-diamond`?g=(i+B+I)*1.4:r===`round-heptagon`?(g=(i+B+I)*1.075,v=-(i/2+B+I)/35):r===`round-hexagon`?g=(i+B+I)*1.12:r===`round-pentagon`?(g=(i+B+I)*1.13,v=-(i/2+B+I)/15):r===`round-tag`?(g=(i+B+I)*1.12,_=(i/2+I+B)*.07):r===`round-triangle`&&(g=(i+B+I)*(Math.PI/2),v=-(i+B/2+I)/Math.PI),g!==0&&(a=(s+g)/s,u=s*a,[`round-hexagon`,`round-tag`].includes(r)||(l=(c+g)/c,f=c*l)),V=V===`auto`?Ta(u,f):V;for(var y=u/2,b=f/2,x=V+(i+I+B)/2,S=Array(m.length/2),C=Array(m.length/2),w=0;w<m.length/2;w++)S[w]={x:n.x+_+y*m[w*2],y:n.y+v+b*m[w*2+1]};var T,D,O,k,A=S.length;for(D=S[A-1],T=0;T<A;T++)O=S[T%A],k=S[(T+1)%A],C[T]=vm(D,O,k,x),D=O,O=k;o.drawRoundPolygonPath(h||e,n.x+_,n.y+v,s*a,c*l,m,C)}else if([`roundrectangle`,`round-rectangle`].includes(r))V=V===`auto`?wa(u,f):V,o.drawRoundRectanglePath(h||e,n.x,n.y,u,f,V+(i+I+B)/2);else if([`cutrectangle`,`cut-rectangle`].includes(r))V=V===`auto`?Ea():V,o.drawCutRectanglePath(h||e,n.x,n.y,u,f,null,V+(i+I+B)/4);else if([`bottomroundrectangle`,`bottom-round-rectangle`].includes(r))V=V===`auto`?wa(u,f):V,o.drawBottomRoundRectanglePath(h||e,n.x,n.y,u,f,V+(i+I+B)/2);else if(r===`barrel`)o.drawBarrelPath(h||e,n.x,n.y,u,f);else if(r.startsWith(`polygon`)||[`rhomboid`,`right-rhomboid`,`round-tag`,`tag`,`vee`].includes(r)){var j=(i+I+B)/s;m=ua(da(m,j)),o.drawPolygonPath(h||e,n.x,n.y,s,c,m)}else{var N=(i+I+B)/s;m=ua(da(m,-N)),o.drawPolygonPath(h||e,n.x,n.y,s,c,m)}if(p?e.stroke(h):e.stroke(),R===`double`){e.lineWidth=i/3;var P=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,p?e.stroke(h):e.stroke(),e.globalCompositeOperation=P}e.setLineDash&&e.setLineDash([])}},oe=function(){i&&o.drawNodeOverlay(e,t,d,s,c)},se=function(){i&&o.drawNodeUnderlay(e,t,d,s,c)},ce=function(){o.drawElementText(e,t,null,r)};if(t.pstyle(`ghost`).value===`yes`){var le=t.pstyle(`ghost-offset-x`).pfValue,ue=t.pstyle(`ghost-offset-y`).pfValue,de=t.pstyle(`ghost-opacity`).value,fe=de*f;e.translate(le,ue),W(),ae(),H(de*D),J(),te(fe,!0),U(de*F),ie(),Y(T!==0||E!==0),ne(T!==0||E!==0),te(fe,!1),re(fe),e.translate(-le,-ue)}p&&e.translate(-d.x,-d.y),se(),p&&e.translate(d.x,d.y),W(),ae(),H(),J(),te(f,!0),U(),ie(),Y(T!==0||E!==0),ne(T!==0||E!==0),te(f,!1),re(),p&&e.translate(-d.x,-d.y),ce(),oe(),n&&e.translate(_.x1,_.y1)}};var rg=function(e){if(![`overlay`,`underlay`].includes(e))throw Error(`Invalid state`);return function(t,n,r,i,a){var o=this;if(n.visible()){var s=n.pstyle(`${e}-padding`).pfValue,c=n.pstyle(`${e}-opacity`).value,l=n.pstyle(`${e}-color`).value,u=n.pstyle(`${e}-shape`).value,d=n.pstyle(`${e}-corner-radius`).value;if(c>0){if(r||=n.position(),i==null||a==null){var f=n.padding();i=n.width()+2*f,a=n.height()+2*f}o.colorFillStyle(t,l[0],l[1],l[2],c),o.nodeShapes[u].draw(t,r.x,r.y,i+s*2,a+s*2,d),t.fill()}}}};ng.drawNodeOverlay=rg(`overlay`),ng.drawNodeUnderlay=rg(`underlay`),ng.hasPie=function(e){return e=e[0],e._private.hasPie},ng.hasStripe=function(e){return e=e[0],e._private.hasStripe},ng.drawPie=function(e,t,n,r){t=t[0],r||=t.position();var i=t.cy().style(),a=t.pstyle(`pie-size`),o=t.pstyle(`pie-hole`),s=t.pstyle(`pie-start-angle`).pfValue,c=r.x,l=r.y,u=t.width(),d=t.height(),f=Math.min(u,d)/2,p,m=0;if(this.usePaths()&&(c=0,l=0),a.units===`%`?f*=a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),o.units===`%`?p=f*o.pfValue:o.pfValue!==void 0&&(p=o.pfValue/2),!(p>=f))for(var h=1;h<=i.pieBackgroundN;h++){var g=t.pstyle(`pie-`+h+`-background-size`).value,_=t.pstyle(`pie-`+h+`-background-color`).value,v=t.pstyle(`pie-`+h+`-background-opacity`).value*n,y=g/100;y+m>1&&(y=1-m);var b=1.5*Math.PI+2*Math.PI*m;b+=s;var x=2*Math.PI*y,S=b+x;g===0||m>=1||m+y>1||(p===0?(e.beginPath(),e.moveTo(c,l),e.arc(c,l,f,b,S),e.closePath()):(e.beginPath(),e.arc(c,l,f,b,S),e.arc(c,l,p,S,b,!0),e.closePath()),this.colorFillStyle(e,_[0],_[1],_[2],v),e.fill(),m+=y)}},ng.drawStripe=function(e,t,n,r){t=t[0],r||=t.position();var i=t.cy().style(),a=r.x,o=r.y,s=t.width(),c=t.height(),l=0,u=this.usePaths();e.save();var d=t.pstyle(`stripe-direction`).value,f=t.pstyle(`stripe-size`);switch(d){case`vertical`:break;case`righward`:e.rotate(-Math.PI/2)}var p=s,m=c;f.units===`%`?(p*=f.pfValue,m*=f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,m=f.pfValue),u&&(a=0,o=0),o-=p/2,a-=m/2;for(var h=1;h<=i.stripeBackgroundN;h++){var g=t.pstyle(`stripe-`+h+`-background-size`).value,_=t.pstyle(`stripe-`+h+`-background-color`).value,v=t.pstyle(`stripe-`+h+`-background-opacity`).value*n,y=g/100;y+l>1&&(y=1-l),!(g===0||l>=1||l+y>1)&&(e.beginPath(),e.rect(a,o+m*l,p,m*y),e.closePath(),this.colorFillStyle(e,_[0],_[1],_[2],v),e.fill(),l+=y)}e.restore()};var ig={},ag=100;ig.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},ig.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,i=0;i<t.length;i++)if(r=t[i],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r},ig.createGradientStyleFor=function(e,t,n,r,i){var a,o=this.usePaths(),s=n.pstyle(t+`-gradient-stop-colors`).value,c=n.pstyle(t+`-gradient-stop-positions`).pfValue;if(r===`radial-gradient`){if(n.isEdge()){var l=n.sourceEndpoint(),u=n.targetEndpoint(),d=n.midpoint(),f=Mi(l,d),p=Mi(u,d);a=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var m=o?{x:0,y:0}:n.position(),h=n.paddedWidth(),g=n.paddedHeight();a=e.createRadialGradient(m.x,m.y,0,m.x,m.y,Math.max(h,g))}}else if(n.isEdge()){var _=n.sourceEndpoint(),v=n.targetEndpoint();a=e.createLinearGradient(_.x,_.y,v.x,v.y)}else{var y=o?{x:0,y:0}:n.position(),b=n.paddedWidth(),x=n.paddedHeight(),S=b/2,C=x/2;switch(n.pstyle(`background-gradient-direction`).value){case`to-bottom`:a=e.createLinearGradient(y.x,y.y-C,y.x,y.y+C);break;case`to-top`:a=e.createLinearGradient(y.x,y.y+C,y.x,y.y-C);break;case`to-left`:a=e.createLinearGradient(y.x+S,y.y,y.x-S,y.y);break;case`to-right`:a=e.createLinearGradient(y.x-S,y.y,y.x+S,y.y);break;case`to-bottom-right`:case`to-right-bottom`:a=e.createLinearGradient(y.x-S,y.y-C,y.x+S,y.y+C);break;case`to-top-right`:case`to-right-top`:a=e.createLinearGradient(y.x-S,y.y+C,y.x+S,y.y-C);break;case`to-bottom-left`:case`to-left-bottom`:a=e.createLinearGradient(y.x+S,y.y-C,y.x-S,y.y+C);break;case`to-top-left`:case`to-left-top`:a=e.createLinearGradient(y.x+S,y.y+C,y.x-S,y.y-C)}}if(!a)return null;for(var w=c.length===s.length,T=s.length,E=0;E<T;E++)a.addColorStop(w?c[E]:E/(T-1),`rgba(`+s[E][0]+`,`+s[E][1]+`,`+s[E][2]+`,`+i+`)`);return a},ig.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,`background`,t,n,r);if(!i)return null;e.fillStyle=i},ig.colorFillStyle=function(e,t,n,r,i){e.fillStyle=`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`},ig.eleFillStyle=function(e,t,n){var r=t.pstyle(`background-fill`).value;if(r===`linear-gradient`||r===`radial-gradient`)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle(`background-color`).value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},ig.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,`line`,t,n,r);if(!i)return null;e.strokeStyle=i},ig.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle=`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`},ig.eleStrokeStyle=function(e,t,n){var r=t.pstyle(`line-fill`).value;if(r===`linear-gradient`||r===`radial-gradient`)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle(`line-color`).value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},ig.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],a=r[3],o=t.getPixelRatio(),s=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var c=i*o,l=a*o,u;if(c!==t.canvasWidth||l!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=i+`px`,d.style.height=a+`px`;for(var f=0;f<t.CANVAS_LAYERS;f++)u=n.canvases[f],u.width=c,u.height=l,u.style.width=i+`px`,u.style.height=a+`px`;for(var f=0;f<t.BUFFER_COUNT;f++)u=n.bufferCanvases[f],u.width=c,u.height=l,u.style.width=i+`px`,u.style.height=a+`px`;t.textureMult=1,o<=1&&(u=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,u.width=c*t.textureMult,u.height=l*t.textureMult),t.canvasWidth=c,t.canvasHeight=l,t.pixelRatio=o}},ig.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},ig.clearCanvas=function(){var e=this,t=e.data;function n(t){t.clearRect(0,0,e.canvasWidth,e.canvasHeight)}n(t.contexts[e.NODE]),n(t.contexts[e.DRAG])},ig.render=function(e){var t=this;e||=Lr();var n=t.cy,r=e.forcedContext,i=e.drawAllLayers,a=e.drawOnlyNodeLayer,o=e.forcedZoom,s=e.forcedPan,c=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,l=t.data,u=l.canvasNeedsRedraw,d=t.textureOnViewport&&!r&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),f=e.motionBlur===void 0?t.motionBlur:e.motionBlur,p=t.motionBlurPxRatio,m=n.hasCompoundNodes(),h=t.hoverData.draggingEles,g=!!(t.hoverData.selecting||t.touchData.selecting);f=f&&!r&&t.motionBlurEnabled&&!g;var _=f;r||(t.prevPxRatio!==c&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint(`eles`,!0),t.redrawHint(`drag`,!0)),t.prevPxRatio=c),!r&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),f&&(t.mbFrames??=0,t.mbFrames++,t.mbFrames<3&&(_=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!d&&(u[t.NODE]=!0,u[t.SELECT_BOX]=!0);var v=n.style(),y=n.zoom(),b=o===void 0?y:o,x=n.pan(),S={x:x.x,y:x.y},C={zoom:y,pan:{x:x.x,y:x.y}},w=t.prevViewport;w!==void 0&&C.zoom===w.zoom&&C.pan.x===w.pan.x&&C.pan.y===w.pan.y&&(!h||m)&&(t.motionBlurPxRatio=1),s&&(S=s),b*=c,S.x*=c,S.y*=c;var T=t.getCachedZSortedEles();function E(e,n,r,i,a){var o=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,t.colorFillStyle(e,255,255,255,t.motionBlurTransparency),e.fillRect(n,r,i,a),e.globalCompositeOperation=o}function D(e,n){var a,c,u,d;!t.clearingMotionBlur&&(e===l.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||e===l.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(a={x:x.x*p,y:x.y*p},c=y*p,u=t.canvasWidth*p,d=t.canvasHeight*p):(a=S,c=b,u=t.canvasWidth,d=t.canvasHeight),e.setTransform(1,0,0,1,0,0),n===`motionBlur`?E(e,0,0,u,d):!r&&(n===void 0||n)&&e.clearRect(0,0,u,d),i||(e.translate(a.x,a.y),e.scale(c,c)),s&&e.translate(s.x,s.y),o&&e.scale(o,o)}if(d||(t.textureDrawLastFrame=!1),d){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var O=t.data.bufferContexts[t.TEXTURE_BUFFER];O.setTransform(1,0,0,1,0,0),O.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:O,drawOnlyNodeLayer:!0,forcedPxRatio:c*t.textureMult});var C=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}u[t.DRAG]=!1,u[t.NODE]=!1;var k=l.contexts[t.NODE],A=t.textureCache.texture,C=t.textureCache.viewport;k.setTransform(1,0,0,1,0,0),f?E(k,0,0,C.width,C.height):k.clearRect(0,0,C.width,C.height);var j=v.core(`outside-texture-bg-color`).value,M=v.core(`outside-texture-bg-opacity`).value;t.colorFillStyle(k,j[0],j[1],j[2],M),k.fillRect(0,0,C.width,C.height);var y=n.zoom();D(k,!1),k.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/c,C.height/C.zoom/c),k.drawImage(A,C.mpan.x,C.mpan.y,C.width/C.zoom/c,C.height/C.zoom/c)}else t.textureOnViewport&&!r&&(t.textureCache=null);var N=n.extent(),P=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),F=t.hideEdgesOnViewport&&P,I=[];if(I[t.NODE]=!u[t.NODE]&&f&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,I[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),I[t.DRAG]=!u[t.DRAG]&&f&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,I[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),u[t.NODE]||i||a||I[t.NODE]){var L=f&&!I[t.NODE]&&p!==1,k=r||(L?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:l.contexts[t.NODE]);D(k,f&&!L?`motionBlur`:void 0),F?t.drawCachedNodes(k,T.nondrag,c,N):t.drawLayeredElements(k,T.nondrag,c,N),t.debug&&t.drawDebugPoints(k,T.nondrag),!i&&!f&&(u[t.NODE]=!1)}if(!a&&(u[t.DRAG]||i||I[t.DRAG])){var L=f&&!I[t.DRAG]&&p!==1,k=r||(L?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:l.contexts[t.DRAG]);D(k,f&&!L?`motionBlur`:void 0),F?t.drawCachedNodes(k,T.drag,c,N):t.drawCachedElements(k,T.drag,c,N),t.debug&&t.drawDebugPoints(k,T.drag),!i&&!f&&(u[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,D),f&&p!==1){var R=l.contexts[t.NODE],z=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],B=l.contexts[t.DRAG],V=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],H=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!_?e.clearRect(0,0,t.canvasWidth,t.canvasHeight):E(e,0,0,t.canvasWidth,t.canvasHeight);var i=p;e.drawImage(n,0,0,t.canvasWidth*i,t.canvasHeight*i,0,0,t.canvasWidth,t.canvasHeight)};(u[t.NODE]||I[t.NODE])&&(H(R,z,I[t.NODE]),u[t.NODE]=!1),(u[t.DRAG]||I[t.DRAG])&&(H(B,V,I[t.DRAG]),u[t.DRAG]=!1)}t.prevViewport=C,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),f&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!d,t.mbFrames=0,u[t.NODE]=!0,u[t.DRAG]=!0,t.redraw()},ag)),r||n.emit(`render`)};var og;ig.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,i=n.data,a=r.style(),o=e.drawOnlyNodeLayer,s=e.drawAllLayers,c=i.canvasNeedsRedraw,l=e.forcedContext;if(n.showFps||!o&&c[n.SELECT_BOX]&&!s){var u=l||i.contexts[n.SELECT_BOX];if(t(u),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var d=n.cy.zoom(),f=a.core(`selection-box-border-width`).value/d;u.lineWidth=f,u.fillStyle=`rgba(`+a.core(`selection-box-color`).value[0]+`,`+a.core(`selection-box-color`).value[1]+`,`+a.core(`selection-box-color`).value[2]+`,`+a.core(`selection-box-opacity`).value+`)`,u.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),f>0&&(u.strokeStyle=`rgba(`+a.core(`selection-box-border-color`).value[0]+`,`+a.core(`selection-box-border-color`).value[1]+`,`+a.core(`selection-box-border-color`).value[2]+`,`+a.core(`selection-box-opacity`).value+`)`,u.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){var d=n.cy.zoom(),p=i.bgActivePosistion;u.fillStyle=`rgba(`+a.core(`active-bg-color`).value[0]+`,`+a.core(`active-bg-color`).value[1]+`,`+a.core(`active-bg-color`).value[2]+`,`+a.core(`active-bg-opacity`).value+`)`,u.beginPath(),u.arc(p.x,p.y,a.core(`active-bg-size`).pfValue/d,0,2*Math.PI),u.fill()}var m=n.lastRedrawTime;if(n.showFps&&m){m=Math.round(m);var h=Math.round(1e3/m),g=`1 frame = `+m+` ms = `+h+` fps`;u.setTransform(1,0,0,1,0,0),u.fillStyle=`rgba(255, 0, 0, 0.75)`,u.strokeStyle=`rgba(255, 0, 0, 0.75)`,u.font=`30px Arial`,og||=u.measureText(g).actualBoundingBoxAscent,u.fillText(g,0,og),u.strokeRect(0,og+10,250,20),u.fillRect(0,og+10,250*Math.min(h/60,1),20)}s||(c[n.SELECT_BOX]=!1)}};function sg(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error(e.getShaderInfoLog(r));return r}function cg(e,t,n){var r=sg(e,e.VERTEX_SHADER,t),i=sg(e,e.FRAGMENT_SHADER,n),a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw Error(`Could not initialize shaders`);return a}function lg(e,t,n){n===void 0&&(n=t);var r=e.makeOffscreenCanvas(t,n),i=r.context=r.getContext(`2d`);return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function ug(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function dg(e){var t=e.pixelRatio;return e.cy.zoom()*t}function fg(e,t,n,r,i){var a=r*n+t.x,o=i*n+t.y;return o=Math.round(e.canvasHeight-o),[a,o]}function pg(e,t){return t.picking?!0:e.pstyle(`background-fill`).value!==`solid`||e.pstyle(`background-image`).strValue!==`none`?!1:e.pstyle(`border-width`).value===0||e.pstyle(`border-opacity`).value===0||e.pstyle(`border-style`).value===`solid`}function mg(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function hg(e,t,n){var r=e[0]/255,i=e[1]/255,a=e[2]/255,o=t,s=n||[,,,,];return s[0]=r*o,s[1]=i*o,s[2]=a*o,s[3]=o,s}function gg(e,t){var n=t||[,,,,];return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function _g(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function vg(e,t){var n=e.createTexture();return n.buffer=function(t){e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},n.deleteTexture=function(){e.deleteTexture(n)},n}function yg(e,t){switch(t){case`float`:return[1,e.FLOAT,4];case`vec2`:return[2,e.FLOAT,4];case`vec3`:return[3,e.FLOAT,4];case`vec4`:return[4,e.FLOAT,4];case`int`:return[1,e.INT,4];case`ivec2`:return[2,e.INT,4]}}function bg(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function xg(e,t,n,r,i,a){switch(t){case e.FLOAT:return new Float32Array(n.buffer,a*r,i);case e.INT:return new Int32Array(n.buffer,a*r,i)}}function Sg(e,t,n,r){var i=ct(yg(e,t),2),a=i[0],o=i[1],s=bg(e,o,r),c=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),o===e.FLOAT?e.vertexAttribPointer(n,a,o,!1,0,0):o===e.INT&&e.vertexAttribIPointer(n,a,o,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,null),c}function Cg(e,t,n,r){var i=ct(yg(e,n),3),a=i[0],o=i[1],s=i[2],c=bg(e,o,t*a),l=a*s,u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,t*l,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,a,o,!1,l,0):o===e.INT&&e.vertexAttribIPointer(r,a,o,l,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var d=Array(t),f=0;f<t;f++)d[f]=xg(e,o,c,l,a,f);return u.dataArray=c,u.stride=l,u.size=a,u.getView=function(e){return d[e]},u.setPoint=function(e,t,n){var r=d[e];r[0]=t,r[1]=n},u.bufferSubData=function(t){e.bindBuffer(e.ARRAY_BUFFER,u),t?e.bufferSubData(e.ARRAY_BUFFER,0,c,0,t*a):e.bufferSubData(e.ARRAY_BUFFER,0,c)},u}function wg(e,t,n){for(var r=9,i=new Float32Array(t*r),a=Array(t),o=0;o<t;o++){var s=o*r*4;a[o]=new Float32Array(i.buffer,s,r)}var c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,i.byteLength,e.DYNAMIC_DRAW);for(var l=0;l<3;l++){var u=n+l;e.enableVertexAttribArray(u),e.vertexAttribPointer(u,3,e.FLOAT,!1,36,l*12),e.vertexAttribDivisor(u,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),c.getMatrixView=function(e){return a[e]},c.setData=function(e,t){a[t].set(e,0)},c.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferSubData(e.ARRAY_BUFFER,0,i)},c}function Tg(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(t,r){e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}var Eg=typeof Float32Array<`u`?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function Dg(){var e=new Eg(9);return Eg!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Og(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function kg(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=n[0],p=n[1],m=n[2],h=n[3],g=n[4],_=n[5],v=n[6],y=n[7],b=n[8];return e[0]=f*r+p*o+m*l,e[1]=f*i+p*s+m*u,e[2]=f*a+p*c+m*d,e[3]=h*r+g*o+_*l,e[4]=h*i+g*s+_*u,e[5]=h*a+g*c+_*d,e[6]=v*r+y*o+b*l,e[7]=v*i+y*s+b*u,e[8]=v*a+y*c+b*d,e}function Ag(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=f*r+p*o+l,e[7]=f*i+p*s+u,e[8]=f*a+p*c+d,e}function jg(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=Math.sin(n),p=Math.cos(n);return e[0]=p*r+f*o,e[1]=p*i+f*s,e[2]=p*a+f*c,e[3]=p*o-f*r,e[4]=p*s-f*i,e[5]=p*c-f*a,e[6]=l,e[7]=u,e[8]=d,e}function Mg(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Ng(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}var Pg=function(){function e(t,n,r,i){$e(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(t,n,n),this.scratch=i(t,n,this.texHeight,`scratch`)}return tt(e,[{key:`lock`,value:function(){this.locked=!0}},{key:`getKeys`,value:function(){return new Set(this.keyToLocation.keys())}},{key:`getScale`,value:function(e){var t=e.w,n=e.h,r=this.texHeight,i=this.texSize,a=r/n,o=t*a,s=n*a;return o>i&&(a=i/t,o=t*a,s=n*a),{scale:a,texW:o,texH:s}}},{key:`draw`,value:function(e,t,n){var r=this;if(this.locked)throw Error(`can't draw, atlas is locked`);var i=this.texSize,a=this.texRows,o=this.texHeight,s=this.getScale(t),c=s.scale,l=s.texW,u=s.texH,d=function(e,r){if(n&&r){var i=r.context,a=e.x,s=e.row,l=a,u=o*s;i.save(),i.translate(l,u),i.scale(c,c),n(i,t),i.restore()}},f=[null,null],p=function(){d(r.freePointer,r.canvas),f[0]={x:r.freePointer.x,y:r.freePointer.row*o,w:l,h:u},f[1]={x:r.freePointer.x+l,y:r.freePointer.row*o,w:0,h:u},r.freePointer.x+=l,r.freePointer.x==i&&(r.freePointer.x=0,r.freePointer.row++)},m=function(){var e=r.scratch,t=r.canvas;e.clear(),d({x:0,row:0},e);var n=i-r.freePointer.x,a=l-n,s=o,c=r.freePointer.x,p=r.freePointer.row*o,m=n;t.context.drawImage(e,0,0,m,s,c,p,m,s),f[0]={x:c,y:p,w:m,h:u};var h=n,g=(r.freePointer.row+1)*o,_=a;t&&t.context.drawImage(e,h,0,_,s,0,g,_,s),f[1]={x:0,y:g,w:_,h:u},r.freePointer.x=a,r.freePointer.row++},h=function(){r.freePointer.x=0,r.freePointer.row++};if(this.freePointer.x+l<=i)p();else if(this.freePointer.row>=a-1)return!1;else this.freePointer.x===i?(h(),p()):this.enableWrapping?m():(h(),p());return this.keyToLocation.set(e,f),this.needsBuffer=!0,f}},{key:`getOffsets`,value:function(e){return this.keyToLocation.get(e)}},{key:`isEmpty`,value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:`canFit`,value:function(e){if(this.locked)return!1;var t=this.texSize,n=this.texRows,r=this.getScale(e).texW;return this.freePointer.x+r>t?this.freePointer.row<n-1:!0}},{key:`bufferIfNeeded`,value:function(e){this.texture||=vg(e,this.debugID),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:`dispose`,value:function(){this.texture&&=(this.texture.deleteTexture(),null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),Fg=function(){function e(t,n,r,i){$e(this,e),this.r=t,this.texSize=n,this.texRows=r,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return tt(e,[{key:`getKeys`,value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:`_createAtlas`,value:function(){var e=this.r,t=this.texSize,n=this.texRows,r=this.createTextureCanvas;return new Pg(e,t,n,r)}},{key:`_getScratchCanvas`,value:function(){if(!this.scratch){var e=this.r,t=this.texSize,n=this.texRows,r=this.createTextureCanvas,i=Math.floor(t/n);this.scratch=r(e,t,i,`scratch`)}return this.scratch}},{key:`draw`,value:function(e,t,n){var r=this.styleKeyToAtlas.get(e);return r||(r=this.atlases[this.atlases.length-1],(!r||!r.canFit(t))&&(r&&r.lock(),r=this._createAtlas(),this.atlases.push(r)),r.draw(e,t,n),this.styleKeyToAtlas.set(e,r)),r}},{key:`getAtlas`,value:function(e){return this.styleKeyToAtlas.get(e)}},{key:`hasAtlas`,value:function(e){return this.styleKeyToAtlas.has(e)}},{key:`markKeyForGC`,value:function(e){this.markedKeys.add(e)}},{key:`gc`,value:function(){var e=this,t=this.markedKeys;if(t.size===0){console.log(`nothing to garbage collect`);return}var n=[],r=new Map,i=null,a=nt(this.atlases),o;try{var s=function(){var a=o.value,s=a.getKeys(),c=Ig(t,s);if(c.size===0)return n.push(a),s.forEach(function(e){return r.set(e,a)}),1;i||(i=e._createAtlas(),n.push(i));var l=nt(s),u;try{for(l.s();!(u=l.n()).done;){var d=u.value;if(!c.has(d)){var f=ct(a.getOffsets(d),2),p=f[0],m=f[1];i.canFit({w:p.w+m.w,h:p.h})||(i.lock(),i=e._createAtlas(),n.push(i)),a.canvas&&(e._copyTextureToNewAtlas(d,a,i),r.set(d,i))}}}catch(e){l.e(e)}finally{l.f()}a.dispose()};for(a.s();!(o=a.n()).done;)if(s())continue}catch(e){a.e(e)}finally{a.f()}this.atlases=n,this.styleKeyToAtlas=r,this.markedKeys=new Set}},{key:`_copyTextureToNewAtlas`,value:function(e,t,n){var r=ct(t.getOffsets(e),2),i=r[0],a=r[1];if(a.w===0)n.draw(e,i,function(e){e.drawImage(t.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h)});else{var o=this._getScratchCanvas();o.clear(),o.context.drawImage(t.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h),o.context.drawImage(t.canvas,a.x,a.y,a.w,a.h,i.w,0,a.w,a.h);var s=i.w+a.w,c=i.h;n.draw(e,{w:s,h:c},function(e){e.drawImage(o,0,0,s,c,0,0,s,c)})}}},{key:`getCounts`,value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function Ig(e,t){return e.intersection?e.intersection(t):new Set(lt(e).filter(function(e){return t.has(e)}))}var Lg=function(){function e(t,n){$e(this,e),this.r=t,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return tt(e,[{key:`getAtlasSize`,value:function(){return this.atlasSize}},{key:`addAtlasCollection`,value:function(e,t){var n=this.globalOptions,r=n.webglTexSize,i=n.createTextureCanvas,a=t.texRows,o=this._cacheScratchCanvas(i),s=new Fg(this.r,r,a,o);this.collections.set(e,s)}},{key:`addRenderType`,value:function(e,t){var n=t.collection;if(!this.collections.has(n))throw Error(`invalid atlas collection name '${n}'`);var r=$t({type:e,atlasCollection:this.collections.get(n)},t);this.renderTypes.set(e,r)}},{key:`getRenderTypeOpts`,value:function(e){return this.renderTypes.get(e)}},{key:`getAtlasCollection`,value:function(e){return this.collections.get(e)}},{key:`_cacheScratchCanvas`,value:function(e){var t=-1,n=-1,r=null;return function(i,a,o,s){return s?((!r||a!=t||o!=n)&&(t=a,n=o,r=e(i,a,o)),r):e(i,a,o)}}},{key:`_key`,value:function(e,t){return`${e}-${t}`}},{key:`invalidate`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.forceRedraw,i=r!==void 0&&r,a=n.filterEle,o=a===void 0?function(){return!0}:a,s=n.filterType,c=s===void 0?function(){return!0}:s,l=!1,u=!1,d=nt(e),f;try{for(d.s();!(f=d.n()).done;){var p=f.value;if(o(p)){var m=nt(this.renderTypes.values()),h;try{var g=function(){var e=h.value,n=e.type;if(c(n)){var r=t.collections.get(e.collection),a=e.getKey(p),o=Array.isArray(a)?a:[a];if(i)o.forEach(function(e){return r.markKeyForGC(e)}),u=!0;else{var s=e.getID?e.getID(p):p.id(),d=t._key(n,s),f=t.typeAndIdToKey.get(d);f!==void 0&&!mg(o,f)&&(l=!0,t.typeAndIdToKey.delete(d),f.forEach(function(e){return r.markKeyForGC(e)}))}}};for(m.s();!(h=m.n()).done;)g()}catch(e){m.e(e)}finally{m.f()}}}}catch(e){d.e(e)}finally{d.f()}return u&&(this.gc(),l=!1),l}},{key:`gc`,value:function(){var e=nt(this.collections.values()),t;try{for(e.s();!(t=e.n()).done;)t.value.gc()}catch(t){e.e(t)}finally{e.f()}}},{key:`getOrCreateAtlas`,value:function(e,t,n,r){var i=this.renderTypes.get(t),a=this.collections.get(i.collection),o=!1,s=a.draw(r,n,function(t){i.drawClipped?(t.save(),t.beginPath(),t.rect(0,0,n.w,n.h),t.clip(),i.drawElement(t,e,n,!0,!0),t.restore()):i.drawElement(t,e,n,!0,!0),o=!0});if(o){var c=i.getID?i.getID(e):e.id(),l=this._key(t,c);this.typeAndIdToKey.has(l)?this.typeAndIdToKey.get(l).push(r):this.typeAndIdToKey.set(l,[r])}return s}},{key:`getAtlasInfo`,value:function(e,t){var n=this,r=this.renderTypes.get(t),i=r.getKey(e);return(Array.isArray(i)?i:[i]).map(function(i){var a=r.getBoundingBox(e,i),o=n.getOrCreateAtlas(e,t,a,i),s=ct(o.getOffsets(i),2),c=s[0];return{atlas:o,tex:c,tex1:c,tex2:s[1],bb:a}})}},{key:`getDebugInfo`,value:function(){var e=[],t=nt(this.collections),n;try{for(t.s();!(n=t.n()).done;){var r=ct(n.value,2),i=r[0],a=r[1].getCounts(),o=a.keyCount,s=a.atlasCount;e.push({type:i,keyCount:o,atlasCount:s})}}catch(e){t.e(e)}finally{t.f()}return e}}])}(),Rg=function(){function e(t){$e(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return tt(e,[{key:`getMaxAtlasesPerBatch`,value:function(){return this.maxAtlasesPerBatch}},{key:`getAtlasSize`,value:function(){return this.atlasSize}},{key:`getIndexArray`,value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(e,t){return t})}},{key:`startBatch`,value:function(){this.batchAtlases=[]}},{key:`getAtlasCount`,value:function(){return this.batchAtlases.length}},{key:`getAtlases`,value:function(){return this.batchAtlases}},{key:`canAddToCurrentBatch`,value:function(e){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(e)}},{key:`getAtlasIndexForBatch`,value:function(e){var t=this.batchAtlases.indexOf(e);if(t<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw Error(`cannot add more atlases to batch`);this.batchAtlases.push(e),t=this.batchAtlases.length-1}return t}}])}(),zg=`
|
|
17
|
+
float circleSD(vec2 p, float r) {
|
|
18
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
19
|
+
}
|
|
20
|
+
`,Bg=`
|
|
21
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
22
|
+
vec2 d = abs(p)-b;
|
|
23
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
24
|
+
}
|
|
25
|
+
`,Vg=`
|
|
26
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
27
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
28
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
29
|
+
vec2 q = abs(p) - b + cr.x;
|
|
30
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
31
|
+
}
|
|
32
|
+
`,Hg=`
|
|
33
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
34
|
+
p = abs( p ); // symmetry
|
|
35
|
+
|
|
36
|
+
// find root with Newton solver
|
|
37
|
+
vec2 q = ab*(p-ab);
|
|
38
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
39
|
+
for( int i=0; i<5; i++ ) {
|
|
40
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
41
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
42
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
43
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// compute final point and distance
|
|
47
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
48
|
+
|
|
49
|
+
// return signed distance
|
|
50
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
51
|
+
}
|
|
52
|
+
`,Ug={SCREEN:{name:`screen`,screen:!0},PICKING:{name:`picking`,picking:!0}},Wg={IGNORE:1,USE_BB:2},Gg=0,Kg=1,qg=2,Jg=3,Yg=4,Xg=5,Zg=6,Qg=7,$g=function(){function e(t,n,r){$e(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=lg,this.atlasManager=new Lg(t,r),this.batchManager=new Rg(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ug.SCREEN),this.pickingProgram=this._createShaderProgram(Ug.PICKING),this.vao=this._createVAO()}return tt(e,[{key:`addAtlasCollection`,value:function(e,t){this.atlasManager.addAtlasCollection(e,t)}},{key:`addTextureAtlasRenderType`,value:function(e,t){this.atlasManager.addRenderType(e,t)}},{key:`addSimpleShapeRenderType`,value:function(e,t){this.simpleShapeOptions.set(e,t)}},{key:`invalidate`,value:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=this.atlasManager;return t?n.invalidate(e,{filterType:function(e){return e===t},forceRedraw:!0}):n.invalidate(e)}},{key:`gc`,value:function(){this.atlasManager.gc()}},{key:`_createShaderProgram`,value:function(e){var t=this.gl,n=`#version 300 es
|
|
53
|
+
precision highp float;
|
|
54
|
+
|
|
55
|
+
uniform mat3 uPanZoomMatrix;
|
|
56
|
+
uniform int uAtlasSize;
|
|
57
|
+
|
|
58
|
+
// instanced
|
|
59
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
60
|
+
|
|
61
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
62
|
+
in int aVertType; // the type of thing we are rendering
|
|
63
|
+
|
|
64
|
+
// the z-index that is output when using picking mode
|
|
65
|
+
in vec4 aIndex;
|
|
66
|
+
|
|
67
|
+
// For textures
|
|
68
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
69
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
70
|
+
|
|
71
|
+
// for edges
|
|
72
|
+
in vec4 aPointAPointB;
|
|
73
|
+
in vec4 aPointCPointD;
|
|
74
|
+
in vec2 aLineWidth; // also used for node border width
|
|
75
|
+
|
|
76
|
+
// simple shapes
|
|
77
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
78
|
+
in vec4 aColor; // also used for edges
|
|
79
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
80
|
+
|
|
81
|
+
// output values passed to the fragment shader
|
|
82
|
+
out vec2 vTexCoord;
|
|
83
|
+
out vec4 vColor;
|
|
84
|
+
out vec2 vPosition;
|
|
85
|
+
// flat values are not interpolated
|
|
86
|
+
flat out int vAtlasId;
|
|
87
|
+
flat out int vVertType;
|
|
88
|
+
flat out vec2 vTopRight;
|
|
89
|
+
flat out vec2 vBotLeft;
|
|
90
|
+
flat out vec4 vCornerRadius;
|
|
91
|
+
flat out vec4 vBorderColor;
|
|
92
|
+
flat out vec2 vBorderWidth;
|
|
93
|
+
flat out vec4 vIndex;
|
|
94
|
+
|
|
95
|
+
void main(void) {
|
|
96
|
+
int vid = gl_VertexID;
|
|
97
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
98
|
+
|
|
99
|
+
if(aVertType == ${Gg}) {
|
|
100
|
+
float texX = aTex.x; // texture coordinates
|
|
101
|
+
float texY = aTex.y;
|
|
102
|
+
float texW = aTex.z;
|
|
103
|
+
float texH = aTex.w;
|
|
104
|
+
|
|
105
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
106
|
+
texX += texW;
|
|
107
|
+
}
|
|
108
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
109
|
+
texY += texH;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
float d = float(uAtlasSize);
|
|
113
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
114
|
+
|
|
115
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
116
|
+
}
|
|
117
|
+
else if(aVertType == ${Yg} || aVertType == ${Qg}
|
|
118
|
+
|| aVertType == ${Xg} || aVertType == ${Zg}) { // simple shapes
|
|
119
|
+
|
|
120
|
+
// the bounding box is needed by the fragment shader
|
|
121
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
122
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
123
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
124
|
+
|
|
125
|
+
// calculations are done in the fragment shader, just pass these along
|
|
126
|
+
vColor = aColor;
|
|
127
|
+
vCornerRadius = aCornerRadius;
|
|
128
|
+
vBorderColor = aBorderColor;
|
|
129
|
+
vBorderWidth = aLineWidth;
|
|
130
|
+
|
|
131
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
132
|
+
}
|
|
133
|
+
else if(aVertType == ${Kg}) {
|
|
134
|
+
vec2 source = aPointAPointB.xy;
|
|
135
|
+
vec2 target = aPointAPointB.zw;
|
|
136
|
+
|
|
137
|
+
// adjust the geometry so that the line is centered on the edge
|
|
138
|
+
position.y = position.y - 0.5;
|
|
139
|
+
|
|
140
|
+
// stretch the unit square into a long skinny rectangle
|
|
141
|
+
vec2 xBasis = target - source;
|
|
142
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
143
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
144
|
+
|
|
145
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
146
|
+
vColor = aColor;
|
|
147
|
+
}
|
|
148
|
+
else if(aVertType == ${qg}) {
|
|
149
|
+
vec2 pointA = aPointAPointB.xy;
|
|
150
|
+
vec2 pointB = aPointAPointB.zw;
|
|
151
|
+
vec2 pointC = aPointCPointD.xy;
|
|
152
|
+
vec2 pointD = aPointCPointD.zw;
|
|
153
|
+
|
|
154
|
+
// adjust the geometry so that the line is centered on the edge
|
|
155
|
+
position.y = position.y - 0.5;
|
|
156
|
+
|
|
157
|
+
vec2 p0, p1, p2, pos;
|
|
158
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
159
|
+
p0 = pointA;
|
|
160
|
+
p1 = pointB;
|
|
161
|
+
p2 = pointC;
|
|
162
|
+
pos = position;
|
|
163
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
164
|
+
p0 = pointD;
|
|
165
|
+
p1 = pointC;
|
|
166
|
+
p2 = pointB;
|
|
167
|
+
pos = vec2(0.0, -position.y);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
vec2 p01 = p1 - p0;
|
|
171
|
+
vec2 p12 = p2 - p1;
|
|
172
|
+
vec2 p21 = p1 - p2;
|
|
173
|
+
|
|
174
|
+
// Find the normal vector.
|
|
175
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
176
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
177
|
+
|
|
178
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
179
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
180
|
+
|
|
181
|
+
// Determine the bend direction.
|
|
182
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
183
|
+
float width = aLineWidth[0];
|
|
184
|
+
|
|
185
|
+
if(sign(pos.y) == -sigma) {
|
|
186
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
187
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
188
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
189
|
+
} else {
|
|
190
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
191
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
192
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
vColor = aColor;
|
|
196
|
+
}
|
|
197
|
+
else if(aVertType == ${Jg} && vid < 3) {
|
|
198
|
+
// massage the first triangle into an edge arrow
|
|
199
|
+
if(vid == 0)
|
|
200
|
+
position = vec2(-0.15, -0.3);
|
|
201
|
+
if(vid == 1)
|
|
202
|
+
position = vec2( 0.0, 0.0);
|
|
203
|
+
if(vid == 2)
|
|
204
|
+
position = vec2( 0.15, -0.3);
|
|
205
|
+
|
|
206
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
207
|
+
vColor = aColor;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
vAtlasId = aAtlasId;
|
|
214
|
+
vVertType = aVertType;
|
|
215
|
+
vIndex = aIndex;
|
|
216
|
+
}
|
|
217
|
+
`,r=this.batchManager.getIndexArray(),i=cg(t,n,`#version 300 es
|
|
218
|
+
precision highp float;
|
|
219
|
+
|
|
220
|
+
// declare texture unit for each texture atlas in the batch
|
|
221
|
+
${r.map(function(e){return`uniform sampler2D uTexture${e};`}).join(`
|
|
222
|
+
`)}
|
|
223
|
+
|
|
224
|
+
uniform vec4 uBGColor;
|
|
225
|
+
uniform float uZoom;
|
|
226
|
+
|
|
227
|
+
in vec2 vTexCoord;
|
|
228
|
+
in vec4 vColor;
|
|
229
|
+
in vec2 vPosition; // model coordinates
|
|
230
|
+
|
|
231
|
+
flat in int vAtlasId;
|
|
232
|
+
flat in vec4 vIndex;
|
|
233
|
+
flat in int vVertType;
|
|
234
|
+
flat in vec2 vTopRight;
|
|
235
|
+
flat in vec2 vBotLeft;
|
|
236
|
+
flat in vec4 vCornerRadius;
|
|
237
|
+
flat in vec4 vBorderColor;
|
|
238
|
+
flat in vec2 vBorderWidth;
|
|
239
|
+
|
|
240
|
+
out vec4 outColor;
|
|
241
|
+
|
|
242
|
+
${zg}
|
|
243
|
+
${Bg}
|
|
244
|
+
${Vg}
|
|
245
|
+
${Hg}
|
|
246
|
+
|
|
247
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
248
|
+
return vec4(
|
|
249
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
250
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
255
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
256
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
257
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
void main(void) {
|
|
261
|
+
if(vVertType == ${Gg}) {
|
|
262
|
+
// look up the texel from the texture unit
|
|
263
|
+
${r.map(function(e){return`if(vAtlasId == ${e}) outColor = texture(uTexture${e}, vTexCoord);`}).join(`
|
|
264
|
+
else `)}
|
|
265
|
+
}
|
|
266
|
+
else if(vVertType == ${Jg}) {
|
|
267
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
268
|
+
outColor = blend(vColor, uBGColor);
|
|
269
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
270
|
+
}
|
|
271
|
+
else if(vVertType == ${Yg} && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
272
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
273
|
+
}
|
|
274
|
+
else if(vVertType == ${Yg} || vVertType == ${Qg}
|
|
275
|
+
|| vVertType == ${Xg} || vVertType == ${Zg}) { // use SDF
|
|
276
|
+
|
|
277
|
+
float outerBorder = vBorderWidth[0];
|
|
278
|
+
float innerBorder = vBorderWidth[1];
|
|
279
|
+
float borderPadding = outerBorder * 2.0;
|
|
280
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
281
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
282
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
283
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
284
|
+
|
|
285
|
+
float d; // signed distance
|
|
286
|
+
if(vVertType == ${Yg}) {
|
|
287
|
+
d = rectangleSD(p, b);
|
|
288
|
+
} else if(vVertType == ${Qg} && w == h) {
|
|
289
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
290
|
+
} else if(vVertType == ${Qg}) {
|
|
291
|
+
d = ellipseSD(p, b);
|
|
292
|
+
} else {
|
|
293
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
297
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
298
|
+
if(d > 0.0) {
|
|
299
|
+
if(d > outerBorder) {
|
|
300
|
+
discard;
|
|
301
|
+
} else {
|
|
302
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
if(d > innerBorder) {
|
|
306
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
307
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
308
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
vec4 outerColor;
|
|
312
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
313
|
+
outerColor = vec4(0);
|
|
314
|
+
} else if(innerBorder == 0.0) {
|
|
315
|
+
outerColor = vBorderColor;
|
|
316
|
+
} else {
|
|
317
|
+
outerColor = blend(vBorderColor, vColor);
|
|
318
|
+
}
|
|
319
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
outColor = vColor;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
${e.picking?`if(outColor.a == 0.0) discard;
|
|
328
|
+
else outColor = vIndex;`:``}
|
|
329
|
+
}
|
|
330
|
+
`);i.aPosition=t.getAttribLocation(i,`aPosition`),i.aIndex=t.getAttribLocation(i,`aIndex`),i.aVertType=t.getAttribLocation(i,`aVertType`),i.aTransform=t.getAttribLocation(i,`aTransform`),i.aAtlasId=t.getAttribLocation(i,`aAtlasId`),i.aTex=t.getAttribLocation(i,`aTex`),i.aPointAPointB=t.getAttribLocation(i,`aPointAPointB`),i.aPointCPointD=t.getAttribLocation(i,`aPointCPointD`),i.aLineWidth=t.getAttribLocation(i,`aLineWidth`),i.aColor=t.getAttribLocation(i,`aColor`),i.aCornerRadius=t.getAttribLocation(i,`aCornerRadius`),i.aBorderColor=t.getAttribLocation(i,`aBorderColor`),i.uPanZoomMatrix=t.getUniformLocation(i,`uPanZoomMatrix`),i.uAtlasSize=t.getUniformLocation(i,`uAtlasSize`),i.uBGColor=t.getUniformLocation(i,`uBGColor`),i.uZoom=t.getUniformLocation(i,`uZoom`),i.uTextures=[];for(var a=0;a<this.batchManager.getMaxAtlasesPerBatch();a++)i.uTextures.push(t.getUniformLocation(i,`uTexture${a}`));return i}},{key:`_createVAO`,value:function(){var e=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=e.length/2;var t=this.maxInstances,n=this.gl,r=this.program,i=n.createVertexArray();return n.bindVertexArray(i),Sg(n,`vec2`,r.aPosition,e),this.transformBuffer=wg(n,t,r.aTransform),this.indexBuffer=Cg(n,t,`vec4`,r.aIndex),this.vertTypeBuffer=Cg(n,t,`int`,r.aVertType),this.atlasIdBuffer=Cg(n,t,`int`,r.aAtlasId),this.texBuffer=Cg(n,t,`vec4`,r.aTex),this.pointAPointBBuffer=Cg(n,t,`vec4`,r.aPointAPointB),this.pointCPointDBuffer=Cg(n,t,`vec4`,r.aPointCPointD),this.lineWidthBuffer=Cg(n,t,`vec2`,r.aLineWidth),this.colorBuffer=Cg(n,t,`vec4`,r.aColor),this.cornerRadiusBuffer=Cg(n,t,`vec4`,r.aCornerRadius),this.borderColorBuffer=Cg(n,t,`vec4`,r.aBorderColor),n.bindVertexArray(null),i}},{key:`buffers`,get:function(){var e=this;return this._buffers||=Object.keys(this).filter(function(e){return Ut(e,`Buffer`)}).map(function(t){return e[t]}),this._buffers}},{key:`startFrame`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ug.SCREEN;this.panZoomMatrix=e,this.renderTarget=t,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:`startBatch`,value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:`endFrame`,value:function(){this.endBatch()}},{key:`_isVisible`,value:function(e,t){return e.visible()?t&&t.isVisible?t.isVisible(e):!0:!1}},{key:`drawTexture`,value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&(!e.isEdge()||this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(o===Wg.IGNORE)return;if(o==Wg.USE_BB){this.drawPickingRectangle(e,t,n);return}}var s=nt(r.getAtlasInfo(e,n)),c;try{for(s.s();!(c=s.n()).done;){var l=c.value,u=l.atlas,d=l.tex1,f=l.tex2;i.canAddToCurrentBatch(u)||this.endBatch();for(var p=i.getAtlasIndexForBatch(u),m=0,h=[[d,!0],[f,!1]];m<h.length;m++){var g=ct(h[m],2),_=g[0],v=g[1];if(_.w!=0){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=Gg,gg(t,this.indexBuffer.getView(y));var b=this.atlasIdBuffer.getView(y);b[0]=p;var x=this.texBuffer.getView(y);x[0]=_.x,x[1]=_.y,x[2]=_.w,x[3]=_.h;var S=this.transformBuffer.getMatrixView(y);this.setTransformMatrix(e,S,a,l,v),this.instanceCount++,v||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(e){s.e(e)}finally{s.f()}}}},{key:`setTransformMatrix`,value:function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var o=r.bb,s=r.tex1,c=r.tex2,l=s.w/(s.w+c.w);i||(l=1-l);var u=this._getAdjustedBB(o,a,i,l);this._applyTransformMatrix(t,u,n,e)}else{var d=n.getBoundingBox(e),f=this._getAdjustedBB(d,a,!0,1);this._applyTransformMatrix(t,f,n,e)}}},{key:`_applyTransformMatrix`,value:function(e,t,n,r){var i,a;Og(e);var o=n.getRotation?n.getRotation(r):0;if(o!==0){var s=n.getRotationPoint(r),c=s.x,l=s.y;Ag(e,e,[c,l]),jg(e,e,o);var u=n.getRotationOffset(r);i=u.x+(t.xOffset||0),a=u.y+(t.yOffset||0)}else i=t.x1,a=t.y1;Ag(e,e,[i,a]),Mg(e,e,[t.w,t.h])}},{key:`_getAdjustedBB`,value:function(e,t,n,r){var i=e.x1,a=e.y1,o=e.w,s=e.h,c=e.yOffset;t&&(i-=t,a-=t,o+=2*t,s+=2*t);var l=0,u=o*r;return n&&r<1?o=u:!n&&r<1&&(l=o-u,i+=l,o=u),{x1:i,y1:a,w:o,h:s,xOffset:l,yOffset:c}}},{key:`drawPickingRectangle`,value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=Yg,gg(t,this.indexBuffer.getView(i)),hg([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:`drawNode`,value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(a===void 0||r.isSimple&&!r.isSimple(e,this.renderTarget)){this.drawTexture(e,t,n);return}var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,a===Xg||a===Zg){var s=r.getBoundingBox(e),c=this._getCornerRadius(e,i.radius,s),l=this.cornerRadiusBuffer.getView(o);l[0]=c,l[1]=c,l[2]=c,l[3]=c,a===Zg&&(l[0]=0,l[2]=0)}gg(t,this.indexBuffer.getView(o));var u=this.renderTarget.picking?1:n===`node-body`?e.effectiveOpacity():1,d=this.renderTarget.picking?1:e.pstyle(i.opacity).value*u,f=e.pstyle(i.color).value;hg(f,d,this.colorBuffer.getView(o));var p=this.lineWidthBuffer.getView(o);if(p[0]=0,p[1]=0,i.border){var m=e.pstyle(`border-width`).value;if(m>0){var h=e.pstyle(`border-color`).value;hg(h,u*e.pstyle(`border-opacity`).value,this.borderColorBuffer.getView(o));var g=e.pstyle(`border-position`).value;if(g===`inside`)p[0]=0,p[1]=-m;else if(g===`outside`)p[0]=m,p[1]=0;else{var _=m/2;p[0]=_,p[1]=-_}}}var v=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,v,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:`_getVertTypeForShape`,value:function(e,t){switch(e.pstyle(t).value){case`rectangle`:return Yg;case`ellipse`:return Qg;case`roundrectangle`:case`round-rectangle`:return Xg;case`bottom-round-rectangle`:return Zg;default:return}}},{key:`_getCornerRadius`,value:function(e,t,n){var r=n.w,i=n.h;if(e.pstyle(t).value===`auto`)return wa(r,i);var a=e.pstyle(t).pfValue,o=r/2,s=i/2;return Math.min(a,s,o)}},{key:`drawEdgeArrow`,value:function(e,t,n){if(e.visible()){var r=e._private.rscratch,i,a,o;if(n===`source`?(i=r.arrowStartX,a=r.arrowStartY,o=r.srcArrowAngle):(i=r.arrowEndX,a=r.arrowEndY,o=r.tgtArrowAngle),!(isNaN(i)||i==null||isNaN(a)||a==null||isNaN(o)||o==null)&&e.pstyle(n+`-arrow-shape`).value!==`none`){var s=e.pstyle(n+`-arrow-color`).value,c=e.pstyle(`opacity`).value*e.pstyle(`line-opacity`).value,l=e.pstyle(`width`).pfValue,u=e.pstyle(`arrow-scale`).value,d=this.r.getArrowWidth(l,u),f=this.instanceCount,p=this.transformBuffer.getMatrixView(f);Og(p),Ag(p,p,[i,a]),Mg(p,p,[d,d]),jg(p,p,o),this.vertTypeBuffer.getView(f)[0]=Jg,gg(t,this.indexBuffer.getView(f)),hg(s,c,this.colorBuffer.getView(f)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:`drawEdgeLine`,value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle(`opacity`).value,i=e.pstyle(`line-opacity`).value,a=e.pstyle(`width`).pfValue,o=e.pstyle(`line-color`).value,s=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=Kg,gg(t,this.indexBuffer.getView(c)),hg(o,s,this.colorBuffer.getView(c));var l=this.lineWidthBuffer.getView(c);l[0]=a;var u=this.pointAPointBBuffer.getView(c);u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var d=0;d<n.length-2;d+=2){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=qg,gg(t,this.indexBuffer.getView(f)),hg(o,s,this.colorBuffer.getView(f));var p=this.lineWidthBuffer.getView(f);p[0]=a;var m=n[d-2],h=n[d-1],g=n[d],_=n[d+1],v=n[d+2],y=n[d+3],b=n[d+4],x=n[d+5];d==0&&(m=2*g-v+.001,h=2*_-y+.001),d==n.length-4&&(b=2*v-g+.001,x=2*y-_+.001);var S=this.pointAPointBBuffer.getView(f);S[0]=m,S[1]=h,S[2]=g,S[3]=_;var C=this.pointCPointDBuffer.getView(f);C[0]=v,C[1]=y,C[2]=b,C[3]=x,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:`_isValidEdge`,value:function(e){var t=e._private.rscratch;return!(t.badLine||t.allpts==null||isNaN(t.allpts[0]))}},{key:`_getEdgePoints`,value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(n.length==4)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:`_getNumSegments`,value:function(e){return Math.min(15,this.maxInstances)}},{key:`_getCurveSegmentPoints`,value:function(e,t){if(e.length==4)return e;for(var n=Array((t+1)*2),r=0;r<=t;r++)if(r==0)n[0]=e[0],n[1]=e[1];else if(r==t)n[r*2]=e[e.length-2],n[r*2+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,r*2)}return n}},{key:`_setCurvePoint`,value:function(e,t,n,r){if(e.length<=2)n[r]=e[0],n[r+1]=e[1];else{for(var i=Array(e.length-2),a=0;a<i.length;a+=2){var o=(1-t)*e[a]+t*e[a+2],s=(1-t)*e[a+1]+t*e[a+3];i[a]=o,i[a+1]=s}return this._setCurvePoint(i,t,n,r)}}},{key:`endBatch`,value:function(){var e=this.gl,t=this.vao,n=this.vertexCount,r=this.instanceCount;if(r!==0){var i=this.renderTarget.picking?this.pickingProgram:this.program;e.useProgram(i),e.bindVertexArray(t);var a=nt(this.buffers),o;try{for(a.s();!(o=a.n()).done;)o.value.bufferSubData(r)}catch(e){a.e(e)}finally{a.f()}for(var s=this.batchManager.getAtlases(),c=0;c<s.length;c++)s[c].bufferIfNeeded(e);for(var l=0;l<s.length;l++)e.activeTexture(e.TEXTURE0+l),e.bindTexture(e.TEXTURE_2D,s[l].texture),e.uniform1i(i.uTextures[l],l);e.uniform1f(i.uZoom,dg(this.r)),e.uniformMatrix3fv(i.uPanZoomMatrix,!1,this.panZoomMatrix),e.uniform1i(i.uAtlasSize,this.batchManager.getAtlasSize());var u=hg(this.bgColor,1);e.uniform4fv(i.uBGColor,u),e.drawArraysInstanced(e.TRIANGLES,0,n,r),e.bindVertexArray(null),e.bindTexture(e.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:r,atlasCount:s.length}),this.startBatch()}}},{key:`getDebugInfo`,value:function(){var e=this.atlasManager.getDebugInfo(),t=e.reduce(function(e,t){return e+t.atlasCount},0),n=this.batchDebugInfo,r=n.reduce(function(e,t){return e+t.count},0);return{atlasInfo:e,totalAtlases:t,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:r}}}])}(),e_={};e_.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=t_(n),e.webglTexSize=Math.min(e.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=e.webglDebug,n.webglDebugShowAtlases=e.webglDebugShowAtlases,n.pickingFrameBuffer=Tg(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new $g(n,r,e);var i=function(e){return function(t){return n.getTextAngle(t,e)}},a=function(e){return function(t){var n=t.pstyle(e);return n&&n.value}},o=function(e){return function(t){return t.pstyle(`${e}-opacity`).value>0}},s=function(e){return e.pstyle(`text-events`).strValue===`yes`?Wg.USE_BB:Wg.IGNORE},c=function(e){var t=e.position(),n=t.x,r=t.y,i=e.outerWidth(),a=e.outerHeight();return{w:i,h:a,x1:n-i/2,y1:r-a/2}};n.drawing.addAtlasCollection(`node`,{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection(`label`,{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType(`node-body`,{collection:`node`,getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType(`node-body`,{getBoundingBox:c,isSimple:pg,shapeProps:{shape:`shape`,color:`background-color`,opacity:`background-opacity`,radius:`corner-radius`,border:!0}}),n.drawing.addSimpleShapeRenderType(`node-overlay`,{getBoundingBox:c,isVisible:o(`overlay`),shapeProps:{shape:`overlay-shape`,color:`overlay-color`,opacity:`overlay-opacity`,padding:`overlay-padding`,radius:`overlay-corner-radius`}}),n.drawing.addSimpleShapeRenderType(`node-underlay`,{getBoundingBox:c,isVisible:o(`underlay`),shapeProps:{shape:`underlay-shape`,color:`underlay-color`,opacity:`underlay-opacity`,padding:`underlay-padding`,radius:`underlay-corner-radius`}}),n.drawing.addTextureAtlasRenderType(`label`,{collection:`label`,getTexPickingMode:s,getKey:r_(t.getLabelKey,null),getBoundingBox:i_(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:a(`label`)}),n.drawing.addTextureAtlasRenderType(`edge-source-label`,{collection:`label`,getTexPickingMode:s,getKey:r_(t.getSourceLabelKey,`source`),getBoundingBox:i_(t.getSourceLabelBox,`source`),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:i(`source`),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:a(`source-label`)}),n.drawing.addTextureAtlasRenderType(`edge-target-label`,{collection:`label`,getTexPickingMode:s,getKey:r_(t.getTargetLabelKey,`target`),getBoundingBox:i_(t.getTargetLabelBox,`target`),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:i(`target`),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:a(`target-label`)});var l=$n(function(){console.log(`garbage collect flag set`),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(e,t){var r=!1;t&&t.length>0&&(r|=n.drawing.invalidate(t)),r&&l()}),a_(n)};function t_(e){var t=e.cy.container();return an(t&&t.style&&t.style.backgroundColor||`white`)}function n_(e,t){var n=e._private.rscratch;return Hr(n,`labelWrapCachedLines`,t)||[]}var r_=function(e,t){return function(n){var r=e(n),i=n_(n,t);return i.length>1?i.map(function(e,t){return`${r}_${t}`}):r}},i_=function(e,t){return function(n,r){var i=e(n);if(typeof r==`string`){var a=r.indexOf(`_`);if(a>0){var o=Number(r.substring(a+1)),s=n_(n,t),c=i.h/s.length,l=c*o,u=i.y1+l;return{x1:i.x1,w:i.w,y1:u,h:c,yOffset:l}}}return i}};function a_(e){var t=e.render;e.render=function(n){n||={};var r=e.cy;e.webgl&&(r.zoom()>$m?(o_(e),t.call(e,n)):(s_(e),g_(e,n,Ug.SCREEN)))};var n=e.matchCanvasSize;e.matchCanvasSize=function(t){n.call(e,t),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0},e.findNearestElements=function(t,n,r,i){return m_(e,t,n)};var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0};var i=e.notify;e.notify=function(t,n){i.call(e,t,n),t===`viewport`||t===`bounds`?e.pickingFrameBuffer.needsDraw=!0:t===`background`&&e.drawing.invalidate(n,{type:`node-body`})}}function o_(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function s_(e){var t=function(t){t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.canvasWidth,e.canvasHeight),t.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function c_(e){var t=e.canvasWidth,n=e.canvasHeight,r=ug(e),i=r.pan,a=r.zoom,o=Dg();Ag(o,o,[i.x,i.y]),Mg(o,o,[a,a]);var s=Dg();Ng(s,t,n);var c=Dg();return kg(c,s,o),c}function l_(e,t){var n=e.canvasWidth,r=e.canvasHeight,i=ug(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(a.x,a.y),t.scale(o,o)}function u_(e,t){e.drawSelectionRectangle(t,function(t){return l_(e,t)})}function d_(e){var t=e.data.contexts[e.NODE];t.save(),l_(e,t),t.strokeStyle=`rgba(0, 0, 0, 0.3)`,t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function f_(e){var t=function(t,n,r){for(var i=t.atlasManager.getAtlasCollection(n),a=e.data.contexts[e.NODE],o=i.atlases,s=0;s<o.length;s++){var c=o[s].canvas;if(c){var l=c.width,u=c.height,d=l*s,f=c.height*r,p=.4;a.save(),a.scale(p,p),a.drawImage(c,d,f),a.strokeStyle=`black`,a.rect(d,f,l,u),a.stroke(),a.restore()}}},n=0;t(e.drawing,`node`,n++),t(e.drawing,`label`,n++)}function p_(e,t,n,r,i){var a,o,s,c,l=ug(e),u=l.pan,d=l.zoom,f=ct(fg(e,u,d,t,n),2),p=f[0],m=f[1],h=6;if(a=p-h/2,o=m-h/2,s=h,c=h,s===0||c===0)return[];var g=e.data.contexts[e.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),g_(e,null,Ug.PICKING),e.pickingFrameBuffer.needsDraw=!1);var _=s*c,v=new Uint8Array(_*4);g.readPixels(a,o,s,c,g.RGBA,g.UNSIGNED_BYTE,v),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var y=new Set,b=0;b<_;b++){var x=_g(v.slice(b*4,b*4+4))-1;x>=0&&y.add(x)}return y}function m_(e,t,n){var r=p_(e,t,n),i=e.getCachedZSortedEles(),a,o,s=nt(r),c;try{for(s.s();!(c=s.n()).done;){var l=i[c.value];if(!a&&l.isNode()&&(a=l),!o&&l.isEdge()&&(o=l),a&&o)break}}catch(e){s.e(e)}finally{s.f()}return[a,o].filter(Boolean)}function h_(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,`node-underlay`),r.drawNode(n,t,`node-body`),r.drawTexture(n,t,`label`),r.drawNode(n,t,`node-overlay`)):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,`source`),r.drawEdgeArrow(n,t,`target`),r.drawTexture(n,t,`label`),r.drawTexture(n,t,`edge-source-label`),r.drawTexture(n,t,`edge-target-label`))}function g_(e,t,n){var r;e.webglDebug&&(r=performance.now());var i=e.drawing,a=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&u_(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var o=e.data.contexts[e.WEBGL];n.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=c_(e),c=e.getCachedZSortedEles();if(a=c.length,i.startFrame(s,n),n.screen){for(var l=0;l<c.nondrag.length;l++)h_(e,l,c.nondrag[l]);for(var u=0;u<c.drag.length;u++)h_(e,u,c.drag[u])}else if(n.picking)for(var d=0;d<c.length;d++)h_(e,d,c[d]);i.endFrame(),n.screen&&e.webglDebugShowAtlases&&(d_(e),f_(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var f=performance.now(),p=Math.ceil(f-r),m=i.getDebugInfo(),h=[`${a} elements`,`${m.totalInstances} instances`,`${m.batchCount} batches`,`${m.totalAtlases} atlases`,`${m.wrappedCount} wrapped textures`,`${m.simpleCount} simple shapes`].join(`, `);console.log(`WebGL (${n.name}) - frame time ${p}ms`),console.log(`Totals:`),console.log(` ${h}`),console.log(`Texture Atlases Used:`);var g=m.atlasInfo,_=nt(g),v;try{for(_.s();!(v=_.n()).done;){var y=v.value;console.log(` ${y.type}: ${y.keyCount} keys, ${y.atlasCount} atlases`)}}catch(e){_.e(e)}finally{_.f()}console.log(``)}e.data.gc&&(console.log(`Garbage Collect!`),e.data.gc=!1,i.gc())}var __={};__.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var c=1;c<a.length/2;c++)e.lineTo(t+o*a[c*2],n+s*a[c*2+1]);e.closePath()},__.drawRoundPolygonPath=function(e,t,n,r,i,a,o){o.forEach(function(t){return _m(e,t)}),e.closePath()},__.drawRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,s=i/2,c=a===`auto`?wa(r,i):Math.min(a,s,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.arcTo(t+o,n-s,t+o,n,c),e.arcTo(t+o,n+s,t,n+s,c),e.arcTo(t-o,n+s,t-o,n,c),e.arcTo(t-o,n-s,t,n-s,c),e.lineTo(t,n-s),e.closePath()},__.drawBottomRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,s=i/2,c=a===`auto`?wa(r,i):a;e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.lineTo(t+o,n-s),e.lineTo(t+o,n),e.arcTo(t+o,n+s,t,n+s,c),e.arcTo(t-o,n+s,t-o,n,c),e.lineTo(t-o,n-s),e.lineTo(t,n-s),e.closePath()},__.drawCutRectanglePath=function(e,t,n,r,i,a,o){var s=r/2,c=i/2,l=o===`auto`?Ea():o;e.beginPath&&e.beginPath(),e.moveTo(t-s+l,n-c),e.lineTo(t+s-l,n-c),e.lineTo(t+s,n-c+l),e.lineTo(t+s,n+c-l),e.lineTo(t+s-l,n+c),e.lineTo(t-s+l,n+c),e.lineTo(t-s,n+c-l),e.lineTo(t-s,n-c+l),e.closePath()},__.drawBarrelPath=function(e,t,n,r,i){var a=r/2,o=i/2,s=t-a,c=t+a,l=n-o,u=n+o,d=Oa(r,i),f=d.widthOffset,p=d.heightOffset,m=d.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(s,l+p),e.lineTo(s,u-p),e.quadraticCurveTo(s+m,u,s+f,u),e.lineTo(c-f,u),e.quadraticCurveTo(c-m,u,c,u-p),e.lineTo(c,l+p),e.quadraticCurveTo(c-m,l,c-f,l),e.lineTo(s+f,l),e.quadraticCurveTo(s+m,l,s,l+p),e.closePath()};for(var v_=Math.sin(0),y_=Math.cos(0),b_={},x_={},S_=Math.PI/40,C_=0*Math.PI;C_<2*Math.PI;C_+=S_)b_[C_]=Math.sin(C_),x_[C_]=Math.cos(C_);__.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,s=r/2,c=i/2,l=0*Math.PI;l<2*Math.PI;l+=S_)a=t-s*b_[l]*v_+s*x_[l]*y_,o=n+c*x_[l]*v_+c*b_[l]*y_,l===0?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var w_={};w_.createBuffer=function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,[n,n.getContext(`2d`)]},w_.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=Q(e.maxWidth)||Q(e.maxHeight),s=this.getPixelRatio(),c=1;if(e.scale!==void 0)i*=e.scale,a*=e.scale,c=e.scale;else if(o){var l=1/0,u=1/0;Q(e.maxWidth)&&(l=c*e.maxWidth/i),Q(e.maxHeight)&&(u=c*e.maxHeight/a),c=Math.min(l,u),i*=c,a*=c}o||(i*=s,a*=s,c*=s);var d=document.createElement(`canvas`);d.width=i,d.height=a,d.style.width=i+`px`,d.style.height=a+`px`;var f=d.getContext(`2d`);if(i>0&&a>0){f.clearRect(0,0,i,a),f.globalCompositeOperation=`source-over`;var p=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*c,-n.y1*c),f.scale(c,c),this.drawElements(f,p),f.scale(1/c,1/c),f.translate(n.x1*c,n.y1*c);else{var m=t.pan(),h={x:m.x*c,y:m.y*c};c*=t.zoom(),f.translate(h.x,h.y),f.scale(c,c),this.drawElements(f,p),f.scale(1/c,1/c),f.translate(-h.x,-h.y)}e.bg&&(f.globalCompositeOperation=`destination-over`,f.fillStyle=e.bg,f.rect(0,0,i,a),f.fill())}return d};function T_(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}function E_(e){var t=e.indexOf(`,`);return e.substr(t+1)}function D_(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case`blob-promise`:return new os(function(r,i){try{t.toBlob(function(e){e==null?i(Error("`canvas.toBlob()` sent a null value in its callback")):r(e)},n,e.quality)}catch(e){i(e)}});case`blob`:return T_(E_(r()),n);case`base64`:return E_(r());default:return r()}}w_.png=function(e){return D_(e,this.bufferCanvasImage(e),`image/png`)},w_.jpg=function(e){return D_(e,this.bufferCanvasImage(e),`image/jpeg`)};var O_={};O_.nodeShapeImpl=function(e,t,n,r,i,a,o,s){switch(e){case`ellipse`:return this.drawEllipsePath(t,n,r,i,a);case`polygon`:return this.drawPolygonPath(t,n,r,i,a,o);case`round-polygon`:return this.drawRoundPolygonPath(t,n,r,i,a,o,s);case`roundrectangle`:case`round-rectangle`:return this.drawRoundRectanglePath(t,n,r,i,a,s);case`cutrectangle`:case`cut-rectangle`:return this.drawCutRectanglePath(t,n,r,i,a,o,s);case`bottomroundrectangle`:case`bottom-round-rectangle`:return this.drawBottomRoundRectanglePath(t,n,r,i,a,s);case`barrel`:return this.drawBarrelPath(t,n,r,i,a)}};var k_=j_,A_=j_.prototype;A_.CANVAS_LAYERS=3,A_.SELECT_BOX=0,A_.DRAG=1,A_.NODE=2,A_.WEBGL=3,A_.CANVAS_TYPES=[`2d`,`2d`,`2d`,`webgl2`],A_.BUFFER_COUNT=3,A_.TEXTURE_BUFFER=0,A_.MOTIONBLUR_BUFFER_NODE=1,A_.MOTIONBLUR_BUFFER_DRAG=2;function j_(e){var t=this,n=t.cy.window().document;e.webgl&&(A_.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log(`webgl rendering enabled`)),t.data={canvases:Array(A_.CANVAS_LAYERS),contexts:Array(A_.CANVAS_LAYERS),canvasNeedsRedraw:Array(A_.CANVAS_LAYERS),bufferCanvases:Array(A_.BUFFER_COUNT),bufferContexts:Array(A_.CANVAS_LAYERS)};var r=`-webkit-tap-highlight-color`,i=`rgba(0,0,0,0)`;t.data.canvasContainer=n.createElement(`div`);var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position=`relative`,a.zIndex=`0`,a.overflow=`hidden`;var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var s={"-webkit-user-select":`none`,"-moz-user-select":`-moz-none`,"user-select":`none`,"-webkit-tap-highlight-color":`rgba(0,0,0,0)`,"outline-style":`none`};Lt()&&(s[`-ms-touch-action`]=`none`,s[`touch-action`]=`none`);for(var c=0;c<A_.CANVAS_LAYERS;c++){var l=t.data.canvases[c]=n.createElement(`canvas`),u=A_.CANVAS_TYPES[c];t.data.contexts[c]=l.getContext(u),t.data.contexts[c]||kr(`Could not create canvas of type `+u),Object.keys(s).forEach(function(e){l.style[e]=s[e]}),l.style.position=`absolute`,l.setAttribute(`data-id`,`layer`+c),l.style.zIndex=String(A_.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[A_.NODE].setAttribute(`data-id`,`layer`+A_.NODE+`-node`),t.data.canvases[A_.SELECT_BOX].setAttribute(`data-id`,`layer`+A_.SELECT_BOX+`-selectbox`),t.data.canvases[A_.DRAG].setAttribute(`data-id`,`layer`+A_.DRAG+`-drag`),t.data.canvases[A_.WEBGL]&&t.data.canvases[A_.WEBGL].setAttribute(`data-id`,`layer`+A_.WEBGL+`-webgl`);for(var c=0;c<A_.BUFFER_COUNT;c++)t.data.bufferCanvases[c]=n.createElement(`canvas`),t.data.bufferContexts[c]=t.data.bufferCanvases[c].getContext(`2d`),t.data.bufferCanvases[c].style.position=`absolute`,t.data.bufferCanvases[c].setAttribute(`data-id`,`buffer`+c),t.data.bufferCanvases[c].style.zIndex=String(-c-1),t.data.bufferCanvases[c].style.visibility=`hidden`;t.pathsEnabled=!0;var d=zi(),f=function(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}},p=function(e){return{x:-e.w/2,y:-e.h/2}},m=function(e){var t=e[0]._private;return t.oldBackgroundTimestamp!==t.backgroundTimestamp},h=function(e){return e[0]._private.nodeKey},g=function(e){return e[0]._private.labelStyleKey},_=function(e){return e[0]._private.sourceLabelStyleKey},v=function(e){return e[0]._private.targetLabelStyleKey},y=function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},b=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`main`,a)},x=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`source`,a)},S=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`target`,a)},C=function(e){return e.boundingBox(),e[0]._private.bodyBounds},w=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||d},T=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||d},E=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||d},D=function(e,t){return t},O=function(e){return f(C(e))},k=function(e,t,n){var r=e?e+`-`:``;return{x:t.x+n.pstyle(r+`text-margin-x`).pfValue,y:t.y+n.pstyle(r+`text-margin-y`).pfValue}},A=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},j=function(e){return k(``,A(e,`labelX`,`labelY`),e)},M=function(e){return k(`source`,A(e,`sourceLabelX`,`sourceLabelY`),e)},N=function(e){return k(`target`,A(e,`targetLabelX`,`targetLabelY`),e)},P=function(e){return p(C(e))},F=function(e){return p(T(e))},I=function(e){return p(E(e))},L=function(e){var t=w(e),n=p(w(e));if(e.isNode()){switch(Yu(e.pstyle(`text-halign`).value)){case`left`:n.x=-t.w-(t.leftPad||0);break;case`right`:n.x=-(t.rightPad||0)}switch(Xu(e.pstyle(`text-valign`).value)){case`top`:n.y=-t.h-(t.topPad||0);break;case`bottom`:n.y=-(t.botPad||0)}}return n},R=t.data.eleTxrCache=new hh(t,{getKey:h,doesEleInvalidateKey:m,drawElement:y,getBoundingBox:C,getRotationPoint:O,getRotationOffset:P,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=t.data.lblTxrCache=new hh(t,{getKey:g,drawElement:b,getBoundingBox:w,getRotationPoint:j,getRotationOffset:L,isVisible:D}),B=t.data.slbTxrCache=new hh(t,{getKey:_,drawElement:x,getBoundingBox:T,getRotationPoint:M,getRotationOffset:F,isVisible:D}),V=t.data.tlbTxrCache=new hh(t,{getKey:v,drawElement:S,getBoundingBox:E,getRotationPoint:N,getRotationOffset:I,isVisible:D}),H=t.data.lyrTxrCache=new Mh(t);t.onUpdateEleCalcs(function(e,t){R.invalidateElements(t),z.invalidateElements(t),B.invalidateElements(t),V.invalidateElements(t),H.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}});var U=function(e){for(var t=0;t<e.length;t++)H.enqueueElementRefinement(e[t].ele)};R.onDequeue(U),z.onDequeue(U),B.onDequeue(U),V.onDequeue(U),e.webgl&&t.initWebgl(e,{getStyleKey:h,getLabelKey:g,getSourceLabelKey:_,getTargetLabelKey:v,drawElement:y,drawLabel:b,drawSourceLabel:x,drawTargetLabel:S,getElementBox:C,getLabelBox:w,getSourceLabelBox:T,getTargetLabelBox:E,getElementRotationPoint:O,getElementRotationOffset:P,getLabelRotationPoint:j,getSourceLabelRotationPoint:M,getTargetLabelRotationPoint:N,getLabelRotationOffset:L,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:I})}A_.redrawHint=function(e,t){var n=this;switch(e){case`eles`:n.data.canvasNeedsRedraw[A_.NODE]=t;break;case`drag`:n.data.canvasNeedsRedraw[A_.DRAG]=t;break;case`select`:n.data.canvasNeedsRedraw[A_.SELECT_BOX]=t;break;case`gc`:n.data.gc=!0}};var M_=typeof Path2D<`u`;A_.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},A_.usePaths=function(){return M_&&this.pathsEnabled},A_.setImgSmoothing=function(e,t){e.imageSmoothingEnabled==null?(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t):e.imageSmoothingEnabled=t},A_.getImgSmoothing=function(e){return e.imageSmoothingEnabled==null?e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled:e.imageSmoothingEnabled},A_.makeOffscreenCanvas=function(e,t){var n;return(typeof OffscreenCanvas>`u`?`undefined`:ft(OffscreenCanvas))===`undefined`?(n=this.cy.window().document.createElement(`canvas`),n.width=e,n.height=t):n=new OffscreenCanvas(e,t),n},[Ih,Uh,Xh,Qh,$h,ng,ig,e_,__,w_,O_].forEach(function(e){$t(A_,e)});var N_=[{type:`layout`,extensions:Hp},{type:`renderer`,extensions:[{name:`null`,impl:Up},{name:`base`,impl:Wm},{name:`canvas`,impl:k_}]}],P_={},F_={};function I_(e,t,n){var r=n,i=function(n){jr("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if(e===`core`){if(ep.prototype[t])return i(t);ep.prototype[t]=n}else if(e===`collection`){if(mf.prototype[t])return i(t);mf.prototype[t]=n}else if(e===`layout`){for(var a=function(e){this.options=e,n.call(this,e),Ct(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),s=[],c=0;c<s.length;c++){var l=s[c];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var u=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return u?u.call(this):this.emit(`layoutstop`),this},o.destroy||=function(){return this},o.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};$t(o,{createEmitter:function(){return this._private.emitter=new Fd(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),ou.eventAliasesOn(o),r=a}else if(e===`renderer`&&t!==`null`&&t!==`base`){var p=L_(`renderer`,`base`),m=p.prototype,h=n,g=n.prototype,_=function(){p.apply(this,arguments),h.apply(this,arguments)},v=_.prototype;for(var y in m){var b=m[y];if(g[y]!=null)return i(y);v[y]=b}for(var x in g)v[x]=g[x];m.clientFunctions.forEach(function(e){v[e]=v[e]||function(){kr("Renderer does not implement `renderer."+e+"()` on its prototype")}}),r=_}else if(e===`__proto__`||e===`constructor`||e===`prototype`)return kr(e+` is an illegal type to be registered, possibly lead to prototype pollutions`);return sn({map:P_,keys:[e,t],value:r})}function L_(e,t){return cn({map:P_,keys:[e,t]})}function R_(e,t,n,r,i){return sn({map:F_,keys:[e,t,n,r],value:i})}function z_(e,t,n,r){return cn({map:F_,keys:[e,t,n,r]})}var B_=function(){if(arguments.length===2)return L_.apply(null,arguments);if(arguments.length===3)return I_.apply(null,arguments);if(arguments.length===4)return z_.apply(null,arguments);if(arguments.length===5)return R_.apply(null,arguments);kr(`Invalid extension access syntax`)};ep.prototype.extension=B_,N_.forEach(function(e){e.extensions.forEach(function(t){I_(e.type,t.name,t.impl)})});var V_=function(){if(!(this instanceof V_))return new V_;this.length=0},H_=V_.prototype;H_.instanceString=function(){return`stylesheet`},H_.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},H_.css=function(e,t){var n=this.length-1;if(Z(e))this[n].properties.push({name:e,value:t});else if(Ct(e))for(var r=e,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a],s=r[o];if(s!=null){var c=Jf.properties[o]||Jf.properties[Bt(o)];if(c!=null){var l=c.name,u=s;this[n].properties.push({name:l,value:u})}}}return this},H_.style=H_.css,H_.generateStyle=function(e){var t=new Jf(e);return this.appendToStyle(t)},H_.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var U_=`3.34.3`,W_=function(e){if(e===void 0&&(e={}),Ct(e))return new ep(e);if(Z(e))return B_.apply(B_,arguments)};W_.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(W_),e.apply(null,t),this},W_.warnings=function(e){return Ar(e)},W_.version=U_,W_.stylesheet=W_.Stylesheet=V_;function G_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function K_(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=J_(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
331
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function q_(e){"@babel/helpers - typeof";return q_=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q_(e)}function J_(e,t){if(e){if(typeof e==`string`)return G_(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G_(e,t):void 0}}var Y_={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,useDagreEdgeControlPoints:!1,automaticDagreEdgeStyle:!1,dagreEdgeStyle:{"curve-style":`unbundled-bezier`,"control-point-weights":function(e){return e.scratch(`controlPointWeights`)},"control-point-distances":function(e){return e.scratch(`controlPointDistances`)},"edge-distances":`intersection`,"edge-ends-overlap":!1},animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},sort:void 0,stop:function(){}},X_=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object),Z_=Object.defineProperty,Q_=(e,t,n)=>t in e?Z_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$_=(e,t)=>{for(var n in t)Z_(e,n,{get:t[n],enumerable:!0})},ev=(e,t,n)=>Q_(e,t+``,n),tv={};$_(tv,{Graph:()=>iv,alg:()=>gv,json:()=>dv,version:()=>uv});var nv=Object.defineProperty,rv=(e,t)=>{for(var n in t)nv(e,n,{get:t[n],enumerable:!0})},iv=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=sv(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=cv(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,av(this._preds[a],i),av(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?lv(this._isDirected,e):sv(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?lv(this._isDirected,e):sv(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?lv(this._isDirected,e):sv(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],ov(this._preds[t],e),ov(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function av(e,t){e[t]?e[t]++:e[t]=1}function ov(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function sv(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function cv(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function lv(e,t){return sv(e,t.v,t.w,t.name)}var uv=`4.0.1`,dv={};rv(dv,{read:()=>hv,write:()=>fv});function fv(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:pv(e),edges:mv(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function pv(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function mv(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function hv(e){let t=new iv(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var gv={};rv(gv,{CycleException:()=>jv,bellmanFord:()=>vv,components:()=>bv,dijkstra:()=>Cv,dijkstraAll:()=>Tv,findCycles:()=>Dv,floydWarshall:()=>kv,isAcyclic:()=>Nv,postorder:()=>Lv,preorder:()=>Rv,prim:()=>zv,shortestPaths:()=>Bv,tarjan:()=>Ev,topsort:()=>Mv});var _v=()=>1;function vv(e,t,n,r){return yv(e,String(t),n||_v,r||function(t){return e.outEdges(t)})}function yv(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function bv(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var xv=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Sv=()=>1;function Cv(e,t,n,r){return wv(e,String(t),n||Sv,r||function(t){return e.outEdges(t)})}function wv(e,t,n,r){let i={},a=new xv,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function Tv(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Cv(e,i,t,n),r},{})}function Ev(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function Dv(e){return Ev(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Ov=()=>1;function kv(e,t,n){return Av(e,t||Ov,n||function(t){return e.outEdges(t)})}function Av(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var jv=class extends Error{constructor(...e){super(...e)}};function Mv(e){let t={},n={},r=[];function i(a){if(a in n)throw new jv;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new jv;return r}function Nv(e){try{Mv(e)}catch(e){if(e instanceof jv)return!1;throw e}return!0}function Pv(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=Fv(e,t,n===`post`,o,a,r,i)}),i}function Fv(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=Fv(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Iv(e,t,n){return Pv(e,t,n,function(e,t){return e.push(t),e},[])}function Lv(e,t){return Iv(e,t,`post`)}function Rv(e,t){return Iv(e,t,`pre`)}function zv(e,t){let n=new iv,r={},i=new xv,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Bv(e,t,n,r){return Vv(e,t,n,r??(t=>e.outEdges(t)??[]))}function Vv(e,t,n,r){if(n===void 0)return Cv(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return vv(e,t,n,r)}return Cv(e,t,n,r)}function Hv(e,t,n,r){let i=r;for(;e.hasNode(i);)i=iy(r);return n.dummy=t,e.setNode(i,n),i}function Uv(e){let t=new iv().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function Wv(e){let t=new iv({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Gv(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Kv(e){let t=ay($v(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function qv(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Qv(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Jv(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Qv(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Yv(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Hv(e,`border`,i,t)}function Xv(e,t=Zv){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Zv=65535;function Qv(e,t){return t.length>Zv?e(...Xv(t).map(t=>e(...t))):e(...t)}function $v(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Qv(Math.max,t)}function ey(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function ty(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function ny(e,t){return t()}var ry=0;function iy(e){return e+(``+ ++ry)}function ay(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function oy(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function sy(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function cy(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var ly=`\0`,uy=`3.0.0`,dy=class{constructor(){ev(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return fy(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&fy(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,py)),n=n._prev;return`[`+e.join(`, `)+`]`}};function fy(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function py(e,t){if(e!==`_next`&&e!==`_prev`)return t}var my=dy,hy=()=>1;function gy(e,t){if(e.nodeCount()<=1)return[];let n=yy(e,t||hy);return _y(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function _y(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)vy(e,t,n,o);for(;o=i.dequeue();)vy(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(vy(e,t,n,o,!0)||[]);break}}}return r}function vy(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,by(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,by(t,n,o)}),e.removeNode(r.v),o}function yy(e,t){let n=new iv,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=xy(i+r+3).map(()=>new my),o=r+1;return n.nodes().forEach(e=>{by(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function by(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function xy(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Sy(e){(e.graph().acyclicer===`greedy`?gy(e,t(e)):Cy(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,iy(`rev`))});function t(e){return t=>e.edge(t).weight}}function Cy(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function wy(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Ty(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ey(e,t))}function Ey(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Hv(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Dy(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Oy(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Qv(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function ky(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ay=jy;function jy(e){let t=new iv({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;My(t,e)<i&&(a=Ny(t,e),a);)o=t.hasNode(a.v)?ky(e,a):-ky(e,a),Py(t,e,o);return t}function My(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!ky(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Ny(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=ky(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Py(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:Fy,postorder:Iy}=gv,Ly=Ry;Ry.initLowLimValues=Hy,Ry.initCutValues=zy,Ry.calcCutValue=Vy,Ry.leaveEdge=Wy,Ry.enterEdge=Gy,Ry.exchangeEdges=Ky;function Ry(e){e=Uv(e),Oy(e);let t=Ay(e);Hy(t),zy(t,e);let n,r;for(;n=Wy(t);)r=Gy(t,e,n),Ky(t,e,n,r)}function zy(e,t){let n=Iy(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>By(e,t,n))}function By(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Vy(e,t,n)}function Vy(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Jy(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Hy(e,t){arguments.length<2&&(t=e.nodes()[0]),Uy(e,{},1,t)}function Uy(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Uy(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Wy(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Gy(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Yy(e,e.node(t.v),s)&&c!==Yy(e,e.node(t.w),s)).reduce((e,n)=>ky(t,n)<ky(t,e)?n:e)}function Ky(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Hy(e),zy(e,t),qy(e,t)}function qy(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=Fy(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Jy(e,t,n){return e.hasEdge(t,n)}function Yy(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Xy=Zy;function Zy(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:eb(e);break;case`tight-tree`:$y(e);break;case`longest-path`:Qy(e);break;case`none`:break;default:eb(e)}}var Qy=Oy;function $y(e){Oy(e),Ay(e)}function eb(e){Ly(e)}var tb=nb;function nb(e){let t=ib(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=rb(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function rb(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function ib(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(ly).forEach(r),t}function ab(e){let t=Hv(e,`root`,{},`_root`),n=sb(e),r=Object.values(n),i=Qv(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=cb(e)+1;e.children(ly).forEach(r=>ob(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function ob(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Yv(e,`_bt`),l=Yv(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{ob(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function sb(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(ly).forEach(e=>n(e,1)),t}function cb(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function lb(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var ub=db;function db(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)fb(e,`borderLeft`,`_bl`,n,i,t),fb(e,`borderRight`,`_br`,n,i,t)}}e.children(ly).forEach(t)}function fb(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Hv(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function pb(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&hb(e)}function mb(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&_b(e),(t===`lr`||t===`rl`)&&(yb(e),hb(e))}function hb(e){e.nodes().forEach(t=>gb(e.node(t))),e.edges().forEach(t=>gb(e.edge(t)))}function gb(e){let t=e.width;e.width=e.height,e.height=t}function _b(e){e.nodes().forEach(t=>vb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(vb),Object.hasOwn(r,`y`)&&vb(r)})}function vb(e){e.y=-e.y}function yb(e){e.nodes().forEach(t=>bb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(bb),Object.hasOwn(r,`x`)&&bb(r)})}function bb(e){let t=e.x;e.x=e.y,e.y=t}function xb(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=ay(Qv(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n);let o=e.successors(n);o&&o.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function Sb(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Cb(e,t[r-1],t[r]);return n}function Cb(e,t,n){let r=cy(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function wb(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Tb(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Eb(Object.values(n).filter(e=>!e.indegree))}function Eb(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Db(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>oy(e,[`vs`,`i`,`barycenter`,`weight`]))}function Db(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Ob(e,t){let n=ey(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(Ab(!!t)),c=kb(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=kb(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function kb(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Ab(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function jb(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=wb(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=jb(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&Nb(t,i)}});let u=Tb(l,n);Mb(u,c);let d=Ob(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function Mb(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Nb(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pb(e,t,n,r){r||=e.nodes();let i=Fb(e),a=new iv({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Fb(e){let t;for(;e.hasNode(t=iy(`_root`)););return t}function Ib(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Lb(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,Lb);return}let n=$v(e),r=Rb(e,ay(1,n+1),`inEdges`),i=Rb(e,ay(n-1,-1,-1),`outEdges`),a=xb(e);if(Bb(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){zb(t%2?r:i,t%4>=2,c),a=Kv(e);let l=Sb(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}Bb(e,s)}function Rb(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Pb(e,t,n,r.get(t)||[])})}function zb(e,t,n){let r=new iv;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=jb(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),Ib(e,r,a.vs)})}function Bb(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Vb(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Ub(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Wb(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Hb(e,t){let n={};function r(t,r,i,a,o){ay(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Wb(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Ub(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Wb(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Gb(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Kb(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!Gb(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function qb(e,t,n,r,i=!1){let a={},o=Jb(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function Jb(e,t,n,r){let i=new iv,a=e.graph(),o=$b(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Yb(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=ex(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function Xb(e,t){let n=Object.values(t),r=Qv(Math.min,n),i=Qv(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Qv(Math.min,c);a!==`l`&&(l=i-Qv(Math.max,c)),l&&(e[o]=sy(s,e=>e+l))})})}function Zb(e,t=void 0){let n=e.ul;return n?sy(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function Qb(e){let t=Kv(e),n=Object.assign(Vb(e,t),Hb(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=Kb(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=qb(e,i,o.root,o.align,t===`r`);t===`r`&&(s=sy(s,e=>-e)),r[a+t]=s})}),Xb(r,Yb(e,r)),Zb(r,e.graph().align)}function $b(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function ex(e,t){return e.node(t).width}function tx(e){e=Wv(e),nx(e),Object.entries(Qb(e)).forEach(([t,n])=>e.node(t).x=n)}function nx(e){let t=Kv(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}function rx(e,t={}){let n=t.debugTiming?ty:ny;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>mx(e));return n(` runLayout`,()=>ix(r,n,t)),n(` updateInputGraph`,()=>ax(e,r)),r})}function ix(e,t,n){t(` makeSpaceForEdgeLabels`,()=>hx(e)),t(` removeSelfEdges`,()=>wx(e)),t(` acyclic`,()=>Sy(e)),t(` nestingGraph.run`,()=>ab(e)),t(` rank`,()=>Xy(Wv(e))),t(` injectEdgeLabelProxies`,()=>gx(e)),t(` removeEmptyRanks`,()=>Jv(e)),t(` nestingGraph.cleanup`,()=>lb(e)),t(` normalizeRanks`,()=>qv(e)),t(` assignRankMinMax`,()=>_x(e)),t(` removeEdgeLabelProxies`,()=>vx(e)),t(` normalize.run`,()=>Ty(e)),t(` parentDummyChains`,()=>tb(e)),t(` addBorderSegments`,()=>ub(e)),t(` order`,()=>Lb(e,n)),t(` insertSelfEdges`,()=>Tx(e)),t(` adjustCoordinateSystem`,()=>pb(e)),t(` position`,()=>tx(e)),t(` positionSelfEdges`,()=>Ex(e)),t(` removeBorderNodes`,()=>Cx(e)),t(` normalize.undo`,()=>Dy(e)),t(` fixupEdgeLabelCoords`,()=>xx(e)),t(` undoCoordinateSystem`,()=>mb(e)),t(` translateGraph`,()=>yx(e)),t(` assignNodeIntersects`,()=>bx(e)),t(` reversePoints`,()=>Sx(e)),t(` acyclic.undo`,()=>wy(e))}function ax(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var ox=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],sx={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},cx=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],lx=[`width`,`height`,`rank`],ux={width:0,height:0},dx=[`minlen`,`weight`,`width`,`height`,`labeloffset`],fx={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},px=[`labelpos`];function mx(e){let t=new iv({multigraph:!0,compound:!0}),n=Ox(e.graph());return t.setGraph(Object.assign({},sx,Dx(n,ox),oy(n,cx))),e.nodes().forEach(n=>{let r=Dx(Ox(e.node(n)),lx);Object.keys(ux).forEach(e=>{r[e]===void 0&&(r[e]=ux[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Ox(e.edge(n));t.setEdge(n,Object.assign({},fx,Dx(r,dx),oy(r,px)))}),t}function hx(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function gx(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Hv(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function _x(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function vx(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function yx(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function bx(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Gv(r,a)),n.points.push(Gv(i,o))})}function xx(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Sx(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Cx(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function wx(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Tx(e){Kv(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{Hv(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Ex(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function Dx(e,t){return sy(oy(e,t),Number)}function Ox(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function kx(e){let t=Kv(e),n=new iv({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var Ax={graphlib:tv,version:uy,layout:rx,debug:kx,util:{time:ty,notime:ny}},jx=function(e){return typeof e==`function`},Mx=.001;function Nx(e){if(e.isParent()){var t=e.children();if(t.length>0)return Nx(t[0])}return e}function Px(e){this.options=X_({},Y_,e)}function Fx(e,t){return{x:Bx(e.x-t.x),y:Bx(e.y-t.y)}}function Ix(e,t){return Bx(e.x*t.x)+Bx(e.y*t.y)}function Lx(e){var t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t,len:t}}function Rx(e){return{x:-e.y,y:e.x}}function zx(e,t){var n=Lx(Fx(t,e)),r=n.x,i=n.y,a=n.len,o={x:r,y:i};return{src:e,tgt:t,dir:o,normal:Rx(o),len:a}}function Bx(e){return Math.abs(e)<Mx?e<0?-Mx:Mx:e}function Vx(e,t){var n=Fx(e,t.src);return{weight:Bx(Ix(n,t.dir)/t.len),distance:Bx(Ix(n,t.normal))}}function Hx(e){var t=1/0,n=-1/0,r=K_(e),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;a.weight<t&&(t=a.weight),a.weight>n&&(n=a.weight)}}catch(e){r.e(e)}finally{r.f()}var o=n-t||1;return e.map(function(e){return{distance:e.distance,weight:(e.weight-t)/o}})}function Ux(e,t){var n=zx(t.source().position(),t.target().position()),r=Hx(e.points.map(function(e){return Vx(e,n)}));return{controlPointWeights:r.slice(1,-1).map(function(e){return e.weight}),controlPointDistances:r.slice(1,-1).map(function(e){return e.distance})}}Px.prototype.run=function(){var e=this.options,t=this,n=e.cy,r=e.eles,i=function(e,t){return jx(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:n.width(),h:n.height()};a.x2===void 0&&(a.x2=a.x1+a.w),a.w===void 0&&(a.w=a.x2-a.x1),a.y2===void 0&&(a.y2=a.y1+a.h),a.h===void 0&&(a.h=a.y2-a.y1);var o=new Ax.graphlib.Graph({multigraph:!0,compound:!0}),s={},c=function(e,t){t!=null&&(s[e]=t)};c(`nodesep`,e.nodeSep),c(`edgesep`,e.edgeSep),c(`ranksep`,e.rankSep),c(`rankdir`,e.rankDir),c(`align`,e.align),c(`ranker`,e.ranker),c(`acyclicer`,e.acyclicer),o.setGraph(s),o.setDefaultEdgeLabel(function(){return{}}),o.setDefaultNodeLabel(function(){return{}});var l=r.nodes();jx(e.sort)&&(l=l.sort(e.sort));for(var u=0;u<l.length;u++){var d=l[u],f=d.layoutDimensions(e);o.setNode(d.id(),{width:f.w,height:f.h,shape:`ellipse`,name:d.id()})}for(var p=0;p<l.length;p++){var m=l[p];m.isChild()&&o.setParent(m.id(),m.parent().id())}var h=r.edges();jx(e.sort)&&(h=h.sort(e.sort));for(var g=0;g<h.length;g++){var _=h[g],v=Nx(_.source()),y=Nx(_.target());o.setEdge(v.id(),y.id(),{minlen:i(_,e.minLen),weight:i(_,e.edgeWeight),name:_.id()},_.id())}Ax.layout(o);for(var b=o.nodes(),x=0;x<b.length;x++){var S=b[x],C=o.node(S);n.getElementById(S).scratch().dagre=C}var w;e.boundingBox?(w={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},l.forEach(function(e){var t=e.scratch().dagre;w.x1=Math.min(w.x1,t.x),w.x2=Math.max(w.x2,t.x),w.y1=Math.min(w.y1,t.y),w.y2=Math.max(w.y2,t.y)}),w.w=w.x2-w.x1,w.h=w.y2-w.y1):w=a;var T=function(t){if(e.boundingBox){var n=w.w===0?0:(t.x-w.x1)/w.w,r=w.h===0?0:(t.y-w.y1)/w.h;return{x:a.x1+n*a.w,y:a.y1+r*a.h}}return t};return l.layoutPositions(t,e,function(e){e=q_(e)===`object`?e:this;var t=e.scratch().dagre;return T({x:t.x,y:t.y})}),e.useDagreEdgeControlPoints&&(e.automaticDagreEdgeStyle&&(n.edges().addClass(`useDagreEdgeControlPoints`),n.style().selector(`edge.useDagreEdgeControlPoints`).style(e.dagreEdgeStyle).update()),o.edges().forEach(function(e){var t=n.getElementById(e.name),r=o.edge(e);r&&r.points&&t.scratch(Ux(r,t))})),this};var Wx=function(e){e&&e(`layout`,`dagre`,Px)};typeof window<`u`&&window.cytoscape!==void 0&&Wx(window.cytoscape),W_.use(Wx);function Gx(e,t){let n=[...e.map(e=>e.id)].sort(),r=new Set(n),i=t.filter(e=>r.has(e.from)&&r.has(e.to)&&e.from!==e.to),a=new Set(i.flatMap(e=>[e.from,e.to])),o=n.filter(e=>a.has(e)),s=n.filter(e=>!a.has(e)),c=W_({headless:!0,styleEnabled:!0,elements:[...o.map(e=>({data:{id:e}})),...i.map(e=>({data:{id:`${e.from}->${e.to}`,source:e.from,target:e.to,weight:e.weight}})).sort((e,t)=>e.data.id<t.data.id?-1:1)],style:[{selector:`node`,style:{width:210,height:84,shape:`round-rectangle`}}]});c.layout({name:`dagre`,rankDir:`LR`,nodeSep:30,rankSep:80,edgeWeight:e=>Number(e.data(`weight`))||1,fit:!1,animate:!1}).run();let l={groups:{},packages:{x:0,y:0}},u=1/0,d=-1/0,f=1/0,p=-1/0;for(let e of c.nodes().toArray()){let t=e.position();l.groups[e.id()]={x:Math.round(t.x),y:Math.round(t.y)},u=Math.min(u,t.x),d=Math.max(d,t.x),f=Math.min(f,t.y),p=Math.max(p,t.y)}if(c.destroy(),s.length){let e=o.length?Math.floor((d-u)/240)+1:0,t=Math.max(e,Math.ceil(Math.sqrt(s.length*2))),n=o.length?u:0,r=o.length?p+84+60:0;s.forEach((e,i)=>{let a={x:Math.round(n+i%t*240),y:Math.round(r+Math.floor(i/t)*114)};l.groups[e]=a,d=Math.max(d,a.x),f=Math.min(f,a.y)})}return l.packages=n.length?{x:Math.round(d+210+80),y:Math.round(f)}:{x:0,y:0},l}var Kx=new Map;function qx(e,t,n){let r=Kx.get(e);return r||(r=Gx(t,n),Kx.set(e,r),Kx.size>20&&Kx.delete(Kx.keys().next().value)),r}function Jx(e,t,n){let r=[...e.map(e=>e.id)].sort(),i=new Set(r),a=W_({headless:!0,styleEnabled:!0,elements:[...r.map(e=>({data:{id:e}})),...t.filter(e=>i.has(e.from)&&i.has(e.to)&&e.from!==e.to).map(e=>({data:{id:`${e.from}->${e.to}`,source:e.from,target:e.to}})).sort((e,t)=>e.data.id<t.data.id?-1:1)],style:[{selector:`node`,style:{width:160,height:50,shape:`round-rectangle`}}]});a.layout({name:`dagre`,rankDir:`LR`,nodeSep:18,rankSep:46,fit:!1,animate:!1}).run();let o={nodes:{},stubs:{},box:{x1:0,y1:0,x2:0,y2:0}},s=1/0,c=1/0,l=-1/0,u=-1/0;for(let e of a.nodes().toArray()){let t={x:Math.round(e.position().x),y:Math.round(e.position().y)};o.nodes[e.id()]=t,s=Math.min(s,t.x-80),l=Math.max(l,t.x+80),c=Math.min(c,t.y-25),u=Math.max(u,t.y+25)}a.destroy(),r.length===0&&([s,c,l,u]=[0,0,160,50]),o.box={x1:s-24,y1:c-36,x2:l+24,y2:u+24};let d=o.box.x2+56+90;return[...n.map(e=>e.id)].sort().forEach((e,t)=>{o.stubs[e]={x:Math.round(d),y:Math.round(o.box.y1+23+t*62)}}),o}var Yx=(e,t)=>{let[n,...r]=t.split(` `),i=t===`broken import`||t===`pending import`?`${t}s`:[`${n}s`,...r].join(` `);return`${e.toLocaleString()} ${e===1?t:i}`},Xx={"file-not-found":`file not found`,"not-exported":`not exported by the package`,"unknown-package":`unknown package`,"alias-not-configured":`path alias not configured`,"package-not-in-sources":`package in no source yet`,"path-not-in-sources":`folder in no source yet`,"default-excluded":`in a folder left out`,"excluded-by-rule":`left out by a rule`,"too-large":`file too large`,asset:`asset (not code)`,minified:`minified file`,"language-not-analyzed":`language not analyzed`};function Zx(e,t){switch(e.kind){case`group`:return`${e.name}\n${Yx(e.count,`import`)} · group`;case`ungrouped`:return`${e.source}\n${Yx(e.count,`import`)} · other source`;case`packages`:{let n=e.packages.slice(0,3).map(t),r=e.packages.length-n.length;return`${n.join(`, `)}${r>0?` +${r}`:``}\nexternal packages`}default:return`${Xx[e.reason]??e.reason}\n${Yx(e.count,e.kind===`broken`?`broken import`:e.kind===`pending`?`pending import`:`import not analyzed`)}`}}var Qx=22,$x=e=>e.length>Qx?`${e.slice(0,21)}…`:e,eS=e=>e.length>Qx?`…${e.slice(e.length-Qx+1)}`:e;function tS(e,t){return t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e}function nS({reply:e,pick:t,onPick:n,onOpenFile:r,onToggleFolder:i,onClear:a,marks:o=null,only:s=null,onContext:c}){let l=(0,y.useRef)(null),u=(0,y.useRef)(null),[d,f]=(0,y.useState)(!1),p=(0,y.useRef)(s);p.current=s;let m=(0,y.useRef)(c);m.current=c,(0,y.useEffect)(()=>{u.current&&Ge(u.current,s)},[s]);let h=(0,y.useRef)(o);h.current=o,(0,y.useEffect)(()=>{u.current&&Ye(u.current,o)},[o]);let g=(0,y.useRef)({onPick:n,onOpenFile:r,onToggleFolder:i,onClear:a});g.current={onPick:n,onOpenFile:r,onToggleFolder:i,onClear:a};let _=e.group.kind===`cluster`?``:e.group.root;(0,y.useEffect)(()=>{if(!l.current)return;let t=Jx(e.nodes,e.imports,e.stubs),n=t.box,r=e=>e.slice(e.lastIndexOf(`:`)+1),i=[{data:{id:`box`,kind:`box`,label:e.group.name,w:n.x2-n.x1,h:n.y2-n.y1},position:{x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},classes:`box`},...e.nodes.map(e=>{let n=e.findings,r=n.broken>0?` · ${Yx(n.broken,`broken import`)}`:``;return e.kind===`folder`?{data:{id:e.id,kind:`folder`,path:e.path,label:`${eS(`${tS(e.path,_)}/`)} (${e.files})\nfolder${r}`},position:t.nodes[e.id],classes:n.broken>0?`folder broken`:`folder`}:{data:{id:e.id,kind:`file`,label:[$x(tS(e.path,_).split(`/`).pop()),...tS(e.path,_).includes(`/`)?[eS(tS(e.path,_).split(`/`).slice(0,-1).join(`/`))]:[],...r?[r.slice(3)]:[]].join(`
|
|
332
|
+
`)},position:t.nodes[e.id],classes:[`file`,n.broken>0?`broken`:``,e.status===`not_analyzed`?`not-analyzed`:``].join(` `)}}),...e.stubs.map(e=>({data:{id:e.id,kind:`stub`,label:Zx(e,r)},position:t.stubs[e.id],classes:`stub ${e.kind}`})),...[...e.calls??[],...e.callStubEdges??[]].map(e=>({data:{id:e.id,kind:`calls`,source:e.from,target:e.to,width:Math.min(1.5+Math.log2(e.count)*1.2,7),label:e.count>1?String(e.count):``,calls:e.calls,references:e.references},classes:e.to.startsWith(`stub|`)?`calls out`:`calls`})),...d?e.imports.map(e=>({data:{id:e.id,kind:`imports`,source:e.from,target:e.to,label:e.count>1?String(e.count):``},classes:`imports`})):[],...(d?e.stubEdges:[]).map(t=>{let n=e.stubs.find(e=>e.id===t.to);return{data:{id:t.id,kind:`out`,source:t.from,target:t.to,label:t.count>1?String(t.count):``},classes:`out ${n?.kind??``}`}})],a=W_({container:l.current,elements:i,layout:{name:`preset`},autounselectify:!0,minZoom:.1,maxZoom:2.5,style:[{selector:`node`,style:{shape:`round-rectangle`,width:160,height:50,label:`data(label)`,"text-wrap":`wrap`,"text-max-width":`144px`,"text-valign":`center`,"text-halign":`center`,"font-size":12,color:`#1d2330`,"background-color":`#fff`,"border-width":1,"border-color":`#c9d1de`}},{selector:`node.box`,style:{width:`data(w)`,height:`data(h)`,"background-color":`#f7faff`,"border-color":`#c6d6f3`,"border-width":2,"text-valign":`top`,"text-halign":`center`,"text-margin-y":22,"font-weight":`bold`,color:`#2a56ad`,events:`no`,"z-compound-depth":`bottom`,"z-index":0}},{selector:`node.folder`,style:{"background-color":`#f3f6fb`,"border-style":`double`,"border-width":3}},{selector:`node.broken`,style:{"border-color":`#c9a45c`}},{selector:`node.not-analyzed`,style:{color:`#8a93a3`,"border-style":`dashed`}},{selector:`node.stub`,style:{width:180,height:46,"border-style":`dashed`,"border-color":`#6b87b8`,color:`#1d2330`}},{selector:`node.stub.packages`,style:{"border-color":`#b7c0cf`,color:`#4a5262`}},{selector:`node.stub.broken`,style:{"border-color":`#c9a45c`,"background-color":`#fffaf0`,color:`#6b4600`}},{selector:`node.stub.not-analyzed, node.stub.pending`,style:{"border-color":`#b7c0cf`,"background-color":`#fafbfc`,color:`#5d6675`}},{selector:`edge`,style:{width:1.5,"curve-style":`bezier`,"line-color":`#8fa0b8`,"target-arrow-shape":`triangle`,"target-arrow-color":`#8fa0b8`,"arrow-scale":.8,label:`data(label)`,"font-size":10,color:`#5d6675`,"text-background-color":`#fff`,"text-background-opacity":1}},{selector:`edge.out`,style:{"line-style":`dashed`,"line-color":`#9fb3d6`,"target-arrow-color":`#9fb3d6`}},{selector:`edge.imports, edge.out:not(.calls)`,style:{opacity:.35,width:1}},{selector:`edge.calls`,style:{width:`data(width)`,"line-color":`#3f5f96`,"target-arrow-color":`#3f5f96`,"line-style":`solid`,opacity:1}},{selector:`edge.calls.out`,style:{"line-style":`dashed`,"line-color":`#6b87b8`}},{selector:`edge.out.broken`,style:{"line-color":`#c9a45c`,"target-arrow-color":`#c9a45c`}},...Je,We,{selector:`node.picked`,style:{"border-width":2,"border-color":`#3b6fd4`,"background-color":`#eef4ff`}},{selector:`edge.picked`,style:{"line-color":`#3b6fd4`,"target-arrow-color":`#3b6fd4`,width:2.5}},{selector:`.faded`,style:{opacity:.3}}]});return a.on(`tap`,`node`,e=>{let t=e.target.data(`kind`);(t===`file`||t===`folder`)&&g.current.onPick(e.target.id())}),a.on(`tap`,`edge`,e=>{e.target.data(`kind`)===`calls`&&g.current.onPick(e.target.id())}),a.on(`dbltap`,`node`,e=>{let t=e.target.data(`kind`);t===`file`?g.current.onOpenFile(e.target.id()):t===`folder`&&g.current.onToggleFolder(e.target.data(`path`))}),a.on(`tap`,e=>{e.target===a&&g.current.onClear()}),rS(a),u.current=a,l.current&&(l.current.veoCy=a),Ge(a,p.current),a.on(`cxttap`,`node, edge`,e=>{let t=e.target.data(),n=t.kind===`file`?`file`:t.kind===`folder`?`folder`:t.kind===`imports`||t.kind===`calls`?`edge`:null;if(!n||!l.current)return;let r=l.current.getBoundingClientRect(),i=e.renderedPosition??{x:0,y:0};m.current?.({kind:n,id:n===`file`&&typeof t.file==`string`?t.file:e.target.id(),data:t,x:r.left+i.x,y:r.top+i.y})}),Ye(a,h.current),()=>{u.current=null,a.destroy()}},[e,_,d]),(0,y.useEffect)(()=>{let e=u.current;e&&e.batch(()=>{e.elements().removeClass(`picked faded`);let n=t?e.getElementById(t):null;if(n&&n.nonempty()){let t=n.union(n.connectedEdges());t.addClass(`picked`),e.elements().not(t).not(t.connectedNodes()).not(`#box`).addClass(`faded`)}})},[t,e,d]);let v=e.nodes,b=t=>{let n=e.nodes.find(e=>e.id===t);n?.kind===`folder`?i(n.path):n&&r(n.id)},x=e=>{if(v.length===0)return;let r=t?v.findIndex(e=>e.id===t):-1;if(e.key===`ArrowRight`||e.key===`ArrowDown`)n(v[(r+1)%v.length].id);else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)n(v[(r-1+v.length)%v.length].id);else if(e.key===`Enter`&&t)b(t);else if(e.key===`Escape`)a();else return;e.preventDefault()},S=t=>e.nodes.find(e=>e.id===t)?.path??e.stubs.find(e=>e.id===t)?.name??t;return(0,X.jsxs)(`div`,{className:`graph-wrap`,children:[(0,X.jsxs)(`label`,{className:`toggle small muted group-imports-toggle`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-command":`toggle-group-imports`,checked:d,onChange:e=>f(e.target.checked)}),`File imports too`]}),(0,X.jsx)(`div`,{ref:l,className:`graph map`,"data-testid":`group-canvas`,tabIndex:0,role:`application`,"aria-label":`The group's files: arrow keys move between them, Enter opens a file or a folder`,onKeyDown:x}),(0,X.jsxs)(`ul`,{className:`visually-hidden`,"aria-label":`Files and folders`,children:[e.nodes.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`button`,{"data-command":`pick-node`,"data-id":e.id,tabIndex:-1,onClick:()=>n(e.id),children:e.path}),e.kind===`folder`?(0,X.jsxs)(`button`,{"data-command":`toggle-folder`,"data-path":e.path,tabIndex:-1,onClick:()=>i(e.path),children:[`Open `,e.path,`/`]}):(0,X.jsxs)(`button`,{"data-command":`open-imports-file`,"data-id":e.id,tabIndex:-1,onClick:()=>r(e.id),children:[`Open `,e.path]})]},e.id)),e.stubs.map(e=>(0,X.jsx)(`li`,{"data-testid":`stub`,"data-id":e.id,"data-count":e.count,children:Zx(e,e=>e.slice(e.lastIndexOf(`:`)+1)).replace(`
|
|
333
|
+
`,` · `)},e.id))]}),(0,X.jsx)(`ul`,{className:`visually-hidden`,"aria-label":`Calls between files`,children:[...e.calls??[],...e.callStubEdges??[]].map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{"data-command":`pick-node`,"data-link":!0,"data-id":e.id,tabIndex:-1,onClick:()=>n(e.id),children:[S(e.from),` calls `,S(e.to),`: `,e.calls,` calls, `,e.references,` references`]})},e.id))}),(0,X.jsx)(`button`,{className:`fit`,onClick:()=>u.current&&rS(u.current),children:`Fit`})]})}function rS(e){e.fit(void 0,30);let t=e.zoom();if(t>1.2)e.zoom(1.2),e.center();else if(t<.75){let t=e.elements().boundingBox();e.zoom(.75),e.pan({x:30-t.x1*.75,y:30-t.y1*.75})}}var iS=`veoflow.allCode`,aS=`veoflow-all-code`;function oS(){try{return localStorage.getItem(iS)===`1`}catch{return!1}}function sS(){let[e,t]=(0,y.useState)(oS);return(0,y.useEffect)(()=>{let e=()=>t(oS());return window.addEventListener(aS,e),()=>window.removeEventListener(aS,e)},[]),[e,e=>{try{localStorage.setItem(iS,e?`1`:`0`)}catch{}t(e),window.dispatchEvent(new Event(aS))}]}var cS=new Map,lS=`veoflow-groups-forget`;function uS(){for(let e of[...cS.keys()])e.startsWith(`["groups"`)&&cS.delete(e);window.dispatchEvent(new Event(lS))}function dS(e,t,n){let r=cS.get(e);return r||(r=n(),cS.set(e,r),r.then(n=>n.committedRun!==t&&cS.delete(e),()=>cS.delete(e)),cS.size>40&&cS.delete(cS.keys().next().value)),r}function fS(e,t,n,r,i){let[a,o]=(0,y.useState)({key:null,data:null,error:null});return(0,y.useEffect)(()=>{if(e===null)return;let r=!1;return dS(e,t,n).then(t=>!r&&o({key:e,scope:i,data:t,error:null}),t=>!r&&o({key:e,scope:i,data:null,error:t.message})),()=>{r=!0}},[e,r]),a.key===e?a:i!==void 0&&a.scope===i&&a.data?{data:a.data,error:null}:{data:null,error:null}}function pS(e,t,n=0,r=null){let[i,a]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=()=>a(e=>e+1);return window.addEventListener(lS,e),()=>window.removeEventListener(lS,e)},[]);let{data:o,error:s}=fS(e?JSON.stringify([`groups`,e,t,r]):null,t,()=>Y.groups(e,r),`${n}:${i}`);return{groups:o,error:s}}function mS(e,t,n,r,i,a=0){let o=[...r].sort(),{data:s,error:c}=fS(e&&n?JSON.stringify([`group`,e,t,n,o,i]):null,t,()=>Y.group(e,n,o,i),a,JSON.stringify([e,t,n]));return{group:s,error:c}}function hS(e,t,n){let{data:r,error:i}=fS(e&&n?JSON.stringify([`imports`,e,t,n]):null,t,()=>Y.imports(e,n),0);return{imports:r,error:i}}function gS(e,t,n,r){let{data:i,error:a}=fS(e&&n?JSON.stringify([`reach`,e,t,n,r]):null,t,()=>Y.reach(e,n,r),0);return{reach:i,error:a}}function _S(e,t,n){let{data:r,error:i}=fS(e&&n?JSON.stringify([`calls`,e,t,n]):null,t,()=>Promise.all([Y.crossFileCalls(e,n,`out`),Y.crossFileCalls(e,n,`in`)]).then(([e,t])=>({committedRun:e.committedRun,out:e,in:t})),0);return{calls:r,error:i}}var vS=(e,t)=>!t&&(e===null||e.kind===`source`),yS=100;function bS(e,t,n,r,i){let[a]=sS(),o=vS(n,a),s=JSON.stringify([e,n,r,o]),c=JSON.stringify([s,t,i]),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!e)return;let t=!1;return Y.findings(e,r.length?r:[`broken`],n?.kind===`file`?{file:n.file,own:o}:n?.kind===`group`?{group:n.group,own:o}:n?.kind===`source`?{source:n.source,own:o}:{own:o},r.length?1e3:1).then(e=>!t&&u({key:c,same:s,data:e,error:null}),e=>!t&&u({key:c,same:s,data:null,error:e.message})),()=>{t=!0}},[c]),!l||l.same!==s?{data:null,error:null}:{data:l.data,error:l.key===c?l.error:null}}function xS({project:e,run:t,scope:n,wholeProject:r,canScope:i,showPending:a,refresh:o,filter:s,onFilter:c,onWholeProject:l,onTogglePending:u,onSelectSite:d,onOpenImport:f,onManageLicense:p}){let m=r?null:n,[h,g]=sS(),_=vS(m,h),{data:v}=bS(e,t,m,[],o),b=v?.counts,x=s??(b&&b.broken>0?`broken`:`open-call`),S=[x,...a&&x!==`open-call`?[`pending`]:[]],{data:C,error:w}=bS(e,t,m,S,o),[T,E]=(0,y.useState)(null),D=C&&T?.after===C?T.rows:[],O=[...C?.findings??[],...D],[k,A]=(0,y.useState)(!1),[j,M]=(0,y.useState)(``),N=()=>{C&&(A(!0),M(``),Y.findings(e,S,m?.kind===`file`?{file:m.file,own:_}:m?.kind===`group`?{group:m.group,own:_}:m?.kind===`source`?{source:m.source,own:_}:{own:_},1e3,O.length).then(e=>E({after:C,rows:[...D,...e.findings]}),e=>M(e.message)).finally(()=>A(!1)))},{groups:P}=pS(e,t),F=(0,y.useMemo)(()=>new Map((P?.groups??[]).map(e=>[e.id,e])),[P]),I=e=>{let t=e.group?F.get(e.group):void 0,n=t&&t.kind!==`cluster`&&t.root&&e.path.startsWith(`${t.root}/`)?e.path.slice(t.root.length+1):e.path;return`${t?`${t.name} › `:``}${n}:${e.line}`},L=n?.kind===`group`?F.get(n.group)?.name??`this group`:``,R=i&&n&&(0,X.jsxs)(`div`,{className:`scope`,role:`group`,"aria-label":`Findings scope`,children:[(0,X.jsx)(`button`,{"aria-pressed":!r,onClick:()=>l(!1),"data-testid":`questions-scope-file`,children:n.kind===`file`?`This file`:n.kind===`group`?`This group (${L})`:`This repository (${n.name??n.source})`}),(0,X.jsx)(`button`,{"aria-pressed":r,onClick:()=>l(!0),"data-testid":`questions-scope-project`,children:`Whole project`})]}),z=(e,t,n)=>(0,X.jsxs)(`button`,{className:`chip`,"aria-pressed":x===e,"data-testid":`findings-filter-${e}`,"data-count":n??``,onClick:()=>c(e),children:[t,` `,(0,X.jsx)(`small`,{children:n??`…`})]},e),B=O.filter(e=>e.kind===x),V=O.filter(e=>e.kind===`pending`);return(0,X.jsxs)(`div`,{className:`findings-panel`,"data-testid":`findings-panel`,children:[(0,X.jsx)(Ue,{project:e,run:t,refresh:o,onManage:p}),R,(0,X.jsxs)(`div`,{className:`chips`,role:`group`,"aria-label":`Kinds of findings`,children:[z(`broken`,`Broken imports`,b?.broken),z(`not-analyzed`,`Imports not analyzed`,b?.notAnalyzed),z(`open-call`,`Open calls`,b?.openCalls)]}),(0,X.jsxs)(`label`,{className:`toggle small muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-command":`toggle-pending`,checked:a,onChange:u}),`Show pending (waiting for another source)`,b?` · ${b.pending}`:``]}),(m===null||m.kind===`source`)&&(0,X.jsxs)(`label`,{className:`toggle small muted`,title:`Own code first: findings in tests, installed libraries, generated output and tools' files are counted when this is on`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`findings-all-code`,checked:h,onChange:e=>g(e.target.checked)}),`Libraries and tests too`]}),w?(0,X.jsx)(`p`,{className:`hint error`,children:w}):C?x===`open-call`?(0,X.jsx)(TS,{rows:B,where:I,project:e,onSelect:d}):(0,X.jsxs)(X.Fragment,{children:[x===`not-analyzed`&&(!m||m.kind===`source`)&&(0,X.jsx)(DS,{project:e,run:t,source:m?.source??null,refresh:o}),(0,X.jsx)(CS,{rows:B,empty:x===`broken`?`No broken imports.`:`No imports of files left out of analysis.`,where:I,project:e,onOpen:f})]}):(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`}),C&&a&&x!==`open-call`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Pending (`,V.length,`)`]}),(0,X.jsx)(CS,{rows:V,empty:`Nothing waits for another source.`,where:I,project:e,onOpen:f})]}),C&&C.total>O.length&&(0,X.jsxs)(`p`,{className:`hint small`,"data-testid":`findings-truncated`,children:[`Showing `,O.length.toLocaleString(`en-US`),` of `,C.total.toLocaleString(`en-US`),`.`,` `,(0,X.jsx)(`button`,{className:`link`,"data-testid":`findings-more`,disabled:k,onClick:N,children:k?`Loading…`:`Show more`}),j&&(0,X.jsxs)(`span`,{className:`error`,children:[` `,j]})]})]})}function SS({project:e,id:t}){let[n,r]=(0,y.useState)(!1);return n?(0,X.jsx)(Le,{project:e,id:t,start:!0}):(0,X.jsx)(`button`,{className:`link small`,"data-command":`explain-finding`,onClick:()=>r(!0),children:`Explain`})}function CS({rows:e,empty:t,where:n,project:r,onOpen:i}){let[a,o]=(0,y.useState)(yS);return e.length===0?(0,X.jsx)(`p`,{className:`hint`,children:t}):(0,X.jsxs)(`ul`,{className:`questions finding-rows`,"data-testid":`finding-rows`,children:[e.slice(0,a).map(e=>(0,X.jsxs)(`li`,{"data-kind":e.kind,children:[(0,X.jsx)(`div`,{className:`qrow`,children:(0,X.jsxs)(`button`,{"data-command":`open-finding`,"data-id":e.id,onClick:()=>i(e.file,e.id,e.group),children:[(0,X.jsx)(`code`,{children:e.text}),(0,X.jsxs)(`small`,{children:[n(e),` · `,Xx[e.reason]??e.reason,wS(e)]})]})}),(0,X.jsx)(SS,{project:r,id:e.id})]},e.id)),e.length>a&&(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link`,onClick:()=>o(a+yS),children:[e.length-a,` more…`]})})]})}function wS(e){let t=e.impact;return!t||t.opens<=1?``:` · opens ${`${t.atLeast?`at least `:``}${t.opens} function${t.opens===1?``:`s`}`}${t.groups>1?` in ${t.groups} groups`:``}${t.shared?`, shared with ${t.shared} more`:``}`}function TS({rows:e,where:t,project:n,onSelect:r}){let[i,a]=(0,y.useState)(yS),[o,s]=(0,y.useState)(null),c=(0,y.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.text);e?e.push(n):t.set(n.text,[n])}let n=e=>Math.max(0,...e.map(e=>e.impact?.opens??0)),r=e=>Number(e.every(e=>e.mayBe?.projectFunctions===0));return[...t].sort(([e,t],[i,a])=>r(t)-r(a)||n(a)-n(t)||a.length-t.length||(e<i?-1:+(e>i)))},[e]),l=e=>e.id.startsWith(`resolution|`)?e.id.slice(11):e.id;return e.length===0?(0,X.jsx)(`p`,{className:`hint`,children:`No open calls.`}):(0,X.jsxs)(`ul`,{className:`questions`,"data-testid":`questions`,children:[c.slice(0,i).map(([e,i])=>{let a=i[0],c=new Set(i.map(e=>e.file)).size,u=i.length===1?t(a):`×${i.length}${c>1?` in ${c} files`:``}`;return(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`div`,{className:`qrow`,children:[(0,X.jsxs)(`button`,{"data-command":`select`,"data-kind":`site`,"data-count":i.length,title:e,onClick:()=>r(l(a),a.file),children:[(0,X.jsx)(`code`,{children:e}),(0,X.jsxs)(`small`,{children:[u,` ·`,` `,a.candidates?a.exhaustive===!1?`${a.candidates} known function${a.candidates===1?``:`s`}, may not be all`:a.candidates===1?`one possible function`:`one of ${a.candidates} functions`:d(a.reason),a.mayBe&&(0,X.jsxs)(`span`,{className:`may-be-builtin`,title:`Its receiver's type isn't known; ${a.mayBe.builtins.join(` or `)} is the standard library's${a.mayBe.projectFunctions?`, and ${a.mayBe.projectFunctions} of the project's functions share the name`:``}`,children:[` `,`· may be `,a.mayBe.builtins[0],a.mayBe.builtins.length>1?`…`:``]}),wS(i.reduce((e,t)=>(t.impact?.opens??0)>(e.impact?.opens??0)?t:e))]})]}),i.length>1&&(0,X.jsx)(`button`,{className:`icon expand`,"aria-expanded":o===e,"aria-label":`Show all ${i.length}`,onClick:()=>s(o===e?null:e),children:o===e?`▾`:`▸`})]}),i.length===1&&(0,X.jsx)(SS,{project:n,id:a.id}),o===e&&(0,X.jsx)(`ul`,{className:`occurrences`,children:i.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`button`,{"data-command":`select`,"data-kind":`site`,onClick:()=>r(l(e),e.file),children:t(e)}),(0,X.jsx)(SS,{project:n,id:e.id})]},e.id))})]},e)}),c.length>i&&(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link`,onClick:()=>a(i+yS),children:[c.length-i,` more…`]})})]})}var ES={"language-not-analyzed":`language not analyzed yet`,"declaration-file":`type declarations`,"too-large":`over the size limit`,minified:`minified`,binary:`not text`,"invalid-utf8":`not UTF-8`,unreadable:`unreadable`,entitlement:`beyond the license`,frozen:`kept from an earlier analysis`,"parse-failure":`could not be parsed`,"internal-error":`the extractor failed`};function DS({project:e,run:t,source:n,refresh:r}){let i=`${e}|${t??``}|${n??``}`,[a,o]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=!1;return Y.totals(e,0,n??void 0).then(e=>!t&&o({key:i,files:e.files}),()=>!t&&o(null)),()=>{t=!0}},[i,r]);let s=a?.key===i?a.files:null,c=s?.notAnalyzed.reduce((e,t)=>e+t.files,0)??0;if(!s||c===0)return null;let l=e=>e.toLocaleString(`en-US`);return(0,X.jsxs)(`p`,{className:`small muted`,"data-testid":`unanalyzed-files`,children:[l(c),` of `,l(s.listed),` files aren't analyzed:`,` `,s.notAnalyzed.map(e=>`${l(e.files)} ${ES[e.reason]??e.reason}`).join(`, `),`. They're marked ⚠ in the file tree; below are imports that lead to such files.`]})}function OS(e,t,n=0){let r=e&&t?`${e}|${t.a}|${t.b}`:null,[i,a]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!r||!e||!t)return;let n=!1;return Y.diff(e,t.a,t.b).then(e=>!n&&a({key:r,data:e,error:null}),e=>!n&&a({key:r,data:null,error:e.message})),()=>{n=!0}},[r,n]),i&&i.key===r?{data:i.data,error:i.error}:{data:null,error:null}}var kS={added:`+`,removed:`−`,changed:`~`},AS={added:`added`,removed:`removed`,changed:`changed`};function jS(e){let t=e.fact,n=e=>String(e??``).slice(String(e??``).lastIndexOf(`:`)+1);switch(e.type){case`Function`:return`function ${String(t.qualifiedName??t.name??n(e.id))}`;case`File`:return`file ${String(t.path??e.id)}`;case`CALLS`:case`CALLS_CROSS_FILE`:return`call ${n(t.from)} → ${n(t.to)}`;case`IMPORTS`:return`import ${String(t.specifier??``)}`;case`UnresolvedImport`:return`import ${String(t.specifier??``)} (${String(t.outcome??``)}${t.reason?`: ${String(t.reason)}`:``})`;case`UnresolvedCallSite`:return`open call ${String(t.expression??``)}`;case`SiteResolution`:return`call ${String(t.site??``).split(`|`)[3]??``} (${String(t.status??``)})`;case`Group`:return`group ${String(t.name??e.id)}`;case`DEPENDS_ON`:return`dependency ${String(t.from??``)} → ${String(t.to??``)}`;case`ExternalPackage`:return`package ${String(t.name??e.id)}`;case`Finding`:return`finding: ${String(t.message??t.kind??``)}`;default:return`${e.type} ${e.id}`}}function MS(e){let t=[];for(let[n,r]of Object.entries({Function:`functions`,File:`files`,IMPORTS:`imports`,CALLS:`calls`,CALLS_CROSS_FILE:`cross-file calls`,UnresolvedImport:`unresolved imports`})){let i=e.byType[n];if(!i||i.added+i.removed+i.changed===0)continue;let a=[i.added?`+${i.added}`:``,i.removed?`−${i.removed}`:``,i.changed?`${i.changed} changed`:``].filter(Boolean);t.push(`${a.join(`, `)} ${r}`)}let{added:n,removed:r,changed:i}=e.total;return t.length?t.join(` · `):n+r+i===0?`No changes`:`${n+r+i} changes`}function NS(e,t){return e.type===`ExternalPackage`?!1:e.change===`removed`?e.file!==null&&e.type!==`File`&&!t.has(e.file):e.file!==null||e.type===`Group`||e.type===`DEPENDS_ON`}var PS=e=>e.startsWith(`sha256:`)?`folder`:e.slice(0,7),FS=e=>e?new Date(e).toLocaleString():``;function IS({run:e,previous:t,picked:n,viewing:r,onPick:i,onView:a}){let o=e.sources.filter(e=>!e.pinned),s=new Map((t?.sources??[]).map(e=>[e.sourceId,e.revision])),c=o.length?o:e.sources,l=t&&c.length>1?c.filter(e=>s.get(e.sourceId)!==e.revision):c,u=e=>[...e.reduce((e,t)=>{let n=`${PS(t.revision)}${t.branch?` (${t.branch})`:``}`;return e.set(n,[...e.get(n)??[],t.sourceId]),e},new Map).entries()].map(([e,t])=>`${t.join(`, `)} @ ${e}`),d=u(l),f=u(c).join(` · `),p=new Set(c.map(e=>e.revision)).size,m=l.length===0?`${p} repositories, none changed`:d.length>3?`${d.slice(0,3).join(` · `)} · +${d.length-3} more`:d.join(` · `),h=l.length>0&&l.length<c.length?`${l.length} of ${c.length} changed: `:``;return(0,X.jsxs)(`li`,{className:`run-row${r?` viewing`:``}`,"data-run":e.runId,children:[(0,X.jsx)(`label`,{className:`pick`,children:(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`compare-pick`,checked:n,onChange:e=>i(e.target.checked),"aria-label":`Compare run ${e.runId}`})}),(0,X.jsxs)(`span`,{className:`what`,children:[(0,X.jsxs)(`span`,{className:`title`,children:[(0,X.jsxs)(`strong`,{children:[`Run `,e.runId]}),e.current?(0,X.jsx)(`span`,{className:`badge`,children:`latest`}):null,e.kind===`branch`?(0,X.jsx)(`span`,{className:`badge`,children:`branch`}):null,e.kind===`draft`?(0,X.jsx)(`span`,{className:`badge`,children:`draft`}):null,e.kind===`debug`?(0,X.jsxs)(`span`,{className:`badge`,"data-testid":`debug-badge`,children:[`debug · until `,e.until]}):null]}),(0,X.jsxs)(`span`,{className:`commits`,title:f||void 0,children:[h,m||`no sources`]}),(0,X.jsxs)(`span`,{className:`muted small`,children:[e.reused?.length?(0,X.jsx)(`span`,{"data-testid":`run-reused`,children:`${e.reused.join(`, `)} reused · `}):null,e.trigger===`commit`?`commit hook`:e.trigger,` · +`,e.written.toLocaleString(`en-US`),` / −`,e.closed.toLocaleString(`en-US`),` facts · `,FS(e.finishedAt)]})]}),(0,X.jsx)(`button`,{className:`link`,"data-command":`open-run`,onClick:a,disabled:r,children:r?`Viewing`:`View`})]})}function LS({project:e,refresh:t,run:n,compare:r,diff:i,diffError:a,onView:o,onCompare:s,onClose:c,onLocate:l,stages:u=[],onDebug:d,onFrom:f}){let[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(``),_=u.slice(1),[v,b]=(0,y.useState)(null),[x,S]=(0,y.useState)(null),[C,w]=(0,y.useState)(r?[r.a,r.b]:[]);(0,y.useEffect)(()=>{r&&w([r.a,r.b])},[r?.a,r?.b]);let[T,E]=(0,y.useState)(``);(0,y.useEffect)(()=>{let t=!1;return Y.history(e).then(e=>!t&&(b(e),S(null)),e=>!t&&S(e.message)),()=>{t=!0}},[e,t]);let D=(e,t)=>w(n=>t?[...n.filter(t=>t!==e),e].slice(-2):n.filter(t=>t!==e)),O=C.length===2?{a:Math.min(...C),b:Math.max(...C)}:null,k=(0,y.useMemo)(()=>new Set((i?.items??[]).filter(e=>e.type===`File`&&e.change===`removed`).map(e=>e.id)),[i]),A=(0,y.useMemo)(()=>{if(!i)return[];let e=T.trim().toLowerCase(),t=new Map(i.files.map(e=>[e.file??`\0${e.source}`,e.group?.name??e.source])),n=new Map;for(let r of i.items){let i=jS(r);if(e&&!`${i} ${r.file??``} ${r.type}`.toLowerCase().includes(e))continue;let a=r.file??`\0${r.source}`,o=t.get(a)??r.source,s=n.get(o);s||n.set(o,s=new Map);let c=s.get(a);c||s.set(a,c=[]),c.push({item:r,words:i})}return[...n].sort(([e],[t])=>e<t?-1:1)},[i,T]);return(0,X.jsxs)(`div`,{className:`history-panel`,"data-testid":`history-panel`,children:[(0,X.jsxs)(`div`,{className:`history-head`,children:[(0,X.jsx)(`strong`,{children:`History`}),(0,X.jsx)(`button`,{className:`icon`,"data-command":`toggle-history`,"aria-label":`Close History`,onClick:c,children:`×`})]}),r?(0,X.jsxs)(`section`,{className:`changes`,"aria-label":`Changes`,"data-testid":`change-list`,children:[(0,X.jsxs)(`div`,{className:`compare-head`,children:[(0,X.jsxs)(`span`,{children:[`Changes from run `,r.a,` to run `,r.b]}),(0,X.jsx)(`button`,{className:`link`,"data-command":`compare-runs`,onClick:()=>s(null),children:`Stop comparing`})]}),a?(0,X.jsx)(`p`,{className:`error`,children:a}):i?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`summary`,"data-testid":`change-summary`,children:MS(i)}),(0,X.jsxs)(`p`,{className:`legend muted small`,children:[`On the canvas:`,` `,(0,X.jsxs)(`span`,{className:`change added`,children:[(0,X.jsx)(`span`,{className:`sign`,children:`+`}),`added`]}),` `,`(solid blue border),`,` `,(0,X.jsxs)(`span`,{className:`change removed`,children:[(0,X.jsx)(`span`,{className:`sign`,children:`−`}),`removed`]}),` `,`(dashed orange),`,` `,(0,X.jsxs)(`span`,{className:`change changed`,children:[(0,X.jsx)(`span`,{className:`sign`,children:`~`}),`changed`]}),` `,`(double purple).`]}),i.latestOnly.length>0&&(0,X.jsxs)(`p`,{className:`muted small`,children:[`Not compared (plain folders have no history): `,i.latestOnly.join(`, `)]}),(0,X.jsx)(`input`,{type:`search`,className:`filter`,placeholder:`Filter changes`,"aria-label":`Filter changes`,"data-testid":`change-filter`,value:T,onChange:e=>E(e.target.value)}),A.map(([e,t])=>(0,X.jsxs)(`div`,{className:`change-group`,children:[(0,X.jsx)(`h4`,{children:e}),[...t].map(([e,t])=>(0,X.jsxs)(`div`,{className:`change-file`,children:[(0,X.jsx)(`div`,{className:`file-name`,children:e.startsWith(`\0`)?`(the repository)`:e.slice(e.indexOf(`:`)+1)}),(0,X.jsx)(`ul`,{children:t.map(({item:e,words:t})=>{let n=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sign`,"aria-hidden":`true`,children:kS[e.change]}),(0,X.jsxs)(`span`,{className:`visually-hidden`,children:[AS[e.change],`: `]}),t]});return(0,X.jsx)(`li`,{className:`change ${e.change}`,children:NS(e,k)?(0,X.jsx)(`button`,{className:`link`,"data-testid":`change-item`,"data-id":e.id,"data-change":e.change,onClick:()=>l(e),children:n}):(0,X.jsx)(`span`,{"data-testid":`change-item`,"data-id":e.id,"data-change":e.change,children:n})},`${e.change}:${e.id}`)})})]},e))]},e)),i.truncated&&(0,X.jsxs)(`p`,{className:`muted small`,children:[`The first `,i.items.length,` of`,` `,i.total.added+i.total.removed+i.total.changed,` changes are listed.`]})]}):(0,X.jsx)(`p`,{className:`muted`,children:`Comparing…`})]}):null,x?(0,X.jsx)(`p`,{className:`error`,children:x}):null,v?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`compare-bar`,children:[(0,X.jsx)(`button`,{"data-command":`compare-runs`,disabled:!O,onClick:()=>O&&s(O),title:`Pick two runs to compare`,children:O?`Compare run ${O.a} with run ${O.b}`:`Pick two runs to compare`}),n!==null&&(0,X.jsx)(`button`,{className:`link`,"data-command":`open-run`,onClick:()=>o(null),children:`Back to latest`})]}),(0,X.jsxs)(`ol`,{className:`runs`,"aria-label":`Runs`,children:[v.draft&&(0,X.jsx)(IS,{run:v.draft,picked:C.includes(v.draft.runId),viewing:n===v.draft.runId,onPick:e=>D(v.draft.runId,e),onView:()=>o(v.draft.runId)}),v.debug&&(0,X.jsx)(IS,{run:v.debug,picked:C.includes(v.debug.runId),viewing:n===v.debug.runId,onPick:e=>D(v.debug.runId,e),onView:()=>o(v.debug.runId)}),v.runs.map((e,t)=>(0,X.jsx)(IS,{run:e,previous:v.runs[t+1],picked:C.includes(e.runId),viewing:n===null?e.current:n===e.runId,onPick:t=>D(e.runId,t),onView:()=>o(e.current?null:e.runId)},e.runId))]}),v.hidden>0&&(0,X.jsxs)(`p`,{className:`muted small`,children:[v.hidden,` older runs aren't shown: this license shows 30 days of history.`]}),v.latestOnly.length>0&&(0,X.jsxs)(`p`,{className:`muted small`,children:[`Not under version control, so latest only: `,v.latestOnly.join(`, `),`. History and diffs need git.`]}),d&&u.length>0&&v.runs.length>0&&(0,X.jsxs)(`form`,{className:`debug-run`,onSubmit:e=>{e.preventDefault(),d(p||u[0])},children:[(0,X.jsxs)(`label`,{className:`muted small`,children:[`Debug run: stop after`,` `,(0,X.jsx)(`select`,{"data-testid":`debug-until`,value:p||u[0],onChange:e=>m(e.target.value),children:u.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]}),(0,X.jsx)(`button`,{type:`submit`,"data-command":`analyze-debug`,"data-testid":`analyze-debug`,title:`Never committed: open it and compare it with the latest`,children:`Run`})]}),f&&_.length>0&&v.runs.length>0&&(0,X.jsxs)(`form`,{className:`debug-run`,onSubmit:e=>{e.preventDefault(),f(h||_.at(-1))},children:[(0,X.jsxs)(`label`,{className:`muted small`,children:[`Analyze again from`,` `,(0,X.jsx)(`select`,{"data-testid":`from-stage`,value:h||_.at(-1),onChange:e=>g(e.target.value),children:_.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]}),(0,X.jsx)(`button`,{type:`submit`,"data-command":`analyze-from`,"data-testid":`analyze-from`,title:`The stages before it are reused, when nothing they read has changed since the latest run`,children:`Run`})]}),(0,X.jsxs)(`p`,{className:`muted small hook-note`,children:[`A run for each commit: `,(0,X.jsx)(`code`,{children:`veoflow hook install`}),` in a repository.`]})]}):!x&&(0,X.jsx)(`p`,{className:`muted`,children:`Loading…`})]})}var RS=e=>e.startsWith(`sha256:`)?``:e.slice(0,7),zS=e=>e.split(`
|
|
334
|
+
`).map(e=>e.trim()).filter(Boolean);function BS({source:e,onSave:t,onCancel:n}){let[r,i]=(0,y.useState)(e.include.join(`
|
|
335
|
+
`)),[a,o]=(0,y.useState)(e.exclude.join(`
|
|
336
|
+
`));return(0,X.jsxs)(`form`,{className:`rules-editor`,"data-testid":`rules-editor`,onSubmit:e=>{e.preventDefault(),t({include:zS(r),exclude:zS(a)})},children:[(0,X.jsxs)(`p`,{className:`muted small`,children:[`Glob patterns, one per line, relative to the repository (`,(0,X.jsx)(`code`,{children:`src/legacy/`}),`,`,` `,(0,X.jsx)(`code`,{children:`**/*.test.ts`}),`). Applied at the next analysis; files left out are closed in the graph and kept in history.`]}),(0,X.jsxs)(`label`,{children:[`Include only`,(0,X.jsx)(`textarea`,{"data-testid":`rules-include`,value:r,onChange:e=>i(e.target.value)})]}),(0,X.jsxs)(`label`,{children:[`Leave out`,(0,X.jsx)(`textarea`,{"data-testid":`rules-exclude`,value:a,onChange:e=>o(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`actions`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,"data-testid":`rules-save`,children:`Save and re-analyze`})]})]})}function VS({project:e,refresh:t,onAdd:n,onChooseFiles:r,onAnalyzeAll:i,onChanged:a,escape:o}){let[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(``),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)({top:0,right:0}),[E,D]=(0,y.useState)(!1),[O,k]=(0,y.useState)(0);(0,y.useEffect)(()=>{let t=!1;return Y.sources(e).then(e=>!t&&c(e.sources.map(e=>({...e,optIn:e.optIn??[]}))),e=>!t&&u(e.message)),()=>{t=!0}},[e,t,O]);let A=async(e,t,n)=>{D(!0),u(``),n&&f(n);try{await e(),f(t),a()}catch(e){f(``),u(e.message??String(e))}finally{D(!1),k(e=>e+1)}},j=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!S)return;j.current?.querySelector(`button`)?.focus();let e=e=>{e.type===`mousedown`&&j.current?.contains(e.target)||C(null)};return document.addEventListener(`mousedown`,e),window.addEventListener(`resize`,e),document.addEventListener(`scroll`,e,!0),()=>{document.removeEventListener(`mousedown`,e),window.removeEventListener(`resize`,e),document.removeEventListener(`scroll`,e,!0)}},[S]),o.current=()=>{if(S){let e=S;return C(null),document.querySelector(`tr[data-source="${CSS.escape(e)}"] [data-testid="repo-more"]`)?.focus(),!0}return p?(m(null),!0):b?(x(null),!0):_?(v(null),!0):!1};let M=(0,y.useRef)(null);if((0,y.useEffect)(()=>{(_||b)&&(M.current?.scrollIntoView({block:`nearest`}),M.current?.querySelector(`textarea, button`)?.focus())},[_,b]),(0,y.useEffect)(()=>{s&&(_&&!s.some(e=>e.id===_)&&v(null),b&&!s.some(e=>e.id===b)&&x(null))},[s,_,b]),!s)return(0,X.jsx)(`p`,{className:l?`error`:`muted`,children:l||`Loading…`});let N=_?s.find(e=>e.id===_):void 0;return(0,X.jsxs)(`div`,{className:`repositories`,"data-testid":`repositories`,children:[(0,X.jsxs)(`div`,{className:`repo-actions`,children:[(0,X.jsx)(`button`,{"data-testid":`repo-add`,onClick:n,children:`+ Add folder`}),(0,X.jsx)(`button`,{"data-testid":`repo-analyze-all`,disabled:E,onClick:i,children:`Re-analyze all`})]}),l&&(0,X.jsx)(`p`,{className:`error`,role:`alert`,children:l}),d&&(0,X.jsx)(`p`,{className:`muted small`,role:`status`,"data-testid":`repo-status`,children:d}),(0,X.jsxs)(`table`,{className:`repo-table`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:`Repository`}),(0,X.jsx)(`th`,{children:`Branch and commit`}),(0,X.jsx)(`th`,{children:`Analyzed`}),(0,X.jsx)(`th`,{children:`Files`}),(0,X.jsx)(`th`,{children:`Left out`}),(0,X.jsx)(`th`,{children:(0,X.jsx)(`span`,{className:`visually-hidden`,children:`Actions`})})]})}),(0,X.jsx)(`tbody`,{children:s.map(t=>{let n=t.analysis,i=t.include.length+t.exclude.length;return(0,X.jsxs)(`tr`,{"data-source":t.id,children:[(0,X.jsxs)(`td`,{children:[p===t.id?(0,X.jsx)(`form`,{onSubmit:n=>{n.preventDefault(),m(null),A(()=>Y.updateSource(e,t.id,{name:h}),`Renamed ${t.id} to ${h||t.id}.`)},onBlur:e=>!e.currentTarget.contains(e.relatedTarget)&&m(null),children:(0,X.jsx)(`input`,{autoFocus:!0,"aria-label":`New name for ${t.id}`,"data-testid":`repo-name`,value:h,onChange:e=>g(e.target.value)})}):(0,X.jsx)(`strong`,{className:`repo-name`,children:t.name??t.id}),(0,X.jsx)(`div`,{className:`muted small path`,children:t.root}),n?.notices.map(e=>(0,X.jsx)(`div`,{className:`notice-line small`,children:e},e))]}),(0,X.jsx)(`td`,{className:`mono small`,children:n?n.kind===`plain`?`plain folder (latest only)`:`${n.branch??`detached`} · ${RS(n.revision)}${n.pinned?` (kept)`:``}`:`not analyzed yet`}),(0,X.jsx)(`td`,{className:`small`,children:n?Ce(n.analyzedAt):``}),(0,X.jsx)(`td`,{className:`small`,children:n?n.files:``}),(0,X.jsx)(`td`,{className:`small`,children:i?`${i} rule${i===1?``:`s`}`:`defaults`}),(0,X.jsxs)(`td`,{className:`row-actions`,children:[(0,X.jsx)(`button`,{className:`link`,"data-testid":`repo-analyze`,"aria-label":`Re-analyze ${t.name??t.id}`,disabled:E,onClick:()=>void A(()=>Y.analyzeSource(e,t.id),`Analyzing ${t.name??t.id} again (the others stay at their commits)…`,`Starting an analysis of ${t.name??t.id}…`),children:`Re-analyze`}),(0,X.jsx)(`button`,{className:`link`,"data-testid":`repo-choose`,"aria-label":`Choose files in ${t.name??t.id}`,onClick:()=>r(t.id),children:`Choose files…`}),(0,X.jsxs)(`span`,{className:`menu-wrap`,children:[(0,X.jsx)(`button`,{className:`icon`,"aria-label":`More for ${t.name??t.id}`,"aria-expanded":S===t.id,"data-testid":`repo-more`,disabled:E,onClick:e=>{let n=e.currentTarget.getBoundingClientRect();T({top:n.bottom+2,right:window.innerWidth-n.right}),C(S===t.id?null:t.id)},children:`⋯`}),S===t.id&&(0,X.jsxs)(`span`,{className:`menu`,role:`menu`,ref:j,style:{top:w.top,right:w.right},children:[(0,X.jsx)(`button`,{role:`menuitem`,"data-testid":`repo-rename`,onClick:()=>{C(null),g(t.name??t.id),m(t.id)},children:`Rename`}),(0,X.jsx)(`button`,{role:`menuitem`,"data-testid":`repo-rules`,onClick:()=>{C(null),v(t.id)},children:`Edit rules`}),(0,X.jsx)(`button`,{role:`menuitem`,"data-testid":`repo-remove`,onClick:()=>{C(null),x(t.id)},children:`Remove…`})]})]})]})]},t.id)})})]}),s.length===0&&(0,X.jsx)(`p`,{className:`muted`,children:`No repositories yet: + Add folder adds one.`}),N&&(0,X.jsx)(`div`,{ref:M,children:(0,X.jsx)(BS,{source:N,onCancel:()=>v(null),onSave:t=>{let n=N.id;v(null),A(async()=>{await Y.updateSource(e,n,t),await Y.analyzeSource(e,n)},`Rules saved; analyzing ${n} again…`)}},N.id)}),b&&(0,X.jsxs)(`div`,{className:`confirm`,role:`alertdialog`,"aria-labelledby":`remove-title`,"data-testid":`repo-remove-confirm`,children:[(0,X.jsx)(`p`,{id:`remove-title`,children:(0,X.jsxs)(`strong`,{children:[`Remove `,s.find(e=>e.id===b)?.name??b,` from this project?`]})}),(0,X.jsx)(`p`,{className:`muted small`,children:`Its files and links leave the current graph. History keeps the analysis: earlier runs still show it, and adding the folder again analyzes it afresh. The folder itself is not touched.`}),(0,X.jsxs)(`div`,{className:`actions`,children:[(0,X.jsx)(`button`,{onClick:()=>x(null),"data-testid":`repo-remove-cancel`,children:`Cancel`}),(0,X.jsx)(`button`,{className:`danger`,"data-testid":`repo-remove-yes`,disabled:E,onClick:()=>{let t=b;x(null),A(()=>Y.removeSource(e,t),`Removed ${t}; history keeps its analysis.`,`Removing ${t} (a run closes its facts)…`)},children:`Remove`})]})]})]})}function HS({project:e}){let[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(null);return(0,y.useEffect)(()=>{Y.projectSettings(e).then(e=>n(String(e.settings.maxFileMB)),e=>i({ok:!1,text:e.message}))},[e]),(0,X.jsxs)(`form`,{className:`analysis-settings`,onSubmit:n=>{n.preventDefault();let r=Number(t);if(!(r>0&&r<=64))return i({ok:!1,text:`The size limit is more than 0 and at most 64 MB.`});Y.saveProjectSettings(e,{maxFileMB:r}).then(e=>i({ok:!0,text:`Saved: files over ${e.settings.maxFileMB} MB are left out at the next analysis.`}),e=>i({ok:!1,text:e.message}))},children:[(0,X.jsxs)(`label`,{children:[`Size limit per file (MB)`,(0,X.jsx)(`input`,{type:`number`,min:.1,max:64,step:.1,required:!0,"data-testid":`analysis-max-mb`,value:t,onChange:e=>n(e.target.value)})]}),(0,X.jsxs)(`p`,{className:`muted small`,children:[`Larger files are listed but not analyzed, unless you choose them in Choose files. Folders of installed libraries, generated output and tools' workspaces (`,(0,X.jsx)(`code`,{children:`node_modules`}),`, `,(0,X.jsx)(`code`,{children:`dist`}),`,`,` `,(0,X.jsx)(`code`,{children:`build`}),`, …) are left out by default; Choose files shows them and can add them.`]}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,"data-testid":`analysis-save`,children:`Save`}),r&&(0,X.jsx)(`p`,{className:r.ok?`muted small`:`error`,role:r.ok?`status`:`alert`,children:r.text})]})}function US({project:e,projectName:t,refresh:n,onClose:r,onAdd:i,onChooseFiles:a,onAnalyzeAll:o,onChanged:s,covered:c=!1,initialTab:l=`repositories`}){let[u,d]=(0,y.useState)(l),f=(0,y.useRef)(null),p=(0,y.useRef)(null),m=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let e=document.activeElement;return p.current?.focus(),()=>e?.focus?.()},[]),(0,y.useEffect)(()=>{if(c)return;let e=e=>{if(e.key===`Escape`)e.stopPropagation(),m.current?.()||r();else if(e.key===`Tab`&&f.current){let t=[...f.current.querySelectorAll(`button:not([disabled]), input, textarea, select`)],n=t[0],r=t[t.length-1];f.current.contains(document.activeElement)?e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus()):(e.preventDefault(),n?.focus())}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[c,r]),(0,X.jsx)(`div`,{className:`backdrop`,onMouseDown:e=>e.target===e.currentTarget&&r(),children:(0,X.jsxs)(`div`,{className:`modal wide`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`project-settings-title`,"data-testid":`project-settings-dialog`,ref:f,children:[(0,X.jsxs)(`div`,{className:`modal-head`,children:[(0,X.jsxs)(`h2`,{id:`project-settings-title`,children:[t,`: settings`]}),(0,X.jsx)(`button`,{className:`icon`,"aria-label":`Close`,onClick:r,ref:p,children:`×`})]}),(0,X.jsx)(`div`,{className:`segmented`,role:`tablist`,"aria-label":`Project settings`,children:[`repositories`,`analysis`,`license`].map(e=>(0,X.jsx)(`button`,{role:`tab`,"aria-selected":u===e,"data-testid":`project-tab-${e}`,onClick:()=>d(e),children:e===`repositories`?`Repositories`:e===`analysis`?`Analysis`:`License`},e))}),u===`repositories`?(0,X.jsx)(VS,{project:e,refresh:n,onAdd:i,onChooseFiles:a,onAnalyzeAll:o,onChanged:s,escape:m}):u===`analysis`?(0,X.jsx)(HS,{project:e}):(0,X.jsx)(He,{onChanged:s})]})})}var WS={library:`installed library code`,generated:`generated or built output`,tool:`a tool's or coding agent's workspace (settings, history, worktrees)`};function GS(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}var KS=(e,t)=>`${e}\0${t}`,qS=(e,t)=>JSON.stringify([e.include,e.exclude,e.optIn??[]])===JSON.stringify([t?.include??[],t?.exclude??[],t?.optIn??[]]);function JS({project:e,files:t,run:n,onAnalyze:r,onClose:i,only:a,at:o}){let[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(new Map),[d,f]=(0,y.useState)(new Set),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(new Map),[S,C]=(0,y.useState)(new Map),[w,T]=(0,y.useState)(null),[E,D]=(0,y.useState)(``),O=(0,y.useRef)(new Set),k=s.length>1,A=(0,y.useCallback)(e=>n?.sources.find(t=>t.sourceId===e),[n]),j=(0,y.useCallback)(async(t,n)=>{let{entries:r}=await Y.browse(e,t,n);O.current.add(KS(t,n)),u(e=>new Map(e).set(KS(t,n),r))},[e]),M=(0,y.useCallback)(async()=>{await Promise.all([...O.current].map(e=>{let[t,n]=e.split(`\0`);return j(t,n).catch(()=>O.current.delete(e))}))},[j]);(0,y.useEffect)(()=>{let t=!1;return(async()=>{try{let[{sources:n},{settings:r}]=await Promise.all([Y.sources(e),Y.projectSettings(e)]);if(t)return;let i=n.map(e=>({...e,optIn:e.optIn??[]})).filter(e=>a===void 0||e.id===a);c(i),T(r.maxFileMB),D(String(r.maxFileMB)),await Promise.all(i.map(e=>j(e.id,``)))}catch(e){t||m(e.message??String(e))}})(),()=>{t=!0}},[e,j,a]),(0,y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(h?g(null):i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,i]),(0,y.useEffect)(()=>{if(!o||!a||s.length===0)return;let e=o.split(`/`).filter(Boolean),t=e.slice(0,-1).map((t,n)=>e.slice(0,n+1).join(`/`));f(e=>new Set([...e,...t.map(e=>KS(a,e))])),Promise.all(t.filter(e=>!O.current.has(KS(a,e))).map(e=>j(a,e))).then(()=>requestAnimationFrame(()=>document.querySelector(`.picker-row[data-path="${CSS.escape(o)}"]`)?.scrollIntoView({block:`center`})),e=>m(e.message))},[o,a,s.length,j]);let N=(e,t)=>{let n=KS(e,t);f(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t}),O.current.has(n)||j(e,t).catch(e=>m(e.message))},P=(0,y.useMemo)(()=>{let e=[],t=(n,r,i)=>{for(let a of l.get(KS(n,r))??[]){if(a.kind===`file`&&!a.language&&!a.path.toLowerCase().endsWith(`.html`))continue;let r=a.kind===`dir`&&d.has(KS(n,a.path));e.push({source:n,entry:a,depth:i,open:r}),r&&t(n,a.path,i+1)}};for(let e of s)t(e.id,``,+!!k);return e},[l,d,s,k]),F=(e,t)=>{if(t.kind!==`dir`)return!1;let n=e=>e.replace(/^\/+/,``).startsWith(`${t.path}/`),r=l.get(KS(e.id,t.path));if(t.excludedBy)return e.optIn.some(n)?!0:!!r?.some(e=>!e.excludedBy);if(r?.some(e=>e.excludedBy&&(e.kind===`dir`||e.language))||e.exclude.some(e=>e.startsWith(`/`)&&n(e)))return!0;let i=A(e.id),a=t=>e.optIn.some(e=>t===e||t.startsWith(`${e}/`));return i?.defaultExcluded?.some(e=>n(e.path)&&!a(e.path))?!0:qS(e,i?.filter)&&!!i?.ruleExcluded?.some(e=>n(e.path)&&!a(e.path))},I=(e,n,r)=>{if(!r)return-t.filter(t=>t.source===e&&(t.path===n.path||t.path.startsWith(`${n.path}/`))).length;if(n.kind===`file`)return 1;let i=A(e);return i?.defaultExcluded?.find(e=>e.path===n.path)?.files??i?.ruleExcluded?.find(e=>e.path===n.path)?.files??null},L=async(t,n,r)=>{v(!0),m(``),x(e=>new Map(e).set(KS(t,n.path),r));try{let{source:i}=await Y.select(e,t,[n.path],r);c(e=>e.map(e=>e.id===t?{...i,optIn:i.optIn??[]}:e)),C(e=>{let i=new Map(e),a=KS(t,n.path);return i.has(a)?i.delete(a):i.set(a,I(t,n,r)),i}),await M()}catch(e){m(e.message??String(e))}finally{x(e=>{let r=new Map(e);return r.delete(KS(t,n.path)),r}),v(!1)}},R=(e,t,n)=>{if(!_){if(n&&t.excludedBy&&t.excludedBy!==`rule`){let n=t.path.slice(t.path.lastIndexOf(`/`)+1),r=A(e)?.defaultExcluded?.find(e=>e.path===t.path),i=t.kind===`dir`&&r?.files?` It has ${r.files.toLocaleString(`en-US`)} file${r.files===1?``:`s`}.`:``;if(t.excludedBy===`too-large`)g({source:e,entry:t,title:`Analyze ${n}?`,text:`${t.path} is ${GS(t.size??0)}, over the ${w??10} MB size limit. Files this large are usually generated or bundled code (minified builds, vendored bundles, source maps), and they slow analysis down. Files over 64 MB are never analyzed.`});else if(t.excludedBy===`minified`)g({source:e,entry:t,title:`Analyze ${n}?`,text:`${t.path} looks minified: most of it is on very long lines, as in a library build. A build adds thousands of functions that aren't your project's own code. Analyze it if it is your code.`});else{let r=WS[t.excludedBy]??WS.generated;g({source:e,entry:t,title:`Analyze ${n}?`,text:`${t.path} is ${r}, not your project's own code.${i} Analyzing it makes analysis slower and the graph larger. Its files will be marked as ${t.excludedBy} code and left out of "largest files" and "most called".`})}return}L(e,t,n)}},z=async()=>{let t=Number(E);if(!Number.isFinite(t)||t<=0||t>64){m(`The size limit must be a number of megabytes between 0 and 64.`);return}try{let{settings:n}=await Y.saveProjectSettings(e,{maxFileMB:t});T(n.maxFileMB),C(e=>new Map(e).set(`\0limit`,null)),await M()}catch(e){m(e.message??String(e))}},B=S.size>0||s.some(e=>!qS(e,A(e.id)?.filter))||w!==null&&n?.sources[0]?.maxFileBytes!==void 0&&n.sources[0].maxFileBytes!==w*1048576,V=0,H=0,U=!1;for(let[e,t]of S)e!==`\0limit`&&(t===null?U=!0:t>0?V+=t:H-=t);let W=e=>`${e} file${e===1?``:`s`}`,G=[U?V?`${V}+ files added`:`files added`:V?`${W(V)} added`:``,H?`${W(H)} removed`:``].filter(Boolean).join(`, `);return(0,X.jsxs)(`div`,{className:`picker`,"data-testid":`file-picker`,children:[(0,X.jsxs)(`div`,{className:`picker-head`,children:[(0,X.jsx)(`strong`,{children:`Choose files`}),(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{onClick:i,"data-testid":`picker-done`,children:`Done`})]}),(0,X.jsx)(`p`,{className:`muted small picker-help`,children:`Unchecked files are left out of the graph. Greyed folders are left out by default: libraries and generated output.`}),(0,X.jsxs)(`label`,{className:`picker-limit`,children:[`Skip files over`,(0,X.jsx)(`input`,{type:`number`,min:1,max:64,step:1,value:E,"data-testid":`size-limit`,"aria-label":`Size limit in MB`,onChange:e=>D(e.target.value),onBlur:()=>E!==String(w)&&void z(),onKeyDown:e=>e.key===`Enter`&&void z()}),`MB`]}),p&&(0,X.jsx)(`p`,{className:`error small`,role:`alert`,children:p}),B&&(0,X.jsxs)(`div`,{className:`picker-pending`,"data-testid":`picker-pending`,children:[(0,X.jsxs)(`span`,{children:[G?(0,X.jsx)(`strong`,{children:G[0].toUpperCase()+G.slice(1)}):`Changes`,` at the next analysis`]}),(0,X.jsx)(`button`,{className:`primary`,"data-testid":`picker-apply`,disabled:_,onClick:()=>{C(new Map),r()},children:`Apply & re-analyze`})]}),(0,X.jsxs)(`div`,{className:`picker-list`,role:`tree`,"aria-label":`Choose files`,children:[s.map(e=>k?(0,X.jsx)(`div`,{className:`picker-row source`,title:e.root,children:(0,X.jsx)(`strong`,{children:e.id})},`s:${e.id}`):null),P.map(({source:e,entry:t,depth:n,open:r})=>{let i=s.find(t=>t.id===e),a=b.get(KS(e,t.path))??!t.excludedBy,c=F(i,t),l=t.path.slice(t.path.lastIndexOf(`/`)+1),u=t.notAnalyzable?t.notAnalyzable===`declaration-file`?`type declarations`:t.notAnalyzable===`symlink`?`link`:`${GS(t.size??0)} · over 64 MB`:t.excludedBy===`library`?`library`:t.excludedBy===`generated`||t.excludedBy===`tool`?t.excludedBy:t.excludedBy===`too-large`?`${GS(t.size??0)} · too large`:t.excludedBy===`minified`?`minified`:t.excludedBy===`rule`?`excluded`:null,d=t.optedIn?t.origin??null:null;return(0,X.jsxs)(`div`,{className:`picker-row ${t.kind} ${a?``:`excluded`}${t.path===o?` target`:``}`,style:{paddingLeft:8+n*14},role:`treeitem`,"aria-expanded":t.kind===`dir`?r:void 0,"aria-level":n+1,"data-path":t.path,children:[t.kind===`dir`?(0,X.jsx)(`button`,{className:`caret`,"aria-label":`${r?`Close`:`Open`} ${l}`,onClick:()=>N(e,t.path),children:r?`▾`:`▸`}):(0,X.jsx)(`span`,{className:`caret`}),t.kind===`dir`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:a,"data-testid":`pick`,"aria-label":`Analyze ${l}`,ref:e=>{e&&(e.indeterminate=c)},"aria-checked":c?`mixed`:a,onChange:n=>R(e,t,n.target.checked)}),(0,X.jsx)(`button`,{className:`name button-link`,"data-command":`open-folder`,onClick:()=>N(e,t.path),children:l})]}):(0,X.jsxs)(`label`,{children:[t.notAnalyzable?(0,X.jsx)(`span`,{className:`caret`}):(0,X.jsx)(`input`,{type:`checkbox`,checked:a,"data-testid":`pick`,ref:e=>{e&&(e.indeterminate=c)},"aria-checked":c?`mixed`:a,onChange:n=>R(e,t,n.target.checked)}),(0,X.jsx)(`span`,{className:`name`,children:l})]}),u&&(0,X.jsx)(`small`,{className:`reason`,children:u}),d&&(0,X.jsx)(`small`,{className:`origin ${d}`,children:d})]},KS(e,t.path))}),s.length>0&&P.length===0&&!p&&(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`})]}),h&&(0,X.jsx)(`div`,{className:`backdrop`,onMouseDown:e=>e.target===e.currentTarget&&g(null),children:(0,X.jsxs)(`div`,{className:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`pick-warning-title`,"data-testid":`pick-warning`,children:[(0,X.jsx)(`h2`,{id:`pick-warning-title`,children:h.title}),(0,X.jsx)(`p`,{children:h.text}),(0,X.jsxs)(`div`,{className:`buttons`,children:[(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{autoFocus:!0,onClick:()=>g(null),children:`Cancel`}),(0,X.jsx)(`button`,{className:`primary`,"data-testid":`pick-warning-confirm`,onClick:()=>{let e=h;g(null),L(e.source,e.entry,!0)},children:`Analyze anyway`})]})]})})]})}var YS=e=>e.toLocaleString(`en-US`);function XS(e){if(e.sites===0)return null;let t=e.sites-e.open,n=Math.floor(t/e.sites*100);return e.open>0?Math.min(n,99):n}function ZS(e){let t=XS(e);return t===null?`No calls found`:`Paths: ${t}% of ${YS(e.sites)} call site${e.sites===1?``:`s`} go somewhere known${e.open?` · ${YS(e.open)} stop short`:``}`}function QS(e){return[{label:`within files`,count:e.withinFiles},{label:`across files`,count:e.acrossFiles},{label:`leave the project`,count:e.external},{label:`to one known body`,count:e.candidates.one},{label:`to a set of candidates`,count:e.candidates.several},{label:`stop short`,count:e.open}]}function $S({projects:e,progress:t=new Map,loading:n=!1,onOpen:r,onCreated:i,onAddFolder:a,onDeleted:o}){let[s]=sS(),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(``),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(null),[v,b]=(0,y.useState)(!1),x=e=>{_({id:e}),Y.projectDisk(e).then(({bytes:t})=>_(n=>n?.id===e?{...n,bytes:t}:n),()=>void 0)},S=async e=>{if(!v){b(!0);try{await Y.deleteProject(e),_(null),o(e)}catch(t){_(n=>n?.id===e?{...n,error:t.message??String(t)}:n)}finally{b(!1)}}},C=()=>{l(!1),d(``),p(``)},w=async()=>{if(!m){h(!0),p(``);try{let{project:e}=await Y.createProject(u.trim());C(),i(e.id)}catch(e){p(e.message??String(e))}finally{h(!1)}}};return(0,X.jsxs)(`section`,{className:`home`,"data-testid":`home`,"aria-labelledby":`home-title`,children:[(0,X.jsxs)(`div`,{className:`home-head`,children:[(0,X.jsx)(`h1`,{id:`home-title`,children:`Projects`}),(0,X.jsxs)(`div`,{className:`home-actions`,children:[(0,X.jsx)(`button`,{"data-testid":`new-project`,onClick:()=>l(!0),children:`+ New project`}),(0,X.jsx)(`button`,{className:`primary`,"data-testid":`home-add-folder`,onClick:a,children:`Add folder`})]})]}),c&&(0,X.jsxs)(`form`,{className:`new-project`,onSubmit:e=>{e.preventDefault(),w()},children:[(0,X.jsxs)(`label`,{children:[`Name`,(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`new-project-name`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Escape`&&C()})]}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!u.trim()||m,"data-testid":`new-project-create`,children:`Create`}),(0,X.jsx)(`button`,{type:`button`,onClick:C,children:`Cancel`}),f&&(0,X.jsx)(`p`,{className:`error`,role:`alert`,children:f})]}),n?(0,X.jsx)(`p`,{className:`muted`,children:`Loading…`}):e.length===0?(0,X.jsx)(`p`,{className:`muted`,children:`No projects yet. Add a folder to analyze its code.`}):(0,X.jsx)(`ul`,{className:`project-cards`,children:e.map(e=>{let n=!s&&e.ownFindings||e.findings,i=n?n.broken+n.notAnalyzed+n.openCalls:0;return(0,X.jsxs)(`li`,{"data-project":e.id,children:[(0,X.jsxs)(`button`,{className:`project-card`,"data-testid":`open-project`,onClick:()=>r(e.id),children:[(0,X.jsx)(`strong`,{children:e.name}),(0,X.jsx)(`span`,{className:`muted small`,"data-testid":`project-sources`,children:e.repositories===void 0?`${e.sources} source${e.sources===1?``:`s`}`:[e.repositories?`${e.repositories} repositor${e.repositories===1?`y`:`ies`}`:``,e.folders?`${e.folders} folder${e.folders===1?``:`s`}`:``].filter(Boolean).join(` · `)||`no sources`}),e.error?(0,X.jsxs)(`span`,{className:`error small`,"data-testid":`project-error`,children:[`Can't be read: `,e.error]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`small`,children:e.latest?e.latest.status===`running`?t.get(e.id)?T(t.get(e.id)).text:`Analyzing…`:e.latest.status===`failed`?e.latest.errorCode===`cancelled`?`Last analysis cancelled`:`Last analysis failed`:`Analyzed${e.latest.finishedAt?` ${Ce(e.latest.finishedAt)}`:``}`:`Not analyzed yet`}),e.analysis?.outdated.length?(0,X.jsx)(`span`,{className:`small outdated-note`,"data-testid":`project-outdated`,children:e.analysis.outdated.every(e=>e.was===null)?`Made before veoflow recorded its version: analyze again to see what this version finds`:`Made by ${e.analysis.veoflow?`veoflow ${e.analysis.veoflow}`:`another veoflow`}: analyze again to see what this version finds`}):null,!n&&e.findingsPending&&(0,X.jsx)(`span`,{className:`muted small`,"data-testid":`findings-pending`,children:`Counting findings…`}),e.files&&e.files.analyzed<e.files.listed&&(0,X.jsx)(`span`,{className:`small`,"data-testid":`files-not-analyzed`,children:e.files.analyzed===0?`None of ${e.files.listed.toLocaleString(`en-US`)} files analyzed`:`${(e.files.listed-e.files.analyzed).toLocaleString(`en-US`)} of ${e.files.listed.toLocaleString(`en-US`)} files not analyzed`}),e.files?.listed===0&&(0,X.jsx)(`span`,{className:`small`,"data-testid":`files-not-analyzed`,children:`No files veoflow analyzes`}),e.completeness&&!(e.files&&e.files.analyzed===0)&&(0,X.jsx)(`span`,{className:`small`,"data-testid":`project-paths`,children:ZS(e.completeness)}),n&&!(e.files&&e.files.analyzed===0)&&(0,X.jsx)(`span`,{className:`muted small`,children:i===0?`No findings`:[n.broken?`${n.broken} broken import${n.broken===1?``:`s`}`:``,n.notAnalyzed?`${n.notAnalyzed} import${n.notAnalyzed===1?``:`s`} not analyzed`:``,n.openCalls?`${n.openCalls.toLocaleString(`en-US`)} open call${n.openCalls===1?``:`s`}`:``].filter(Boolean).join(` · `)})]})]}),(0,X.jsx)(`button`,{className:`project-delete`,"data-testid":`project-delete`,"aria-label":`Delete ${e.name}`,title:`Delete this project`,onClick:()=>x(e.id),children:`Delete…`}),g?.id===e.id&&(0,X.jsxs)(`div`,{className:`confirm`,role:`alertdialog`,"aria-labelledby":`delete-${e.id}`,"data-testid":`project-delete-confirm`,onKeyDown:e=>e.key===`Escape`&&_(null),children:[(0,X.jsx)(`p`,{id:`delete-${e.id}`,children:(0,X.jsxs)(`strong`,{children:[`Delete `,e.name,`?`]})}),(0,X.jsxs)(`p`,{className:`muted small`,children:[`Its graph, history and evidence`,g.bytes===void 0?``:` (${eC(g.bytes)})`,` are deleted, and the commit hooks veoflow installed for it. The folders it analyzed are not touched. This can't be undone.`]}),g.error&&(0,X.jsx)(`p`,{className:`error small`,role:`alert`,children:g.error}),(0,X.jsxs)(`div`,{className:`actions`,children:[(0,X.jsx)(`button`,{autoFocus:!0,onClick:()=>_(null),"data-testid":`project-delete-cancel`,children:`Cancel`}),(0,X.jsx)(`button`,{className:`danger`,"data-testid":`project-delete-yes`,disabled:v,onClick:()=>void S(e.id),children:`Delete project`})]})]})]},e.id)})})]})}function eC(e){return e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:`${Math.ceil(e/1024)} KB`}function tC({title:e,entries:t,x:n,y:r,onClose:i}){let a=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=document.activeElement;a.current?.querySelector(`button`)?.focus();let t=e=>{e.type===`mousedown`&&a.current?.contains(e.target)||i()},n=e=>{if(e.key===`Escape`){e.stopPropagation(),i();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let t=[...a.current?.querySelectorAll(`button`)??[]],n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},r=e=>{a.current?.contains(e.relatedTarget)||i()},o=a.current;return document.addEventListener(`mousedown`,t),window.addEventListener(`resize`,t),document.addEventListener(`scroll`,t,!0),window.addEventListener(`keydown`,n,!0),o?.addEventListener(`focusout`,r),()=>{document.removeEventListener(`mousedown`,t),window.removeEventListener(`resize`,t),document.removeEventListener(`scroll`,t,!0),window.removeEventListener(`keydown`,n,!0),o?.removeEventListener(`focusout`,r),e&&e!==document.body&&document.contains(e)&&e.focus()}},[i]);let o=Math.max(4,Math.min(n,window.innerWidth-260)),s=Math.max(4,Math.min(r,window.innerHeight-40-t.length*30));return(0,X.jsxs)(`div`,{ref:a,className:`context-menu`,role:`menu`,"aria-label":e,"data-testid":`context-menu`,style:{left:o,top:s},children:[(0,X.jsx)(`div`,{className:`context-title`,"aria-hidden":`true`,children:e}),t.map(e=>(0,X.jsx)(`button`,{role:`menuitem`,tabIndex:-1,"data-command-name":e.command,onClick:()=>{i(),e.run()},children:e.label},e.label))]})}function nC(e,t){let n=e.trim().toLowerCase();if(!n)return 0;let r=t.toLowerCase(),i=r.indexOf(n);if(i>=0)return i;let a=0,o=0;for(let e of r)if(e===n[a]?a++:a>0&&o++,a===n.length)return 100+o;return null}function rC(e,t,n){return n===0?[]:t.map((t,n)=>({item:t,i:n,score:nC(e,t.label)})).filter(e=>e.score!==null).sort((e,t)=>e.score-t.score||e.i-t.i).slice(0,n).map(e=>e.item)}function iC(e,t){let{view:n,command:r}=t,i=e.trim(),a=[];if(n.project){let e=rC(i,t.files.map(e=>({...e,label:e.path})),i?5:0);for(let i of e)a.push({key:`file:${i.id}`,group:`Files`,label:i.path,run:()=>n.tab===`imports`?r(`openImportsFile`,{file:i.id}):r(`openFile`,{file:i.id})}),e.length<=2&&(n.tab===`imports`&&n.group!==null&&!n.fileLevel&&a.push({key:`only:${i.id}`,group:`Files`,label:`Show only links of ${i.path}`,run:()=>r(`showOnlyLinks`,{id:i.id})}),a.push({key:`leave:${i.id}`,group:`Files`,label:`Leave ${i.path} out of analysis…`,run:()=>t.action(`chooseFiles`,{source:i.id.slice(0,i.id.indexOf(`:`)),path:i.path})}));for(let e of rC(i,t.groups.map(e=>({...e,label:e.name})),i?4:0))a.push({key:`group:${e.id}`,group:`Groups`,label:e.name,detail:`open the group`,run:()=>r(`openGroup`,{group:e.id})}),a.push({key:`only:${e.id}`,group:`Groups`,label:`Show only links of ${e.name}`,run:()=>{(n.tab!==`imports`||n.group!==null||n.fileLevel)&&r(`openGroup`,{}),r(`showOnlyLinks`,{id:e.id})}}),a.push({key:`pick:${e.id}`,group:`Groups`,label:`Details of ${e.name}`,detail:`on the project map`,run:()=>{(n.tab!==`imports`||n.group!==null||n.fileLevel)&&r(`openGroup`,{}),r(`pickNode`,{id:e.id})}})}let o=[],s=(e,t,n,r)=>o.push({label:e,run:t,...n?{detail:n}:{},...r?{key:r}:{}});if(n.project){s(n.history?`Close History`:`History: runs by commit`,()=>r(`toggleHistory`)),n.compare&&s(`Stop comparing`,()=>r(`compareRuns`,{}));let e=/^(?:compare\s+)?(?:run\s*)?(\d+)\s*(?:\.\.|with|vs|and|,|\s)\s*(?:run\s*)?(\d+)$/i.exec(i);if(e){let[t,n]=[Number(e[1]),Number(e[2])];s(`Compare run ${Math.min(t,n)} with run ${Math.max(t,n)}`,()=>r(`compareRuns`,{a:t,b:n}))}n.run!==null&&s(`Back to latest`,()=>r(`openRun`,{}));let a=/^(?:view\s+)?run\s*(\d+)$/i.exec(i);a&&s(`View run ${a[1]}`,()=>r(`openRun`,{run:Number(a[1])})),s(`File tab`,()=>r(`showTab`,{tab:`file`}),`functions and calls inside a file`),s(`Imports tab`,()=>r(`showTab`,{tab:`imports`}),`how files depend on each other`),s(`Project map`,()=>r(`openArea`,{}),`the Imports tab from the top: the whole map`),s(`Show the code`,()=>r(`showPanel`,{panel:`evidence`})),s(`Show Findings`,()=>r(`showPanel`,{panel:`questions`})),s(n.showPending?`Hide pending imports`:`Show pending imports`,()=>r(`togglePending`)),s(n.showUnresolved?`Hide unresolved call sites`:`Show unresolved call sites`,()=>r(`toggleUnresolved`)),n.selection&&s(`Clear the selection`,()=>r(`clearSelection`));let o=n.selection?.kind===`function`?n.selection.id:null,c=o??n.file;if(c){let e=o?o.slice(o.indexOf(`:`,o.indexOf(`:`)+1)+1):c.slice(c.indexOf(`:`)+1);s(`Reach from ${e}`,()=>r(`openReach`,{root:c,direction:`forward`}),`what paths from it reach`),s(`What reaches ${e}`,()=>r(`openReach`,{root:c,direction:`backward`}),`the paths that lead to it`)}n.reach&&n.tab!==`reach`&&s(`Reach tab`,()=>r(`showTab`,{tab:`reach`})),n.only&&s(`Show everything again`,()=>r(`showOnlyLinks`,{}),`not only one item's links`);for(let e of t.sources)s(`Re-analyze ${e.name??e.id}`,()=>t.action(`analyzeSource`,{source:e.id}),`this repository only`,`analyze:${e.id}`);if(t.sources.length>1){n.source&&s(`Scope: all repositories`,()=>r(`scopeSource`,{}));for(let e of t.sources)e.id!==n.source&&s(`Scope: ${e.name??e.id}`,()=>r(`scopeSource`,{source:e.id}),`one repository only`,`scope:${e.id}`)}n.group&&i.includes(`/`)&&s(`Open or close folder ${i}`,()=>r(`toggleFolder`,{path:i.replace(/^\.?\//,``).replace(/\/$/,``)})),s(`Re-analyze the project`,()=>t.action(`analyze`)),t.canDraft&&s(`Analyze uncommitted edits`,()=>t.action(`analyzeDraft`),`a draft beside the graph`);for(let e of(t.stages??[]).slice(1))s(`Analyze again from ${e}`,()=>t.action(`analyzeFrom`,{from:e}),`the stages before it reused, when nothing they read changed`,`from:${e}`);for(let e of t.stages??[])s(`Debug run: stop after ${e}`,()=>t.action(`analyzeDebug`,{until:e}),`never committed; compare it with the latest`,`debug:${e}`);s(`Repositories…`,()=>t.action(`openProjectSettings`),`re-analyze, choose files, rename, remove`),s(`License…`,()=>t.action(`openProjectSettings`,{tab:`license`}),`what the license includes; add or replace a key`)}n.project&&s(`All projects (home)`,()=>r(`goHome`),`every project and its last run`),s(`Add a folder…`,()=>t.action(`addFolder`)),s(`Settings…`,()=>t.action(`openSettings`),`the model for questions`);for(let e of t.projects)e.id!==n.project&&s(`Switch to project ${e.name}`,()=>r(`selectProject`,{project:e.id}),void 0,`project:${e.id}`);let c=o.filter(e=>/^(Compare run|View run|Open or close folder)/.test(e.label)),l=rC(i,o.filter(e=>!c.includes(e)),i?6:0);for(let e of[...c,...l])a.push({key:`cmd:${e.key??e.label}`,group:`Commands`,label:e.label,run:e.run,...e.detail?{detail:e.detail}:{}});return a}var aC=e=>e.slice(e.lastIndexOf(`/`)+1),oC=20;function sC({project:e,file:t,run:n,onOpen:r,onShowImports:i}){let{calls:a,error:o}=_S(e,n,t);if(o)return(0,X.jsx)(`p`,{className:`small muted`,children:`Calls to and from other files couldn't be loaded.`});if(!a||a.out.total===0&&a.in.total===0)return null;let s=(e,t)=>{if(e.total===0)return null;let n=new Map;for(let r of e.calls){let e=t===`out`?r.from:r.to,i=t===`out`?r.to:r.from,a=n.get(i.id)??{there:i,here:new Set,n:0,line:r.evidence.span.start.line};a.here.add(xe(e)),a.n++,n.set(i.id,a)}let i=[...n.values()].sort((e,t)=>t.n-e.n||(e.there.path<t.there.path?-1:1)),a=e.total-e.calls.length;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[t===`out`?`Calls into other files`:`Called from other files`,` (`,e.total,n.size!==e.total&&a===0?`, ${n.size} function${n.size===1?``:`s`}`:``,`)`]}),(0,X.jsx)(`ul`,{className:`cross-calls`,"data-testid":`file-cross-calls-${t}`,children:i.slice(0,oC).map(({there:e,here:n,n:i,line:a})=>{let o=[...n],s=`${o.slice(0,2).join(`, `)}${o.length>2?` and ${o.length-2} more`:``}`;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link-row`,"data-command":`open-cross-file`,title:`Open ${xe(e)} in ${e.path}`,onClick:()=>r({id:e.id,file:e.file}),children:[(0,X.jsxs)(`span`,{className:`name`,children:[(0,X.jsxs)(`span`,{className:`muted`,children:[aC(e.path),` › `]}),xe(e),i>1&&(0,X.jsxs)(`span`,{className:`times`,children:[` ×`,i]})]}),(0,X.jsxs)(`small`,{children:[t===`out`?`from ${s}`:`calls ${s}`,i===1?` · line ${a}`:``]})]})},e.id)})}),(i.length>oC||a>0)&&(0,X.jsxs)(`p`,{className:`small muted`,children:[i.length>oC?`${(i.length-oC).toLocaleString(`en-US`)} more functions`:`${a.toLocaleString(`en-US`)} more calls`,`: select a function to see its own.`]})]})};return(0,X.jsxs)(`div`,{className:`file-cross-calls`,"data-testid":`file-cross-calls`,children:[i&&(0,X.jsx)(`button`,{className:`button-link`,"data-command":`cross-calls-in-imports`,onClick:i,children:`⇄ See them drawn on the Imports tab`}),s(a.out,`out`),s(a.in,`in`)]})}var cC=`area|`,lC=`singles|`,uC=e=>e.root,dC=(e,t)=>t===``||e===t||e.startsWith(`${t}/`),fC=()=>({broken:0,notAnalyzed:0,pending:0,openCalls:0});function pC(e){let t=e.indexOf(`|`);return t<0?{source:e,path:``}:{source:e.slice(0,t),path:e.slice(t+1)}}function mC(e,t,n,r,i,a){let o=fC();for(let e of a)o.broken+=e.findings.broken,o.notAnalyzed+=e.findings.notAnalyzed,o.pending+=e.findings.pending,o.openCalls+=e.findings.openCalls;return{id:e,name:t,kind:n,source:r,root:i,files:a.reduce((e,t)=>e+t.files,0),functions:a.reduce((e,t)=>e+t.functions,0),externalPackages:0,findings:o,members:a.length}}function hC(e,t){let n=new Map,r=new Map;for(let i of e){let e=t.get(i.from),a=t.get(i.to);if(!e||!a||e===a)continue;let o=`${e}->${a}`,s=n.get(o);if(s){let e=(s.references??0)+(i.references??0),{carrying:t,references:r,...a}=s;n.set(o,{...a,imports:s.imports+i.imports,calls:s.calls+i.calls,...e?{references:e}:{},...s.carrying!==void 0&&i.carrying!==void 0?{carrying:s.carrying+i.carrying}:{}})}else n.set(o,{...i,id:o,from:e,to:a});if(l(i)){let e=r.get(o)??{from:new Set,to:new Set};e.from.add(i.from),e.to.add(i.to),r.set(o,e)}}return[...n.values()].map(e=>{let t=r.get(e.id),n=!e.from.startsWith(`group|`)||!e.to.startsWith(`group|`);return t&&n?{...e,groups:{from:t.from.size,to:t.to.size}}:e}).sort((e,t)=>e.id<t.id?-1:1)}function gC(e,t){let n=pC(t);return e.groups.filter(e=>e.source===n.source&&dC(uC(e),n.path))}function _C(e,t,n=new Set){let r=[...new Set(e.groups.map(e=>e.source))].sort(),i=t?pC(t):null,a=i?e.groups.filter(e=>e.source===i.source&&dC(uC(e),i.path)):e.groups,o=new Map,s=[],c=[],l=!1;if(a.length>30){let u=new Map;for(let e of a){let t,n,a;if(!i&&r.length>1)t=`${e.source}|`,n=e.source,a=``;else{let r=i?.path??``,o=r===``?uC(e):uC(e).slice(r.length+1),s=o.split(`/`)[0]??``;if(o===``||s===``){c.push(e);continue}a=r===``?s:`${r}/${s}`,t=`${e.source}|${a}`,n=`${a}/`}let o=u.get(t)??{name:n,source:e.source,root:a,members:[]};o.members.push(e),u.set(t,o)}if(u.size===1&&c.length===0){let[r]=u.keys();if(r!==t)return _C(e,r,n)}for(let[e,t]of u){if(t.members.length===1){c.push(t.members[0]);continue}l=!0;let n=`${cC}${e}`;s.push(mC(n,t.name,`area`,t.source,t.root,t.members));for(let e of t.members)o.set(e.id,n)}}else c.push(...a);let u=new Map;for(let e of c)if(e.kind===`cluster`&&e.files===1){let t=`${e.source}|${uC(e)}`;u.set(t,[...u.get(t)??[],e])}for(let e of c){let t=`${e.source}|${uC(e)}`;e.kind===`cluster`&&e.files===1&&u.get(t).length>1&&!n.has(t)||(s.push(e),o.set(e.id,e.id))}for(let[e,t]of u){if(t.length<2||n.has(e))continue;let r=`${lC}${e}`,{source:i,path:a}=pC(e);s.push(mC(r,`${a?`${a}/`:`(top)`}`,`singles`,i,a,t));for(let e of t)o.set(e.id,r)}return s.sort((e,t)=>e.id<t.id?-1:1),{area:t,summary:l,map:{...e,groups:s,dependsOn:hC(e.dependsOn,o)}}}function vC(e,t){let{source:n,path:r}=pC(e),i=t?[{area:`${n}|`,label:n}]:[],a=r?r.split(`/`):[];for(let e=1;e<=a.length;e++)i.push({area:`${n}|${a.slice(0,e).join(`/`)}`,label:a[e-1]});return i}var yC=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`;function bC({project:e,run:t,source:n,group:r,file:i,fileLevel:a,expand:o,showPending:s,onOpenGroup:c,onCloseGroup:l,onOpenFile:u,onToggleFolder:d,onCollapse:f,onMenu:p,sources:m=[],onScope:h,area:g=null,onAllGroups:_}){let[v,b]=(0,y.useState)(``),{groups:x,error:S}=pS(e,t,0,n),C=a&&i!==null,{imports:w}=hS(e,t,C?i:null),T=C?w?.file.group??null:r??(x&&x.total===1?x.groups[0]?.id??null:null),{group:E}=mS(e,t,T,C?[]:o,s),D=(0,y.useMemo)(()=>{let e=v.trim().toLowerCase(),t=new Map;for(let n of x?g&&!T?gC(x,g):x.groups:[])(!e||n.name.toLowerCase().includes(e)||n.id===T)&&t.set(n.source,[...t.get(n.source)??[],n]);for(let e of t.values())e.sort((e,t)=>e.name<t.name?-1:+(e.name>t.name));return[...t].sort((e,t)=>e[0]<t[0]?-1:1)},[x,v,T,g]),O=D.length,k=e=>{let t=e.id===T,n=t&&!C&&r===e.id,a=e.findings.broken;return(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`button`,{className:`outline-group${t?` current`:``}`,"data-command":`outline-group`,"data-id":e.id,"aria-expanded":t,title:`${e.name}: ${yC(e.files,`file`)}, ${yC(e.functions,`function`)}${a?`, ${yC(a,`broken import`)}`:``}${n?` (close it)`:``}`,onClick:()=>n?l():c(e.id),onContextMenu:p&&(t=>{t.preventDefault(),p({kind:`group`,id:e.id,data:{label:e.name},x:t.clientX,y:t.clientY})}),children:[(0,X.jsx)(`span`,{className:`caret`,"aria-hidden":`true`,children:t?`▾`:`▸`}),(0,X.jsx)(`span`,{className:`name`,children:e.name}),a>0&&(0,X.jsx)(`small`,{className:`badge broken`,title:yC(a,`broken import`),children:a}),(0,X.jsx)(`small`,{className:`count`,children:e.files})]}),t&&E&&(0,X.jsxs)(`ul`,{className:`outline-files`,children:[!C&&o.map(t=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`outline-folder open`,"data-command":`outline-folder`,"data-path":t,"aria-expanded":`true`,title:`${t}/: open on the canvas (close it)`,onClick:()=>d(t),children:[(0,X.jsx)(`span`,{className:`caret`,"aria-hidden":`true`,children:`▾`}),(0,X.jsxs)(`span`,{className:`name`,children:[tS(t,e.root),`/`]})]})},`open:${t}`)),E.nodes.map(t=>t.kind===`folder`?(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`outline-folder`,"data-command":`outline-folder`,"data-path":t.path,"aria-expanded":`false`,title:`${t.path}/: ${yC(t.files,`file`)} (open it on the canvas)`,onClick:()=>C?c(e.id,t.path):d(t.path),children:[(0,X.jsx)(`span`,{className:`caret`,"aria-hidden":`true`,children:`▸`}),(0,X.jsxs)(`span`,{className:`name`,children:[tS(t.path,e.root),`/`]}),(0,X.jsx)(`small`,{className:`count`,children:t.files})]})},t.id):(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`outline-file${t.id===i&&C?` current`:``}`,"data-command":`outline-file`,"data-file":t.id,title:t.path,onClick:()=>u(t.id,e.id),onContextMenu:p&&(e=>{e.preventDefault(),p({kind:`file`,id:t.id,data:{},x:e.clientX,y:e.clientY})}),children:[(0,X.jsx)(`span`,{className:`name`,children:tS(t.path,e.root)}),t.findings.broken>0&&(0,X.jsx)(`small`,{className:`badge broken`,children:t.findings.broken})]})},t.id))]})]},e.id)},[A,j]=(0,y.useState)(new Set),M=e=>{let t=e=>e.kind===`cluster`&&e.files===1,n=new Map;for(let r of e)t(r)&&n.set(r.root,[...n.get(r.root)??[],r]);let r=[],i=new Set;for(let a of e){let e=n.get(a.root);if(!t(a)||!e||e.length<2)r.push({type:`group`,g:a});else if(!i.has(a.root)){i.add(a.root);let t=`${a.source}|${a.root}`,n=A.has(t)||v.trim()!==``||e.some(e=>e.id===T);r.push({type:`singles`,key:t,root:a.root,members:e,open:n})}}return r};return(0,X.jsxs)(`nav`,{className:`nav outline`,"aria-label":`Groups`,"data-testid":`group-outline`,children:[(0,X.jsxs)(`div`,{className:`nav-head`,children:[(m.length>1||n)&&(0,X.jsxs)(`label`,{className:`nav-scope`,children:[(0,X.jsx)(`span`,{className:`small muted`,children:`Scope`}),(0,X.jsxs)(`select`,{"data-command":`scope-source`,value:n??``,onChange:e=>h?.(e.target.value||null),children:[(0,X.jsx)(`option`,{value:``,children:`All repositories`}),m.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.name??e.id},e.id))]})]}),(0,X.jsxs)(`div`,{className:`outline-head`,children:[(0,X.jsx)(`input`,{className:`nav-filter`,placeholder:`Filter ${x?yC(x.total,`group`):`groups`}…`,"aria-label":`Filter groups`,"data-testid":`outline-filter`,value:v,onChange:e=>b(e.target.value)}),(0,X.jsx)(`button`,{className:`icon`,title:`Hide this pane ( [ )`,"aria-label":`Hide the groups pane`,onClick:f,children:`⟨`})]}),(0,X.jsx)(`button`,{className:`outline-map${!T&&!C?` current`:``}`,"data-command":`outline-project-map`,onClick:()=>c(),title:`The project map: every group`,children:`⌂ Project map`})]}),(0,X.jsxs)(`div`,{className:`nav-list outline-list`,children:[S&&(0,X.jsx)(`p`,{className:`hint error`,children:S}),x&&g&&!T&&(0,X.jsxs)(`p`,{className:`small muted outline-area`,"data-testid":`outline-area`,children:[g.slice(g.indexOf(`|`)+1)?`In ${g.slice(g.indexOf(`|`)+1)}/:`:`In the ${g.slice(0,g.indexOf(`|`))} repository:`,` `,yC(gC(x,g).length,`group`),` ·`,` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>(_??(()=>c()))(),children:`all groups`})]}),x&&!x.stage2&&(0,X.jsx)(`p`,{className:`hint`,children:`Groups come from import analysis (Stage 2), which hasn't run for this project.`}),D.map(([e,t])=>(0,X.jsxs)(`section`,{children:[O>1&&(0,X.jsx)(`h4`,{className:`outline-source`,children:e}),(0,X.jsx)(`ul`,{children:M(t).map(e=>e.type===`group`?k(e.g):(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`button`,{className:`outline-singles`,"data-command":`outline-singles`,"aria-expanded":e.open,title:`${e.members.length} groups of one file each in ${e.root||`the top folder`}`,onClick:()=>j(t=>{let n=new Set(t);return n.has(e.key)?n.delete(e.key):n.add(e.key),n}),children:[(0,X.jsx)(`span`,{className:`caret`,"aria-hidden":`true`,children:e.open?`▾`:`▸`}),(0,X.jsxs)(`span`,{className:`name`,children:[e.root?`${e.root}/`:`(top)`,` · `,e.members.length,` single files`]}),(0,X.jsx)(`small`,{className:`count`,children:e.members.length})]}),e.open&&(0,X.jsx)(`ul`,{className:`outline-singles-list`,children:e.members.map(k)})]},e.key))})]},e))]})]})}function xC(e){switch(e.context){case`argument`:return`to ${e.handedTo} (argument ${(e.argument??0)+1})`;case`jsx-attribute`:return`as ${e.handedTo}`;case`property`:return`as ${e.handedTo} in an object`;case`array-element`:return`in an array`;case`return`:return`as its result`;default:return`to ${e.handedTo}`}}function SC({project:e,fn:t,run:n,onOpen:r}){let[i,a]=(0,y.useState)(null);if((0,y.useEffect)(()=>{let n=!1;return Promise.all([Y.references(e,t,`out`),Y.references(e,t,`in`)]).then(([e,r])=>!n&&a({fn:t,out:e,in:r}),()=>!n&&a(`error`)),()=>{n=!0}},[e,t,n]),i===`error`||i===null||i.fn!==t||i.out.total===0&&i.in.total===0)return null;let o=e=>e.evidence.span.start.line,s=e=>e.truncated?`${e.total}; the first ${e.references.length} shown`:`${e.total}`;return(0,X.jsxs)(`div`,{className:`imported-calls handed-on`,"data-testid":`handed-on`,children:[i.out.references.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Hands on (`,s(i.out),`)`]}),i.out.references.map(e=>(0,X.jsxs)(`div`,{className:`imported-call`,"data-testid":`handed-on-out`,children:[(0,X.jsxs)(`span`,{className:`mono small`,children:[e.to.name,` · line `,o(e)]}),(0,X.jsxs)(`span`,{className:`small`,children:[`passes `,(0,X.jsx)(`strong`,{children:e.to.name}),e.to.file!==e.from.file&&(0,X.jsxs)(X.Fragment,{children:[` `,`in `,(0,X.jsx)(`span`,{className:`mono`,children:e.to.path})]}),` `,xC(e),`; whatever receives it may call it`]}),e.to.file!==e.from.file&&(0,X.jsx)(`span`,{className:`small links`,children:(0,X.jsx)(`button`,{className:`button-link`,"data-command":`open-handed-on`,onClick:()=>r({id:e.to.id,file:e.to.file}),children:`Open that file`})})]},e.id))]}),i.in.references.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Handed on by (`,s(i.in),`)`]}),i.in.references.map(e=>(0,X.jsxs)(`div`,{className:`imported-call`,"data-testid":`handed-on-in`,children:[(0,X.jsxs)(`span`,{className:`small`,children:[(0,X.jsx)(`strong`,{children:e.from.name}),` in `,(0,X.jsx)(`span`,{className:`mono`,children:e.from.path}),` passes it`,` `,xC(e),` · line `,o(e)]}),(0,X.jsx)(`span`,{className:`small links`,children:(0,X.jsx)(`button`,{className:`button-link`,"data-command":`open-handed-on`,onClick:()=>r({id:e.from.id,file:e.from.file}),children:`Open`})})]},e.id))]})]})}var CC=e=>e.reason===`imported-symbol`||e.reason===`template-reference`;function wC(e){let t=e.group;if(!t)return e.path;let n=t.root&&e.path.startsWith(`${t.root}/`)?e.path.slice(t.root.length+1):e.path;return`${t.name} › ${n}`}var TC={broken:`its import is broken`,pending:`its import waits for another source`,"not-analyzed":`its import leads to a file not analyzed`};function EC({project:e,graph:t,fn:n,onOpen:r,onShowImports:i}){let[a,o]=(0,y.useState)(null),s=t.file.id,c=t.unresolved.some(CC);(0,y.useEffect)(()=>{if(!c)return;let t=!1;return Y.siteLinks(e,s).then(e=>!t&&o({file:s,byId:new Map(e.links.map(e=>[e.site,e]))}),()=>!t&&o({file:s,byId:`error`})),()=>{t=!0}},[e,s,t.committedRun,c]);let l=t.unresolved.filter(e=>e.enclosingFn===n&&CC(e)&&!e.component).sort((e,t)=>e.evidence.span.start.offset-t.evidence.span.start.offset);if(l.length===0)return null;let u=a?.file===s?a.byId:null,d=u===`error`?null:u;return(0,X.jsxs)(`div`,{className:`imported-calls`,"data-testid":`imported-calls`,children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Calls into other files (`,l.length,`)`]}),u===`error`&&(0,X.jsx)(`p`,{className:`small muted`,children:`Where these calls lead couldn't be loaded.`}),l.map(e=>{let t=d?.get(e.id),n=e.importSpecifier?`imported from ${e.importSpecifier}`:`defined in another file`;return(0,X.jsxs)(`div`,{className:`imported-call`,"data-testid":`imported-call`,"data-site":e.id,children:[(0,X.jsxs)(`span`,{className:`mono small`,children:[e.expression,` · line `,e.evidence.span.start.line]}),u===`error`?(0,X.jsx)(`span`,{className:`small muted`,children:n}):d===null?(0,X.jsxs)(`span`,{className:`small muted`,children:[n,`…`]}):t?.status===`linked`&&t.target?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`small`,children:[`calls `,(0,X.jsx)(`strong`,{children:t.target.name}),` in`,` `,(0,X.jsx)(`span`,{className:`mono`,children:wC(t.target)}),`, found by`,` `,t.via===`import`||e.reason===`imported-symbol`?`import analysis`:`component linking`]}),(0,X.jsxs)(`span`,{className:`small links`,children:[(0,X.jsx)(`button`,{className:`button-link`,"data-command":`open-imported`,onClick:()=>r({id:t.target.id,file:t.target.file}),children:`Open that file`}),(0,X.jsx)(`button`,{className:`button-link`,"data-command":`show-in-imports`,onClick:i,children:`Show in Imports`})]})]}):t?.status===`external`?(0,X.jsxs)(`span`,{className:`small`,children:[`calls into the external package `,(0,X.jsx)(`strong`,{children:t.package?.name})]}):t?(0,X.jsxs)(`span`,{className:`small`,children:[n,`, not linked`,t.importOutcome?`: ${TC[t.importOutcome]}`:t.candidates?.length?t.exhaustive===!1?`: ${t.candidates.length} known function${t.candidates.length===1?``:`s`} could run (may not be all)`:`: it could be any of ${t.candidates.length} functions`:t.reason?`: ${t.reason}`:``]}):(0,X.jsxs)(`span`,{className:`small muted`,children:[n,`, not linked yet`]})]},e.id)})]})}var DC=(e,t)=>{let n=be(e).name;return n.length>t?`${n.slice(0,t-1)}…`:n},OC=6;function kC(e,t,n,r){let i=e=>e.slice(e.indexOf(`:`)+1),a=e=>e.split(`/`).slice(-2).join(`/`),o=r.calls?t.out.calls:[],s=r.calls?t.in.calls:[],c=new Map,l=e=>{let t=be(e).unnamed;c.set(e.id,{label:t?DC(e,34):`ƒ ${DC(e,32)}`,line:e.line??0})};for(let e of o)l(e.from);for(let e of s)l(e.to);let u=[...c].sort((e,t)=>e[1].line-t[1].line||(e[1].label<t[1].label?-1:+(e[1].label>t[1].label))).map(([e])=>e),d=(e,t)=>({id:`${e}|${t.id}`,file:t.file,label:`${a(t.path)} ›\n${DC(t,28)}`}),f=new Map(s.map(e=>[e.from.id,d(`caller`,e.from)])),p=new Map(o.map(e=>[e.to.id,d(`callee`,e.to)])),m=new Map,h=new Map;if(r.imports&&n){for(let t of n.imports)t.outcome===`file`&&t.file&&t.file.id!==e&&!h.has(t.file.id)&&h.set(t.file.id,{id:`imported|${t.file.id}`,file:t.file.id,label:`${a(t.file.path)}\nimported`,edge:t.id});for(let t of n.importedBy.files)t.file.id!==e&&!m.has(t.file.id)&&m.set(t.file.id,{id:`importer|${t.file.id}`,file:t.file.id,label:`${a(t.file.path)}\nimports this file`,edge:t.id})}let g=e=>[...e.values()].sort((e,t)=>e.label<t.label?-1:+(e.label>t.label)),_=[...g(f),...g(m)],v=[...g(p),...g(h)],y=Math.max(u.length,1),b=e=>-((e-1)*58)/2,x=[{data:{id:`box`,kind:`box`,label:i(e),w:210,h:y*58+50},position:{x:0,y:0},classes:`box`},...u.map((e,t)=>({data:{id:e,kind:`function`,label:c.get(e).label},position:{x:0,y:b(u.length)+t*58+12},classes:`function`})),..._.map((e,t)=>({data:{id:e.id,kind:`port`,side:`left`,file:e.file,label:e.label},position:{x:-330,y:b(_.length)+t*58},classes:e.id.startsWith(`importer|`)?`port file`:`port`})),...v.map((e,t)=>({data:{id:e.id,kind:`port`,side:`right`,file:e.file,label:e.label},position:{x:330,y:b(v.length)+t*58},classes:e.id.startsWith(`imported|`)?`port file`:`port`}))],S=new Map,C=(e,t,n)=>{let r=`${e}->${t}`,i=S.get(r);i?i.calls.push(n):S.set(r,{id:n,source:e,target:t,calls:[n]})};for(let e of o)C(e.from.id,`callee|${e.to.id}`,e.id);for(let e of s)C(`caller|${e.from.id}`,e.to.id,e.id);for(let e of S.values())x.push({data:{id:e.id,kind:`call`,source:e.source,target:e.target,calls:e.calls,label:e.calls.length>1?`×${e.calls.length}`:``},classes:`call`});let w=h.size+m.size<=OC?`imports`:``;for(let e of h.values())x.push({data:{id:`edge|${e.edge}`,edge:e.edge,kind:`import`,source:`box`,target:e.id,label:w},classes:`import`});for(let e of m.values())x.push({data:{id:`edge|${e.edge}`,edge:e.edge,kind:`import`,source:e.id,target:`box`,label:w},classes:`import`});return x}function AC({file:e,calls:t,imports:n,show:r,pick:i,onPick:a,onOpenFile:o,onClear:s,marks:c=null,onContext:l}){let u=(0,y.useRef)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(c);f.current=c;let p=(0,y.useRef)(l);p.current=l,(0,y.useEffect)(()=>{d.current&&Ye(d.current,c)},[c]);let m=(0,y.useRef)({onPick:a,onOpenFile:o,onClear:s});m.current={onPick:a,onOpenFile:o,onClear:s};let h=(0,y.useMemo)(()=>kC(e,t,n,r),[e,t,n,r.calls,r.imports]);(0,y.useEffect)(()=>{if(!u.current)return;let e=W_({container:u.current,elements:h,layout:{name:`preset`},autounselectify:!0,minZoom:.15,maxZoom:2.5,style:[{selector:`node`,style:{shape:`round-rectangle`,width:170,height:36,label:`data(label)`,"text-wrap":`wrap`,"text-max-width":`194px`,"text-valign":`center`,"text-halign":`center`,"font-size":12,color:`#1d2330`,"background-color":`#fff`,"border-width":1,"border-color":`#c9d1de`,"z-index-compare":`manual`,"z-index":2}},{selector:`node.box`,style:{"background-color":`#f7faff`,"border-color":`#c6d6f3`,"border-width":2,"text-valign":`top`,"text-margin-y":18,color:`#2a56ad`,"font-weight":`bold`,width:`data(w)`,height:`data(h)`,events:`no`,"z-index":0}},{selector:`node.function`,style:{height:40,"text-max-width":`156px`,"text-overflow-wrap":`anywhere`}},{selector:`node.port`,style:{width:210,height:42,"border-style":`dashed`,"border-color":`#6b87b8`}},{selector:`node.port.file`,style:{"border-color":`#b7c0cf`,color:`#4a5262`}},{selector:`edge`,style:{"z-index-compare":`manual`,"z-index":1,width:1.5,"curve-style":`bezier`,"line-color":`#6b87b8`,"target-arrow-shape":`triangle`,"target-arrow-color":`#6b87b8`,"arrow-scale":.8,label:`data(label)`,"font-size":10,color:`#5d6675`,"text-background-color":`#fff`,"text-background-opacity":1}},{selector:`edge.import`,style:{"line-color":`#8a93a3`,"line-style":`dashed`,"target-arrow-shape":`vee`,"target-arrow-color":`#5d6675`,"arrow-scale":1.2,"font-size":9}},...Je,{selector:`.picked`,style:{"line-color":`#3b6fd4`,"target-arrow-color":`#3b6fd4`,width:3}}]});return e.on(`tap`,`node`,e=>{e.target.data(`kind`)===`port`&&m.current.onOpenFile(e.target.data(`file`))}),e.on(`tap`,`edge`,e=>m.current.onPick(e.target.data(`edge`)??e.target.id())),e.on(`tap`,t=>{t.target===e&&m.current.onClear()}),e.fit(void 0,30),e.zoom()>1.2&&(e.zoom(1.2),e.center()),d.current=e,Ye(e,f.current),e.on(`cxttap`,`node, edge`,e=>{let t=e.target.data(),n=t.kind===`function`?`function`:t.kind===`port`&&t.file?`file`:t.kind===`call`||t.kind===`import`?`edge`:null;if(!n||!u.current)return;let r=u.current.getBoundingClientRect(),i=e.renderedPosition??{x:0,y:0};p.current?.({kind:n,id:n===`file`&&typeof t.file==`string`?t.file:e.target.id(),data:t,x:r.left+i.x,y:r.top+i.y})}),()=>{d.current=null,e.destroy()}},[h]),(0,y.useEffect)(()=>{let e=d.current;e&&(e.elements().removeClass(`picked`),i&&e.edges().filter(e=>(e.data(`calls`)??[]).includes(i)||e.data(`edge`)===i).addClass(`picked`))},[i,h]);let g=e=>h.filter(t=>t.data.kind===`port`&&t.data.side===e).map(e=>e.data.id).join(` `),_=[t.in,t.out].filter(e=>e.truncated),v=(r.calls?t.out.calls.length+t.in.calls.length:0)===0,b=[...new Map([...t.in.calls.map(e=>e.from),...t.out.calls.map(e=>e.to)].map(e=>[e.file,e])).values()];return(0,X.jsxs)(`div`,{className:`graph-wrap`,children:[v&&r.calls&&(0,X.jsx)(`p`,{className:`hint overlay`,"data-testid":`no-cross-file-calls`,children:`No calls cross into or out of this file.`}),(0,X.jsx)(`div`,{ref:u,className:`graph map`,"data-testid":`file-canvas`,"data-calls":h.filter(e=>e.data.kind===`call`).length,"data-imports":h.filter(e=>e.data.kind===`import`).length,"data-ports-left":g(`left`),"data-ports-right":g(`right`)}),_.length>0&&(0,X.jsxs)(`p`,{className:`hint small overlay`,"data-testid":`calls-truncated`,children:[_.map(e=>`Showing ${e.calls.length} of ${e.total} calls ${e.direction===`in`?`into`:`out of`} this file`).join(`; `),`.`]}),(0,X.jsxs)(`details`,{className:`graph-key`,"data-testid":`imports-file-key`,children:[(0,X.jsx)(`summary`,{children:`Key`}),(0,X.jsxs)(`ul`,{children:[(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node`}),(0,X.jsx)(`span`,{children:`a function in this file that calls or is called across files`})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node port`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`code`,{children:`file ›`}),` a function in another file: callers on the left, what this file calls on the right`]})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-line call`}),(0,X.jsx)(`span`,{children:`calls: one function calls the other (×2: two calls)`})]}),r.imports&&(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node port file`}),(0,X.jsx)(`span`,{children:`another file: one this file imports (right) or one importing it (left)`})]}),r.imports&&(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-line import`}),(0,X.jsx)(`span`,{children:`imports: a file imports another (the one this file imports, or one importing it)`})]})]})]}),(0,X.jsxs)(`ul`,{className:`visually-hidden`,"aria-label":`Cross-file calls`,children:[t.in.calls.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{"data-command":`pick-node`,"data-kind":`call`,"data-id":e.id,"data-direction":`in`,tabIndex:-1,onClick:()=>a(e.id),children:[e.from.path,` › `,xe(e.from),` calls `,xe(e.to)]})},e.id)),t.out.calls.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{"data-command":`pick-node`,"data-kind":`call`,"data-id":e.id,"data-direction":`out`,tabIndex:-1,onClick:()=>a(e.id),children:[xe(e.from),` calls `,e.to.path,` › `,xe(e.to)]})},e.id)),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{"data-command":`open-imports-file`,"data-id":e.file,tabIndex:-1,onClick:()=>o(e.file),children:[`Open `,e.path]})},e.file))]}),(0,X.jsx)(`button`,{className:`fit`,onClick:()=>d.current?.fit(void 0,30),children:`Fit`})]})}var jC=(e,t)=>`${e.toLocaleString()} ${t}${e===1?``:`s`}`;function MC(e){let t=`(${jC(e.imports,`import`)})`;return e.calls===0&&!e.references?`no calls linked ${t}`:[e.calls?jC(e.calls,`call`):``,e.references?jC(e.references,`reference`):``].filter(Boolean).join(`, `).concat(` ${t}`)}var NC=e=>!e.startsWith(`group|`);function PC(e,t){let n=MC(e),r=e.groups;return r?`${NC(e.from)?`${jC(r.from,`group`)} in ${t(e.from)}`:t(e.from)} ${NC(e.from)&&r.from!==1?`call`:`calls`} into ${NC(e.to)?NC(e.from)?`${r.to.toLocaleString()} in ${t(e.to)}`:`${jC(r.to,`group`)} in ${t(e.to)}`:t(e.to)}: ${n}`:`${t(e.from)} calls into ${t(e.to)}: ${n}`}var FC={repository:`repository`,"workspace-package":`workspace package`,cluster:`cluster`,area:`folder`,singles:`single files`},IC=(e,t)=>`${e.toLocaleString()} ${t}${e===1?``:`s`}`,LC=.55;function RC(e){return e.resize(),e.elements().empty()?1:(e.fit(void 0,40),e.zoom()>1.2&&(e.zoom(1.2),e.center()),e.zoom())}function zC(e){let{members:t,kind:n}=e;if(t!==void 0)return n===`singles`?`${IC(t,`single file`)} · open them`:`${IC(t,`group`)} · open it`}var BC=(e,t=30)=>e.length>t?`${e.slice(0,t-1)}…`:e;function VC(e,t){if(!e||!t)return 0;let n=Math.abs(t.x-e.x)/290;return n>1.2||t.x<e.x?-(84*.9+12*Math.min(4,n)):0}var HC=(e,t)=>1+6*Math.sqrt(e/Math.max(1,t));function UC(e,t){return e.startsWith(`group|`)&&t.startsWith(`group|`)?`DEPENDS_ON|${e}|${t}`:`arrow|${encodeURIComponent(e)}|${encodeURIComponent(t)}`}function WC({map:e,layoutKey:t,pick:n,showPackages:r,onPick:i,onOpen:a,onClear:o,marks:s=null,only:c=null,onContext:u}){let d=(0,y.useRef)(null),f=(0,y.useRef)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(null),b=(0,y.useRef)(!1),x=(0,y.useRef)(c);x.current=c;let S=(0,y.useRef)(u);S.current=u,(0,y.useEffect)(()=>{f.current&&Ge(f.current,c)},[c]);let C=(0,y.useRef)(s);C.current=s,(0,y.useEffect)(()=>{f.current&&Ye(f.current,s)},[s]);let w=(0,y.useRef)({x:0,y:0}),T=(0,y.useRef)({onPick:i,onOpen:a,onClear:o});return T.current={onPick:i,onOpen:a,onClear:o},(0,y.useEffect)(()=>{if(!d.current)return;let n=qx(t,e.groups,e.dependsOn.map(e=>({from:e.from,to:e.to,weight:e.imports+e.calls}))),r=e.dependsOn.flatMap(e=>{let t=l(e);return t?[{d:e,weight:t.weight}]:[]}),i=Math.max(1,...r.map(e=>e.weight)),a=new Map(e.groups.map(e=>[e.id,e.name])),o=e=>a.get(e)??e;w.current=n.packages;let s=new Set(e.groups.map(e=>e.source)).size>1,c=[...e.groups.map(e=>{let t=e.findings.broken;return{data:{id:e.id,kind:`group`,label:[BC(e.name),zC(e)??BC(s?`${e.source} · ${FC[e.kind]??e.kind}`:FC[e.kind]??e.kind),t>0?`${IC(e.files,`file`)} · ${IC(t,`broken import`)}`:`${IC(e.files,`file`)} · ${IC(e.functions,`function`)}`].join(`
|
|
337
|
+
`)},position:n.groups[e.id]??{x:0,y:0},classes:t>0?`group broken`:`group`}}),...r.map(({d:e,weight:t})=>({data:{bend:VC(n.groups[e.from],n.groups[e.to]),id:e.id,kind:`depends`,source:e.from,target:e.to,width:HC(t,i),count:t*3>=i&&t>1?String(t):``,label:t*3>=i&&t>1?String(t):``,sentence:PC(e,o)},classes:t===0?`depends unlinked`:`depends`}))],u=W_({container:d.current,elements:c,layout:{name:`preset`},autounselectify:!0,minZoom:.1,maxZoom:2.5,style:[{selector:`node`,style:{shape:`round-rectangle`,width:210,height:84,label:`data(label)`,"text-wrap":`wrap`,"text-max-width":`190px`,"text-valign":`center`,"text-halign":`center`,"font-size":13,"line-height":1.45,color:`#1d2330`,"background-color":`#f7f9fc`,"border-width":1,"border-color":`#c9d1de`}},{selector:`node.broken`,style:{"border-color":`#c9a45c`}},{selector:`node.packages`,style:{"background-color":`#fff`,"border-style":`dashed`,"border-color":`#b7c0cf`,color:`#4a5262`}},{selector:`edge`,style:{width:`data(width)`,"curve-style":`unbundled-bezier`,"control-point-distances":`data(bend)`,"control-point-weights":.5,"line-color":`#9aa6b8`,"target-arrow-shape":`triangle`,"target-arrow-color":`#9aa6b8`,"arrow-scale":.8,label:`data(label)`,"font-size":11,color:`#5d6675`,"text-background-color":`#fff`,"text-background-opacity":1,"text-background-padding":`2px`}},{selector:`edge.unlinked`,style:{"line-style":`dashed`}},{selector:`edge.uses`,style:{"line-style":`dashed`,"line-color":`#c9d1de`,"target-arrow-shape":`none`}},...Je,We,{selector:`node.picked`,style:{"border-width":2,"border-color":`#3b6fd4`,"background-color":`#eef4ff`}},{selector:`edge.picked`,style:{"line-color":`#3b6fd4`,"target-arrow-color":`#3b6fd4`}},{selector:`edge.role-into`,style:{"line-color":`#1f63c6`,"target-arrow-color":`#1f63c6`,color:`#1f63c6`}},{selector:`edge.role-from`,style:{"line-color":`#c25e00`,"target-arrow-color":`#c25e00`,color:`#c25e00`}},{selector:`.faded`,style:{opacity:.25}}]});u.on(`tap`,`node`,e=>{e.target.data(`kind`)===`group`&&T.current.onPick(e.target.id())}),u.on(`dbltap`,`node`,e=>{e.target.data(`kind`)===`group`&&T.current.onOpen(e.target.id())}),u.on(`tap`,`edge`,e=>{e.target.data(`kind`)===`depends`&&T.current.onPick(UC(e.target.data(`source`),e.target.data(`target`)))}),u.on(`tap`,e=>{e.target===u&&T.current.onClear()}),u.on(`mouseover`,`edge`,e=>{let t=e.target.data(`sentence`),n=e.renderedPosition??{x:0,y:0};t&&v({text:t,x:n.x,y:n.y})}),u.on(`mouseout`,`edge`,()=>v(null)),u.on(`pan zoom`,()=>v(null)),b.current=!1,m(RC(u)<LC),u.on(`scrollzoom pinchzoom dragpan`,()=>{b.current=!0});let p=new ResizeObserver(()=>{b.current?u.resize():m(RC(u)<LC)});return d.current&&p.observe(d.current),f.current=u,d.current&&(d.current.veoCy=u),Ge(u,x.current),u.on(`cxttap`,`node, edge`,e=>{let t=e.target.data(),n=t.kind===`group`?`group`:t.kind===`depends`?`edge`:null;if(!n||!d.current)return;let r=d.current.getBoundingClientRect(),i=e.renderedPosition??{x:0,y:0};S.current?.({kind:n,id:n===`file`&&typeof t.file==`string`?t.file:e.target.id(),data:t,x:r.left+i.x,y:r.top+i.y})}),Ye(u,C.current),()=>{p.disconnect(),v(null),f.current=null,u.destroy()}},[e,t]),(0,y.useEffect)(()=>{let t=f.current;if(!t||(t.remove(`#packages, .uses`),!r||e.externalPackages.total===0))return;let n=[],i=e.externalPackages.top.slice(0,4).map(e=>e.name),a=e.externalPackages.total-i.length;n.push({data:{id:`packages`,kind:`packages`,label:[`External packages`,i.join(`, `),a>0?`+ ${a} more`:``].filter(Boolean).join(`
|
|
338
|
+
`)},position:w.current,classes:`packages`});for(let t of e.groups)t.externalPackages>0&&n.push({data:{id:`packages|${t.id}`,kind:`uses`,source:t.id,target:`packages`,width:1,label:``,bend:0},classes:`uses`});t.add(n),b.current||m(RC(t)<LC)},[e,t,r]),(0,y.useEffect)(()=>{let e=f.current;e&&e.batch(()=>{e.elements().removeClass(`picked faded role-into role-from`),e.edges(`[kind = "depends"]`).forEach(e=>{e.data(`label`,e.data(`count`))});let t=(n?.startsWith(`DEPENDS_ON|`)||n?.startsWith(`arrow|`)?e.edges().filter(e=>UC(e.data(`source`),e.data(`target`))===n):null)??(n?e.getElementById(n):null);if(t&&t.nonempty()&&t.isEdge()){let n=t.union(t.connectedNodes());n.addClass(`picked`),e.elements().not(n).addClass(`faded`)}else if(t&&t.nonempty()){let n=t.connectedEdges(`[kind = "depends"]`);t.addClass(`picked`),n.forEach(e=>{let n=e.data(`source`)===t.id();e.addClass(n?`role-into`:`role-from`);let r=e.data(`count`);e.data(`label`,n?`▶${r?` ${r}`:``}`:`◀${r?` ${r}`:``}`)});let r=t.union(n);e.elements().not(r).not(r.connectedNodes()).addClass(`faded`)}})},[n,e,t,r]),(0,X.jsxs)(`div`,{className:`graph-wrap`,children:[(0,X.jsx)(`div`,{ref:d,className:`graph map`,"data-testid":`project-map`,tabIndex:0,role:`application`,"aria-label":`Project map: arrow keys move between groups, Enter opens one`,onKeyDown:t=>{let r=e.groups.map(e=>e.id);if(r.length===0)return;let s=n?r.indexOf(n):-1;if(t.key===`ArrowRight`||t.key===`ArrowDown`)i(r[(s+1)%r.length]);else if(t.key===`ArrowLeft`||t.key===`ArrowUp`)i(r[(s-1+r.length)%r.length]);else if(t.key===`Enter`&&n)a(n);else if(t.key===`Escape`)o();else return;t.preventDefault()}}),(0,X.jsx)(`ul`,{className:`visually-hidden`,"aria-label":`Groups`,children:e.groups.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`button`,{"data-command":`pick-node`,"data-id":e.id,tabIndex:-1,onClick:()=>i(e.id),children:e.name}),(0,X.jsxs)(`button`,{"data-command":`open-group`,"data-id":e.id,tabIndex:-1,onClick:()=>a(e.id),children:[`Open `,e.name]})]},e.id))}),(0,X.jsx)(`ul`,{className:`visually-hidden`,"aria-label":`Arrows`,children:e.dependsOn.filter(e=>l(e)).map(t=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{"data-command":`pick-node`,"data-arrow":!0,"data-id":UC(t.from,t.to),tabIndex:-1,onClick:()=>i(UC(t.from,t.to)),children:PC(t,t=>e.groups.find(e=>e.id===t)?.name??t)})},t.id))}),_&&!h&&(0,X.jsx)(`div`,{className:`map-hover`,"data-testid":`arrow-hover`,role:`status`,style:{left:_.x+12,top:_.y+12},children:_.text}),!h&&(0,X.jsx)(`p`,{className:`overlay map-key small muted`,"data-testid":`map-key`,children:`A ──▶ B: A calls into B · callers left, what they call right`}),h&&(0,X.jsx)(`ul`,{className:`map-list`,"data-testid":`map-list`,"aria-label":`Groups`,children:e.groups.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link-row${e.id===n?` picked`:``}`,"data-command":`list-group`,"data-id":e.id,onClick:()=>i(e.id),onDoubleClick:()=>a(e.id),title:`${e.name}: ${e.source} · ${FC[e.kind]??e.kind} (double-click or Enter opens it)`,onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),a(e.id))},children:[(0,X.jsx)(`span`,{className:`name`,children:e.name}),(0,X.jsxs)(`small`,{children:[e.source,` · `,FC[e.kind]??e.kind,` · `,IC(e.files,`file`),e.findings.broken>0?` · ${IC(e.findings.broken,`broken import`)}`:``]})]})},e.id))}),!h&&p&&(0,X.jsxs)(`p`,{className:`overlay bottom small muted map-note`,"data-testid":`map-too-small`,children:[`All `,e.groups.length,` groups are shown, zoomed out: scroll to zoom in, or`,` `,(0,X.jsx)(`button`,{className:`button-link`,onClick:()=>g(!0),children:`see them as a list`}),`.`]}),(0,X.jsxs)(`div`,{className:`map-controls`,children:[(0,X.jsx)(`button`,{"data-command":`map-as-list`,"aria-pressed":h,onClick:()=>g(!h),title:`The groups as a list`,children:h?`Map`:`List`}),!h&&(0,X.jsx)(`button`,{className:`fit`,"data-command":`fit-map`,onClick:()=>{f.current&&(b.current=!1,m(RC(f.current)<LC))},children:`Fit`})]})]})}function GC({project:e,projectName:t,run:n,group:r,source:i=null,pick:a,file:o,fileLevel:s,expand:c,showPending:l,tabs:u,onPick:d,onOpenGroup:f,onOpenFile:p,onToggleFolder:m,onTogglePending:h,onClear:g,marks:_=null,only:v=null,onContext:b,area:x=null,onOpenArea:S=()=>{}}){let[C,w]=(0,y.useState)(0),{groups:T,error:E}=pS(e,n,C,i),[D,O]=(0,y.useState)(!1),[k,A]=sS(),j=s&&o!==null,{imports:M}=hS(e,n,j?o:null),{calls:N,error:P}=_S(e,n,j?o:null),[F,I]=(0,y.useState)({calls:!0,imports:!0}),L=j?M?M.file.group:null:r??(T&&T.total===1?T.groups[0].id:null),R=L?T?.groups.find(e=>e.id===L):void 0,[z,B]=(0,y.useState)(0),{group:V,error:H}=mS(e,n,j?null:L,c,l,z),[U,W]=(0,y.useState)(new Set),G=(0,y.useMemo)(()=>T&&!L&&!j?_C(T,x,U):null,[T,L,j,x,U]),K=(0,y.useMemo)(()=>new Set(T?.groups.map(e=>e.source)).size>1,[T]),ee=G?.area??x,q=ee?vC(ee,K):[],J=q.map(e=>[(0,X.jsx)(`span`,{className:`muted`,children:`›`},`s:${e.area}`),(0,X.jsx)(`button`,{className:`link`,"data-command":`open-area`,onClick:()=>S(e.area),children:e.label},e.area)]),te=e=>{e.startsWith(`area|`)?S(e.slice(cC.length)):e.startsWith(`singles|`)?W(t=>new Set([...t,e.slice(lC.length)])):f(e)},Y=e=>e.startsWith(`area|`)||e.startsWith(`singles|`),ne=(0,X.jsxs)(`div`,{className:`toolbar`,children:[u,(0,X.jsx)(`nav`,{className:`breadcrumb`,"aria-label":`Zoom`,"data-testid":`breadcrumb`,children:L?(0,X.jsxs)(X.Fragment,{children:[T?.total===1?(0,X.jsx)(`span`,{children:t}):(0,X.jsx)(`button`,{className:`link`,"data-command":`open-group`,onClick:()=>f(),children:t}),!j&&J,(0,X.jsx)(`span`,{className:`muted`,children:`›`}),j?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{className:`link`,"data-command":`open-group`,onClick:()=>f(L),children:R?.name??L}),(0,X.jsx)(`span`,{className:`muted`,children:`›`}),(0,X.jsx)(`strong`,{className:`mono`,title:qC(o),children:we(tS(qC(o),JC(R)),48)})]}):(0,X.jsx)(`strong`,{children:R?.name??L})]}):j?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{className:`link`,"data-command":`open-group`,onClick:()=>f(),children:t}),(0,X.jsx)(`span`,{className:`muted`,children:`›`}),(0,X.jsx)(`strong`,{className:`mono`,title:qC(o),children:we(qC(o),48)})]}):q.length>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{className:`link`,"data-command":`open-group`,onClick:()=>f(),children:t}),J.slice(0,-1),(0,X.jsx)(`span`,{className:`muted`,children:`›`}),(0,X.jsx)(`strong`,{children:q[q.length-1].label})]}):(0,X.jsx)(`strong`,{children:t})}),(L||j||q.length>0)&&T&&T.total>1&&(0,X.jsx)(`button`,{className:`small`,"data-command":`go-project-map`,title:`Back to the project map: every group, nothing picked`,onClick:()=>f(),children:`⌂ Project map`}),T&&!L&&T.stage2&&(0,X.jsx)(`span`,{className:`small muted toolbar-note`,children:G?.area?(()=>{let e=G.map.groups.reduce((e,t)=>e+(t.members??1),0);return`folder · ${e.toLocaleString()} group${e===1?``:`s`} of ${T.total.toLocaleString()}`})():`project map · ${T.total} group${T.total===1?``:`s`}`}),V&&!j&&(0,X.jsxs)(`span`,{className:`small muted toolbar-note`,children:[`group · `,V.group.files,` file`,V.group.files===1?``:`s`,` · `,V.group.source]}),L&&!j&&c.length>0&&(0,X.jsx)(`span`,{className:`open-folders small`,children:c.map(e=>(0,X.jsxs)(`span`,{className:`chip`,children:[tS(e,JC(R)),`/`,(0,X.jsx)(`button`,{className:`icon`,"data-command":`toggle-folder`,"data-testid":`close-folder`,"data-path":e,"aria-label":`Close the folder ${e}`,onClick:()=>m(e),children:`×`})]},e))}),j&&(0,X.jsx)(`span`,{className:`small muted toolbar-note`,children:`its imports and cross-file calls`}),(0,X.jsx)(`span`,{className:`spacer`}),j&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`label`,{className:`toggle`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`toggle-calls`,checked:F.calls,onChange:e=>I({...F,calls:e.target.checked})}),`Cross-file calls`]}),(0,X.jsxs)(`label`,{className:`toggle`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`toggle-imports`,checked:F.imports,onChange:e=>I({...F,imports:e.target.checked})}),`Imports`]})]}),L&&!j&&(0,X.jsxs)(`label`,{className:`toggle`,title:`Imports waiting for another source to be added`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-command":`toggle-pending`,checked:l,onChange:h}),`Pending imports`]}),T&&!L&&T.externalPackages.total>0&&(0,X.jsxs)(`label`,{className:`toggle`,title:`External packages are hidden by default: nearly every group imports the same few`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`toggle-packages`,checked:D,onChange:e=>O(e.target.checked)}),`External packages`]})]});if(E)return(0,X.jsxs)(X.Fragment,{children:[ne,(0,X.jsxs)(`p`,{className:`hint error`,children:[E,` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>w(e=>e+1),children:`Try again`})]})]});if(!T)return(0,X.jsxs)(X.Fragment,{children:[ne,(0,X.jsx)(`p`,{className:`hint`,children:`Loading the imports…`})]});if(!T.stage2)return(0,X.jsxs)(X.Fragment,{children:[ne,(0,X.jsx)(`p`,{className:`hint`,"data-testid":`imports-no-stage2`,children:`Imports haven't been analyzed in this project yet: Stage 2, which follows imports across files, hasn't run. Analyze the project again to see them.`})]});let re=T.stats.own,ie=re.files!==T.stats.files,ae=x&&G?.area?gC(T,G.area):null,oe=ae?new Set(ae.map(e=>e.id)):null,se=ae?{files:ae.reduce((e,t)=>e+t.files,0),functions:ae.reduce((e,t)=>e+t.functions,0),crossFileCalls:T.dependsOn.filter(e=>oe.has(e.from)&&oe.has(e.to)).reduce((e,t)=>e+t.calls,0),brokenImports:ae.reduce((e,t)=>e+t.findings.broken,0),openCalls:ae.reduce((e,t)=>e+t.findings.openCalls,0)}:k||!ie?T.stats:{files:re.files,functions:re.functions,crossFileCalls:re.crossFileCalls,brokenImports:re.brokenImports??T.stats.brokenImports,openCalls:re.openCalls??T.stats.openCalls};return(0,X.jsxs)(X.Fragment,{children:[ne,j?P?(0,X.jsx)(`p`,{className:`hint error`,children:P}):N?(0,X.jsx)(`div`,{className:`group-level`,"data-testid":`file-level`,children:(0,X.jsx)(AC,{marks:_,onContext:b,file:o,calls:N,imports:M,show:F,pick:a,onPick:d,onOpenFile:e=>p(e),onClear:g})}):(0,X.jsx)(`p`,{className:`hint`,children:`Loading the file…`}):L?H?(0,X.jsxs)(`p`,{className:`hint error`,children:[H,` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>B(e=>e+1),children:`Try again`})]}):V?(0,X.jsxs)(`div`,{className:`group-level`,"data-testid":`group-level`,children:[V.truncated&&(0,X.jsxs)(`p`,{className:`hint small`,children:[`Showing `,V.nodes.length,` of `,V.total,` files and folders.`]}),(0,X.jsx)(nS,{marks:_,onContext:b,only:v,reply:V,pick:a,onPick:d,onOpenFile:e=>p(e,L),onToggleFolder:m,onClear:g})]}):(0,X.jsx)(`p`,{className:`hint`,children:`Loading the group…`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`dl`,{className:`map-stats`,"data-testid":`map-stats`,children:[(0,X.jsx)(KC,{n:se.files,label:`files`}),(0,X.jsx)(KC,{n:se.functions,label:`functions`}),(0,X.jsx)(KC,{n:se.crossFileCalls,label:ae?`calls between its groups`:`cross-file calls`}),(0,X.jsx)(KC,{n:se.brokenImports,label:`broken imports`,tone:se.brokenImports>0?`warn`:void 0}),(0,X.jsx)(KC,{n:se.openCalls,label:`open calls`}),!ae&&(0,X.jsx)(KC,{n:T.externalPackages.total,label:D?`external packages`:`external packages (hidden)`}),ie&&!ae&&(0,X.jsxs)(`label`,{className:`toggle stats-scope`,title:`Own code: ${re.files.toLocaleString()} of ${T.stats.files.toLocaleString()} files. The rest are tests, installed libraries, generated output or tools' files.`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`stats-all-code`,checked:k,onChange:e=>A(e.target.checked)}),`Libraries and tests too`]})]}),T.total===0?(0,X.jsx)(`p`,{className:`hint`,children:`No groups: nothing was analyzed.`}):(0,X.jsx)(WC,{marks:_,onContext:b&&(e=>Y(e.id)?void 0:b(e)),only:v,map:G?.map??T,layoutKey:`${e}|${T.committedRun}|${i??``}|${G?.area??``}|${[...U].join(`,`)}`,pick:a,showPackages:D,onPick:e=>Y(e)?te(e):d(e),onOpen:te,onClear:g}),T.truncated&&(0,X.jsxs)(`p`,{className:`hint small`,children:[`Showing `,T.groups.length,` of `,T.total,` groups.`]})]})]})}function KC({n:e,label:t,tone:n}){return(0,X.jsxs)(`div`,{className:n,children:[(0,X.jsx)(`dd`,{children:e.toLocaleString()}),(0,X.jsx)(`dt`,{children:t})]})}var qC=e=>e.slice(e.indexOf(`:`)+1);function JC(e){return!e||e.kind===`cluster`?``:e.root}var YC=(e,t=34)=>e.length>t?`${e.slice(0,t-1)}…`:e,XC=e=>e.slice(e.lastIndexOf(`/`)+1);function ZC(e){let t=[e.name,e.member].filter(Boolean).join(`.`)||`?`;return`${e.packageName??`runtime`}: ${t}`}function QC(e){let t=e.direction===`forward`?1:-1,n=[],r=new Map,i=[],a=e=>{let t=r.get(e)??0;r.set(e,t+1);let n={position:{x:0,y:0},depth:e,row:t};return i.push(n),n.position},o=new Map(e.functions.map(e=>[e.id,e.depth])),s=new Set(e.starts.map(e=>e.function));for(let t of e.functions)n.push({group:`nodes`,data:{id:t.id,kind:`function`,label:`${YC(t.name,26)}${s.has(t.id)?` ▸ start`:``}\n${YC(XC(t.path),28)}`,path:t.path,line:t.line,depth:t.depth},position:a(t.depth),classes:[`function`,...t.depth===0?[`root`]:[],...s.has(t.id)?[`start`]:[]].join(` `)});e.edges.forEach((e,t)=>{o.has(e.from)&&o.has(e.to)&&n.push({group:`edges`,data:{id:`hop|${t}`,source:e.from,target:e.to,kind:e.kind,label:e.kind===`call`||e.kind===`cross-file`?``:e.kind,path:e.evidence.file.slice(e.evidence.file.indexOf(`:`)+1),line:e.evidence.span.start.line,file:e.evidence.file},classes:e.trust===`candidate`?`hop candidate`:`hop`})});let c=new Map;for(let t of e.gaps){let e=`gap|${t.in}|${t.expression}|${t.reason}`,n=c.get(e);n?n.count++:c.set(e,{id:e,in:t.in,label:`? ${YC(t.expression,26)}\n${t.reason}`,kind:`gap`,count:1,file:t.evidence.file,line:t.evidence.span.start.line})}for(let t of e.exits){let e=ZC(t.exit),n=`exit|${t.in}|${e}`,r=c.get(n);r?r.count++:c.set(n,{id:n,in:t.in,label:YC(e,30),kind:`exit`,count:1,file:t.evidence.file,line:t.evidence.span.start.line})}for(let e of[...c.values()].sort((e,t)=>e.id<t.id?-1:1)){let t=o.get(e.in);t!==void 0&&(n.push({group:`nodes`,data:{id:e.id,kind:e.kind,label:e.count>1?`${e.label} ×${e.count}`:e.label,file:e.file,line:e.line},position:a(t+1),classes:`port ${e.kind}`}),n.push({group:`edges`,data:{id:`to|${e.id}`,source:e.in,target:e.id,kind:e.kind,label:``,file:e.file,line:e.line},classes:`stop ${e.kind}`}))}let l=Math.max(0,...r.keys()),u=[],d=0;for(let e=0;e<=l;e++)u[e]=d,d+=Math.ceil((r.get(e)??1)/24)*270;for(let e of i)e.position.x=t*(u[e.depth]+Math.floor(e.row/24)*270),e.position.y=e.row%24*62;return n}var $C=e=>e.slice(e.indexOf(`:`)+1),ew=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function tw({project:e,run:t,root:n,direction:r,onDirection:i,onReach:a,onOpenFile:o,onContext:s}){let{reach:c,error:l}=gS(e,t,n,r),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(null),p=(0,y.useRef)(null),m=(0,y.useRef)({onReach:a,onContext:s});m.current={onReach:a,onContext:s};let h=(0,y.useMemo)(()=>c?QC(c):[],[c]);(0,y.useEffect)(()=>d(null),[n,r]),(0,y.useEffect)(()=>{if(!f.current||h.length===0)return;let e=W_({container:f.current,elements:h,layout:{name:`preset`},autounselectify:!0,minZoom:.1,maxZoom:2.5,style:[{selector:`node`,style:{shape:`round-rectangle`,width:210,height:48,label:`data(label)`,"text-wrap":`wrap`,"text-max-width":`194px`,"text-valign":`center`,"text-halign":`center`,"font-size":14,color:`#1d2330`,"background-color":`#fff`,"border-width":1,"border-color":`#c9d1de`}},{selector:`node.root`,style:{"border-color":`#3b6fd4`,"border-width":2,"font-weight":`bold`}},{selector:`node.start`,style:{"border-color":`#2e8b57`,"border-width":2}},{selector:`node.port.gap`,style:{"border-style":`dotted`,"border-color":`#c0392b`,color:`#8e2b20`,"background-color":`#fff8f6`}},{selector:`node.port.exit`,style:{"border-style":`double`,"border-width":3,"border-color":`#6b87b8`,color:`#2a56ad`}},{selector:`edge`,style:{width:1.5,"curve-style":`bezier`,"line-color":`#4a5262`,"target-arrow-shape":`triangle`,"target-arrow-color":`#4a5262`,"arrow-scale":.8,label:`data(label)`,"font-size":11,color:`#5d6675`,"text-background-color":`#fff`,"text-background-opacity":1}},{selector:`edge.candidate`,style:{"line-style":`dashed`,"line-color":`#8a96aa`}},{selector:`edge.stop.gap`,style:{"line-style":`dotted`,"line-color":`#c0392b`,"target-arrow-shape":`none`}},{selector:`edge.stop.exit`,style:{"line-color":`#6b87b8`,"target-arrow-color":`#6b87b8`}},{selector:`.picked`,style:{"line-color":`#3b6fd4`,"target-arrow-color":`#3b6fd4`,width:3}}]});return e.on(`tap`,`edge`,t=>{e.elements().removeClass(`picked`),t.target.addClass(`picked`),d(t.target.data())}),e.on(`tap`,`node`,e=>{let t=e.target.data();t.kind===`function`?m.current.onReach(t.id):d(t)}),e.on(`cxttap`,`node`,e=>{let t=e.target.data();if(t.kind!==`function`||!f.current)return;let n=f.current.getBoundingClientRect(),r=e.renderedPosition??{x:0,y:0};m.current.onContext?.({kind:`function`,id:t.id,data:t,x:n.left+r.x,y:n.top+r.y})}),e.fit(void 0,30),e.zoom()>1.2&&(e.zoom(1.2),e.center()),p.current=e,()=>{p.current=null,e.destroy()}},[h]);let g=new Map((c?.functions??[]).map(e=>[e.id,e.name])),_=e=>g.get(e)??e,v=c?.counts,b=v?`in ${ew(v.files,`file`)} across ${ew(v.groups,`group`)}`:``,x=c?.functions.find(e=>e.id===n)?.name??$C(n);return(0,X.jsxs)(`div`,{className:`reach`,"data-testid":`reach`,children:[(0,X.jsxs)(`div`,{className:`toolbar`,children:[(0,X.jsx)(`span`,{className:`file-title`,title:n,children:x}),(0,X.jsx)(`div`,{className:`segmented`,role:`group`,"aria-label":`Direction`,children:[`forward`,`backward`].map(e=>(0,X.jsx)(`button`,{"aria-pressed":r===e,"data-command":`open-reach`,"data-direction":e,title:e===`forward`?`What paths from it reach`:`What reaches it`,onClick:()=>i(e),children:e===`forward`?`Reaches →`:`← Reached by`},e))}),v&&(0,X.jsx)(`span`,{className:`reach-counts`,"data-testid":`reach-counts`,children:r===`forward`?`${v.functions?`reaches ${ew(v.functions,`function`)} ${b}`:`reaches no other function`} · ${ew(v.gaps,`gap`)} · ${ew(v.exits,`exit`)}`:`${v.functions?`reached by ${ew(v.functions,`function`)} ${b}`:`nothing reaches it`}${c.starts.length?` · ${ew(c.starts.length,`start candidate`)}`:``}`}),c?.truncated&&(0,X.jsxs)(`span`,{className:`badge degraded`,"data-testid":`reach-truncated`,children:[`stopped at the `,c.truncated.reason,` budget, `,ew(c.truncated.depth,`step`),` out`]})]}),l&&(0,X.jsx)(`div`,{className:`error`,children:l}),(0,X.jsx)(`div`,{className:`graph-wrap`,children:(0,X.jsx)(`div`,{className:`graph map`,ref:f,"data-testid":`reach-canvas`})}),u&&(0,X.jsxs)(`div`,{className:`reach-hop`,"data-testid":`reach-hop`,children:[(0,X.jsxs)(`span`,{children:[String(u.kind),` · `,String(u.file??``).slice(String(u.file??``).indexOf(`:`)+1),`:`,String(u.line??``)]}),typeof u.file==`string`&&(0,X.jsx)(`button`,{"data-command":`open-file`,onClick:()=>o(u.file,u.line),children:`Open`})]}),c&&(0,X.jsxs)(`details`,{className:`reach-list`,"data-testid":`reach-list`,children:[(0,X.jsx)(`summary`,{children:`As a list`}),(0,X.jsx)(`ol`,{children:c.functions.map(e=>(0,X.jsxs)(`li`,{"data-depth":e.depth,children:[` `.repeat(e.depth),(0,X.jsx)(`button`,{className:`link`,"data-command":`open-reach`,title:`Reach from this function instead`,onClick:()=>a(e.id),children:e.name}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[e.path,`:`,e.line]})]},e.id))}),(0,X.jsx)(`ul`,{"data-testid":`reach-hops`,children:c.edges.map((e,t)=>(0,X.jsxs)(`li`,{"data-kind":e.kind,"data-trust":e.trust,children:[(0,X.jsxs)(`button`,{"data-command":`reach-hop`,onClick:()=>d({kind:e.kind,file:e.evidence.file,line:e.evidence.span.start.line}),children:[_(e.from),` → `,_(e.to)]}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[e.kind,e.trust===`candidate`?` (candidate)`:``]})]},t))}),c.gaps.length>0&&(0,X.jsx)(`ul`,{"data-testid":`reach-gaps`,children:c.gaps.map(e=>(0,X.jsxs)(`li`,{children:[`? `,e.expression,` `,(0,X.jsx)(`span`,{className:`muted`,children:e.reason}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[$C(e.evidence.file),`:`,e.evidence.span.start.line]})]},e.site))}),c.exits.length>0&&(0,X.jsx)(`ul`,{"data-testid":`reach-exits`,children:c.exits.map(e=>(0,X.jsxs)(`li`,{children:[e.expression,` `,(0,X.jsx)(`span`,{className:`muted`,children:e.exit.packageName??`runtime`}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[$C(e.evidence.file),`:`,e.evidence.span.start.line]})]},e.id))})]})]})}function nw(e,t,n){let r=new Map,i=e=>{let t=r.get(e.id);return t||r.set(e.id,t={kind:`function`,end:e,out:[],into:[]}),t};for(let n of t)n.from.file===e&&i(n.from).out.push(n);for(let t of n)t.to.file===e&&i(t.to).into.push(t);let a=e=>e.end.title!==void 0&&e.end.suite!==void 0&&e.into.length===0&&e.out.length>0?`${e.end.suite}\u0000${[...new Set(e.out.map(e=>e.to.id))].sort().join(`\0`)}`:null,o=new Map;for(let e of r.values()){let t=a(e);t!==null&&o.set(t,[...o.get(t)??[],e])}let s=[],c=new Set;for(let e of r.values()){let t=a(e),n=t===null?void 0:o.get(t);if(!n||n.length<2){s.push(e);continue}if(c.has(t))continue;c.add(t);let r=new Map(n.flatMap(e=>e.out.map(e=>[e.to.id,e.to])));s.push({kind:`suite`,suite:e.end.suite,callees:[...r.values()],tests:n})}return s}var rw={focus:3,site:2,call:1},iw=e=>e.end.column<=1&&e.end.line>e.start.line?e.end.line-1:e.end.line;function aw(e,t){if(e.kind!==`call`||iw(e)===e.start.line)return e;let n=Array.from(t(e.start.line)??``),r=n.indexOf(`(`,e.start.column-1),i=r>=0?r+2:n.length+1;return{...e,end:{line:e.start.line,column:i}}}function ow(e,t){let n=t=>e.lines[t-e.startLine],r=t.map(e=>aw(e,n)),i=r.map(e=>(e.end.line-e.start.line)*1e4+(e.end.column-e.start.column)),a=new Map;r.forEach((t,n)=>{let r=Math.max(t.start.line,e.startLine),i=Math.min(iw(t),e.startLine+e.lines.length-1);for(let e=r;e<=i;e++){let t=a.get(e);t?t.push(n):a.set(e,[n])}});let o=new Set;return e.lines.map((t,n)=>{let s=e.startLine+n,c=Array.from(t),l=c.map(()=>null);for(let e of a.get(s)??[]){let t=r[e],n=s===t.start.line?t.start.column-1:0,a=s===t.end.line?t.end.column-1:c.length;for(let o=Math.max(0,n);o<Math.min(c.length,a);o++){let n=l[o];(n==null||rw[t.kind]>rw[r[n].kind]||rw[t.kind]===rw[r[n].kind]&&i[e]<i[n])&&(l[o]=e)}}let u=[];return c.forEach((e,t)=>{let n=u[u.length-1],r=l[t]??null;if(n&&n.mark===r)n.text+=e;else{let t=r!==null&&!o.has(r);r!==null&&o.add(r),u.push({text:e,mark:r,first:t})}}),{n:s,runs:u,focus:r.some(e=>e.kind===`focus`&&s>=e.start.line&&s<=iw(e))}})}function sw({snippet:e,marks:t,focusLine:n,testId:r,className:i}){let a=(0,y.useRef)(null),o=(0,y.useMemo)(()=>ow(e,t),[e,t]);(0,y.useEffect)(()=>{let e=a.current,t=e?.querySelector(`[data-line="${n}"]`);e&&t&&(e.scrollTop=Math.max(0,t.offsetTop-e.clientHeight/3))},[e,n]);let s=e=>{let n=e?.closest(`[data-mark]`);if(!n)return!1;let r=t[Number(n.dataset.mark)];return r?.onClick?(r.onClick(),!0):!1};return(0,X.jsx)(`pre`,{className:`code ${i??``}`,"data-testid":r,ref:a,onClick:e=>s(e.target),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&s(e.target)&&e.preventDefault()},children:o.map(({n:e,runs:n,focus:r})=>(0,X.jsxs)(`div`,{"data-line":e,className:r?`focus-line`:``,children:[(0,X.jsx)(`span`,{className:`ln`,"aria-hidden":`true`,children:e}),` `,n.map((e,n)=>{if(e.mark===null)return e.text;let r=t[e.mark],i=r.kind===`focus`?`hit`:r.kind===`site`?`site-mark`:`call-mark`,a=!!r.onClick;return(0,X.jsx)(`span`,{className:`mark ${i}${a?` clickable`:``}`,"data-mark":e.mark,title:r.title,...a&&e.first?{role:`button`,tabIndex:0}:{},children:e.text},n)})]},e))})}function cw({title:e,location:t,snippet:n,marks:r,focusLine:i,onClose:a}){let o=(0,y.useRef)(null),s=(0,y.useRef)(null);return(0,y.useEffect)(()=>{o.current?.focus();let e=e=>{if(e.key===`Escape`)e.stopPropagation(),a();else if(e.key===`Tab`&&s.current){let t=s.current.querySelectorAll(`button, [tabindex="0"]`),n=t[0],r=t[t.length-1];s.current.contains(document.activeElement)?e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus()):(e.preventDefault(),n?.focus())}};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[a]),(0,X.jsx)(`div`,{className:`backdrop`,onMouseDown:e=>e.target===e.currentTarget&&a(),children:(0,X.jsxs)(`div`,{className:`modal code-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,"data-testid":`code-modal`,ref:s,tabIndex:-1,children:[(0,X.jsxs)(`div`,{className:`evidence-head`,children:[(0,X.jsx)(`h3`,{children:e}),(0,X.jsx)(`code`,{className:`muted small`,children:t}),(0,X.jsx)(`button`,{ref:o,className:`icon close`,"aria-label":`Close (Esc)`,title:`Close (Esc)`,onClick:a,children:`×`})]}),n?(0,X.jsx)(sw,{snippet:n,marks:r,focusLine:i,testId:`modal-code`,className:`large`}):(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`}),(0,X.jsx)(`p`,{className:`muted small`,children:`Use your browser's find (⌘F / Ctrl+F) to search the code.`})]})})}var lw=(e,t,n=`${t}s`)=>`${e.toLocaleString(`en-US`)} ${e===1?t:n}`;function uw({project:e,run:t,from:n,to:r,onOpenFile:i}){let[a,o]=(0,y.useState)([]),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(!1),d=JSON.stringify([e,t,n,r]),f=(0,y.useRef)(d);if(f.current=d,(0,y.useEffect)(()=>{let t=!1;return o([]),c(null),Y.callsBetween(e,n,r).then(e=>!t&&o([e]),e=>!t&&c(e.message)),()=>{t=!0}},[d]),s)return(0,X.jsx)(`p`,{className:`hint error`,children:s});let p=a[0];if(!p)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let m=a.flatMap(e=>e.calls),h=p.pair.summary,g=new Map;for(let e of m)g.set(e.from.path,[...g.get(e.from.path)??[],e]);let _=()=>{if(l)return;let t=d;u(!0),Y.callsBetween(e,n,r,m.length).then(e=>{f.current===t&&o(t=>[...t,e])},e=>c(e.message)).finally(()=>u(!1))};return(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`pair-details`,children:[(0,X.jsxs)(`h3`,{children:[p.pair.from.name,` → `,p.pair.to.name]}),(0,X.jsxs)(`p`,{"data-testid":`pair-summary`,children:[p.pair.from.name,` calls into `,p.pair.to.name,`: `,lw(h.calls,`call`),` from`,` `,lw(h.callers,`function`),` to `,lw(h.callees,`function`),h.references?`, ${lw(h.references,`reference`)}`:``,` (`,lw(h.imports,`import`),`)`]}),h.calls===0&&(0,X.jsx)(`p`,{className:`small muted`,children:h.references?`No calls: functions are handed on between them (references).`:`No calls: only imports link them.`}),[...g].map(([e,t])=>(0,X.jsxs)(`div`,{className:`pair-file`,children:[(0,X.jsx)(`h4`,{className:`small`,children:(0,X.jsx)(`button`,{className:`link`,onClick:()=>i(t[0].from.file),children:e})}),(0,X.jsx)(`ul`,{className:`plain`,"data-testid":`pair-calls`,children:t.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`button`,{className:`link`,onClick:()=>i(e.from.file),children:xe(e.from)}),` `,(0,X.jsxs)(`span`,{className:`small muted`,children:[`:`,e.evidence.span.start.line]}),` →`,` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>i(e.to.file),children:xe(e.to)}),` `,(0,X.jsxs)(`span`,{className:`small muted`,children:[`(`,e.to.path,`)`]})]},e.id))})]},e)),m.length<p.total&&(0,X.jsx)(`button`,{className:`link small`,"data-testid":`pair-more`,disabled:l,onClick:_,children:l?`Loading…`:`${p.total-m.length} more calls…`}),p.pair.references.length>0&&(0,X.jsxs)(`details`,{children:[(0,X.jsxs)(`summary`,{className:`small`,children:[`References (`,h.references,`)`]}),(0,X.jsx)(`ul`,{className:`plain small`,children:p.pair.references.map(e=>(0,X.jsxs)(`li`,{children:[xe(e.from),` hands on `,xe(e.to),` (`,e.to.path,`) · `,e.context,` · line`,` `,e.evidence.span.start.line]},e.id))})]}),p.pair.imports.length>0&&(0,X.jsxs)(`details`,{children:[(0,X.jsxs)(`summary`,{className:`small`,children:[`Imports (`,h.imports,`)`]}),(0,X.jsx)(`ul`,{className:`plain small`,"data-testid":`pair-imports`,children:p.pair.imports.map(e=>(0,X.jsxs)(`li`,{children:[e.path,`:`,e.evidence.span.start.line,` · `,(0,X.jsx)(`code`,{children:e.specifier})]},e.id))})]})]})}var dw={repository:`repository`,"workspace-package":`workspace package`,cluster:`cluster`};function fw(e){let{project:t,run:n,pick:r,file:i,fileLevel:a}=e;return a&&i&&r?.startsWith(`CALLS_CROSS_FILE|`)?(0,X.jsx)(Cw,{project:t,run:n,file:i,call:r}):a&&i&&(r?.startsWith(`IMPORTS|`)||r?.startsWith(`unresolved-import|`))?(0,X.jsx)(Ew,{project:t,run:n,file:i,edge:r}):a&&i?(0,X.jsx)(_w,{project:t,run:n,file:i,onOpenFile:e.onOpenFile}):r&&(r.startsWith(`DEPENDS_ON|`)||r.startsWith(`arrow|`))?(0,X.jsx)(pw,{...e,arrow:r}):r&&r.startsWith(`calls|`)?(0,X.jsx)(mw,{...e,link:r}):r&&r.startsWith(`folder|`)?(0,X.jsx)(bw,{...e,folder:r}):r&&!r.startsWith(`group|`)?(0,X.jsx)(_w,{project:t,run:n,file:r,onOpenFile:e.onOpenFile,canOpen:!0}):(0,X.jsx)(hw,{project:t,run:n,group:e.group,pick:r,onOpenGroup:e.onOpenGroup,onPick:e.onPick})}function pw({project:e,run:t,arrow:n,onOpenFile:r}){let{groups:i}=pS(e,t);if(!i)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let a=null;if(n.startsWith(`DEPENDS_ON|`)){let e=i.dependsOn.find(e=>e.id===n);e&&(a=[[e.from],[e.to]])}else{let[e,t]=n.slice(6).split(`|`).map(decodeURIComponent);e&&t&&(a=[[e],[t]])}return!a||a[0].length===0||a[1].length===0?(0,X.jsx)(`p`,{className:`hint`,children:`That arrow isn't on the map any more.`}):(0,X.jsx)(uw,{project:e,run:t,from:a[0],to:a[1],onOpenFile:r})}function mw({project:e,run:t,group:n,link:r,expand:i,showPending:a,onOpenFile:o}){let{group:s}=mS(e,t,n,i,a);if(!s)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let c=[...s.calls,...s.callStubEdges].find(e=>e.id===r);return c?(0,X.jsx)(uw,{project:e,run:t,from:[c.from],to:[(e=>e.startsWith(`stub|`)?e.slice(5):e)(c.to)],onOpenFile:o}):(0,X.jsx)(`p`,{className:`hint`,children:`That link isn't drawn any more.`})}function hw({project:e,run:t,group:n,pick:r,onOpenGroup:i,onPick:a}){let{groups:o}=pS(e,t),s=n??(o?.total===1?o.groups[0].id:r),c=s&&o?o.groups.find(e=>e.id===s):void 0;if(!o)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});if(!o.stage2)return(0,X.jsx)(`p`,{className:`hint`,children:`Stage 2 hasn't run on this project, so there are no groups yet.`});if(!c)return(0,X.jsx)(`p`,{className:`hint`,children:`Pick a group on the map to see what it holds and what it depends on; double-click or press Enter to open it.`});let u=e=>o.groups.find(t=>t.id===e)?.name??e,d=o.dependsOn.filter(e=>e.from===c.id&&l(e)),f=o.dependsOn.filter(e=>e.to===c.id&&l(e)),p=o.dependsOn.filter(e=>(e.from===c.id||e.to===c.id)&&!l(e)),m=c.findings,h=(e,t,r)=>e.length===0?(0,X.jsx)(`p`,{className:`small muted`,"data-testid":r,children:`None`}):(0,X.jsx)(`ul`,{className:`plain`,"data-testid":r,children:e.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`button`,{className:`link`,onClick:()=>n?i(e[t]):a(e[t]),children:u(e[t])}),` `,(0,X.jsx)(`span`,{className:`small muted`,children:l(e)?MC(e):`${e.imports} import${e.imports===1?``:`s`}, no call`})]},e.id))});return(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`group-details`,children:[(0,X.jsx)(`h3`,{children:c.name}),(0,X.jsxs)(`p`,{className:`muted small`,children:[c.source,` · `,dw[c.kind]??c.kind,c.root?` · ${c.root}`:``]}),(0,X.jsxs)(`p`,{children:[c.files.toLocaleString(),` files · `,c.functions.toLocaleString(),` functions · `,c.externalPackages,` `,`external package`,c.externalPackages===1?``:`s`]}),m.broken+m.notAnalyzed+m.openCalls+m.pending>0&&(0,X.jsx)(`p`,{className:`small`,"data-testid":`group-findings`,children:[m.broken?`${m.broken} broken import${m.broken===1?``:`s`}`:``,m.notAnalyzed?`${m.notAnalyzed} import${m.notAnalyzed===1?``:`s`} of files not analyzed`:``,m.openCalls?`${m.openCalls} open question${m.openCalls===1?``:`s`}`:``,m.pending?`${m.pending} pending`:``].filter(Boolean).join(` · `)}),(0,X.jsx)(`h4`,{className:`small role-into`,children:`▶ Calls into`}),h(d,`to`,`calls-into`),(0,X.jsx)(`h4`,{className:`small role-from`,children:`◀ Called from`}),h(f,`from`,`called-from`),p.some(e=>e.from===c.id)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h4`,{className:`muted small`,title:`Type-only, value-only or unused imports: no path, so no arrow`,children:`Imports from, no calls`}),h(p.filter(e=>e.from===c.id),`to`,`imports-only`)]}),p.some(e=>e.to===c.id)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h4`,{className:`muted small`,title:`Type-only, value-only or unused imports: no path, so no arrow`,children:`Imported by, no calls`}),h(p.filter(e=>e.to===c.id),`from`,`imported-only`)]}),!n&&o.total>1&&(0,X.jsxs)(`button`,{"data-command":`open-group`,"data-testid":`open-picked`,onClick:()=>i(c.id),children:[`Open `,c.name]})]})}var gw=e=>e.slice(e.indexOf(`:`)+1);function _w({project:e,run:t,file:n,onOpenFile:r,canOpen:i=!1}){let{imports:a,error:o}=hS(e,t,n),{groups:s}=pS(e,t),{calls:c,error:l}=_S(e,t,i?null:n);if(o)return(0,X.jsx)(`p`,{className:`hint error`,children:o});if(!a)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let u=a.file.group?s?.groups.find(e=>e.id===a.file.group):void 0,d=u&&u.kind!==`cluster`?u.root:``;return(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`file-details`,children:[(0,X.jsx)(`h3`,{className:`mono`,children:tS(a.file.path,d)}),(0,X.jsx)(`p`,{className:`muted small`,children:u?`${u.name} · ${u.source}`:gw(n)}),l&&(0,X.jsxs)(`p`,{className:`small error`,children:[`Calls across files: `,l]}),c&&(0,X.jsx)(yw,{file:n,calls:c,onOpenFile:r}),(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Imports (`,a.total,`)`]}),a.imports.length===0?(0,X.jsx)(`p`,{className:`small muted`,children:`None`}):(0,X.jsx)(`ul`,{className:`plain`,"data-testid":`file-imports`,children:a.imports.map(e=>(0,X.jsxs)(`li`,{className:e.outcome===`broken`?`broken`:void 0,"data-outcome":e.outcome,children:[(0,X.jsx)(`span`,{className:`mono small`,children:e.specifier}),` `,e.outcome===`file`&&e.file?(0,X.jsx)(`button`,{className:`link small`,onClick:()=>r(e.file.id),children:e.file.path}):e.outcome===`package`&&e.package?(0,X.jsxs)(`span`,{className:`small muted`,children:[`package `,e.package.name,e.package.version?` ${e.package.version}`:``]}):(0,X.jsxs)(`span`,{className:`small outcome`,children:[`(`,e.outcome===`not-analyzed`?`not analyzed`:e.outcome,`:`,` `,Xx[e.reason??``]??e.reason,`)`]})]},e.id))}),a.truncated&&(0,X.jsxs)(`p`,{className:`small muted`,children:[`Showing `,a.imports.length,` of `,a.total,`.`]}),(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Imported by (`,a.importedBy.total,`)`]}),a.importedBy.files.length===0?(0,X.jsx)(`p`,{className:`small muted`,children:`None`}):(0,X.jsx)(`ul`,{className:`plain`,"data-testid":`file-importers`,children:a.importedBy.files.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{className:`link small`,onClick:()=>r(e.file.id),children:e.file.path})},e.id))}),i&&(0,X.jsx)(`button`,{"data-command":`open-imports-file`,"data-testid":`open-picked-file`,onClick:()=>r(n),children:`Open file`})]})}function vw({end:e}){let{name:t,parent:n,test:r}=be(e);return(0,X.jsxs)(X.Fragment,{children:[r&&(0,X.jsx)(`small`,{className:`tag`,children:`test`}),` `,(0,X.jsx)(`strong`,{title:e.name,children:t}),n&&(0,X.jsxs)(`span`,{className:`small muted`,children:[` in `,n]})]})}function yw({file:e,calls:t,onOpenFile:n}){let r=nw(e,t.out.calls,t.in.calls);if(r.length===0)return(0,X.jsx)(`p`,{className:`small muted`,children:`No calls to or from other files.`});let i=r.reduce((e,t)=>e+(t.kind===`suite`?t.tests.length:1),0),a=t.out.truncated||t.in.truncated,o=e=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{className:`link`,title:e.to.name,onClick:()=>n(e.to.file),children:xe(e.to)}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[`(`,e.to.path,`)`]})]});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Functions calling across files (`,i,`)`]}),(0,X.jsx)(`ul`,{className:`plain`,"data-testid":`file-function-calls`,children:r.map(e=>e.kind===`suite`?(0,X.jsx)(`li`,{"data-testid":`suite-calls`,children:(0,X.jsxs)(`details`,{children:[(0,X.jsxs)(`summary`,{children:[(0,X.jsx)(`small`,{className:`tag`,children:`test`}),` `,(0,X.jsxs)(`strong`,{children:[`“`,e.suite,`”`]}),(0,X.jsxs)(`span`,{className:`small`,children:[` `,`· `,e.tests.length,` tests call`,` `,e.callees.map((e,t)=>(0,X.jsxs)(`span`,{children:[t>0&&`, `,(0,X.jsx)(`button`,{className:`link`,title:e.name,onClick:()=>n(e.file),children:xe(e)}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[`(`,e.path,`)`]})]},e.id))]})]}),(0,X.jsx)(`ul`,{className:`plain small suite-tests`,children:e.tests.map(e=>(0,X.jsxs)(`li`,{"data-function":e.end.id,children:[(0,X.jsx)(`span`,{title:e.end.name,children:be(e.end).name}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[`· line `,e.out.map(e=>e.evidence.span.start.line).join(`, `)]})]},e.end.id))})]})},`suite|${e.tests[0].end.id}`):(0,X.jsxs)(`li`,{"data-function":e.end.id,children:[(0,X.jsx)(vw,{end:e.end}),e.out.length>0&&(0,X.jsxs)(`div`,{className:`small`,children:[`calls`,` `,e.out.map((e,t)=>(0,X.jsxs)(`span`,{children:[t>0&&`, `,o(e),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[`at line `,e.evidence.span.start.line]})]},e.id))]}),e.into.length>0&&(0,X.jsxs)(`div`,{className:`small`,children:[`called by`,` `,e.into.map((e,t)=>(0,X.jsxs)(`span`,{children:[t>0&&`, `,(0,X.jsx)(`button`,{className:`link`,title:e.from.name,onClick:()=>n(e.from.file),children:xe(e.from)}),` `,(0,X.jsxs)(`span`,{className:`muted`,children:[`(`,e.from.path,`)`]})]},e.id))]})]},e.end.id))}),a&&(0,X.jsx)(`p`,{className:`small muted`,children:`The first 500 calls each way are listed.`})]})}function bw({project:e,run:t,group:n,folder:r,expand:i,showPending:a,onToggleFolder:o}){let{groups:s}=pS(e,t),{group:c}=mS(e,t,n??(s?.total===1?s.groups[0].id:null),i,a),l=c?.nodes.find(e=>e.id===r);return!l||l.kind!==`folder`?(0,X.jsx)(`p`,{className:`hint`,children:`Pick a file or a folder in the group.`}):(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`folder-details`,children:[(0,X.jsxs)(`h3`,{className:`mono`,children:[l.path,`/`]}),(0,X.jsxs)(`p`,{children:[l.files.toLocaleString(),` files`]}),l.findings.broken>0&&(0,X.jsxs)(`p`,{className:`small`,children:[l.findings.broken,` broken import`,l.findings.broken===1?``:`s`]}),(0,X.jsx)(`button`,{"data-command":`toggle-folder`,onClick:()=>o(l.path),children:`Open the folder`})]})}function xw({project:e,run:t,file:n,span:r}){let[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=(0,y.useCallback)(()=>s(!1),[]),l=`${t}|${n}|${r.start.offset}|${r.end.offset}`;if((0,y.useEffect)(()=>{let t=!1;return a(null),Y.snippet(e,n,r).then(e=>!t&&a(e),()=>!t&&a(`error`)),()=>{t=!0}},[e,l]),!i)return null;if(i===`error`)return(0,X.jsx)(`p`,{className:`small muted`,children:`The code couldn't be loaded.`});let u=[{start:r.start,end:r.end,kind:`focus`}];return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(sw,{snippet:i,marks:u,focusLine:r.start.line,testId:`snippet`}),(0,X.jsx)(`button`,{className:`button-link small`,"data-testid":`expand-code`,onClick:()=>s(!0),children:`Expand`}),o&&(0,X.jsx)(cw,{title:gw(n),location:`${gw(n)}:${r.start.line}`,snippet:i,marks:u,focusLine:r.start.line,onClose:c})]})}function Sw({file:e,span:t}){return(0,X.jsx)(`p`,{className:`location small`,"data-testid":`evidence-location`,children:(0,X.jsxs)(`code`,{children:[gw(e),`:`,t.start.line,`:`,t.start.column]})})}function Cw({project:e,run:t,file:n,call:r}){let{calls:i}=_S(e,t,n),a=i?[...i.out.calls,...i.in.calls].find(e=>e.id===r):void 0;if(!i)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});if(!a)return(0,X.jsx)(`p`,{className:`hint`,children:`Pick a call or an import on the canvas.`});let o=a.via===`import`?`found by import analysis${a.hops?.length?`, through ${a.hops.length} re-export${a.hops.length===1?``:`s`}`:``}`:a.via===`component`?`found by component linking`:`found by the template link`,s=a.steps?.find(e=>e.kind===`import`);return(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`call-details`,children:[(0,X.jsxs)(`h3`,{"data-testid":`evidence-title`,children:[xe(a.from),` calls `,xe(a.to)]}),(0,X.jsxs)(`p`,{className:`muted small`,children:[`across files · `,o]}),s&&(0,X.jsx)(`p`,{className:`small`,"data-testid":`call-import`,children:s.detail}),a.hops&&a.hops.length>0&&(0,X.jsxs)(`p`,{className:`small muted`,children:[`through `,a.hops.join(` › `)]}),a.provenance&&(0,X.jsxs)(`p`,{className:`muted small`,"data-testid":`evidence-provenance`,children:[`Found by `,Se(a.provenance.stage),` · run `,a.provenance.run]}),(0,X.jsx)(Sw,{file:a.evidence.file,span:a.evidence.span}),(0,X.jsx)(xw,{project:e,run:t,file:a.evidence.file,span:a.evidence.span}),(0,X.jsx)(Le,{project:e,id:a.id},a.id)]})}function ww(e){if(e.uses===null)return`its use isn't known`;if(e.unused)return`never used`;let t=[],n=e.uses;return n.calls&&t.push(`called ${n.calls}×`),n.jsx&&t.push(`rendered ${n.jsx}×`),n.values&&t.push(`used ${n.values}×`),n.types&&t.push(`as a type ${n.types}×`),n.extends&&t.push(`extended`),n.reexports&&t.push(`exported again`),t.join(`, `)}function Tw({names:e}){return(0,X.jsxs)(`div`,{className:`imported-names`,"data-testid":`import-names`,children:[(0,X.jsxs)(`h4`,{className:`muted small`,children:[`Names (`,e.length,`)`]}),(0,X.jsx)(`ul`,{children:e.map(e=>(0,X.jsxs)(`li`,{"data-testid":`import-name`,"data-unused":e.unused||void 0,children:[(0,X.jsx)(`span`,{className:`mono small`,children:e.local}),` `,(0,X.jsxs)(`span`,{className:`small`,children:[e.target?e.target.kind===`package`?`from ${e.target.label}`:`${e.target.kind===`symbol`?`${e.target.symbolKind} `:e.target.kind===`module`?`module `:``}${e.target.kind===`module`?``:e.target.label}${e.target.path?` in ${e.target.path}`:``}`:e.outcome===`not-exported`?`not exported there`:`doesn't resolve (${e.outcome})`,` · `,(0,X.jsx)(`span`,{className:e.unused?`unused`:`muted`,children:ww(e)})]})]},e.id))})]})}function Ew({project:e,run:t,file:n,edge:r}){let{imports:i}=hS(e,t,n);if(!i)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`});let a=i.imports.find(e=>e.id===r),o=i.importedBy.files.find(e=>e.id===r);if(!a&&!o)return(0,X.jsx)(`p`,{className:`hint`,children:`Pick a call or an import on the canvas.`});let s=a?.evidence??o.evidence;return(0,X.jsxs)(`div`,{className:`evidence imports-details`,"data-testid":`import-details`,children:[(0,X.jsx)(`h3`,{"data-testid":`evidence-title`,children:a?`imports ${a.specifier}`:`${o.file.path} imports this file`}),a?.file&&(0,X.jsxs)(`p`,{className:`small`,children:[`resolves to `,a.file.path]}),a&&!a.file&&!a.package&&(0,X.jsxs)(`p`,{className:`small`,"data-testid":`import-outcome`,children:[a.outcome===`not-analyzed`?`not analyzed`:a.outcome,`:`,` `,Xx[a.reason??``]??a.reason]}),a?.steps.map((e,t)=>(0,X.jsx)(`p`,{className:`small muted`,children:e.detail},t)),a?.names&&a.names.length>0&&(0,X.jsx)(Tw,{names:a.names}),(a?.provenance??o?.provenance)&&(0,X.jsxs)(`p`,{className:`muted small`,"data-testid":`evidence-provenance`,children:[`Found by `,Se((a?.provenance??o.provenance).stage),` · run`,` `,(a?.provenance??o.provenance).run]}),(0,X.jsx)(Sw,{file:s.file,span:s.span}),(0,X.jsx)(xw,{project:e,run:t,file:s.file,span:s.span}),(0,X.jsx)(Le,{project:e,id:r},r)]})}var Dw=o(),Ow=(e,t)=>`${e.toLocaleString(`en-US`)} ${t}${e===1?``:`s`}`,kw=8,Aw=50,jw={installed:`installed by a package manager`,packages:`copied packages with their own manifests`,banners:`a library banner or versioned name`};function Mw(e){return`${[e.name==="default"||e.name===null?``:e.name,e.member??``].filter(Boolean).join(e.member?.startsWith(`(`)?``:`.`)||`default`}${e.instance?` (on an instance)`:``}`}function Nw({project:e,source:t,pkg:n,onOpen:r}){let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(!1);(0,y.useEffect)(()=>{if(!i||o)return;let r=!0;return Y.library(e,n.name,n.ecosystem,t).then(e=>r&&s(e)).catch(e=>r&&l(e.message)),()=>{r=!1}},[i,o,e,n.name,n.ecosystem,t]);let f=n.files>0&&n.ownFiles===0,p=o?u?o.members:o.members.slice(0,kw):[];return(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`button`,{className:`library-row`,"data-testid":`library-package`,"data-name":n.name,"aria-expanded":i,title:`${n.name}${n.versions.length?` ${n.versions.join(`, `)}`:``}: imported by ${Ow(n.files,`file`)} (${n.ownFiles.toLocaleString(`en-US`)} own code) in ${Ow(n.groups,`group`)} · ${Ow(n.calls,`call`)}${n.references?`, ${Ow(n.references,`reference`)}`:``}`,onClick:()=>a(e=>!e),children:[(0,X.jsx)(`span`,{className:`caret`,"aria-hidden":`true`,children:i?`▾`:`▸`}),(0,X.jsx)(`span`,{className:`name`,children:n.name}),n.versions.length>0&&(0,X.jsx)(`small`,{className:`muted`,children:n.versions.join(`, `)}),n.typeOnly&&(0,X.jsx)(`small`,{className:`tag`,title:"Every import of it is `import type`: nothing of it runs",children:`types`}),f&&(0,X.jsx)(`small`,{className:`tag`,title:`Imported only by tests, libraries or generated files`,children:`not own code`}),(0,X.jsx)(`small`,{className:`count`,children:n.files})]}),i&&(0,X.jsxs)(`div`,{className:`library-detail`,"data-testid":`library-detail`,children:[c&&(0,X.jsx)(`p`,{className:`hint error`,children:c}),!o&&!c&&(0,X.jsx)(`p`,{className:`hint`,children:`Loading…`}),o&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`small muted`,children:o.members.length===0?n.typeOnly?`Only its types are imported.`:`Nothing of it is called where the analysis can tell.`:`Used: ${Ow(n.calls,`call`)}${n.references?`, ${Ow(n.references,`reference`)}`:``}`}),p.length>0&&(0,X.jsx)(`ul`,{className:`library-members`,children:p.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`code`,{children:Mw(e)}),(0,X.jsx)(`small`,{className:`count`,children:e.calls+e.references})]},`${e.name}|${e.member}|${e.instance}`))}),o.members.length>kw&&(0,X.jsx)(`button`,{className:`link small`,onClick:()=>d(e=>!e),children:u?`fewer`:`${o.members.length-kw} more`}),(0,X.jsx)(`p`,{className:`small muted`,children:`Imported by`}),(0,X.jsx)(`ul`,{className:`library-files`,children:o.importers.slice(0,Aw).map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{className:`link`,"data-command":`library-file`,"data-file":e.path,title:`${e.path}${e.group?` (${e.group.name})`:``}${e.own?``:`: not own code`}${e.forms.includes(`type-only`)?` · types`:``}`,onClick:()=>r(e.file),children:e.path})},e.file))}),o.importers.length>Aw&&(0,X.jsxs)(`p`,{className:`small muted`,children:[`and `,Ow(o.importers.length-Aw,`more file`)]})]})]})]})}function Pw({project:e,run:t,source:n,filter:r,onOpen:i}){let[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(``);if((0,y.useEffect)(()=>{let t=!0;return c(``),Y.libraries(e,n).then(e=>t&&o(e)).catch(e=>t&&c(e.message)),()=>{t=!1}},[e,n,t]),s)return(0,X.jsx)(`p`,{className:`hint error`,children:s});if(!a)return(0,X.jsx)(`p`,{className:`hint`,children:`Loading libraries…`});let l=r.trim().toLowerCase(),u=a.packages.filter(e=>!l||e.name.toLowerCase().includes(l)),d=a.copied.filter(e=>!l||e.path.toLowerCase().includes(l)),f=a.leftOut.filter(e=>!l||e.path.toLowerCase().includes(l)),p=new Set([...a.copied,...a.leftOut].map(e=>e.source)).size>1,m=e=>p?`${e.source}/${e.path}`:e.path;return(0,X.jsxs)(`div`,{className:`libraries`,"data-testid":`libraries`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`h4`,{className:`outline-source`,children:[`Installed packages `,(0,X.jsx)(`small`,{className:`muted`,children:a.total})]}),a.stage2?u.length===0?(0,X.jsx)(`p`,{className:`hint`,children:l?`No packages match.`:`No file imports an installed package.`}):(0,X.jsx)(`ul`,{children:u.map(r=>(0,X.jsx)(Nw,{project:e,source:n,pkg:r,onOpen:i},`${n??``}|${t??``}|${r.ecosystem}:${r.name}`))}):(0,X.jsx)(`p`,{className:`hint`,children:`Packages come from import analysis (Stage 2), which hasn't run for this project.`}),a.truncated&&(0,X.jsxs)(`p`,{className:`small muted`,children:[`The first `,Ow(a.packages.length,`package`),`.`]})]}),d.length>0&&(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`h4`,{className:`outline-source`,title:`Third-party code copied into the project (plan D66)`,children:[`Copied into the project `,(0,X.jsx)(`small`,{className:`muted`,children:d.length})]}),(0,X.jsx)(`ul`,{children:d.map(e=>(0,X.jsxs)(`li`,{className:`library-row`,"data-testid":`library-copied`,title:`${m(e)}: ${jw[e.why]}${e.names.length?` (${e.names.join(`, `)})`:``}. ${e.state===`kept`?`Kept: analyzed as the project's own code.`:`Not decided: counted apart from own code until you keep it or leave it out.`}`,children:[(0,X.jsxs)(`span`,{className:`name`,children:[m(e),e.kind===`dir`?`/`:``]}),(0,X.jsx)(`small`,{className:`tag${e.state===`pending`?` warn`:``}`,children:e.state===`kept`?`kept`:`not decided`}),(0,X.jsx)(`small`,{className:`count`,children:e.files})]},`${e.source}|${e.path}`))})]}),f.length>0&&(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`h4`,{className:`outline-source`,title:`Library folders left out by default (plan D36, D57); Choose files… analyzes them`,children:[`Left out by default `,(0,X.jsx)(`small`,{className:`muted`,children:f.length})]}),(0,X.jsx)(`ul`,{children:f.map(e=>(0,X.jsxs)(`li`,{className:`library-row`,"data-testid":`library-left-out`,title:`${m(e)}/: ${e.files===null?`not read`:Ow(e.files,`file`)}, not analyzed`,children:[(0,X.jsxs)(`span`,{className:`name`,children:[m(e),`/`]}),(0,X.jsx)(`small`,{className:`count`,children:e.files??`–`})]},`${e.source}|${e.path}`))})]})]})}var Fw=24,Iw=12,Lw=300,Rw=new Set([`apps`,`packages`,`services`,`libs`,`modules`,`crates`,`projects`]),zw=/(^|\/)([\w-]+\.config\.[cm]?[jt]sx?|\.?[\w-]*rc\.[cm]?[jt]s|(vite|vitest|jest|webpack|rollup|babel|eslint|prettier|tailwind|postcss|playwright|next|nuxt|svelte|astro|tsup|knip|commitlint|stylelint)\.[\w.-]*[cm]?[jt]s)$/i;function Bw(e){return h(e)?`tests`:zw.test(e)?`config`:`source`}var Vw=e=>e.status!==`analyzed`,Hw={"parse-failure":`could not be parsed`,"declaration-file":`type declarations`,"language-not-analyzed":`language not analyzed yet`,"too-large":`too large`,binary:`not text`,minified:`minified`,"invalid-utf8":`not UTF-8 text`,unreadable:`could not be read`,entitlement:`beyond the license`,frozen:`kept from an earlier analysis (beyond the license)`},Uw={degraded:`partly analyzed`,not_analyzed:`not analyzed`,parse_error:`could not be parsed`},Ww=(e,t)=>e<t?-1:+(e>t);function Gw(e,t,n){let r={key:``,name:``,dirs:new Map,files:[],total:0,functions:0};for(let i of e){let e=(n?`${i.source}/${i.path}`:i.path).split(`/`);e.pop();let a=r,o=t[i.id]?.functions??0;a.total++,a.functions+=o;let s=``;for(let t of e){s=s?`${s}/${t}`:t;let e=a.dirs.get(t);e||(e={key:s,name:t,dirs:new Map,files:[],total:0,functions:0},a.dirs.set(t,e)),a=e,a.total++,a.functions+=o}a.files.push(i)}return r}function Kw(e,t=!1,n=0){for(let[r,i]of e.dirs)e.dirs.set(r,Kw(i,t,n+1));if(e.key!==``&&!(t&&n===1)&&e.files.length===0&&e.dirs.size===1){let t=[...e.dirs.values()][0];return{...t,name:`${e.name}/${t.name}`}}return e}function qw(e,t,n){let r=[],i=(e,a)=>{let o=[...e.dirs.values()].sort((e,t)=>{if(a===0){let n=+!Rw.has(e.name.split(`/`)[0]),r=+!Rw.has(t.name.split(`/`)[0]);if(n!==r)return n-r}return Ww(e.name,t.name)});for(let e of o){let n=t.has(e.key);r.push({type:`dir`,key:e.key,name:e.name,depth:a,open:n,total:e.total,functions:e.functions}),n&&i(e,a+1)}for(let t of[...e.files].sort((e,t)=>Ww(e.path,t.path))){let e=n[t.id];r.push({type:`file`,file:t,depth:a,label:t.path.slice(t.path.lastIndexOf(`/`)+1),...e?{hint:`${e.functions}ƒ`}:{}})}};return i(e,0),r}var Jw=60;function Yw(e,t){let n=new Set,r=e=>{for(let t of e.dirs.values())n.add(t.key),r(t)};if(t<=Jw)return r(e),n;for(let t of e.dirs.values())if(n.add(t.key),Rw.has(t.name.split(`/`).pop())||Rw.has(t.name.split(`/`)[0]))for(let e of t.dirs.values())n.add(e.key);return n}var Xw=e=>`veoflow.tree.${e}`;function Zw(e){try{let t=localStorage.getItem(Xw(e)),n=t?JSON.parse(t):[];return n.length>0?new Set(n):null}catch{return null}}function Qw(e,t){try{localStorage.setItem(Xw(e),JSON.stringify([...t]))}catch{}}function $w({project:e,files:t,counts:n,current:r,onOpen:i,run:a=null,onAnalyze:o,sources:s=[],scope:c=null,onScope:l,onCollapse:u,onImports:d,onMenu:f,hidden:p=!1,onReveal:m}){let[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(``),[b,x]=(0,y.useState)({source:!0,tests:!1,config:!0}),[S,C]=(0,y.useState)(!1),[w,T]=(0,y.useState)(!1),E=(0,y.useRef)(null);a?.status===`committed`&&(E.current=a.runId);let[D,O]=(0,y.useState)(new Set),[k,A]=(0,y.useState)(0),[j,M]=(0,y.useState)(600),[N,P]=(0,y.useState)(0),F=(0,y.useRef)(null),I=(0,y.useRef)(null),L=t;t=(0,y.useMemo)(()=>c?L.filter(e=>e.source===c):L,[L,c]);let R=(0,y.useMemo)(()=>s.length>1||new Set(L.map(e=>e.source)).size>1,[L,s.length]),z=(0,y.useMemo)(()=>new Map(s.map(e=>[e.id,e])),[s]),B=e=>{let t=z.get(e)?.analysis;return t?t.kind===`git`?`${t.branch??`detached`} · ${t.revision.slice(0,7)} · ${Ce(t.analyzedAt)}`:`plain folder · latest only`:``},V=(0,y.useMemo)(()=>{let e={source:0,tests:0,config:0,attention:0};for(let n of t)e[Bw(n.path)]++,Vw(n)&&e.attention++;return e},[t]),H=(0,y.useMemo)(()=>t.filter(e=>S?Vw(e):e.id===r||b[Bw(e.path)]||Vw(e)),[t,b,S,r]),U=(0,y.useMemo)(()=>{let e=Kw(Gw(H,n,R),R);return c&&R?e.dirs.get(c)??{...e,dirs:new Map,files:[]}:e},[H,n,R,c]),W=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!W.current&&e&&t.length!==0&&(W.current=!0,O(Zw(e)??Yw(U,t.length)))},[e,t,U]);let G=t.find(e=>e.id===r);(0,y.useEffect)(()=>{if(!G)return;let e=(R?`${G.source}/${G.path}`:G.path).split(`/`);e.pop(),O(t=>{let n=new Set(t),r=``,i=!1;for(let t of e)r=r?`${r}/${t}`:t,n.has(r)||(n.add(r),i=!0);return i?n:t})},[G?.id]);let K=(0,y.useMemo)(()=>{let e=_.trim().toLowerCase();return e?t.map(t=>{let n=t.path.toLowerCase(),r=n.slice(n.lastIndexOf(`/`)+1);return{f:t,rank:r.replace(/\.[^.]+$/,``)===e||r===e?0:r.startsWith(e)?1:r.includes(e)?2:n.includes(e)?3:-1,kind:Bw(t.path)===`source`?0:1}}).filter(e=>e.rank>=0).sort((e,t)=>e.rank-t.rank||e.kind-t.kind||e.f.path.length-t.f.path.length||Ww(e.f.path,t.f.path)).slice(0,Lw).map(({f:e})=>{let t=e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):``,n=R?z.get(e.source)?.name??e.source:``;return{type:`file`,file:e,depth:0,label:e.path.slice(e.path.lastIndexOf(`/`)+1),hint:[n,t].filter(Boolean).join(` · `)}}):qw(U,D,n)},[_,U,D,n,t,R,z]);(0,y.useEffect)(()=>{W.current&&e&&Qw(e,D)},[D,e]),(0,y.useEffect)(()=>{N>=K.length&&P(Math.max(0,K.length-1))},[K.length,N]),(0,y.useEffect)(()=>{let e=F.current;if(!e)return;let t=new ResizeObserver(()=>M(e.clientHeight));return t.observe(e),()=>t.disconnect()},[]);let ee=(0,y.useRef)(null),q=_.trim()!==``;(0,y.useEffect)(()=>{if(p)return;let e=r?`${r}\0${q}`:null;if(!r||ee.current===e)return;let t=K.findIndex(e=>e.type===`file`&&e.file.id===r);if(t<0||!F.current)return;ee.current=e;let n=t*Fw,i=F.current;(n<i.scrollTop||n+Fw>i.scrollTop+i.clientHeight)&&(i.scrollTop=Math.max(0,n-i.clientHeight/3),A(i.scrollTop)),P(t)},[r,K,q,p]),(0,y.useLayoutEffect)(()=>{!p&&F.current&&A(F.current.scrollTop)},[p]);let J=(0,y.useRef)(p);J.current=p;let te=(0,y.useRef)(m);te.current=m,(0,y.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`p`){if(document.querySelector(`[role="dialog"], [role="menu"]`))return;e.preventDefault(),J.current&&te.current?.(),setTimeout(()=>{I.current?.focus(),I.current?.select()},0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Y=e=>O(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),ne=e=>{let t=Math.max(0,Math.min(K.length-1,e)),n=F.current;if(n){let e=t*Fw,r=n.scrollTop;e<r?r=e:e+Fw>r+n.clientHeight&&(r=e+Fw-n.clientHeight),n.scrollTop=r,(0,Dw.flushSync)(()=>{A(r),P(t)})}else P(t);F.current?.querySelector(`[data-row="${t}"]`)?.focus({preventScroll:!0})},re=e=>{let t=K[e]?.depth??0;for(let n=e-1;n>=0;n--)if(K[n].type===`dir`&&K[n].depth<t)return n;return-1},ie=e=>{let t=K[N];if(e.key===`ArrowDown`)ne(N+1);else if(e.key===`ArrowUp`)ne(N-1);else if(e.key===`Home`)ne(0);else if(e.key===`End`)ne(K.length-1);else if(e.key===`ArrowRight`&&t?.type===`dir`)t.open?ne(N+1):Y(t.key);else if(e.key===`ArrowLeft`){if(t?.type===`dir`&&t.open)Y(t.key);else{let e=re(N);e>=0&&ne(e)}}else return;e.preventDefault()},ae=Math.max(0,Math.floor(k/Fw)-Iw),oe=Math.min(K.length,Math.ceil((k+j)/Fw)+Iw),se=(e,t)=>V[e]===0?null:(0,X.jsxs)(`button`,{className:`chip`,"aria-pressed":!S&&!w&&b[e],"data-testid":`chip-${e}`,disabled:V[e]===0,onClick:()=>{C(!1),w?(T(!1),x(t=>({...t,[e]:!0}))):x(t=>({...t,[e]:!t[e]}))},children:[t,` `,(0,X.jsx)(`small`,{children:V[e]})]}),ce=(0,y.useMemo)(()=>{let e=0,t=0;for(let n of a?.sources??[])e+=n.defaultExcluded?.length??0,t+=(n.ruleExcluded?.length??0)+(n.ruleExcludedMore??0);return{folders:e,paths:t}},[a]);return h&&e?(0,X.jsx)(`nav`,{className:`nav`,"aria-label":`Files`,hidden:p,children:(0,X.jsx)(JS,{project:e,files:t,run:a,onAnalyze:()=>{o?.(),g(!1)},onClose:()=>g(!1)})}):(0,X.jsxs)(`nav`,{className:`nav`,"aria-label":`Files`,hidden:p,children:[(0,X.jsxs)(`div`,{className:`nav-head`,children:[(s.length>1||c)&&(0,X.jsxs)(`label`,{className:`nav-scope`,children:[(0,X.jsx)(`span`,{className:`small muted`,children:`Scope`}),(0,X.jsxs)(`select`,{"data-command":`scope-source`,value:c??``,onChange:e=>l?.(e.target.value||null),children:[(0,X.jsx)(`option`,{value:``,children:`All repositories`}),s.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.name??e.id},e.id))]})]}),(0,X.jsxs)(`div`,{className:`outline-head`,children:[(0,X.jsx)(`input`,{ref:I,className:`nav-filter`,"data-testid":`file-filter`,type:`search`,placeholder:w?`Filter libraries…`:`Filter ${t.length} files… ⌘P`,"aria-label":w?`Filter libraries`:`Filter files`,value:_,onChange:e=>{v(e.target.value),F.current&&(F.current.scrollTop=0),P(0)},onKeyDown:e=>{if(e.key===`Enter`&&_.trim()&&!w){let e=K.find(e=>e.type===`file`);e?.type===`file`&&i(e.file.id)}else e.key===`ArrowDown`?(e.preventDefault(),w?F.current?.parentElement?.querySelector(`.libraries button, [data-testid="library-package"]`)?.focus():ne(0)):e.key===`Escape`&&v(``)}}),u&&(0,X.jsx)(`button`,{className:`icon`,title:`Hide this pane ( [ )`,"aria-label":`Hide the files pane`,onClick:u,children:`⟨`})]}),(0,X.jsxs)(`div`,{className:`nav-chips`,role:`group`,"aria-label":`Show`,children:[se(`source`,`Source`),se(`tests`,`Tests`),se(`config`,`Config`),V.attention>0&&(0,X.jsxs)(`button`,{className:`chip attention`,"aria-pressed":S&&!w,"data-testid":`chip-attention`,title:`Files that were not fully analyzed`,onClick:()=>{C(e=>w||!e),T(!1)},children:[`⚠ `,(0,X.jsx)(`small`,{children:V.attention})]}),e&&(t.length>0||w)&&(0,X.jsx)(`button`,{className:`chip`,"aria-pressed":w,"data-testid":`chip-libraries`,title:`The libraries the project uses: installed packages, copied libraries, and folders left out`,onClick:()=>{C(!1),T(e=>!e)},children:`Libraries`})]})]}),w&&e&&(0,X.jsx)(`div`,{className:`nav-list`,children:(0,X.jsx)(Pw,{project:e,run:E.current,source:c,filter:_,onOpen:i})}),(0,X.jsxs)(`div`,{className:`nav-list`,hidden:w&&!!e,ref:F,role:`tree`,"aria-label":`Files`,onScroll:e=>A(e.currentTarget.scrollTop),onKeyDown:ie,children:[K.length===0&&t.length>0&&(0,X.jsx)(`p`,{className:`hint`,children:`No files match.`}),(0,X.jsx)(`div`,{style:{height:K.length*Fw,position:`relative`},children:K.slice(ae,oe).map((e,t)=>{let n=ae+t,a={top:n*Fw,paddingLeft:8+e.depth*14};if(e.type===`dir`&&R&&!c&&e.depth===0&&z.has(e.key))return(0,X.jsxs)(`button`,{"data-row":n,role:`treeitem`,"aria-expanded":e.open,"aria-level":1,"aria-setsize":K.length,"aria-posinset":n+1,tabIndex:n===N?0:-1,className:`row dir repo`,"data-testid":`repo-row`,"data-source":e.key,style:a,title:z.get(e.key)?.root??e.key,onClick:()=>{P(n),Y(e.key)},children:[(0,X.jsx)(`span`,{className:`caret`,children:e.open?`▾`:`▸`}),(0,X.jsx)(`strong`,{className:`name`,children:z.get(e.key)?.name??e.key}),(0,X.jsx)(`small`,{className:`muted repo-hint`,children:B(e.key)}),(0,X.jsx)(`small`,{className:`count`,title:`${e.total} files, ${e.functions} functions`,children:e.total})]},`r:${e.key}`);if(e.type===`dir`)return(0,X.jsxs)(`button`,{"data-row":n,role:`treeitem`,"aria-expanded":e.open,"aria-level":e.depth+1,"aria-setsize":K.length,"aria-posinset":n+1,tabIndex:n===N?0:-1,className:`row dir`,style:a,title:e.key,onClick:()=>{P(n),Y(e.key)},children:[(0,X.jsx)(`span`,{className:`caret`,children:e.open?`▾`:`▸`}),(0,X.jsx)(`span`,{className:`name`,children:e.name}),(0,X.jsx)(`small`,{className:`count`,title:`${e.total} files, ${e.functions} functions`,children:e.total})]},`d:${e.key}`);let o=e.file;return[(0,X.jsxs)(`button`,{"data-row":n,role:`treeitem`,"aria-level":e.depth+1,"aria-setsize":K.length,"aria-posinset":n+1,"aria-selected":o.id===r,tabIndex:n===N?0:-1,"data-command":`open-file`,"data-file":o.path,className:`row file ${o.id===r?`current`:``} ${o.status}`,style:a,title:o.status===`analyzed`?o.path:`${o.path}: ${Uw[o.status]??o.status}${o.reason?` (${Hw[o.reason]??o.reason})`:``}`,onClick:()=>{P(n),i(o.id)},onContextMenu:f&&(e=>{e.preventDefault(),f({kind:`file`,id:o.id,data:{},x:e.clientX,y:e.clientY})}),children:[(0,X.jsx)(`span`,{className:`caret`}),(0,X.jsxs)(`span`,{className:`name`,children:[e.label,_.trim()&&e.hint?(0,X.jsxs)(`small`,{className:`muted`,children:[` `,e.hint]}):null]}),o.origin&&(0,X.jsx)(`small`,{className:`origin ${o.origin}`,title:o.origin===`library`?`Installed library code, not the project's own`:o.origin===`tool`?`A tool's or coding agent's workspace, not the project's own code`:`Generated output, not the project's own code`,children:o.origin}),Vw(o)?(0,X.jsxs)(`small`,{className:`warn`,"aria-label":`${Uw[o.status]??o.status}${o.reason?`: ${Hw[o.reason]??o.reason}`:``}`,children:[`⚠ `,Hw[o.reason??``]??o.reason??o.status]}):!_.trim()&&e.hint&&(0,X.jsx)(`small`,{className:`count`,children:e.hint})]},`f:${o.id}`),d&&o.status!==`not_analyzed`&&(0,X.jsx)(`button`,{className:`row-action`,"aria-hidden":`true`,"data-command":`file-imports`,"data-file":o.path,style:{top:n*Fw},tabIndex:-1,title:`Imports of ${e.label}: what it imports and what depends on it (Imports tab)`,onClick:()=>d(o.id),children:`⇄`},`i:${o.id}`)]})})]}),e&&o&&(0,X.jsxs)(`div`,{className:`nav-foot`,children:[(0,X.jsx)(`small`,{className:`muted`,"data-testid":`left-out`,children:ce.folders+ce.paths===0?``:`Left out: ${[ce.folders?`${ce.folders} by default (libraries, generated, tools)`:``,ce.paths?`${ce.paths} by your choice`:``].filter(Boolean).join(`, `)}`}),(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{"data-testid":`choose-files`,onClick:()=>g(!0),title:`Choose which files are analyzed`,children:`Choose files…`})]})]})}W_.use(Wx);function eT(e){try{return tT(e)}catch{return nT(e)}}function tT(e){let t=W_({headless:!0,styleEnabled:!0,elements:[...e.nodes.map(e=>({data:{id:e.id,w:e.w,h:e.h}})),...e.edges.map(e=>({data:{id:e.id,source:e.source,target:e.target}}))],style:[{selector:`node`,style:{width:`data(w)`,height:`data(h)`}}]}),n=e=>t.layout({name:`dagre`,rankDir:e,nodeSep:14,rankSep:e===`LR`?70:50,fit:!1,animate:!1}).run();try{n(`LR`);let r=t.elements().boundingBox(),{w:i,h:a}=e.canvas;r.w*e.fitZoom>i-2*e.pad&&r.w/Math.max(1,r.h)>i/a&&n(`TB`)}catch(e){throw t.destroy(),e}let r={};for(let e of t.nodes().toArray())r[e.id()]={...e.position()};return t.destroy(),r}function nT(e){let t=Math.max(1,Math.ceil(Math.sqrt(e.nodes.length))),n=Math.max(40,...e.nodes.map(e=>e.w))+24,r={};return e.nodes.forEach((e,i)=>{r[e.id]={x:i%t*n,y:Math.floor(i/t)*40}}),r}var rT=null,iT=typeof Worker>`u`,aT=0,oT=new Map,sT=e=>new Promise(t=>setTimeout(()=>t(eT(e)),0));function cT(){try{let e=new Worker(new URL(`/assets/callLayout.worker-BugXMtxI.js`,``+import.meta.url),{type:`module`});return e.addEventListener(`message`,e=>{let t=oT.get(e.data.id);t&&(oT.delete(e.data.id),e.data.error===void 0?t.resolve(e.data.positions):(console.error(`veoflow: laying out this graph failed; placed in a grid`,e.data.error),t.resolve(nT(t.input))))}),e.addEventListener(`error`,t=>{console.error(`veoflow: the layout worker failed; laying out on the page instead`,t),iT=!0,e.terminate(),rT=null;for(let[e,t]of oT)oT.delete(e),sT(t.input).then(t.resolve)}),e}catch{return iT=!0,null}}function lT(e){if(oT.size>0&&rT&&(rT.terminate(),rT=null,oT.clear()),!iT&&!rT&&(rT=cT()),!rT)return sT(e);let t=++aT;return new Promise(n=>{oT.set(t,{input:e,resolve:n}),rT.postMessage({id:t,input:e})})}var uT=2,dT=40,fT=25,pT=7;function mT(e){let t=gT.get(e);if(t)return t;let n=hT(e),r=new Set(e.calls.map(e=>`${e.from}\u0000${e.to}`)),i=[];for(let t of e.functions){let e=n.get(t.id);e&&e!==t.id&&!r.has(`${e}\u0000${t.id}`)&&i.push({id:`inside:${t.id}`,parent:e,child:t.id})}return gT.set(e,i),i}function hT(e){let t=new Map(e.functions.map(e=>[e.qualifiedName,e.id])),n=new Set(t.keys()),r=new Map;for(let i of e.functions){let e=_e(i.qualifiedName,n),a=e===null?void 0:t.get(e);a&&r.set(i.id,a)}return r}var gT=new WeakMap;function _T(e,t,n=null){let r=new Map,i=(e,t)=>{e!==t&&(r.has(e)||r.set(e,new Set),r.get(e).add(t))};for(let t of e.calls)i(t.from,t.to),i(t.to,t.from);for(let{parent:t,child:n}of mT(e))i(t,n),i(n,t);let a=e=>r.get(e)?.size??0,o=(e,t)=>[...e].sort((e,t)=>a(t)-a(e)||(e<t?-1:1)).slice(0,t),s=new Set(e.functions.map(e=>e.id));if(n&&s.has(n[0])&&s.has(n[1])){let e=new Set(n);for(let t of n)for(let n of o(r.get(t)??[],pT))e.add(n);return e}if(t&&s.has(t)){let e=new Set([t]),n=o(r.get(t)??[],fT);for(let t of n)e.add(t);for(let t=1;t<uT&&e.size<dT;t++)for(let t of n)for(let n of o(r.get(t)??[],5))e.size<dT&&e.add(n);return e}return new Set(o(s,dT))}var vT=e=>`site:${e}`,yT=(e,t)=>`pair:${e}->${t}`;W_.use(Wx);var bT=.85,xT=1.25,ST=45,CT=.68,wT=4,TT=36,ET=e=>Math.max(36,String(e.data(`label`)).length*7+18);function DT(e){let t=e.nodes(`[kind = "function"], [kind = "port"], [kind = "ghost"]`).not(`.hidden`),n=`[kind = "call"], [kind = "ghost-call"], [kind = "inside"]`,r=e.edges(n).not(`.hidden`),i=t.filter(e=>e.connectedEdges(n).not(`.hidden`).empty());return{fns:t,isolated:i,connected:t.difference(i).union(r)}}var OT=300;function kT(e){let{connected:t}=DT(e);return{nodes:t.nodes().toArray().map(e=>({id:e.id(),w:e.outerWidth(),h:e.outerHeight()})),edges:t.edges().map(e=>({id:e.id(),source:e.source().id(),target:e.target().id()})),canvas:{w:Math.max(1,e.width()),h:Math.max(1,e.height())},fitZoom:CT,pad:TT}}function AT(e,t){let{fns:n,isolated:r,connected:i}=DT(e),a=e=>i.layout({name:`dagre`,rankDir:e,nodeSep:14,rankSep:e===`LR`?70:50,fit:!1}).run(),o={w:Math.max(1,e.width()),h:Math.max(1,e.height())};if(t)e.batch(()=>{for(let e of i.nodes().toArray()){let n=t[e.id()];n&&e.position(n)}});else if(i.nonempty()){a(`LR`);let e=i.boundingBox();e.w*CT>o.w-72&&e.w/Math.max(1,e.h)>o.w/o.h&&a(`TB`)}let s=r.toArray(),c=i.nonempty()?i.boundingBox():{x1:0,y1:0,x2:0,y2:0,w:0,h:0},l=i.nonempty()?c.y2+48:0,u=Math.max(0,...s.map(e=>ET(e)))+24,d=Math.max(wT,Math.floor(Math.max(c.w,o.w/bT-72)/u));s.forEach((e,t)=>{e.position({x:c.x1+t%d*u+u/2,y:l+Math.floor(t/d)*34})});for(let e of n.toArray()){let t=e.outgoers(`node[kind = "site"]`).not(`.hidden`).toArray();if(t.length===0)continue;let n=e.position(),r=n.x+ET(e)/2+48;t.forEach((e,i)=>e.position({x:r+ET(e)/2,y:n.y+(i-(t.length-1)/2)*26}))}}function jT(e,t){if(t.empty())return;e.fit(t,TT);let n=e.zoom(),r=t.nodes().length<=ST?CT:bT;if(n>xT)e.zoom(xT),e.center(t);else if(n<r){let n=t.boundingBox();e.zoom(r),e.pan({x:TT-n.x1*r,y:TT-n.y1*r})}}function MT(e,t){if(t.edges().nonempty()||t.nodes(`[kind = "site"]`).nonempty()){jT(e,t.union(t.edges().connectedNodes()).union(t.nodes().incomers(`node`)));return}let n=t,r=n.renderedBoundingBox(),i=e.width(),a=e.height();r.x1>=0&&r.y1>=0&&r.x2<=i&&r.y2<=a||e.animate({center:{eles:n}},{duration:250})}function NT({graph:e,showUnresolved:t,selection:n,onSelect:r,onClear:i,focus:a,sitesFor:o,answered:s,marks:c,only:l=null,onContext:u,extraSite:d=null}){let f=(0,y.useRef)(null),m=(0,y.useRef)(null),h=(0,y.useRef)(l);h.current=l;let g=(0,y.useRef)(u);g.current=u,(0,y.useEffect)(()=>{m.current&&Ge(m.current,l)},[l]);let _=(0,y.useRef)(0),[v,b]=(0,y.useState)(!1),[x,S]=(0,y.useState)(null),[C,w]=(0,y.useState)(0);(0,y.useEffect)(()=>{let n=new Set(e.functions.map(e=>e.id)),a=new Map;for(let t of e.calls){if(!t.crossFile)continue;let e=n.has(t.from)?t.to:t.from;if(n.has(e)||a.has(e))continue;let r=t.function.path.split(`/`).pop()??t.function.path;a.set(e,`${r} › ${ae(t.function.qualifiedName,void 0,t.function.title).name}`)}for(let e of a.keys())n.add(e);let o=new Set(e.calls.filter(e=>e.from===e.to).map(e=>e.from)),s=new Map;for(let t of e.calls){if(t.from===t.to||!n.has(t.from)||!n.has(t.to))continue;let e=yT(t.from,t.to),r=s.get(e);r?r.calls.push(t.id):s.set(e,{from:t.from,to:t.to,calls:[t.id]})}let c=e.functions.map(e=>{let t=ye(e);return t.unnamed?`λ ${t.name}`:t.name}),l=new Map(e.functions.map(e=>[e.id,e.qualifiedName])),u=new Map(e.functions.map(e=>[e.id,e])),_=mT(e),v=hT(e),y=e=>{let t=v.get(e);return t===void 0?null:l.get(t)??null},b=new Set(c.filter((e,t)=>c.indexOf(e)!==t)),x=[...e.functions.map((e,t)=>{let n=c[t],r=b.has(n)&&!n.includes(`· line`)?`${n} · line ${e.evidence.span.start.line}`:n,i=ve(e.qualifiedName,e.code,e.evidence.span.start.line,y(e.id));return{data:{id:e.id,label:o.has(e.id)?`${r} ↻`:r,kind:`function`,...i?{hover:i}:{}},classes:e.qualifiedName===`<module>`?`module`:ye(e).unnamed?`unnamed`:``}}),...[...a].map(([e,t])=>({data:{id:e,label:t,kind:`port`},classes:`port`})),..._.map(e=>{let t=l.get(e.parent)??``,n=u.get(e.child),r=n?ge(n.qualifiedName,n.code,n.title)??oe(n.qualifiedName):``;return{data:{id:e.id,source:e.parent,target:e.child,kind:`inside`,label:``,hover:`${r} is written inside ${t===`<module>`?`the file's top level`:oe(t)}. A dotted line shows where a function is written, not a call.`},classes:`inside`}}),...[...s].map(([e,t])=>({data:{id:e,source:t.from,target:t.to,kind:`call`,calls:t.calls,label:t.calls.length>1?`×${t.calls.length}`:``}}))];if(t||d){let r=new Map;for(let i of e.unresolved){if(!n.has(i.enclosingFn)||!(t&&p(i))&&i.id!==d)continue;let e=`${i.enclosingFn}\u0000${i.expression}\u0000${i.status}`,a=r.get(e);a?a.ids.push(i.id):r.set(e,{fn:i.enclosingFn,expression:i.expression,ids:[i.id],status:i.status})}for(let e of r.values()){let t=vT(e.ids[0]),n=e.expression.length>40?`${e.expression.slice(0,39)}…`:e.expression;x.push({data:{id:t,label:e.ids.length>1?`${n} ×${e.ids.length}`:n,kind:`site`,ids:e.ids},classes:`site ${e.status}`},{data:{id:`edge:${t}`,source:e.fn,target:t,kind:`site-edge`,label:``},classes:`site-edge`})}}let C=W_({container:f.current,elements:x,autounselectify:!0,layout:{name:`preset`},minZoom:.15,maxZoom:3,style:[{selector:`node`,style:{label:`data(label)`,"font-size":12,"text-valign":`center`,"text-halign":`center`,shape:`round-rectangle`,width:ET,height:22,"background-color":`#e8eef8`,"border-width":1,"border-color":`#6b87b8`,color:`#1d2330`}},{selector:`node.module`,style:{"background-color":`#eceef2`,"border-color":`#8a93a3`,"font-weight":`bold`}},{selector:`node.unnamed`,style:{"font-style":`italic`,"background-color":`#f4f1fa`,"border-color":`#9a86c4`,"border-style":`dashed`}},{selector:`node.port`,style:{"background-color":`#fff`,"border-style":`dashed`,"border-color":`#7a8aa0`,color:`#4a5568`}},{selector:`node.site`,style:{"background-color":`#fff`,"border-style":`dashed`,"border-color":`#c07a00`,color:`#8a5a00`}},{selector:`node.site.awaiting-link, node.site.external`,style:{"border-color":`#999`,color:`#777`}},{selector:`edge`,style:{width:1.5,"curve-style":`bezier`,"target-arrow-shape":`triangle`,"line-color":`#8fa6cc`,"target-arrow-color":`#8fa6cc`,label:`data(label)`,"font-size":10,color:`#5c6678`,"text-background-color":`#fafbfc`,"text-background-opacity":1,"text-background-padding":`2px`}},{selector:`edge.inside`,style:{"line-style":`dotted`,width:1.5,"line-color":`#a493cc`,"target-arrow-shape":`none`}},{selector:`edge.site-edge`,style:{"line-style":`dashed`,"line-color":`#c9a45c`,"target-arrow-color":`#c9a45c`}},...Je,We,{selector:`.hidden`,style:{display:`none`}},{selector:`node.answered`,style:{"border-width":2,"border-color":`#d99a00`,"background-color":`#fff4cc`}},{selector:`.faded`,style:{opacity:.22}},{selector:`node.picked`,style:{"border-width":2,"border-color":`#2f5fbf`,"background-color":`#d6e3fa`}},{selector:`edge.picked`,style:{"line-color":`#2f5fbf`,"target-arrow-color":`#2f5fbf`,width:3}}]});return C.on(`tap`,`node, edge`,e=>{let t=e.target.data(`kind`),n=e.target.id();t===`function`?r({kind:`function`,id:n}):t===`inside`?r({kind:`function`,id:e.target.target().id()}):t===`call`?r({kind:`call`,id:e.target.data(`calls`)[0]}):t===`site`&&r({kind:`site`,id:e.target.data(`ids`)[0]})}),C.on(`tap`,e=>{e.target===C&&i()}),C.on(`mouseover`,`node, edge`,e=>{let t=e.target.data(`hover`),n=e.renderedPosition??e.target.renderedMidpoint?.()??{x:0,y:0};S(t?{text:t,x:n.x,y:n.y}:null)}),C.on(`mouseout`,`node, edge`,()=>S(null)),C.on(`pan zoom drag remove`,()=>S(null)),m.current=C,Ge(C,h.current),C.on(`cxttap`,`node, edge`,e=>{let t=e.target.data(),n=t.kind===`function`?`function`:t.kind===`call`?`edge`:null;if(!n||!f.current)return;let r=f.current.getBoundingClientRect(),i=e.renderedPosition??{x:0,y:0};g.current?.({kind:n,id:n===`file`&&typeof t.file==`string`?t.file:e.target.id(),data:t,x:r.left+i.x,y:r.top+i.y})}),f.current&&(f.current.veoCy=C),()=>{m.current=null,S(null),C.destroy()}},[e,t,r,i,d]);let T=(c?.removed??[]).filter(t=>t.file===e.file.id&&(t.type===`Function`||t.type===`CALLS`)).map(e=>e.id).join(`
|
|
339
|
+
`);(0,y.useEffect)(()=>{let t=m.current;t&&t.batch(()=>{if(t.elements(`.ghost`).remove(),t.elements().removeClass(`diff-added diff-removed diff-changed`),!c)return;t.nodes(`[kind = "function"]`).forEach(e=>{let t=c.byId.get(e.id());t&&e.addClass(qe(t))}),t.edges(`[kind = "call"]`).forEach(e=>{let t=e.data(`calls`).map(e=>c.byId.get(e)).find(Boolean);t&&e.addClass(qe(t))});let n=new Set(t.nodes().map(e=>e.id())),r=new Set,i=[];for(let t of c.removed){if(t.type!==`Function`||t.file!==e.file.id||n.has(t.id))continue;let a=t.fact;r.add(t.id),i.push({data:{id:t.id,label:`${a.qualifiedName??a.name??t.id} (removed)`,kind:`ghost`},classes:`diff-removed ghost`})}for(let e of c.removed){if(e.type!==`CALLS`)continue;let t=e.fact,a=e=>!!e&&(n.has(e)||r.has(e));a(t.from)&&a(t.to)&&t.from!==t.to&&i.push({data:{id:`gone:${e.id}`,source:t.from,target:t.to,kind:`ghost-call`,label:``},classes:`diff-removed ghost`})}i.length&&t.add(i)})},[c,e,t,d]);let E=a?o:null;return(0,y.useEffect)(()=>{let e=m.current;if(!e)return;e.batch(()=>{if(e.elements().removeClass(`hidden`),a){let t=e.nodes().filter(e=>e.data(`kind`)===`function`?!a.has(e.id()):e.incomers(`node`).first().id()!==E);t.addClass(`hidden`),t.connectedEdges().addClass(`hidden`)}});let t=++_.current;if(DT(e).connected.nodes().length<=OT){AT(e),jT(e,e.elements().not(`.hidden`)),h.current&&Ge(e,h.current),b(!1);return}b(!0),lT(kT(e)).then(n=>{t===_.current&&m.current===e&&(AT(e,n),jT(e,e.elements().not(`.hidden`)),h.current&&Ge(e,h.current),b(!1),w(e=>e+1))})},[a,e,t,E,T,d]),(0,y.useEffect)(()=>{let t=m.current;if(!t||(t.batch(()=>{t.elements().removeClass(`picked faded`)}),f.current?.setAttribute(`data-picked`,``),!n))return;let r=n.kind===`site`?t.nodes(`[kind = "site"]`).filter(e=>e.data(`ids`).includes(n.id)):t.getElementById(n.id);if(r.empty()&&n.kind===`call`&&(r=t.edges().filter(e=>(e.data(`calls`)??[]).includes(n.id)),r.empty())){let i=e.calls.find(e=>e.id===n.id);i&&(r=t.getElementById(i.from))}if(r.empty())return;f.current?.setAttribute(`data-picked`,`${n.kind}:${n.id}`);let i=r.union(r.nodes().closedNeighborhood()).union(r.edges().connectedNodes());t.batch(()=>{r.addClass(`picked`),a||t.elements().not(i).addClass(`faded`)}),MT(t,r)},[n,e,t,a,C,d]),(0,y.useEffect)(()=>{let e=m.current;e&&e.batch(()=>{e.nodes().removeClass(`answered`),s&&e.nodes().filter(e=>s.has(e.id())).addClass(`answered`)})},[s,e,t,a,d]),(0,X.jsxs)(`div`,{className:`graph-wrap`,children:[(0,X.jsx)(`div`,{className:`graph`,ref:f,"data-testid":`graph`,"data-laying-out":v||void 0}),v&&(0,X.jsx)(`div`,{className:`laying-out`,children:`Laying out…`}),x&&(0,X.jsx)(`div`,{className:`graph-hover`,role:`tooltip`,"data-testid":`graph-hover`,style:{left:x.x+12,top:x.y+12},children:x.text}),(0,X.jsxs)(`details`,{className:`graph-key`,"data-testid":`graph-key`,children:[(0,X.jsx)(`summary`,{children:`Key`}),(0,X.jsxs)(`ul`,{children:[(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node`}),(0,X.jsx)(`span`,{children:`a function`})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node unnamed`,children:`λ`}),(0,X.jsxs)(`span`,{children:[`a function with no name in the code, shown as its code: `,(0,X.jsx)(`code`,{children:`.map(l => …)`}),` is the arrow function handed to `,(0,X.jsx)(`code`,{children:`.map()`})]})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-node module`}),(0,X.jsx)(`span`,{children:`the file's top level: what runs when the file is loaded`})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-line call`}),(0,X.jsx)(`span`,{children:`calls (×2: two call sites)`})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-line inside`}),(0,X.jsx)(`span`,{children:`written inside: where a function is written, not a call`})]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`key-line site`}),(0,X.jsx)(`span`,{children:`a call the analysis couldn't tie to a function here`})]})]})]}),(0,X.jsx)(`button`,{className:`fit`,title:`Fit the graph to the view`,"aria-label":`Fit the graph to the view`,onClick:()=>{let e=m.current;e&&jT(e,e.elements().not(`.hidden`))},children:`Fit`})]})}var PT=(e,t,n)=>(e.find(e=>e.id===t)?.kept??[]).some(e=>n===e||n.startsWith(`${e}/`)),FT={installed:`installed packages`,packages:`copied packages with their own manifests`,banners:`library banners or versioned names`},IT=3,LT=(e,t)=>`veoflow.librariesLater.${e}.${t}`,RT=(e,t)=>`veoflow.librariesSeen.${e}.${t}`,zT=e=>{try{return localStorage.getItem(e)===`1`}catch{return!1}};function BT({project:e,run:t,sources:n,onAnalyze:r,onKept:i,onChooseFiles:a}){let[o,s]=(0,y.useState)({}),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(()=>t?zT(LT(e,t.runId)):!1),[f,p]=(0,y.useState)(()=>!t||!zT(RT(e,t.runId)));(0,y.useEffect)(()=>{if(t)try{localStorage.setItem(RT(e,t.runId),`1`)}catch{}},[e,t?.runId]);let m=(t?.sources??[]).flatMap(e=>(e.libraries??[]).filter(t=>!PT(n,e.sourceId,t.path)).map(t=>({...t,source:e.sourceId}))),h=m.filter(e=>!o[`${e.source}:${e.path}`]),g=Object.values(o).filter(e=>e===`out`).length;if(!t||u||m.length===0||h.length===0&&g===0)return null;let _=async(t,n)=>{l(``);try{await Y.select(e,t.source,[t.path],!n,!n),s(e=>({...e,[`${t.source}:${t.path}`]:n?`out`:`kept`})),n||i()}catch(e){l(e.message??String(e))}},v=e=>`${e.toLocaleString(`en-US`)} file${e===1?``:`s`}`,b=()=>{try{localStorage.setItem(LT(e,t.runId),`1`)}catch{}d(!0)};return!f&&h.length>0&&g===0?(0,X.jsxs)(`section`,{className:`library-offer folded`,"data-testid":`library-offer`,"data-folded":!0,"aria-label":`Third-party libraries`,children:[(0,X.jsx)(`span`,{children:h.length===1?h[0].kind===`dir`?`${h[0].path}/ looks like ${v(h[0].files)} of third-party libraries`:`${h[0].path} looks like a third-party library`:`${h.length} folders or files look like third-party libraries`}),(0,X.jsx)(`button`,{className:`link`,"data-testid":`library-review`,onClick:()=>p(!0),children:`Review`}),(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{className:`link small`,title:`Hide this until the next analysis`,onClick:b,children:`Later`})]}):(0,X.jsxs)(`section`,{className:`library-offer`,"data-testid":`library-offer`,"aria-label":`Third-party libraries`,children:[h.length>0&&(0,X.jsx)(`ul`,{children:h.slice(0,IT).map(e=>(0,X.jsxs)(`li`,{"data-path":e.path,children:[(0,X.jsxs)(`span`,{className:`what`,children:[(0,X.jsxs)(`strong`,{className:`mono`,children:[e.path,e.kind===`dir`?`/`:``]}),` `,`looks like`,` `,e.kind===`dir`?`${v(e.files)} of third-party libraries`:`a third-party library`,` `,(0,X.jsxs)(`small`,{className:`muted`,children:[`(`,FT[e.why],`: `,e.names.join(`, `),`)`]})]}),(0,X.jsx)(`button`,{"data-testid":`library-leave-out`,onClick:()=>void _(e,!0),children:`Leave out`}),(0,X.jsx)(`button`,{className:`quiet`,"data-testid":`library-keep`,title:`Keep analyzing it, and don't offer it again`,onClick:()=>void _(e,!1),children:`Keep analyzing`})]},`${e.source}:${e.path}`))}),(0,X.jsxs)(`div`,{className:`offer-foot`,children:[h.length>IT&&(0,X.jsxs)(`button`,{className:`link`,onClick:()=>a(h[IT].source),children:[h.length-IT,` more…`]}),g>0&&(0,X.jsxs)(`span`,{children:[g,` left out at the next analysis.`,` `,(0,X.jsx)(`button`,{className:`link`,"data-testid":`library-analyze`,onClick:r,children:`Analyze now`})]}),c&&(0,X.jsx)(`span`,{className:`error small`,children:c}),(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{className:`link small`,title:`Hide this until the next analysis`,onClick:b,children:`Later`})]})]})}var VT=e=>/ looks like .*third-party librar/.test(e);function HT({run:e,quiet:t=!1}){let n=e?.sources??[],r=n.flatMap(e=>(e.notices??[]).filter(e=>!VT(e)).map(t=>n.length>1?`${e.sourceId}: ${t}`:t));return r.length?(0,X.jsx)(`ul`,{className:`run-notices${t?` quiet`:``}`,"data-testid":`run-notices`,"aria-label":`Notes from the analysis`,children:r.map(e=>(0,X.jsx)(`li`,{children:e},e))}):null}function UT({analysis:e}){let t=e.outdated.every(e=>e.was===null);return(0,X.jsxs)(`p`,{className:`outdated-note`,"data-testid":`graph-outdated`,children:[t?`This graph was made before veoflow recorded which analysis made it, so it may be older than this version's.`:`This graph was made by ${e.veoflow?`veoflow ${e.veoflow}`:`another veoflow`}; ${e.outdated.map(e=>e.stage).join(`, `)} ${e.outdated.length===1?`has`:`have`} changed since.`,` `,`Analyze again to see what this version finds.`]})}function WT({project:e,files:t,run:n,counts:r,source:i,sources:a,onOpen:o,onQuestions:s}){let[c,l]=(0,y.useState)(null),[u,d]=sS();(0,y.useEffect)(()=>{let t=!1;return Y.totals(e,30,i??void 0,!u).then(e=>!t&&l(e),()=>!t&&l(`error`)),()=>{t=!0}},[e,t,i,u,a]);let f=c&&c!==`error`?c:null,p=(0,y.useMemo)(()=>(f?.mostCalled??[]).filter(e=>Bw(e.path)===`source`).slice(0,5).map(e=>({key:e.id,name:e.name,count:e.calls})),[f]),m=f?.pendingLibraries,h=(0,y.useMemo)(()=>v(new Map(Object.entries(m??{}))),[m]),g=(0,y.useMemo)(()=>t.filter(e=>(!i||e.id.startsWith(`${i}:`))&&(u||h(e))),[t,i,u,h]),_=(0,y.useMemo)(()=>t.some(e=>!h(e)),[t,h]),b=(0,y.useMemo)(()=>g.reduce((e,t)=>e+(r[t.id]?.functions??0),0),[g,r]),x=(0,y.useMemo)(()=>g.filter(e=>Bw(e.path)===`source`&&!e.origin).map(e=>({f:e,n:r[e.id]?.functions??0})).filter(e=>e.n>0).sort((e,t)=>t.n-e.n||(e.f.path<t.f.path?-1:1)).slice(0,5),[g,r]),S=(0,y.useMemo)(()=>new Map(t.map(e=>[e.id,e.path])),[t]),C=(0,y.useMemo)(()=>new Set(g.map(e=>e.id.slice(0,e.id.indexOf(`:`)))).size>1,[g]),w=e=>e.toLocaleString(`en-US`);return(0,X.jsxs)(`div`,{className:`overview`,"data-testid":`overview`,children:[(0,X.jsx)(HT,{run:n,quiet:!0}),f?.analysis?.outdated.length?(0,X.jsx)(UT,{analysis:f.analysis}):null,f?.stage2&&f.completeness.sites>0&&(0,X.jsxs)(`section`,{className:`paths`,"data-testid":`overview-paths`,children:[(0,X.jsx)(`strong`,{children:ZS(f.completeness)}),(0,X.jsxs)(`small`,{children:[QS(f.completeness).filter(e=>e.count>0).map(e=>`${w(e.count)} ${e.label}`).join(` · `),f.completeness.openByReason.length>0&&` — they stop: ${f.completeness.openByReason.slice(0,3).map(e=>`${w(e.sites)} ${e.reason}`).join(`, `)}`]})]}),(0,X.jsxs)(`dl`,{className:`stats`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`files`}),(0,X.jsx)(`dd`,{children:w(g.length)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`functions`}),(0,X.jsx)(`dd`,{children:w(b)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`dt`,{children:[`calls`,f?.stage2&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`br`,{}),(0,X.jsxs)(`small`,{children:[w(f.calls.acrossFiles),` across files`]})]})]}),(0,X.jsx)(`dd`,{"data-testid":`overview-calls`,children:f?w(f.calls.withinFiles+f.calls.acrossFiles):c===`error`?`?`:`…`})]}),(0,X.jsxs)(`div`,{className:`muted-stat`,children:[(0,X.jsxs)(`dt`,{children:[`open calls`,(0,X.jsx)(`br`,{}),(0,X.jsx)(`small`,{children:`calls the analysis couldn't follow`})]}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`button`,{className:`stat-link`,"data-testid":`overview-open-calls`,onClick:s,title:`Show them in Findings (the same count as there)`,children:f?w(f.openCalls):c===`error`?`?`:`…`})})]}),_&&(0,X.jsxs)(`label`,{className:`toggle stats-scope`,title:`Own code first: tests, installed libraries, generated output and tools' files are counted when this is on`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`overview-all-code`,checked:u,onChange:e=>d(e.target.checked)}),`Libraries and tests too`]})]}),(0,X.jsxs)(`div`,{className:`columns`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{children:`Largest files`}),(0,X.jsx)(`ul`,{children:x.map(({f:e,n:t})=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link-row`,onClick:()=>o(e.id),title:e.path,children:[(0,X.jsx)(`span`,{className:`name`,children:C?`${e.id.slice(0,e.id.indexOf(`:`))} › ${e.path}`:e.path}),(0,X.jsxs)(`small`,{children:[t,` function`,t===1?``:`s`]})]})},e.id))})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{children:`Most called`}),(0,X.jsx)(`ul`,{children:p.map(e=>{let t=e.key.slice(0,e.key.lastIndexOf(`:`));return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{className:`link-row`,onClick:()=>o(t),title:`${e.name??e.key} in ${S.get(t)??t}`,children:[(0,X.jsxs)(`span`,{className:`name`,children:[ae(e.name??e.key).name,p.filter(t=>t.name===e.name).length>1&&(0,X.jsxs)(`small`,{className:`muted`,children:[` `,(S.get(t)??t).split(`/`).pop()]})]}),(0,X.jsxs)(`small`,{children:[e.count,` call`,e.count===1?``:`s`]})]})},e.key)})})]})]}),(0,X.jsx)(`p`,{className:`muted small`,children:`Open a file on the left, or ask a question above (⌘K).`})]})}function GT({onClose:e,onSaved:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(!1),m=(0,y.useRef)(null);(0,y.useEffect)(()=>{Y.settings().then(({model:e})=>{r(e),a(e.baseUrl),s(e.model),setTimeout(()=>m.current?.focus(),0)},e=>d({ok:!1,text:`Could not load the settings: ${e.message??String(e)}`}))},[]),(0,y.useEffect)(()=>{let t=t=>t.key===`Escape`&&e();return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]);let h=async(e={})=>{p(!0),d(null);try{let{model:n}=await Y.saveSettings({baseUrl:i,model:o,...c.trim()?{apiKey:c.trim()}:{},...e});return r(n),l(``),t(n),n}catch(e){return d({ok:!1,text:e.message??String(e)}),null}finally{p(!1)}},[g,_]=(0,y.useState)(!1),v=async(t=!1)=>{if(!t&&(c.trim()||n?.apiKeySet)){p(!0),d(null);let e=!1;try{let t=await Y.testSettings({baseUrl:i,model:o,...c.trim()?{apiKey:c.trim()}:{}});e=t.ok,t.ok||d({ok:!1,text:t.message})}catch(e){d({ok:!1,text:e.message??String(e)})}finally{p(!1)}if(!e){_(!0);return}}await h()&&e()},b=async()=>{p(!0),d(null);try{let e=await Y.testSettings({baseUrl:i,model:o,...c.trim()?{apiKey:c.trim()}:{}});d({ok:e.ok&&e.toolCalls,text:e.message})}catch(e){d({ok:!1,text:e.message??String(e)})}finally{p(!1)}};return(0,X.jsx)(`div`,{className:`backdrop`,onMouseDown:t=>t.target===t.currentTarget&&e(),children:(0,X.jsxs)(`form`,{className:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`settings-title`,"data-testid":`settings-dialog`,onSubmit:e=>{e.preventDefault(),v()},children:[(0,X.jsx)(`h2`,{id:`settings-title`,children:`Settings`}),(0,X.jsxs)(`p`,{className:`muted`,children:[`Built-in questions work without a model. To ask anything, connect a model through`,` `,(0,X.jsx)(`a`,{href:`https://openrouter.ai/keys`,target:`_blank`,rel:`noreferrer`,children:`OpenRouter`}),` `,`(or any OpenAI-compatible endpoint) with your own key.`]}),(0,X.jsxs)(`fieldset`,{disabled:!n,className:`plain`,children:[(0,X.jsxs)(`label`,{children:[`Model`,(0,X.jsx)(`input`,{ref:m,"data-testid":`settings-model`,value:o,onChange:e=>s(e.target.value),placeholder:`anthropic/claude-sonnet-5.5`,spellCheck:!1}),(0,X.jsx)(`small`,{className:`muted`,children:`An OpenRouter model id that supports tool calls.`})]}),(0,X.jsxs)(`label`,{children:[`API key`,(0,X.jsx)(`input`,{"data-testid":`settings-key`,type:`password`,autoComplete:`off`,value:c,onChange:e=>l(e.target.value),placeholder:n?.apiKeySet?`Saved (…${n.apiKeyHint})${n.keySource===`env`?` from OPENROUTER_API_KEY`:``}`:`sk-or-…`,spellCheck:!1}),(0,X.jsx)(`small`,{className:`muted`,children:`Stored only on this computer, in the veoflow folder (readable by you only). It is never shown again.`})]}),(0,X.jsxs)(`details`,{children:[(0,X.jsx)(`summary`,{children:`Advanced`}),(0,X.jsxs)(`label`,{children:[`Base URL`,(0,X.jsx)(`input`,{"data-testid":`settings-base-url`,value:i,onChange:e=>a(e.target.value),placeholder:`https://openrouter.ai/api/v1`,spellCheck:!1})]})]})]}),(0,X.jsx)(`p`,{className:`muted small`,children:`When a model answers, your question and the graph data it looks up (names, file paths, line numbers) are sent to the provider. Nothing is sent for built-in questions.`}),u&&(0,X.jsx)(`p`,{className:u.ok?`ok`:`error`,role:`status`,"data-testid":`settings-status`,children:u.text}),(0,X.jsxs)(`div`,{className:`buttons`,children:[n?.apiKeySet&&n.keySource===`config`&&(0,X.jsx)(`button`,{type:`button`,className:`danger`,disabled:f,onClick:()=>void h({apiKey:null}),"data-testid":`settings-remove-key`,children:`Remove key`}),(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{type:`button`,disabled:f||!n,onClick:()=>void b(),"data-testid":`settings-test`,children:`Test connection`}),(0,X.jsx)(`button`,{type:`button`,onClick:e,children:`Cancel`}),g&&(0,X.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>void v(!0),"data-testid":`settings-save-anyway`,children:`Save anyway`}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,disabled:f||!n,"data-testid":`settings-save`,children:`Save`})]})]})})}function KT(e,t){if(t.type===`undo`)return I(e);if(t.type===`redo`)return L(e);if(t.type===`load`)return R(t.view)===R(e.present)?e:{past:[...e.past,e.present],present:t.view,future:[]};let n={name:t.name,...t.args?{args:t.args}:{}};try{return t.type===`reset`?{...e,present:F(P(e.present),n).present}:F(e,n)}catch(t){return console.warn(t),e}}var qT=[{id:`stage1`,name:`Functions & calls`,release:`R1`},{id:`stage2`,name:`Cross-file links`,release:`R2`},{id:`stage3`,name:`APIs & data`,release:`R4`},{id:`stage4`,name:`Runtime`,release:`R11`},{id:`stage5`,name:`Deployment`,release:`R10`}];function JT(){let[e,t]=(0,y.useReducer)(KT,void 0,()=>P(V(location.hash.slice(1)))),n=e.present,r=(0,y.useCallback)((e,n)=>t({type:`command`,name:e,...n?{args:n}:{}}),[]),[i,a]=(0,y.useState)([]),o=(0,y.useRef)(!0),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)([]),[d,f]=(0,y.useState)({}),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(`file`),[v,b]=(0,y.useState)(``),x=(0,y.useRef)(n.tab);x.current=n.tab;let[C,w]=(0,y.useState)(()=>{try{return localStorage.getItem(`veoflow.navCollapsed`)===`1`}catch{return!1}}),T=(0,y.useCallback)(e=>{w(t=>{let n=typeof e==`function`?e(t):e;try{localStorage.setItem(`veoflow.navCollapsed`,n?`1`:`0`)}catch{}return n})},[]),E=(0,y.useRef)(0),[D,O]=(0,y.useState)(null),[k,A]=(0,y.useState)(!1),[M,N]=(0,y.useState)(!1),[F,I]=(0,y.useState)(null),[L,z]=(0,y.useState)(null),[B,G]=(0,y.useState)(null),[q,J]=(0,y.useState)([]),[te,re]=(0,y.useState)([]),ie=(0,y.useMemo)(()=>new Set(te.flatMap(e=>[...e.changed,...e.removed].map(t=>`${e.sourceId}:${t}`))),[te]),[oe,se]=(0,y.useState)(`pending`),ce=(0,y.useRef)(!1);ce.current=oe===`running`;let[le,ue]=(0,y.useState)(``),[de,fe]=(0,y.useState)(new Map),[pe,me]=(0,y.useState)(``),[he,ge]=(0,y.useState)(``),[_e,ve]=(0,y.useState)(!1),[ye,be]=(0,y.useState)(null),[xe,Se]=(0,y.useState)(null),[Ce,Te]=(0,y.useState)(null),[Ee,Oe]=(0,y.useReducer)(e=>e+1,0);ee(n.run);let ke=(0,y.useRef)(!0);(0,y.useEffect)(()=>{if(ke.current){ke.current=!1;return}Oe()},[n.run]);let Ae=(0,y.useRef)(n);Ae.current=n,(0,y.useEffect)(()=>{let e=e=>{let{run:n,reason:r}=e.detail??{};Ae.current.run&&n===Ae.current.run&&(t({type:`reset`,name:`openRun`,args:{}}),ge(r===`history`?`That run is older than the 30 days of history this license shows, so the latest analysis is shown.`:`That run is no longer available (a newer draft or analysis replaced it), so the latest analysis is shown.`))};return window.addEventListener(`veo-run-gone`,e),()=>window.removeEventListener(`veo-run-gone`,e)},[]);let je=n.run??F,Me=OS(n.project,n.compare,Ee),Ne=(0,y.useMemo)(()=>Ke(Me.data),[Me.data]),{groups:Pe}=pS(n.project,je,0,n.source),Ie=(0,y.useCallback)((e,t)=>r(`select`,{kind:`function`,id:e,file:t}),[r]),Le=(0,y.useCallback)(e=>{let t=e.file,i=e=>n.tab!==e&&r(`showTab`,{tab:e});if(e.change===`removed`){t&&e.type!==`File`&&Ne?.fileFacts.get(t)!==`removed`&&(i(`file`),r(`openFile`,{file:t}));return}switch(e.type){case`Function`:if(t)return r(`select`,{kind:`function`,id:e.id,file:t});break;case`CALLS`:case`CALLS_CROSS_FILE`:if(t)return r(`select`,{kind:`call`,id:e.id,file:t});break;case`UnresolvedCallSite`:if(t)return r(`select`,{kind:`site`,id:e.id,file:t});break;case`IMPORTS`:case`UnresolvedImport`:if(t)return r(`openImportsFile`,{file:t,pick:e.id});break;case`Group`:return i(`imports`),r(`openGroup`,{group:e.id});case`DEPENDS_ON`:return i(`imports`),r(`openGroup`,{group:String(e.fact.from)})}t&&(i(`file`),r(`openFile`,{file:t}))},[r,n.tab,Ne]),[Re,ze]=(0,y.useState)(null),[Be,Ve]=(0,y.useState)(null),He=(0,y.useRef)(n.project);He.current=n.project;let Ue=(0,y.useRef)(n.file);Ue.current=n.file;let We=(0,y.useRef)(n.source);We.current=n.source;let[Ge,qe]=(0,y.useState)(!1),[Je,Ye]=(0,y.useState)([]),[Xe,Ze]=(0,y.useState)([]),[Qe,$e]=(0,y.useState)(null),[et,tt]=(0,y.useState)(!1),[nt,rt]=(0,y.useState)(!1),[it,at]=(0,y.useState)(0),ot=(0,y.useRef)(null),st=(0,y.useRef)(null),[ct,lt]=(0,y.useState)(!1),[ut,dt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(at(0),!Ge)return;let e=Date.now(),t=setInterval(()=>at(Math.round((Date.now()-e)/1e3)),1e3);return()=>clearInterval(t)},[Ge,Be]),(0,y.useEffect)(()=>{Y.settings().then(e=>$e(e.model),()=>void 0)},[]);let ft=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=`#${R(n)}`,t=JSON.stringify([n.project,n.file,n.selection,n.tab,n.group,n.fileLevel]);if(location.hash!==e){let r=R(V(location.hash.slice(1)))===R(n);ft.current!==null&&ft.current!==t&&!r?window.history.pushState(null,``,e):window.history.replaceState(null,``,e)}ft.current=t},[n]),(0,y.useEffect)(()=>{let e=()=>t({type:`load`,view:V(location.hash.slice(1))});return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,y.useEffect)(()=>{if(n.project||!i.some(e=>e.findingsPending))return;let e=setTimeout(()=>{Y.projects(!0).then(({projects:e})=>a(e),()=>void 0)},2e3);return()=>clearTimeout(e)},[i,n.project]),(0,y.useEffect)(()=>{let e=!1;return Y.projects(!n.project).then(({projects:r})=>{if(e)return;a(r),c(!0);let i=r.some(e=>e.id===n.project);n.project&&!i&&me(`Project ${n.project} was not found.`),(o.current&&!n.project||n.project&&!i)&&t(r.length===1?{type:`reset`,name:`selectProject`,args:{project:r[0].id}}:{type:`reset`,name:`goHome`,args:{}}),o.current=!1},t=>!e&&me(t.message)),()=>{e=!0}},[Ee,n.project===null]),(0,y.useEffect)(()=>{if(!n.project)return Ze([]);let e=!1;return Y.suggestions(n.project).then(t=>!e&&Ze(t.suggestions),()=>!e&&Ze([])),()=>{e=!0}},[n.project,Ee]),(0,y.useEffect)(()=>{u([]),f({}),ze(null),qe(!1),Ve(null),Ct.current++,ue(``),O(null),A(!1),N(!1),I(null),se(`pending`),z(null),G(null),J([]),re([])},[n.project]),(0,y.useEffect)(()=>{if(!n.project){u([]);return}let e=!1,t=n.project;return Y.files(t).then(t=>{e||(u(t.files),N(!0))},()=>{e||(u([]),N(!0))}),Y.fileCounts(t).then(t=>!e&&f(t.counts),()=>!e&&f({})),Y.status(t).then(n=>{e||(O(n.latest),z(n.draft??null),G(n.debug??null),I(n.committedRun),A(!0),n.progress&&fe(e=>e.has(t)?e:new Map(e).set(t,n.progress)),se(n.runInProgress?`running`:n.latest?.status===`failed`?`failed`:n.latest?`done`:`pending`))},()=>void 0),()=>{e=!0}},[n.project,Ee]),(0,y.useEffect)(()=>{if(re([]),!n.project||F===null)return;let e=n.project,t=!1,r=()=>!ce.current&&void Y.stale(e).then(e=>!t&&re(e.committedRun===F?e.sources:[]),()=>void 0);return r(),window.addEventListener(`focus`,r),()=>{t=!0,window.removeEventListener(`focus`,r)}},[n.project,F]);let[pt,mt]=(0,y.useState)([]),ht=(0,y.useMemo)(()=>n.file&&(n.tab===`file`||n.fileLevel)?{kind:`file`,file:n.file}:n.tab===`imports`&&n.group?{kind:`group`,group:n.group}:n.source?{kind:`source`,source:n.source,name:pt.find(e=>e.id===n.source)?.name}:null,[n.file,n.tab,n.fileLevel,n.group,n.source,pt]);(0,y.useEffect)(()=>{if(!n.project)return mt([]);let e=!1;return Y.sources(n.project).then(t=>!e&&mt(t.sources.map(e=>({...e,optIn:e.optIn??[]}))),()=>void 0),()=>{e=!0}},[n.project,Ee]),(0,y.useEffect)(()=>{n.source&&pt.length>0&&!pt.some(e=>e.id===n.source)&&t({type:`reset`,name:`scopeSource`,args:{}})},[n.source,pt]);let{data:gt}=bS(n.project,je,g===`project`?null:ht,[],Ee),_t=gt?gt.counts.broken+gt.counts.notAnalyzed+gt.counts.openCalls:null,[vt,yt]=(0,y.useState)(null),bt=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!n.project||!n.file){h(null);return}n.file!==bt.current&&ge(``),bt.current=n.file,h(e=>e&&e.file.id===n.file?e:null),lt(!1);let e=!1,r=n.file;return Y.fileGraph(n.project,r).then(t=>!e&&h(t),r=>{e||K(r)||(h(null),ge(n.run===null?`That file wasn't in the latest analysis, so the project overview is shown instead.`:`That file isn't in run ${n.run}, so the project overview is shown instead.`),t({type:`reset`,name:`selectProject`,args:{project:n.project}}))}),()=>{e=!0}},[n.project,n.file,Ee]),(0,y.useEffect)(()=>ne(Oe,e=>{if(typeof e.projectId==`string`&&fe(t=>{let n=t.get(e.projectId)??null,r=S(n,e);if(r===n)return t;let i=new Map(t);return r?i.set(e.projectId,r):i.delete(e.projectId),i}),!n.project){(e.type===`run.started`||e.type===`run.committed`||e.type===`run.failed`)&&Oe();return}e.projectId===n.project&&(e.type===`run.started`?(se(`running`),ue(`Analyzing…`)):e.type===`stage.completed`?ue(`Analyzing…`):e.type===`run.committed`?(re([]),se(`done`),ue(`Analyzed just now`),Oe()):e.type===`run.failed`&&(se(`failed`),ue(`Analysis failed: ${String(e.error)}`),Oe()))}),[n.project]),(0,y.useEffect)(()=>{let e=e=>{let n=e.target;if(document.querySelector(`[role="dialog"], [role="menu"]`)||n.closest(`input:not([type="checkbox"]):not([type="radio"]), textarea, select, [contenteditable], [role=dialog]`))return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`z`){e.preventDefault(),t({type:e.shiftKey?`redo`:`undo`});return}if(e.metaKey||e.ctrlKey||e.altKey)return;let i=E.current&&Date.now()-E.current<1200;if(E.current=0,i&&e.key===`m`){r(`openGroup`,{});return}e.key===`Escape`?r(`clearSelection`):e.key===`u`?r(`toggleUnresolved`):e.key===`1`?r(`showTab`,{tab:`file`}):e.key===`2`?x.current!==`imports`&&r(`showTab`,{tab:`imports`}):e.key===`3`?r(`showTab`,{tab:`reach`}):e.key===`[`?T(e=>!e):e.key===`g`&&(E.current=Date.now())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let Z=(0,y.useCallback)(e=>r(`select`,e),[r]),xt=(0,y.useCallback)(()=>r(`clearSelection`),[r]),St=async(e,t)=>{if(b(``),!cE(e)){b(`Enter an absolute path (for example /Users/you/app), not "${e}"`);return}let i=t?ye??n.project:null;try{U(`addFolder`,{root:e}),i||(i=(await Y.createProject(e.split(/[\\/]/).filter(Boolean).pop()??`project`,e)).project.id,r(`selectProject`,{project:i})),await Y.addSource(i,e)}catch(e){b(e.message??String(e));return}ve(!1),be(null),b(``),se(`running`);try{await Y.analyze(i)}catch(e){me(e.message??String(e))}Oe()},Ct=(0,y.useRef)(0),wt=(0,y.useRef)(null),Q=async(e,i)=>{if(!n.project)return;U(`ask`,{question:e});let a=++Ct.current,o=n.project;wt.current?.abort();let s=new AbortController;wt.current=s,t({type:`reset`,name:`showPanel`,args:{panel:`answer`}}),qe(!0),Ve(e),Ye(t=>[e,...t.filter(t=>t!==e)].slice(0,5));let c;try{c=await Y.ask(o,e,i,Ue.current,s.signal,We.current)}catch(t){let n=t;c={question:e,via:`help`,...i?{mode:i}:{},summary:`Could not answer: ${n.message??String(t)}`,results:[],toolCalls:[],error:{code:n.code??`error`,message:n.message??String(t)}}}if(a!==Ct.current||He.current!==o)return;let l=c.results[0];l?.kind===`function`&&l.file===Ue.current&&(c.intent===`callers`||c.intent===`callees`||c.intent===`definition`)&&(r(`select`,{kind:`function`,id:l.id,file:l.file}),t({type:`reset`,name:`showPanel`,args:{panel:`answer`}})),ze(c),qe(!1),Ve(null)},Tt=e=>{for(let t of W(e))r(t.name,t.args);t({type:`reset`,name:`showPanel`,args:{panel:`answer`}})},Et=()=>{wt.current?.abort(),Ct.current++,qe(!1),Ve(null)},Dt=()=>{n.project&&(U(`analyzeDraft`),me(``),ue(`Analyzing your uncommitted edits as a draft…`),Y.analyzeDraft(n.project).catch(e=>{me(e.message),Oe()}))},Ot=e=>{n.project&&(U(`analyzeFrom`,{from:e}),me(``),ue(`Analyzing again from ${e}…`),Y.analyzeFrom(n.project,e).catch(e=>{me(e.message),Oe()}))},kt=e=>{n.project&&(U(`analyzeDebug`,{until:e}),me(``),ue(`Debug run: analyzing up to ${e}…`),Y.analyzeDebug(n.project,e).catch(e=>{me(e.message),Oe()}))};(0,y.useEffect)(()=>{if(!n.project)return;let e=!1;return Y.stages(n.project).then(t=>!e&&J(t.pipeline),()=>!e&&J([])),()=>{e=!0}},[n.project]);let[At,jt]=(0,y.useState)(null),Mt=(0,y.useCallback)(()=>jt(null),[]),Nt=e=>{let t=e=>e.slice(0,e.indexOf(`:`)),i=e=>decodeURIComponent(e.slice(e.indexOf(`:`)+1)),a=e=>e.slice(0,e.indexOf(`:`,e.indexOf(`:`)+1)),o=(e,t)=>({label:`Leave it out of analysis…`,command:`chooseFiles`,run:()=>Te({source:e,...t?{path:t}:{}})}),s=e=>({label:`Re-analyze its repository`,command:`analyzeSource`,run:()=>void Pt(e)}),c=e=>({label:`Broken imports in it`,command:`showPanel`,run:()=>{e(),yt(`broken`),r(`showPanel`,{panel:`questions`})}});if(e.kind===`group`){let[,t=``,i=``]=e.id.split(`|`);return{title:String(e.data.label??e.id).split(`
|
|
340
|
+
`)[0],entries:[{label:`Open`,command:`openGroup`,run:()=>r(`openGroup`,{group:e.id})},{label:`Show only its links`,command:`showOnlyLinks`,run:()=>{(n.group!==null||n.fileLevel)&&r(`openGroup`,{}),r(`showOnlyLinks`,{id:e.id})}},{label:`What depends on it`,command:`pickNode`,run:()=>r(`pickNode`,{id:e.id})},c(()=>r(`openGroup`,{group:e.id})),s(t),...i.startsWith(`cluster:`)?[]:[o(t,i||void 0)]]}}if(e.kind===`file`){let a=t(e.id);return{title:i(e.id),entries:[{label:`Open`,command:n.tab===`imports`?`openImportsFile`:`openFile`,run:()=>n.tab===`imports`?r(`openImportsFile`,{file:e.id}):r(`openFile`,{file:e.id})},...n.tab===`imports`&&!n.fileLevel?[{label:`Show only its links`,command:`showOnlyLinks`,run:()=>r(`showOnlyLinks`,{id:e.id})}]:[],{label:n.tab===`imports`?`What depends on it`:`⇄ Imports of this file`,command:`openImportsFile`,run:()=>r(`openImportsFile`,{file:e.id})},c(()=>r(`openImportsFile`,{file:e.id})),{label:`Reach from this file`,command:`openReach`,run:()=>r(`openReach`,{root:e.id,direction:`forward`})},s(a),o(a,i(e.id))]}}if(e.kind===`folder`){let t=e.id.split(`|`)[2]??``,n=String(e.data.path??``);return{title:`${n}/`,entries:[{label:`Open or close`,command:`toggleFolder`,run:()=>r(`toggleFolder`,{path:n})},s(t),o(t,n)]}}if(e.kind===`function`){let c=a(e.id),l=e.id.slice(c.length+1);return{title:l,entries:[{label:`Open`,command:`select`,run:()=>r(`select`,{kind:`function`,id:e.id,file:c})},...n.tab===`file`&&Xt===`graph`?[{label:`Show only its links`,command:`showOnlyLinks`,run:()=>r(`showOnlyLinks`,{id:e.id})}]:[],{label:`Who calls it`,command:`ask`,run:()=>void Q(`who calls ${l}`)},{label:`Reach from here`,command:`openReach`,run:()=>r(`openReach`,{root:e.id,direction:`forward`})},{label:`What reaches it`,command:`openReach`,run:()=>r(`openReach`,{root:e.id,direction:`backward`})},s(t(c)),{...o(t(c),i(c)),label:`Leave its file out of analysis…`}]}}let l=e.data,u=e=>[{label:`Go to its start`,command:`openGroup`,run:()=>l.source&&e(l.source)},{label:`Go to its end`,command:`openGroup`,run:()=>l.target&&e(l.target)}];if(l.kind===`call`&&l.calls?.length&&n.tab===`file`)return{title:`Call`,entries:[{label:`Open`,command:`select`,run:()=>r(`select`,{kind:`call`,id:l.calls[0]})}]};if(l.kind===`depends`)return{title:`Dependency`,entries:[{label:`Show its calls`,command:`pickNode`,run:()=>l.source&&l.target&&r(`pickNode`,{id:UC(l.source,l.target)})},...u(e=>r(`openGroup`,{group:e}))]};if(l.kind===`calls`)return{title:`Calls`,entries:[{label:`Show its calls`,command:`pickNode`,run:()=>r(`pickNode`,{id:e.id})},...u(e=>e.startsWith(`stub|`)?r(`openGroup`,{group:e.slice(5)}):e.startsWith(`folder|`)?r(`toggleFolder`,{path:e.split(`|`).slice(4).join(`|`)}):r(`openImportsFile`,{file:e}))]};if(l.kind===`imports`)return{title:`Imports`,entries:u(e=>e.startsWith(`folder|`)?r(`toggleFolder`,{path:e.split(`|`).slice(4).join(`|`)}):r(`openImportsFile`,{file:e})).map(e=>({...e,command:`openImportsFile`}))};let d=e.data.edge??e.id;return{title:`Link`,entries:[{label:`Open`,command:`pickNode`,run:()=>r(`pickNode`,{id:d})}]}};(0,y.useEffect)(()=>{let e=e=>{if(!(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`)||e.target.closest?.(`input, textarea, select, [role=dialog], [role=menu]`))return;let r=document.querySelector(`.graph-wrap .graph`)?.getBoundingClientRect(),i={x:r?r.left+r.width/2:200,y:r?r.top+r.height/3:200},a=null;if(n.tab===`file`&&n.selection?.kind===`function`?a={kind:`function`,id:n.selection.id,data:{},...i}:n.tab===`imports`&&n.pick&&(n.pick.startsWith(`group|`)||/^[^|]+:/.test(n.pick))&&(a={kind:n.pick.startsWith(`group|`)?`group`:`file`,id:n.pick,data:{},...i}),!a)return;e.preventDefault();let o=Pe?.groups.find(e=>e.id===a.id);o&&(a.data={label:o.name}),t=!0,jt(a)},t=!1,r=e=>{t&&e.preventDefault(),t=!1};return window.addEventListener(`keydown`,e),window.addEventListener(`contextmenu`,r),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`contextmenu`,r)}},[n.tab,n.selection,n.pick,Pe]);let Pt=async e=>{if(n.project){try{await Y.analyzeSource(n.project,e)}catch(e){me(e.message??String(e))}Oe()}},Ft=()=>{n.project&&(U(`analyze`),me(``),se(`running`),Y.analyze(n.project).catch(e=>{me(e.message),Oe()}))},It=(0,y.useCallback)(e=>iC(e,{view:n,projects:i.map(e=>({id:e.id,name:e.name})),sources:pt.map(e=>({id:e.id,...e.name?{name:e.name}:{}})),files:l.map(e=>({id:e.id,path:e.path})),groups:(Pe?.groups??[]).map(e=>({id:e.id,name:e.name})),canDraft:pt.some(e=>e.analysis?.kind===`git`),stages:F===null?[]:q,command:(e,t)=>r(e,t??{}),action:(e,t)=>{e!==`addFolder`&&U(e,t??{}),e===`analyze`?Ft():e===`analyzeSource`?Pt(String(t?.source)):e===`chooseFiles`?Te({source:String(t?.source),...t?.path?{path:String(t.path)}:{}}):e===`analyzeDraft`?Dt():e===`analyzeDebug`?kt(String(t?.until)):e===`analyzeFrom`?Ot(String(t?.from)):e===`addFolder`?ve(!0):e===`openSettings`?tt(!0):e===`openProjectSettings`&&Se(t?.tab??`repositories`)}}),[n,i,pt,l,Pe,r]),Lt=m!==null&&m.functions.length>80&&!ct,Rt=n.selection?.kind===`function`?n.selection.id:n.selection?.kind===`call`?m?.calls.find(e=>e.id===n.selection.id)?.from??null:n.selection?.kind===`site`?m?.unresolved.find(e=>e.id===n.selection.id)?.enclosingFn??null:null,zt=Rt&&m?.functions.some(e=>e.id===Rt)?Rt:null,Bt=n.selection?.kind===`call`?m?.calls.find(e=>e.id===n.selection.id):void 0,Vt=Bt?[Bt.from,Bt.to]:null,Ht=Vt?.join(`|`)??``,Ut=(0,y.useMemo)(()=>Lt&&m?_T(m,zt,Ht?Ht.split(`|`):null):null,[Lt,m,zt,Ht]),Wt=m?m.unresolved.filter(p).length:0,Gt=n.selection?.kind===`site`?m?.unresolved.find(e=>e.id===n.selection.id):void 0,Kt=Gt&&!(n.showUnresolved&&p(Gt))?Gt.id:null,qt=(0,y.useMemo)(()=>{if(!Re||!m)return null;let e=new Set(Re.results.filter(e=>e.kind===`function`&&e.file===m.file.id).map(e=>e.id));return e.size?e:null},[Re,m]),Jt=zt?(()=>{let e=m?.functions.find(e=>e.id===zt);return ae(e?.qualifiedName??``,void 0,e?.title).name})():``,Yt=zt?new Set((m?.calls??[]).flatMap(e=>e.from===zt&&e.to!==zt?[e.to]:e.to===zt&&e.from!==zt?[e.from]:[])).size:0,Xt=ut??(m&&m.calls.length===0?`list`:`graph`),Zt=n.tab===`file`&&!n.file&&n.panel===`answer`&&(Re!==null||Ge),Qt=n.tab===`imports`&&F!==null&&l.length>0,$t=(0,X.jsx)(Fe,{answer:Re,busy:Ge,pending:Be,elapsed:it,modelConfigured:Qe?.configured??!1,selectedId:n.selection?.id??null,wide:nt,onWide:rt,onOpen:Tt,onAsk:(e,t)=>void Q(e,t),onCancel:Et,onTemplate:e=>st.current?.prefill(e),onSettings:()=>tt(!0),onShowQuestions:e=>{r(`openFile`,{file:e}),_(`file`),t({type:`reset`,name:`showPanel`,args:{panel:`questions`}})}});return(0,X.jsxs)(`div`,{className:`app`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsx)(`button`,{className:`logo`,"aria-label":`veoflow: all projects (home)`,"data-command":`go-home`,title:j.goHome.description,onClick:()=>r(`goHome`,{}),children:`veoflow`}),(0,X.jsxs)(`select`,{"data-command":`select-project`,"aria-label":`Project`,className:`project`,value:i.some(e=>e.id===n.project)?n.project??``:``,onChange:e=>r(`selectProject`,{project:e.target.value}),children:[(0,X.jsx)(`option`,{value:``,disabled:!0,children:i.length===0?`No project yet`:`Choose a project`}),i.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),n.project&&(0,X.jsx)(iE,{tab:n.tab,reach:n.reach!==null,onTab:e=>r(`showTab`,{tab:e})}),(0,X.jsxs)(`button`,{"data-testid":`add-folder`,className:`quiet`,title:H.addFolder.description,"aria-label":`Add a folder`,onClick:()=>ve(!0),children:[`+`,(0,X.jsx)(`span`,{className:`wide-only`,children:` Add folder`})]}),(0,X.jsx)(De,{project:n.project,modelName:Qe?.configured?Qe.model:null,disabled:!n.project||l.length===0,loading:!!n.project&&l.length===0&&!k,suggestions:Xe,recent:Je,busy:Ge,onAsk:e=>void Q(e),handle:st,palette:It,onOpenFunction:Ie}),n.project&&(0,X.jsx)(YT,{stage1:oe,message:le,progress:oe===`running`?de.get(n.project)??null:null,...oe!==`running`&&D?.errorCode===`stage-inputs-changed`?{onFullRun:Ft}:{},latest:D,loading:!!n.project&&!k,...n.project&&oe===`running`?{onCancel:()=>{let e=n.project;le!==`Cancelling…`&&(ue(`Cancelling…`),Y.cancelRun(e).then(()=>{ue(``),Oe()},e=>ue(`Couldn't cancel: ${e.message}`)))}}:{}}),n.project&&pt.some(e=>e.analysis?.kind===`git`)&&(0,X.jsx)(`button`,{"data-testid":`analyze-draft`,className:`icon`,title:H.analyzeDraft.description,"aria-label":`Analyze uncommitted edits`,onClick:Dt,children:`✎`}),n.project&&(0,X.jsx)(`button`,{"data-testid":`reanalyze`,className:`icon`,title:`${H.analyze.description}`,"aria-label":`Analyze again`,onClick:Ft,children:`↻`}),n.project&&(0,X.jsx)(`button`,{"data-command":`toggle-history`,className:`quiet${n.history?` active`:``}`,"aria-pressed":n.history,title:j.toggleHistory.description,onClick:()=>r(`toggleHistory`,{}),children:`History`}),(0,X.jsx)(`button`,{"data-testid":`undo`,disabled:e.past.length===0,onClick:()=>t({type:`undo`}),title:`Undo (⌘Z)`,"aria-label":`Undo`,className:`icon`,children:(0,X.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M6 3 2 7l4 4M2.5 7H10a4 4 0 0 1 0 8H7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`})})}),(0,X.jsx)(`button`,{"data-testid":`redo`,disabled:e.future.length===0,onClick:()=>t({type:`redo`}),title:`Redo (⇧⌘Z)`,"aria-label":`Redo`,className:`icon`,children:(0,X.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M10 3l4 4-4 4M13.5 7H6a4 4 0 0 0 0 8h3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`})})}),n.project&&(0,X.jsx)(`button`,{"data-testid":`project-settings`,className:`quiet`,title:H.openProjectSettings.description,onClick:()=>{U(`openProjectSettings`),Se(`repositories`)},children:`Repositories`}),(0,X.jsx)(`button`,{"data-testid":`settings`,className:`icon`,title:H.openSettings.description,"aria-label":`Settings`,ref:ot,onClick:()=>{U(`openSettings`),tt(!0)},children:(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinejoin:`round`,d:`M10.3 3h3.4l.5 2.4 1.7.7 2-1.4 2.4 2.4-1.4 2 .7 1.7 2.4.5v3.4l-2.4.5-.7 1.7 1.4 2-2.4 2.4-2-1.4-1.7.7-.5 2.4h-3.4l-.5-2.4-1.7-.7-2 1.4-2.4-2.4 1.4-2-.7-1.7L3 13.7v-3.4l2.4-.5.7-1.7-1.4-2 2.4-2.4 2 1.4 1.7-.7z`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`})]})})]}),he&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`notice`,children:[(0,X.jsx)(`span`,{children:he}),(0,X.jsx)(`button`,{className:`icon`,"aria-label":`Dismiss`,onClick:()=>ge(``),children:`×`})]}),n.only&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`only-banner`,children:[(0,X.jsxs)(`span`,{children:[`Showing only`,` `,n.only.startsWith(`group|`)?n.only.split(`|`).slice(2).join(`|`).replace(/^cluster:/,``)||n.only.split(`|`)[1]:n.only.slice(n.only.indexOf(`:`)+1),` `,`and what it links to.`]}),(0,X.jsx)(`button`,{"data-command":`show-only-links`,onClick:()=>r(`showOnlyLinks`,{}),children:`Show everything`})]}),n.project?n.run!==null&&(n.compare!==null||n.run!==F)?(0,X.jsxs)(`div`,{className:`notice draft`,role:`status`,"data-testid":`draft-banner`,children:[(0,X.jsx)(`span`,{children:n.compare?`Comparing run ${n.compare.a} with run ${n.compare.b}: the canvas shows run ${n.compare.b}, its changes marked.`:n.run===L?.runId?`You're viewing a draft of your uncommitted edits (run ${n.run}). The latest analysis is unchanged.`:n.run===B?.runId?`You're viewing a debug run that stopped after ${B.stages.at(-1)?.stage??`?`} (run ${n.run}): it shows only what those stages produced, and is never committed. The latest analysis is unchanged.`:`You're viewing run ${n.run}, not the latest analysis.`}),n.run===B?.runId&&F!==null&&!n.compare&&(0,X.jsx)(`button`,{"data-command":`compare-runs`,"data-testid":`debug-compare`,onClick:()=>r(`compareRuns`,{a:F,b:B.runId}),children:`Compare with latest`}),(0,X.jsx)(`button`,{"data-command":`open-run`,onClick:()=>r(`openRun`,{}),children:`Back to latest`})]}):(0,X.jsxs)(X.Fragment,{children:[L&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`draft-ready`,children:[(0,X.jsxs)(`span`,{children:[`A draft of your uncommitted edits is ready (run `,L.runId,`).`]}),(0,X.jsx)(`button`,{"data-command":`open-run`,onClick:()=>r(`openRun`,{run:L.runId}),children:`Open it`})]}),B&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`debug-ready`,children:[(0,X.jsxs)(`span`,{children:[`A debug run that stopped after `,B.stages.at(-1)?.stage??`?`,` is ready (run`,` `,B.runId,`).`]}),(0,X.jsx)(`button`,{"data-command":`open-run`,onClick:()=>r(`openRun`,{run:B.runId}),children:`Open it`})]})]}):null,n.project&&te.length>0&&oe!==`running`&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`stale-evidence`,children:[(0,X.jsx)(`span`,{children:uE(te)}),(0,X.jsx)(`button`,{onClick:Ft,"data-testid":`stale-reanalyze`,children:`Re-analyze`})]}),pe&&(0,X.jsxs)(`div`,{className:`error`,role:`alert`,"data-testid":`error`,children:[(0,X.jsx)(`span`,{children:pe}),(0,X.jsx)(`button`,{className:`icon`,"aria-label":`Dismiss`,onClick:()=>me(``),children:`×`})]}),_e&&(0,X.jsx)(XT,{current:i.find(e=>e.id===(ye??n.project))?.name??(ye?`the new project`:null),intoByDefault:ye!==null||i.find(e=>e.id===n.project)?.sources===0,onAdd:(e,t)=>void St(e,t),onCancel:()=>{ve(!1),be(null),b(``)},error:v}),xe&&n.project&&(0,X.jsx)(US,{initialTab:xe,project:n.project,projectName:i.find(e=>e.id===n.project)?.name??n.project,refresh:Ee,onClose:()=>Se(null),onAdd:()=>{Se(null),ve(!0)},onChooseFiles:e=>Te({source:e}),onAnalyzeAll:Ft,onChanged:Oe,covered:Ce!==null},xe),At&&(()=>{let e=Nt(At);return(0,X.jsx)(tC,{title:e.title,entries:e.entries,x:At.x,y:At.y,onClose:Mt})})(),Ce!==null&&n.project&&(0,X.jsx)(JS,{project:n.project,only:Ce.source,...Ce.path?{at:Ce.path}:{},files:l,run:D,onAnalyze:()=>{Ft(),Te(null)},onClose:()=>Te(null)}),et&&(0,X.jsx)(GT,{onClose:()=>{tt(!1),ot.current?.focus()},onSaved:e=>$e(e)}),!n.project&&(0,X.jsx)($S,{projects:i,progress:de,loading:!s,onOpen:e=>r(`selectProject`,{project:e}),onCreated:e=>{Oe(),r(`selectProject`,{project:e}),be(e),ve(!0)},onAddFolder:()=>ve(!0),onDeleted:()=>Oe()}),n.project&&(0,X.jsxs)(`main`,{className:[nt&&n.panel===`answer`&&!Zt?`wide-aside`:``,C?`nav-hidden`:``].filter(Boolean).join(` `),children:[C?(0,X.jsx)(`div`,{className:`nav-collapsed-bar`,children:(0,X.jsx)(`button`,{className:`icon`,"data-command":`show-nav`,title:`Show the ${Qt?`groups`:`files`} pane ( [ )`,"aria-label":`Show the ${Qt?`groups`:`files`} pane`,onClick:()=>T(!1),children:`⟩`})}):Qt?(0,X.jsx)(bC,{project:n.project,run:je,source:n.source,group:n.group,file:n.file,fileLevel:n.fileLevel,expand:n.expand,showPending:n.showPending,onOpenGroup:(e,t)=>r(`openGroup`,e?{group:e,...t?{folder:t}:{}}:{}),onCloseGroup:()=>r(n.area?`openArea`:`openGroup`,n.area?{area:n.area}:{}),onOpenFile:(e,t)=>r(`openImportsFile`,t?{file:e,group:t}:{file:e}),onToggleFolder:e=>r(`toggleFolder`,{path:e}),onCollapse:()=>T(!0),onMenu:jt,sources:pt,onScope:e=>r(`scopeSource`,e?{source:e}:{}),area:n.area??null}):null,(0,X.jsx)($w,{hidden:C||Qt,onReveal:()=>{T(!1),n.tab!==`file`&&r(`showTab`,{tab:`file`})},onCollapse:()=>T(!0),project:n.project,files:l,counts:d,current:n.file,onOpen:e=>r(`openFile`,{file:e}),onImports:e=>r(`openImportsFile`,{file:e}),onMenu:jt,run:D,onAnalyze:()=>{n.project&&(se(`running`),Y.analyze(n.project).catch(e=>me(e.message)))},sources:pt,scope:n.source,onScope:e=>r(`scopeSource`,e?{source:e}:{})},n.project??``),(0,X.jsxs)(`section`,{className:`center`,children:[(0,X.jsx)(BT,{project:n.project,run:D?.runId===F?D:null,sources:pt,onAnalyze:Ft,onKept:()=>{uS(),Oe()},onChooseFiles:e=>Te({source:e})},`${n.project}:${F}`),n.project&&n.tab===`reach`&&n.reach&&F!==null?(0,X.jsx)(tw,{project:n.project,run:je,root:n.reach.root,direction:n.reach.direction,onDirection:e=>r(`openReach`,{root:n.reach.root,direction:e}),onReach:e=>r(`openReach`,{root:e}),onOpenFile:e=>{r(`openFile`,{file:e}),r(`showTab`,{tab:`file`})},onContext:jt}):n.project&&n.tab===`reach`&&F===null?(0,X.jsx)(`div`,{className:`empty`,"data-testid":`reach-empty`,children:`Reach needs an analysis: run one, and open Reach from a function or file.`}):n.project&&Qt?(0,X.jsx)(GC,{marks:Ne,only:n.only,onContext:jt,project:n.project,projectName:i.find(e=>e.id===n.project)?.name??n.project,run:je,group:n.group,area:n.area,onOpenArea:e=>r(`openArea`,e?{area:e}:{}),source:n.source,pick:n.pick,file:n.file,fileLevel:n.fileLevel,expand:n.expand,showPending:n.showPending,onPick:e=>r(`pickNode`,{id:e}),onOpenGroup:e=>r(`openGroup`,e?{group:e}:{}),onOpenFile:(e,t)=>r(`openImportsFile`,t?{file:e,group:t}:{file:e}),onToggleFolder:e=>r(`toggleFolder`,{path:e}),onTogglePending:()=>r(`togglePending`),onClear:xt}):m?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`toolbar`,children:[(0,X.jsx)(`span`,{className:`file-title`,"data-testid":`file-title`,title:m.file.path,children:we(m.file.path)}),m.file.status===`degraded`&&(0,X.jsx)(`span`,{className:`badge degraded`,"data-testid":`degraded`,title:m.file.reason??``,children:`partly analyzed`}),(0,X.jsx)(`span`,{className:`spacer`}),m.file.status!==`not_analyzed`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{"data-command":`file-to-imports`,title:`This file on the Imports tab: what it imports, what depends on it, its calls across files (2)`,onClick:()=>r(`openImportsFile`,{file:m.file.id}),children:[`⇄ Imports`,(0,X.jsx)(`span`,{className:`wide-only`,children:` of this file`})]}),(0,X.jsxs)(`div`,{className:`segmented`,role:`group`,"aria-label":`Show as`,children:[(0,X.jsx)(`button`,{"aria-pressed":Xt===`graph`,"data-testid":`show-graph`,onClick:()=>dt(`graph`),children:`Graph`}),(0,X.jsx)(`button`,{"aria-pressed":Xt===`list`,"data-testid":`show-list`,onClick:()=>dt(`list`),children:`List`})]}),(0,X.jsxs)(`label`,{className:`toggle`,title:`Calls within this file the analysis could not resolve, drawn in the graph (press u): ${Wt} of the ${m.unresolved.length} unresolved calls here; the rest are imports or built-ins.${gt&&n.file&&g===`file`&&ht?.kind===`file`&>.counts.openCalls!==Wt?` Findings lists ${gt.counts.openCalls} open calls for this file: it adds calls through imports that couldn't be linked.`:``}`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-command":`toggle-unresolved`,checked:n.showUnresolved&&Wt>0,disabled:Wt===0,onChange:()=>r(`toggleUnresolved`)}),`Open questions (`,lE(Wt),`)`]}),m.functions.length>80&&Xt===`graph`&&(0,X.jsxs)(`label`,{className:`toggle`,title:`Large files show the selection and its neighbours`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`whole-file`,checked:ct,onChange:e=>lt(e.target.checked)}),`Whole file`]})]})]}),Ut&&Xt===`graph`&&(0,X.jsxs)(`p`,{className:`focus-note`,"data-testid":`focus-note`,children:[zt?Yt===0?`${Jt} calls nothing else in this file, and nothing here calls it. `:`${Jt} and ${Math.min(Yt,Ut.size-1)} of its ${Yt} direct neighbours${Ut.size-1>Yt?`, with some of theirs`:``}. `:Vt?`This call, its two functions and a few of their neighbours. `:`The ${Ut.size} most connected of ${m.functions.length} functions. Select one to focus on it${n.showUnresolved?` and see its open questions`:``}. `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>dt(`list`),children:`See all in the list`})]}),m.findings.length>0&&(0,X.jsx)(`ul`,{className:`findings`,"data-testid":`findings`,children:m.findings.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:e.kind}),`: `,e.message]},e.id))}),m.file.status===`not_analyzed`?(0,X.jsx)(`p`,{className:`hint`,"data-testid":`not-analyzed`,children:QT(m.file.reason)}):Xt===`graph`?(0,X.jsx)(NT,{marks:Ne,only:n.only,onContext:jt,graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:Z,onClear:xt,focus:Ut,sitesFor:zt,answered:qt,extraSite:Kt}):(0,X.jsx)(ZT,{graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:Z,extraSite:Kt,onContext:jt})]}):n.file?(0,X.jsxs)(`p`,{className:`hint`,"data-testid":`loading-file`,children:[`Loading `,l.find(e=>e.id===n.file)?.path??`the file`,`…`]}):Zt?(0,X.jsx)(`div`,{className:`centre-answer`,children:$t}):n.project&&l.length>0?(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(WT,{project:n.project,files:l,run:D?.runId===F?D:null,counts:d,source:n.source??null,sources:pt,onOpen:e=>r(`openFile`,{file:e}),onQuestions:()=>{yt(`open-call`),r(`showPanel`,{panel:`questions`})}})}):n.project&&k&&M&&F!==null?(0,X.jsxs)(`div`,{className:`overview`,"data-testid":`overview-empty`,children:[(0,X.jsx)(`p`,{className:`hint`,children:`No files were analyzed in this project.`}),(0,X.jsx)(HT,{run:D?.runId===F?D:null})]}):(0,X.jsx)(`p`,{className:`hint`,children:n.project&&(!k||!M)?`Loading ${i.find(e=>e.id===n.project)?.name??`the project`}…`:(0,X.jsxs)(X.Fragment,{children:[`Add a folder to analyze it.`,` `,(0,X.jsx)(`button`,{className:`primary`,"data-testid":`empty-add-folder`,onClick:()=>ve(!0),children:`Add folder`})]})})]}),(0,X.jsx)(`aside`,{children:n.history&&n.project?(0,X.jsx)(LS,{project:n.project,refresh:Ee,run:n.run,compare:n.compare,diff:Me.data,diffError:Me.error,onView:e=>r(`openRun`,e===null?{}:{run:e}),onCompare:e=>r(`compareRuns`,e??{}),onClose:()=>r(`toggleHistory`,{}),onLocate:Le,stages:q,onDebug:kt,onFrom:Ot}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`tabs`,role:`tablist`,children:[(Re||Ge||n.panel===`answer`)&&!Zt&&(0,X.jsx)(`button`,{role:`tab`,"data-command":`show-panel`,"data-testid":`answer-tab`,"aria-selected":n.panel===`answer`,onClick:()=>r(`showPanel`,{panel:`answer`}),children:`Answer`}),(0,X.jsx)(`button`,{role:`tab`,"data-command":`show-panel`,"aria-selected":n.panel===`evidence`,title:Qt?`What is picked on the canvas, in detail`:`The code that proves what is selected`,onClick:()=>r(`showPanel`,{panel:`evidence`}),children:`Selected`}),(0,X.jsxs)(`button`,{role:`tab`,"data-command":`show-panel`,"data-testid":`questions-tab`,"aria-selected":n.panel===`questions`,title:ht&&g===`file`?`What the analysis couldn't settle in this ${ht.kind}`:`What the analysis couldn't settle in the project`,onClick:()=>r(`showPanel`,{panel:`questions`}),children:[ht&&g===`file`?`Findings here`:`Findings`,` (`,_t===null?`…`:lE(_t),`)`]})]}),n.panel===`answer`&&!Zt?$t:n.panel===`evidence`||n.panel===`answer`?(0,X.jsxs)(X.Fragment,{children:[Re&&!Zt&&(0,X.jsx)(`button`,{className:`link back`,onClick:()=>t({type:`reset`,name:`showPanel`,args:{panel:`answer`}}),children:`← Back to the answer`}),Qt&&n.project?(0,X.jsx)(fw,{project:n.project,run:je,group:n.group,pick:n.pick,file:n.file,fileLevel:n.fileLevel,expand:n.expand,showPending:n.showPending,onPick:e=>r(`pickNode`,{id:e}),onOpenGroup:e=>r(`openGroup`,{group:e}),onOpenFile:e=>r(`openImportsFile`,{file:e}),onToggleFolder:e=>r(`toggleFolder`,{path:e})}):(0,X.jsx)($T,{project:n.project,graph:m,changedOnDisk:ie,selection:n.selection,onClear:xt,onSelect:Z,onOpenFunction:e=>r(`select`,{kind:`function`,...e}),onShowImports:()=>r(`showTab`,{tab:`imports`}),sources:pt})]}):n.project&&(0,X.jsx)(xS,{project:n.project,run:je,scope:ht,wholeProject:g===`project`,canScope:ht!==null,showPending:n.showPending,refresh:Ee,onWholeProject:e=>_(e?`project`:`file`),onTogglePending:()=>r(`togglePending`),filter:vt,onFilter:yt,onSelectSite:(e,t)=>r(`select`,{kind:`site`,id:e,file:t}),onOpenImport:(e,t,n)=>r(`openImportsFile`,n?{file:e,pick:t,group:n}:{file:e,pick:t}),onManageLicense:()=>{U(`openProjectSettings`,{tab:`license`}),Se(`license`)}})]})})]})]})}function YT({stage1:e,message:t,progress:n=null,onFullRun:r,latest:i,loading:a,onCancel:o}){let[,s]=(0,y.useState)(0);(0,y.useEffect)(()=>{if(!n)return;let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[n===null]);let c=n&&t!==`Cancelling…`?T(n):null,l=n?.startedAt?Date.parse(n.startedAt):null,u=c&&l?Math.max(0,Math.round((Date.now()-l)/1e3)):null,d=(c?`${c.text}${u===null?``:` · ${u<60?`${u} s`:`${Math.floor(u/60)} min ${u%60} s`}`}`:``)||t||(i?i.status===`failed`?i.errorCode===`cancelled`?`Analysis cancelled; the graph is as it was`:`Analysis failed${i.error?`: ${i.error}`:``}`:i.status===`running`?`Analyzing…`:`Analyzed${i.finishedAt?` ${Ce(i.finishedAt)}`:``}`:a?`Loading…`:``);return(0,X.jsxs)(`ol`,{className:`timeline`,"data-testid":`timeline`,children:[n&&n.stages.length>0?n.stages.map((e,t)=>{let r=n.finished.find(t=>t.stage===e),i=r?`done`:e===n.stage?`running`:`pending`;return(0,X.jsx)(`li`,{className:i,"data-stage":e,"data-state":i,title:`${C[e]??e}${r?`: done in ${(r.durationMs/1e3).toFixed(1)} s`:i===`running`?`: running`:`: next`}`,children:(0,X.jsx)(`span`,{className:`dot`})},e)}):null,!(n&&n.stages.length>0)&&qT.filter(e=>e.release===`R1`).map(t=>{let n=t.id===`stage1`?e:`future`;return(0,X.jsx)(`li`,{className:n,"data-stage":t.id,"data-state":n,title:t.name,children:(0,X.jsx)(`span`,{className:`dot`})},t.id)}),(0,X.jsxs)(`li`,{className:`message`,"data-testid":`run-message`,title:i?`${d} · run ${i.runId}`:d||void 0,children:[(0,X.jsx)(`span`,{className:`status-text`,"data-testid":`run-status-text`,children:d}),c&&(0,X.jsx)(`span`,{className:`run-bar`,"data-testid":`run-bar`,role:`progressbar`,"aria-label":`Analysis progress`,...c.fraction===null?{}:{"aria-valuenow":Math.round(c.fraction*100)},children:(0,X.jsx)(`span`,{style:{width:`${Math.round((c.fraction??0)*100)}%`}})}),r&&(0,X.jsx)(`button`,{className:`link`,"data-testid":`full-run`,onClick:r,children:`Analyze the whole project`}),o&&(0,X.jsx)(`button`,{className:`link`,"data-testid":`cancel-run`,disabled:t===`Cancelling…`,onClick:o,title:`Stop this analysis; the graph stays as it was`,children:`Cancel`})]})]})}function XT({current:e,onAdd:t,onCancel:n,error:r,intoByDefault:i=!1}){let[a,o]=(0,y.useState)(i),[s,c]=(0,y.useState)(``),l=(0,y.useRef)(null);return(0,y.useEffect)(()=>l.current?.focus(),[]),(0,y.useEffect)(()=>{let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,X.jsx)(`div`,{className:`backdrop`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,X.jsxs)(`form`,{className:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`add-title`,onSubmit:e=>{e.preventDefault(),s.trim()&&t(s.trim(),a)},children:[(0,X.jsx)(`h2`,{id:`add-title`,children:`Add a folder`}),(0,X.jsxs)(`label`,{children:[`Folder to analyze`,(0,X.jsx)(`input`,{ref:l,"data-testid":`folder-path`,value:s,onChange:e=>c(e.target.value),placeholder:`/Users/you/projects/app`,spellCheck:!1}),r?(0,X.jsx)(`small`,{className:`field-error`,role:`alert`,children:r}):(0,X.jsx)(`small`,{className:`muted`,children:`The absolute path of a git repository or any folder. It is read, never changed.`})]}),e&&(0,X.jsxs)(`label`,{className:`inline`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-testid":`add-into-current`,checked:a,onChange:e=>o(e.target.checked)}),`Add it to `,e,` instead of a new project (to analyze several repositories together)`]}),(0,X.jsxs)(`div`,{className:`buttons`,children:[(0,X.jsx)(`span`,{className:`spacer`}),(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsx)(`button`,{type:`submit`,className:`primary`,"data-testid":`add-folder-submit`,children:`Add and analyze`})]})]})})}function ZT({graph:e,showUnresolved:t,selection:n,onSelect:r,extraSite:i=null,onContext:a}){let o=new Map(e.functions.map(e=>[e.id,ye(e).name])),s=[...e.functions].sort((e,t)=>e.evidence.span.start.line-t.evidence.span.start.line),c=e.unresolved.filter(e=>t&&p(e)&&e.id!==i).sort((e,t)=>e.evidence.span.start.line-t.evidence.span.start.line),l=i?e.unresolved.find(e=>e.id===i):void 0,u=(e,t,i)=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{"data-command":`select`,"data-kind":e.kind,"data-id":e.id,className:n?.kind===e.kind&&n.id===e.id?`selected`:``,onClick:()=>r(e),onContextMenu:t=>{let n=e.kind===`function`?`function`:e.kind===`call`?`edge`:null;n&&a&&(t.preventDefault(),a({kind:n,id:e.id,data:n===`edge`?{kind:`call`,calls:[e.id]}:{},x:t.clientX,y:t.clientY}))},children:[t,i&&(0,X.jsxs)(`small`,{className:`muted`,children:[` `,i]})]})},`${e.kind}:${e.id}`);return(0,X.jsxs)(`div`,{className:`elements`,"data-testid":`elements`,children:[(0,X.jsxs)(`h4`,{children:[`Functions (`,e.functions.length,`)`]}),(0,X.jsx)(`ul`,{children:s.map(e=>{let t=ye(e);return u({kind:`function`,id:e.id},`${t.unnamed?`λ`:`ƒ`} ${t.name}`,t.parent?`in ${t.parent}`:void 0)})}),e.calls.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{children:[`Calls (`,e.calls.length,`)`]}),(0,X.jsx)(`ul`,{children:e.calls.map(e=>u({kind:`call`,id:e.id},`${o.get(e.from)??sE(e)} → ${o.get(e.to)??sE(e)} (line ${e.evidence.span.start.line})`))})]}),l&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h4`,{children:`Selected call site`}),(0,X.jsx)(`ul`,{children:u({kind:`site`,id:l.id},`? ${l.expression}`,`line ${l.evidence.span.start.line} · ${l.status===`awaiting-link`?`not linked across files`:l.status}`)})]}),c.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`h4`,{children:[`Open questions (`,c.length,`)`]}),(0,X.jsx)(`ul`,{children:c.map(e=>u({kind:`site`,id:e.id},`? ${e.expression}`,`${d(e.reason)}, line ${e.evidence.span.start.line}`))})]})]})}function QT(e){switch(e){case`declaration-file`:return`Type declarations only (.d.ts): there are no functions to show.`;case`language-not-analyzed`:return`This language is not analyzed yet; Python, Go and Rust arrive in a later release.`;case`too-large`:return`This file is too large to analyze.`;case`binary`:return`This is not a text file.`;case`minified`:return`Minified code (built output, not source); choose it in Choose files to analyze it anyway.`;default:return`This file was not analyzed${e?` (${e})`:``}.`}}function $T({project:e,graph:t,changedOnDisk:n,selection:r,onClear:i,onSelect:a,onOpenFunction:o,onShowImports:s,sources:c}){let[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(null),h=(0,y.useRef)(null),g=(0,y.useMemo)(()=>new Map(c.map(e=>[e.id,e.root])),[c]),_=(0,y.useMemo)(()=>{if(!t||!r)return null;if(r.kind===`function`){let e=t.functions.find(e=>e.id===r.id),n=e&&ae(e.qualifiedName,void 0,e.title);return e&&n&&{title:`function ${n.name}`,parent:n.parent,detail:[e.kind===`module`?tE.module:e.kind===`function`?``:tE[e.kind]??e.kind,e.exported?`exported`:``,e.isAsync?`async`:``].filter(Boolean).join(`, `),evidence:e.evidence,provenance:e.provenance,frame:e.id,whole:e.qualifiedName===`<module>`}}if(r.kind===`call`){let e=t.calls.find(e=>e.id===r.id),n=e=>{let n=t.functions.find(t=>t.id===e);return n?ae(n.qualifiedName,void 0,n.title).name:e};return e&&{title:`${n(e.from)} calls ${n(e.to)}`,parent:``,detail:`${nE[e.form]??`${e.form} call`} on line ${e.evidence.span.start.line}${e.resolution===`static-exact`?``:`, ${rE[e.resolution]??e.resolution}`}`,evidence:e.evidence,provenance:e.provenance,frame:e.from,whole:!1}}let e=t.unresolved.find(e=>e.id===r.id);return e&&{title:`Open question: ${e.expression}`,parent:``,detail:aE(e),evidence:e.evidence,provenance:e.provenance,frame:e.enclosingFn,whole:!1}},[t,r]),v=(0,y.useMemo)(()=>{if(!t||!_)return null;let e=t.functions.find(e=>e.id===_.frame)?.evidence.span??_.evidence.span,n=_.evidence.span,i=e=>{let n=t.functions.find(t=>t.id===e);return n?ae(n.qualifiedName,void 0,n.title).name:e},o=t.calls.filter(e=>e.from===_.frame&&e.id!==r?.id).map(e=>({start:e.evidence.span.start,end:e.evidence.span.end,kind:`call`,title:`Calls ${i(e.to)} (select)`,onClick:()=>a({kind:`call`,id:e.id})}));r?.kind!==`function`&&o.push({start:n.start,end:n.end,kind:`focus`});let s=e.end.line-e.start.line+1,c=Math.max(e.start.line,Math.min(n.start.line-30,e.end.line-eE+1));return{frame:e,panel:s<=eE?e:{start:{...e.start,line:c},end:{...e.end,line:Math.min(e.end.line,c+eE-1)}},marks:o,focusLine:n.start.line,clipped:s>eE}},[t,_,r,a]),b=_?.evidence.file??null,x=v?`${b}|${v.panel.start.line}|${v.panel.end.line}`:``,S=v?.clipped?`${b}|${v.frame.start.line}|${v.frame.end.line}`:``;(0,y.useEffect)(()=>{if(!e||!b||!v){u(null);return}let t=!1;return Y.snippet(e,b,v.panel).then(e=>!t&&u(e),()=>!t&&u(null)),()=>{t=!0}},[e,x]),(0,y.useEffect)(()=>{if(!d||!e||!b||!v||!S)return;let t=!1;return Y.snippet(e,b,v.frame).then(e=>!t&&m(e),()=>!t&&m(null)),()=>{t=!0}},[d,e,S]);let C=v?.clipped?p:l;if((0,y.useEffect)(()=>{_||f(!1)},[_]),!_)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`hint`,children:`Select a function or a call, in the graph or the list, to see the code that proves it.`}),e&&t&&(0,X.jsx)(sC,{project:e,file:t.file.id,run:t.committedRun,onOpen:o,onShowImports:s})]});let{span:w}=_.evidence,T=_.evidence.file.slice(0,_.evidence.file.indexOf(`:`)),E=t?.file.path??``,D=g.get(T)?oE(`${g.get(T)}/${E}`):null;return(0,X.jsxs)(`div`,{className:`evidence`,"data-testid":`evidence`,children:[(0,X.jsxs)(`div`,{className:`evidence-head`,children:[(0,X.jsx)(`h3`,{"data-testid":`evidence-title`,children:_.title}),(0,X.jsx)(`button`,{className:`icon close`,"data-command":`clear-selection`,"aria-label":`Clear the selection (Esc)`,title:`Clear the selection (Esc)`,onClick:i,children:`×`})]}),_.parent&&(0,X.jsxs)(`p`,{className:`muted small`,children:[`in `,_.parent]}),_.detail&&(0,X.jsx)(`p`,{children:_.detail}),e&&t&&r?.kind===`function`&&(0,X.jsx)(EC,{project:e,graph:t,fn:r.id,onOpen:o,onShowImports:s}),e&&t&&r?.kind===`function`&&(0,X.jsx)(SC,{project:e,fn:r.id,run:t.committedRun,onOpen:o}),e&&r&&r.kind!==`function`&&(0,X.jsx)(Le,{project:e,id:r.id},r.id),_.provenance&&(0,X.jsxs)(`p`,{className:`muted small`,"data-testid":`evidence-provenance`,children:[`Found by `,Se(_.provenance.stage),` · run `,_.provenance.run]}),n.has(_.evidence.file)&&(0,X.jsx)(`p`,{className:`muted small`,"data-testid":`evidence-changed`,children:`This file changed on disk since it was analyzed. The code shown is what was analyzed; the editor may open it at a different line. Re-analyze to update.`}),(0,X.jsxs)(`p`,{className:`location`,"data-testid":`evidence-location`,children:[(0,X.jsxs)(`code`,{children:[E,`:`,w.start.line,`:`,w.start.column]}),D&&(0,X.jsx)(`a`,{className:`button-link`,"data-testid":`open-in-editor`,href:`vscode://file${D}:${w.start.line}:${w.start.column}`,children:`Open in editor`}),l&&(0,X.jsx)(`button`,{className:`button-link`,ref:h,onClick:()=>f(!0),"data-testid":`expand-code`,children:`Expand`})]}),l&&v&&(0,X.jsx)(sw,{snippet:l,marks:v.marks,focusLine:v.focusLine,testId:`snippet`}),l&&v&&v.marks.some(e=>e.kind===`call`)&&(0,X.jsxs)(`p`,{className:`muted small legend`,children:[r?.kind!==`function`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`mark hit`,children:`The selection`}),`;`,` `]}),(0,X.jsx)(`span`,{className:`mark call-mark`,children:`highlighted`}),` calls in this function; click one to see it.`]}),l&&v?.clipped&&(0,X.jsxs)(`p`,{className:`muted small`,children:[`Showing lines `,l.startLine,`–`,l.startLine+l.lines.length-1,`.`,` `,(0,X.jsx)(`button`,{className:`link`,onClick:()=>f(!0),children:`Expand to see all of it`})]}),(0,X.jsxs)(`p`,{className:`commit muted small`,title:_.evidence.commit,children:[`at commit `,(0,X.jsx)(`code`,{children:_.evidence.commit.slice(0,12)}),` `,(0,X.jsx)(`button`,{className:`link`,"data-testid":`copy-commit`,"aria-label":`Copy the full commit`,onClick:()=>void navigator.clipboard?.writeText(_.evidence.commit),children:`copy`})]}),d&&v&&(0,X.jsx)(cw,{title:_.title,location:`${E}:${w.start.line}`,snippet:C,marks:v.marks,focusLine:v.focusLine,onClose:()=>{f(!1),h.current?.focus()}})]})}var eE=400,tE={function:`Function`,method:`Method`,arrow:`Arrow function`,constructor:`Constructor`,getter:`Getter`,setter:`Setter`,module:`The file's top-level code`},nE={plain:`Called`,member:`Called as a method`,optional:`Called with ?.`,new:`Constructed with new`,super:`Called through super`,"call-apply":`Called with call/apply`,bind:`Bound with bind`,"tagged-template":`Called as a tagged template`,decorator:`Applied as a decorator`,jsx:`Rendered as a JSX element`,iife:`Called immediately`},rE={"static-exact":`resolved exactly`,"static-inferred":`resolved by inference`,"dynamic-only":`seen only at run time`,"runtime-confirmed":`confirmed at run time`};function iE({tab:e,reach:t,onTab:n}){return(0,X.jsx)(`div`,{className:`segmented view-tabs`,role:`tablist`,"aria-label":`View`,children:(t?[`file`,`imports`,`reach`]:[`file`,`imports`]).map(t=>(0,X.jsx)(`button`,{role:`tab`,"aria-selected":e===t,"data-command":`show-tab`,"data-tab":t,title:t===`file`?`Files: inside one file, its functions and calls (1)`:t===`imports`?`Imports: how files and groups depend on each other (2)`:`Reach: where paths from or to one function or file go (3)`,onClick:()=>n(t),children:t===`file`?`Files`:t===`imports`?`Imports`:`Reach`},t))})}function aE(e){switch(e.reason){case`dynamic-dispatch`:return`Type unknown: the call is on a value whose type the analysis doesn't know (dynamic dispatch), so it can't tell which function runs.`;case`reflection`:return`Reflection: called through eval, Reflect or Function, so the target is unknown.`;case`template-binding`:return`Awaiting its component: a call in a template file, resolved once a component declaring the template is analyzed.`;case`template-reference`:return`Registered elsewhere: a component or directive registered outside this file (a global or a module), so its definition isn't linked.`;case`imported-symbol`:return`Imported${e.importSpecifier?` from '${e.importSpecifier}'`:``}: calls across files are not linked yet.`;case`runtime-global`:return`Built-in: part of the language or runtime, outside the code analyzed.`;case`builtin-value`:return`On a built-in value: the value it is called on is a string, number, DOM element or other runtime value, so it runs the runtime's code.`;default:return`${e.reason} (${e.status})`}}function oE(e){let t=e.replace(/\\/g,`/`);return encodeURI(t.startsWith(`/`)?t:`/${t}`).replace(/#/g,`%23`).replace(/\?/g,`%3F`)}function sE(e){return`${ae(e.function.qualifiedName,void 0,e.function.title).name} (${e.function.path})`}function cE(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function lE(e){return e<1e3?String(e):e<1e4?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}k`:`${Math.round(e/100)/10}k`.replace(/\.0k$/,`k`)}function uE(e){let t=e=>e.root.split(/[\\/]/).filter(Boolean).at(-1)??e.sourceId,n=e=>e.changed.length+e.removed.length;if(e.length===1){let r=e[0],i=n(r),a=i===1?r.changed[0]??r.removed[0]:`${i} files`;return`${t(r)} changed on disk since it was analyzed (${a}), so some evidence may point at old lines.`}return`${e.map(t).join(`, `)} changed on disk since they were analyzed, so some evidence may point at old lines.`}(0,b.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(y.StrictMode,{children:(0,X.jsx)(JT,{})}));
|