veoflow 0.5.7 → 0.7.0
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 +1 -1
- package/dist/checkers.mjs +618 -2
- package/dist/veo.mjs +2342 -180
- package/native/binding.cjs +2 -0
- 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 +3 -2
- package/web/assets/{index-DKA0d0wb.js → index-C3_r4kcv.js} +3 -3
- package/web/index.html +1 -1
|
@@ -6,8 +6,8 @@ var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function
|
|
|
6
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
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,X=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 Z(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(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 Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(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&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(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 nt(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 rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=Y.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function st(e,t){var n=Y.p;try{return Y.p=e,t()}finally{Y.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct,_t=`__reactLoad$`+ct;function vt(e){delete e[lt],delete e[ut],delete e[pt],delete e[mt]}function yt(e){var t;if(t=e[lt])return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[lt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[lt]||e[dt]){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[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[gt]=!0}function wt(e){e[_t]=void 0}var Tt=new Set,Et={};function Dt(e,t){Ot(e,t),Ot(e+`Capture`,t)}function Ot(e,t){for(Et[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var Q=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:Q.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(q(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=bt(e);if(t&&(e=t.stateNode)){var n=e[ut]||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[ut]||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[ut]||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),Dt(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[lt]=e,t[ut]=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=J.S;J.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(q(t)||te(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(q(n)||te(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(q(r)||te(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(q(a))return h(e,r,a,c);if(te(a)){if(l=te(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,nt(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,J.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){J.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)}J.H=cc,a=t(n,r)}while(Fo);return a}function Ko(){var e=J.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,J.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===ee)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)}};J.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=J.T,o={};o.types=a===null?null:a.types,J.T=o;try{var s=n(i,r),c=J.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),J.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=Y.p;Y.p=a!==0&&8>a?a:8;var o=J.T,s={};s.types=o===null?null:o.types,J.T=s,tc(e,!1,t,n);try{var c=i(),l=J.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{Y.p=a,o!==null&&s.types!==null&&(o.types=s.types),J.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,nt(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=rt(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=rt(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=K(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:Ze(),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[lt]=t,a[ut]=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[lt]=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[lt]=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[lt]=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[lt]=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[ut]=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[lt]=e,t[ut]=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)}du(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 du(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&&du(n,r);break a;default:du(n,r)}}e=e.sibling}}function fu(e){var t=e.alternate;t!==null&&(e.alternate=null,fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(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 pu=null,mu=!1;function $(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),$(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=pu,i=mu;Sp(n.type)&&(pu=n.stateNode,mu=!1),$(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),pu=r,mu=i;break;case 5:Zl||vl(n,t),xl(n);case 6:if(n.tag===6&&xl(n),r=pu,i=mu,pu=null,$(e,t,n),pu=r,mu=i,pu!==null){if(mu)try{(pu.nodeType===9?pu.body:pu.nodeName===`HTML`?pu.ownerDocument.body:pu).removeChild(n.stateNode),Mt=!0}catch(e){df(n,t,e)}else try{pu.removeChild(n.stateNode),Mt=!0}catch(e){df(n,t,e)}}break;case 18:pu!==null&&(mu?(e=pu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(pu,n.stateNode));break;case 4:r=pu,i=mu,pu=n.stateNode.containerInfo,mu=!0,$(e,t,n),pu=r,mu=i;break;case 0:case 11:case 14:case 15:ml(2,n,t),Zl||ml(4,n,t),$(e,t,n);break;case 1:Zl||(vl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&gl(n,t,r)),$(e,t,n);break;case 21:$(e,t,n);break;case 22:Zl=(r=Zl)||n.memoizedState!==null,$(e,t,n),Zl=r;break;case 30:vl(n,t),$(e,t,n);break;case 7:Zl||vl(n,t),$(e,t,n);break;default:$(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)){pu=l.stateNode,mu=!1;break a}break;case 5:pu=l.stateNode,mu=!1;break a;case 3:case 4:pu=l.stateNode.containerInfo,mu=!0;break a}l=l.return}if(pu===null)throw Error(s(160));hu(o,c,a),pu=null,mu=!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[gt]||r[lt]||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[lt]=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[lt]=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(fu(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:J.T===null?ot():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)),$e(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||Je(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),Z(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=Ye(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&&tt(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=Je(e,t),ed=!1,sd=od=ad=id=rd=nd=0,ld=cd=null,ud=!1,td=Ye(e,t),di(),n}function zd(e,t){jo=null,J.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=J.H;return J.H=ac,e===null?ac:e}function Hd(){var e=J.A;return J.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,J.H=i,J.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=Je(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,J.H=r,J.A=i,Ku=n,Ju===null?(qu=null,Yu=0,di(),nd):0}function qd(){for(;Ju!==null&&!X();)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,et(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=J.T,J.T=null,i=Y.p,Y.p=2,a=Ku,Ku|=4;try{ou(e,t,n)}finally{Ku=a,Y.p=i,J.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=J.T,J.T=null;var i=Y.p;Y.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,Y.p=i,J.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=J.T,J.T=null;var r=Y.p;Y.p=2;var i=Ku;Ku|=4;try{cu(e,t.alternate,t)}finally{Ku=i,Y.p=r,J.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),at(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=J.T,a=Y.p,Y.p=2,J.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{J.T=n,Y.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=at(yd),r=J.T,i=Y.p;try{Y.p=32>n?32:n,J.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{Y.p=i,J.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&&($e(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),$e(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=Ze()),e=mi(e,t),e!==null&&($e(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=Z(r,r===qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(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]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=qu,n=Yu,n=Z(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&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),at(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&&Ee(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=Z(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[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||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`),Ot(`onMouseEnter`,[`mouseout`,`mouseover`]),Ot(`onMouseLeave`,[`mouseout`,`mouseover`]),Ot(`onPointerEnter`,[`pointerout`,`pointerover`]),Ot(`onPointerLeave`,[`pointerout`,`pointerover`]),Dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Dt(`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[ft];n===void 0&&(n=t[ft]=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,Tt.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=yt(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)&&(yt(u)||u[dt]))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?yt(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,yt(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(!Et.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[ut]||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[lt]=r,n[ut]=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[gt]||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=yt(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),vt(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[gt])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),vt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(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=Y.d;Y.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=bt(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[_t]=!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[_t]){r.loading=1;return}}else t=e.createElement(`link`),t[_t]=!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[gt]||a[lt]||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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(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=it(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=J.T;J.T=null;var a=Y.p;try{Y.p=2,yh(e,t,n,r)}finally{Y.p=a,J.T=i}}function vh(e,t,n,r){var i=J.T;J.T=null;var a=Y.p;try{Y.p=8,yh(e,t,n,r)}finally{Y.p=a,J.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=bt(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=yt(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=bt(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=yt(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,st(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,st(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=bt(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=bt(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[ut]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||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[dt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();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`));Y.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:J,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[dt]=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}}function E(e,t){let n=new Set([t]);for(let t=!0;t;){t=!1;for(let r of e)!n.has(r.file)&&n.has(r.from)&&(n.add(r.file),t=!0)}return e.filter(e=>!n.has(e.file))}var D={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,grouping:`declared`,differences:!1,reveal:[],unfold:[],allCallbacks:!1},O=(e,t=!1)=>n=>t&&n[e]===void 0||typeof n[e]==`string`&&n[e].length>0?[]:[e],k=(e,t)=>n=>t.includes(n[e])?[]:[e],A=(...e)=>t=>e.flatMap(e=>e(t)),j=()=>[],M={selectProject:{description:`Show a project`,control:{kind:`select`,testId:`select-project`},check:O(`project`),apply:(e,t)=>({...D,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:j,apply:e=>({...D,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:O(`file`),apply:(e,t)=>({...e,only:null,file:t.file,selection:null,fileLevel:e.tab===`imports`,pick:e.tab===`imports`?null:e.pick,reveal:t.file===e.file&&(e.tab!==`imports`||e.fileLevel)?e.reveal:[]})},select:{description:`Select a function, call or unresolved call site to see its evidence`,control:{kind:`canvas`,testId:`select`,shortcut:`Enter`},check:A(k(`kind`,[`function`,`call`,`site`]),O(`id`),O(`file`,!0)),apply:(e,t)=>({...e,file:t.file??e.file,selection:{kind:t.kind,id:t.id},reveal:(t.file??e.file)===e.file?e.reveal:[],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:j,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:k(`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:k(`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:[],reveal:[]}:t.tab===`imports`&&e.tab===`imports`?{...e,fileLevel:!1,group:null,pick:null,only:null,expand:[],area:null,reveal:[]}:{...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:A(O(`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:O(`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:A(O(`group`,!0),O(`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,reveal:[]}}},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:O(`area`,!0),apply:(e,t)=>({...e,only:null,tab:`imports`,group:null,pick:null,fileLevel:!1,area:t.area??null,reveal:[]})},openImportsFile:{description:`Open a file on the Imports tab: its imports and its cross-file calls`,control:{kind:`canvas`,testId:`open-imports-file`},check:A(O(`file`),O(`group`,!0),O(`pick`,!0)),apply:(e,t)=>({...e,only:null,tab:`imports`,file:t.file,group:t.group??e.group,fileLevel:!0,reveal:t.file===e.file&&e.fileLevel?e.reveal:[],pick:t.pick??null,panel:t.pick?`evidence`:e.panel,selection:null})},revealFile:{description:`On a file's Imports level, show another file's imports and calls in place, or with side "left" its callers and importers (or hide them again, with what was revealed from it)`,control:{kind:`canvas`,testId:`reveal-file`},check:A(O(`file`),O(`from`,!0),O(`side`,!0)),apply:(e,t)=>e.reveal.some(e=>e.file===t.file)?{...e,reveal:E(e.reveal,t.file)}:t.file===e.file||!e.file||e.tab!==`imports`||!e.fileLevel?e:{...e,reveal:[...e.reveal,{file:t.file,from:t.from??e.file,...t.side===`left`?{side:`left`}:{}}]}},toggleCallbacks:{description:`On the File tab, show a function's callbacks (the unnamed functions written inside it), or fold them into it again`,control:{kind:`button`,testId:`toggle-callbacks`},check:O(`fn`),apply:(e,t)=>({...e,unfold:e.unfold.includes(t.fn)?e.unfold.filter(e=>e!==t.fn):[...e.unfold,t.fn]})},setAllCallbacks:{description:`On the File tab, show every function's callbacks, or fold them all`,control:{kind:`toggle`,testId:`all-callbacks`},check:e=>typeof e.all==`boolean`?[]:[`all`],apply:(e,t)=>({...e,allCallbacks:t.all,unfold:[]})},resetReveal:{description:`On a file's Imports level, hide every file revealed in place: the open file's own imports and calls only`,control:{kind:`button`,testId:`reset-reveal`},check:j,apply:e=>({...e,reveal:[]})},toggleFolder:{description:`Open or close a folder in a large group on the Imports tab`,control:{kind:`canvas`,testId:`toggle-folder`},check:O(`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:O(`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:j,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:O(`id`,!0),apply:(e,t)=>({...e,only:t.id??null})},setGrouping:{description:`Group the project map by its packages and folders (declared), or by how its files connect (connected)`,control:{kind:`select`,testId:`set-grouping`},check:k(`grouping`,[`declared`,`connected`]),apply:(e,t)=>t.grouping===e.grouping?e:{...e,grouping:t.grouping,differences:t.grouping===`connected`&&e.differences,group:null,pick:null,area:null,expand:[],only:null}},toggleDifferences:{description:`Mark, on the map grouped by how files connect, the declared groups it splits or merges`,control:{kind:`toggle`,testId:`toggle-differences`},check:j,apply:e=>({...e,differences:!e.differences})},togglePending:{description:`Show or hide imports waiting for another source (pending)`,control:{kind:`toggle`,testId:`toggle-pending`},check:j,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:j,apply:e=>({...e,showUnresolved:!e.showUnresolved})}},N=class extends Error{code;fields;constructor(e,t,n=[]){super(t),this.code=e,this.fields=n}};function P(e,t){let n=Object.hasOwn(M,t.name)?M[t.name]:void 0;if(!n)throw new N(`unknown-command`,`no command ${t.name}`);let r=t.args??{},i=n.check(r);if(i.length>0)throw new N(`invalid-arguments`,`invalid arguments for ${t.name}: ${i.join(`, `)}`,i);let a=n.apply(e,r);return a.file!==e.file&&a.unfold.length>0?{...a,unfold:[]}:a}function F(e=D){return{past:[],present:e,future:[]}}function I(e,t){let n=P(e.present,t);return JSON.stringify(n)===JSON.stringify(e.present)?e:{past:[...e.past,e.present].slice(-200),present:n,future:[]}}function L(e){let t=e.past.at(-1);return t?{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}:e}function R(e){let t=e.future[0];return t?{past:[...e.past,e.present],present:t,future:e.future.slice(1)}:e}function z(e){return encodeURIComponent(JSON.stringify(e))}function B(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 V(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 H(e){if(!e)return D;let t;try{t=JSON.parse(decodeURIComponent(e))}catch{return D}if(!t||typeof t!=`object`||t.v!==1)return D;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:D.showUnresolved,tab:t.tab===`imports`?`imports`:t.tab===`reach`&&V(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:B(t.compare),only:n(t.only),area:n(t.area),reach:V(t.reach),grouping:t.grouping===`connected`?`connected`:`declared`,differences:t.grouping===`connected`&&t.differences===!0,expand:Array.isArray(t.expand)?t.expand.filter(e=>typeof e==`string`&&e.length>0):[],unfold:Array.isArray(t.unfold)?t.unfold.filter(e=>typeof e==`string`&&e.length>0):[],allCallbacks:t.allCallbacks===!0,reveal:Array.isArray(t.reveal)?t.reveal.flatMap(e=>e&&typeof e==`object`&&n(e.file)&&n(e.from)?[{file:e.file,from:e.from,...e.side===`left`?{side:`left`}:{}}]:[]):[]}}var U={addFolder:{description:`Add a folder to the project and analyze it`,control:{kind:`button`,testId:`add-folder`},check:O(`root`)},analyze:{description:`Analyze the project again`,control:{kind:`button`,testId:`reanalyze`},check:j},analyzeDraft:{description:`Analyze the working tree's uncommitted edits as a draft, beside the current graph`,control:{kind:`button`,testId:`analyze-draft`},check:j},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:O(`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:O(`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:O(`question`)},openSettings:{description:`Set the model provider: base URL, API key and model name`,control:{kind:`button`,testId:`settings`},check:j},analyzeSource:{description:`Analyze one repository again (the others stay at their commits)`,control:{kind:`button`,testId:`repo-analyze`},check:O(`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:A(O(`source`),O(`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?[]:k(`tab`,[`repositories`,`analysis`,`license`])(e))}};function W(e,t={}){let n=Object.hasOwn(U,e)?U[e]:void 0;if(!n)throw new N(`unknown-command`,`no action ${e}`);let r=n.check(t);if(r.length>0)throw new N(`invalid-arguments`,`invalid arguments for ${e}: ${r.join(`, `)}`,r)}function ee(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 te(e){return e?.details?.kind===`run`}function ne(e){G=e}async function K(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 q=e=>`/api/projects/${encodeURIComponent(e)}`,J=e=>new URLSearchParams(e).toString(),Y={projects:(e=!1)=>K(`/api/projects${e?`?findings=1`:``}`),createProject:(e,t)=>K(`/api/projects`,{method:`POST`,body:JSON.stringify(t===void 0?{name:e}:{name:e,root:t})}),projectDisk:e=>K(`${q(e)}/disk`),deleteProject:e=>K(q(e),{method:`DELETE`,body:`{}`}),addSource:(e,t)=>K(`${q(e)}/sources`,{method:`POST`,body:JSON.stringify({root:t})}),analyze:e=>K(`${q(e)}/runs`,{method:`POST`,body:`{}`}),history:e=>K(`${q(e)}/history?limit=200`),diff:(e,t,n)=>K(`${q(e)}/diff?${J({a:String(t),b:String(n),limit:`5000`})}`),cancelRun:e=>K(`${q(e)}/runs/cancel`,{method:`POST`,body:`{}`}),analyzeDraft:e=>K(`${q(e)}/runs?draft=true`,{method:`POST`,body:`{}`}),analyzeFrom:(e,t)=>K(`${q(e)}/runs?${J({from:t})}`,{method:`POST`,body:`{}`}),analyzeDebug:(e,t)=>K(`${q(e)}/runs?${J({debug:`true`,until:t})}`,{method:`POST`,body:`{}`}),stages:e=>K(`${q(e)}/stages`),status:e=>K(`${q(e)}/status`),files:e=>K(`${q(e)}/files`),search:(e,t,n,r=6)=>K(`${q(e)}/search?${J({label:t,text:n,limit:String(r)})}`),aggregate:(e,t,n,r=5,i=!1)=>K(`${q(e)}/aggregate?${J({label:t,groupBy:n,limit:String(r),...i?{ownCode:`true`}:{}})}`),fileCounts:e=>K(`${q(e)}/file-counts`),stale:e=>K(`${q(e)}/stale`),groups:(e,t,n=`declared`)=>{let r=new URLSearchParams;t&&r.set(`source`,t),n!==`declared`&&r.set(`grouping`,n);let i=r.toString();return K(`${q(e)}/groups${i?`?${i}`:``}`)},group:(e,t,n,r,i=`declared`)=>{let a=new URLSearchParams({group:t});for(let e of n)a.append(`expand`,e);return r&&a.set(`pending`,`true`),i!==`declared`&&a.set(`grouping`,i),K(`${q(e)}/group?${a.toString()}`)},libraries:(e,t)=>K(`${q(e)}/libraries${t?`?${J({source:t})}`:``}`),library:(e,t,n,r)=>K(`${q(e)}/library?${J({name:t,ecosystem:n,...r?{source:r}:{}})}`),imports:(e,t,n=`declared`)=>K(`${q(e)}/imports?${J({file:t,...n===`declared`?{}:{grouping:n}})}`),fileSummary:(e,t)=>K(`${q(e)}/file-summary?${J({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`),n.grouping&&n.grouping!==`declared`&&a.set(`grouping`,n.grouping),n.groupBy&&a.set(`groupBy`,n.groupBy),n.cause&&a.set(`cause`,n.cause),K(`${q(e)}/findings?${a.toString()}`)},callsBetween:(e,t,n,r=0,i=`declared`)=>{let a=new URLSearchParams;i!==`declared`&&a.set(`grouping`,i);for(let e of t)a.append(`from`,e);for(let e of n)a.append(`to`,e);return a.set(`limit`,`200`),r&&a.set(`offset`,String(r)),K(`${q(e)}/cross-file-calls?${a.toString()}`)},crossFileCalls:(e,t,n)=>K(`${q(e)}/cross-file-calls?${J({file:t,direction:n,limit:`500`})}`),totals:(e,t=10,n,r=!1)=>K(`${q(e)}/totals?${J({top:String(t),...n?{source:n}:{},...r?{own:`true`}:{}})}`),reach:(e,t,n)=>K(`${q(e)}/reach?${J({...t.split(`:`).length>2?{function:t}:{file:t},direction:n})}`),references:(e,t,n=`out`)=>K(`${q(e)}/references?${J({function:t,direction:n,limit:`500`})}`),siteLinks:(e,t)=>K(`${q(e)}/site-links?${J({file:t})}`),explain:(e,t)=>K(`${q(e)}/explain?${J({id:t})}`),fileGraph:(e,t)=>K(`${q(e)}/file-graph?${J({file:t})}`),unresolved:(e,t,n)=>K(`${q(e)}/unresolved?${J({...t?{file:t}:{},...n?{limit:String(n.limit),offset:String(n.offset??0)}:{}})}`),snippet:(e,t,n)=>K(`${q(e)}/snippet`,{method:`POST`,body:JSON.stringify({file:t,span:n})}),ask:(e,t,n,r,i,a)=>K(`${q(e)}/ask`,{method:`POST`,body:JSON.stringify({question:t,...n?{mode:n}:{},...r?{file:r}:{},...a?{source:a}:{}}),...i?{signal:i}:{}}),suggestions:e=>K(`${q(e)}/suggestions`),settings:()=>K(`/api/settings`),saveSettings:e=>K(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),testSettings:(e={})=>K(`/api/settings/test`,{method:`POST`,body:JSON.stringify(e)}),sources:e=>K(`${q(e)}/sources`),select:(e,t,n,r,i=!1)=>K(`${q(e)}/sources/${encodeURIComponent(t)}/select`,{method:`POST`,body:JSON.stringify({paths:n,selected:r,...i?{keep:i}:{}})}),browse:(e,t,n)=>K(`${q(e)}/sources/${encodeURIComponent(t)}/browse?${J({dir:n})}`),updateSource:(e,t,n)=>K(`${q(e)}/sources/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(n)}),removeSource:(e,t)=>K(`${q(e)}/sources/${encodeURIComponent(t)}`,{method:`DELETE`,body:`{}`}),analyzeSource:(e,t)=>K(`${q(e)}/runs?${J({source:t})}`,{method:`POST`,body:`{}`}),license:e=>K(e?`${q(e)}/license`:`/api/license`),installLicense:e=>K(`/api/license`,{method:`PUT`,body:JSON.stringify({key:e})}),refreshLicense:()=>K(`/api/license/refresh`,{method:`POST`,body:`{}`}),projectSettings:e=>K(`${q(e)}/settings`),saveProjectSettings:(e,t)=>K(`${q(e)}/settings`,{method:`PUT`,body:JSON.stringify(t)})};function re(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 ie(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 ae(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 oe(e,t,n){if(!e.includes(`<`))return{name:e,parent:``};let r=ie(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>`?ae(i):ae(i,t),parent:a?r.map(e=>ae(e)).join(` › `):r.join(`.`)}}function se(e,t,n){let{name:r,parent:i}=oe(e,t,n);return i?`${r} (in ${i})`:r}var ce=/^<(callback|iife|anonymous)(?::([^>]*))?>(?:#\d+)?$/;function le(e){return ce.exec(ie(e).pop()??``)}function ue(e){return le(e)!==null}var de=new Set([`call`,`iife`]),fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),pe=24,me=e=>e.length>pe?e.startsWith(`(`)?`(…)`:`…`:e;function he(e){let t=/^(async\s+)?(?:<[^<>]*>\s*)?(\([^()]*\)|[\w$]+)\s*(?::\s*[^=()]+?)?\s*=>/.exec(e);if(t)return{text:`${t[1]??``}${me(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}(${me(n[4])}) {…}`,arrow:!1}}return null}function ge(e,t){let n=fe(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 _e(e,t,n){let r=le(e);if(!r||!t||n)return null;let i=he(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=ge(o,t.before);return s?.jsx?`${o}={${i.text}}`:!s&&de.has(o)?i.text:`${s?.call??o}(${s?.extra?`…, `:``}${i.text})`}function ve(e,t){let n=t instanceof Set?t:new Set(t),r=ie(e);for(r.pop();r.length>0;){let e=r.join(`.`);if(n.has(e))return e;r.pop()}return ue(e)&&n.has(`<module>`)&&e!==`<module>`?`<module>`:null}function ye(e,t,n,r){let i=le(e);if(!i)return null;let[,a,o]=i,s=!r||r===`<module>`,c=s?`the file's top level`:se(r),l=t?he(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?ge(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 be(e){let t=oe(e.qualifiedName,e.evidence.span.start.line,e.title);return{name:_e(e.qualifiedName,e.code,e.title)??t.name,parent:t.parent,unnamed:ue(e.qualifiedName)&&!e.title}}function xe(e){let t=oe(e.name,e.line,e.title),n=_e(e.name,e.code,e.title),r=ue(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 Se(e){let{name:t,parent:n}=xe(e);return n?`${t} (in ${n})`:t}function Ce(e){return{stage1:`in-file analysis (Stage 1)`,"template-link":`template linking`,stage2:`import analysis (Stage 2)`}[e]??e}function we(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 Te(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 Ee=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=Ee()}))(),De=/^(who calls|callers of|what does|where is|functions in|open questions in)\s+(\S{2,})$/i;function Oe({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)([]);(0,y.useEffect)(()=>{f(``),m(!1),g(null),v(!1)},[e]);let 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=De.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||De.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 ke(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 Ae=`<(?:callback|module|iife|anonymous|object)(?::[^<>\\s]*)?>(?:#\\d+)?`,je=RegExp(`(?<![\\w$])(?:[A-Za-z_$][\\w$]*(?:\\.(?:[\\w$]+|${Ae}))*\\.${Ae}(?:\\.(?:[\\w$]+|${Ae}))*|${Ae})`,`g`);function Me({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(je,e=>se(e,r.get(e),i.get(e))),o=(e,r)=>ke(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 Ne=20;function Pe({r:e,active:t,onOpen:n}){let r=e.kind===`function`||e.kind===`call`?oe(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:Le[e.kind]}),` `,r]}),e.detail&&(0,X.jsx)(`small`,{children:e.detail})]})}function Fe(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 Ie({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,Ne),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:Fe(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)(Me,{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)(Pe,{r:e,active:e.id===a,onOpen:c})},`${e.kind}:${e.id}`))})]}),e.results.length>Ne&&!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)(Pe,{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 Le={function:`ƒ`,call:`→`,file:`▤`,site:`?`,group:`#`};function Re({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 ze=[[`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`]],Be={javascript:`JavaScript`,typescript:`TypeScript`,python:`Python`,go:`Go`,rust:`Rust`,java:`Java`,kotlin:`Kotlin`},Ve=new Set([`javascript`,`typescript`]);function He({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 Ue({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)(He,{...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(Be).filter(e=>u.languages.includes(e)).map(e=>Be[e]).join(`, `)}),u.languages.some(e=>e in Be&&!Ve.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:ze.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 We({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 Ge={selector:`.only-out`,style:{display:`none`}};function Ke(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)}var qe=()=>typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`):null;function Z(e){return typeof document>`u`?``:getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim()}function Je(){return(0,y.useSyncExternalStore)(e=>{let t=qe();return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>qe()?.matches?`dark`:`light`,()=>`light`)}function Ye(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 Xe=e=>e?`diff-${e}`:``,Ze=()=>[{selector:`node.diff-added`,style:{"border-width":3,"border-color":Z(`blue-52`),"border-style":`solid`}},{selector:`node.diff-removed`,style:{"border-width":2,"border-color":Z(`orange-66`),"border-style":`dashed`,opacity:.75}},{selector:`node.diff-changed`,style:{"border-width":4,"border-color":Z(`purple-51`),"border-style":`double`}},{selector:`edge.diff-added`,style:{"line-color":Z(`blue-52`),"target-arrow-color":Z(`blue-52`),width:3}},{selector:`edge.diff-removed`,style:{"line-color":Z(`orange-66`),"target-arrow-color":Z(`orange-66`),"line-style":`dashed`,width:2}},{selector:`edge.diff-changed`,style:{"line-color":Z(`purple-51`),"target-arrow-color":Z(`purple-51`),"line-style":`dotted`,width:3}}];function Qe(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 $e(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 et(e){if(Array.isArray(e))return e}function tt(e){if(Array.isArray(e))return $e(e)}function nt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rt(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,mt(r.key),r)}}function it(e,t,n){return t&&rt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function at(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=gt(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.
|
|
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(!Et.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[ut]||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[lt]=r,n[ut]=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[gt]||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=yt(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),vt(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[gt])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),vt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(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=Y.d;Y.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=bt(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[_t]=!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[_t]){r.loading=1;return}}else t=e.createElement(`link`),t[_t]=!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[gt]||a[lt]||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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(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=it(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=J.T;J.T=null;var a=Y.p;try{Y.p=2,yh(e,t,n,r)}finally{Y.p=a,J.T=i}}function vh(e,t,n,r){var i=J.T;J.T=null;var a=Y.p;try{Y.p=8,yh(e,t,n,r)}finally{Y.p=a,J.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=bt(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=yt(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=bt(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=yt(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,st(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,st(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=bt(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=bt(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[ut]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||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[dt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();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`));Y.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:J,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[dt]=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`,"package-symbol":`in another file of its package`,"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}}function E(e,t){let n=new Set([t]);for(let t=!0;t;){t=!1;for(let r of e)!n.has(r.file)&&n.has(r.from)&&(n.add(r.file),t=!0)}return e.filter(e=>!n.has(e.file))}var D={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,grouping:`declared`,differences:!1,reveal:[],unfold:[],allCallbacks:!1},O=(e,t=!1)=>n=>t&&n[e]===void 0||typeof n[e]==`string`&&n[e].length>0?[]:[e],k=(e,t)=>n=>t.includes(n[e])?[]:[e],A=(...e)=>t=>e.flatMap(e=>e(t)),j=()=>[],M={selectProject:{description:`Show a project`,control:{kind:`select`,testId:`select-project`},check:O(`project`),apply:(e,t)=>({...D,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:j,apply:e=>({...D,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:O(`file`),apply:(e,t)=>({...e,only:null,file:t.file,selection:null,fileLevel:e.tab===`imports`,pick:e.tab===`imports`?null:e.pick,reveal:t.file===e.file&&(e.tab!==`imports`||e.fileLevel)?e.reveal:[]})},select:{description:`Select a function, call or unresolved call site to see its evidence`,control:{kind:`canvas`,testId:`select`,shortcut:`Enter`},check:A(k(`kind`,[`function`,`call`,`site`]),O(`id`),O(`file`,!0)),apply:(e,t)=>({...e,file:t.file??e.file,selection:{kind:t.kind,id:t.id},reveal:(t.file??e.file)===e.file?e.reveal:[],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:j,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:k(`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:k(`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:[],reveal:[]}:t.tab===`imports`&&e.tab===`imports`?{...e,fileLevel:!1,group:null,pick:null,only:null,expand:[],area:null,reveal:[]}:{...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:A(O(`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:O(`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:A(O(`group`,!0),O(`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,reveal:[]}}},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:O(`area`,!0),apply:(e,t)=>({...e,only:null,tab:`imports`,group:null,pick:null,fileLevel:!1,area:t.area??null,reveal:[]})},openImportsFile:{description:`Open a file on the Imports tab: its imports and its cross-file calls`,control:{kind:`canvas`,testId:`open-imports-file`},check:A(O(`file`),O(`group`,!0),O(`pick`,!0)),apply:(e,t)=>({...e,only:null,tab:`imports`,file:t.file,group:t.group??e.group,fileLevel:!0,reveal:t.file===e.file&&e.fileLevel?e.reveal:[],pick:t.pick??null,panel:t.pick?`evidence`:e.panel,selection:null})},revealFile:{description:`On a file's Imports level, show another file's imports and calls in place, or with side "left" its callers and importers (or hide them again, with what was revealed from it)`,control:{kind:`canvas`,testId:`reveal-file`},check:A(O(`file`),O(`from`,!0),O(`side`,!0)),apply:(e,t)=>e.reveal.some(e=>e.file===t.file)?{...e,reveal:E(e.reveal,t.file)}:t.file===e.file||!e.file||e.tab!==`imports`||!e.fileLevel?e:{...e,reveal:[...e.reveal,{file:t.file,from:t.from??e.file,...t.side===`left`?{side:`left`}:{}}]}},toggleCallbacks:{description:`On the File tab, show a function's callbacks (the unnamed functions written inside it), or fold them into it again`,control:{kind:`button`,testId:`toggle-callbacks`},check:O(`fn`),apply:(e,t)=>({...e,unfold:e.unfold.includes(t.fn)?e.unfold.filter(e=>e!==t.fn):[...e.unfold,t.fn]})},setAllCallbacks:{description:`On the File tab, show every function's callbacks, or fold them all`,control:{kind:`toggle`,testId:`all-callbacks`},check:e=>typeof e.all==`boolean`?[]:[`all`],apply:(e,t)=>({...e,allCallbacks:t.all,unfold:[]})},resetReveal:{description:`On a file's Imports level, hide every file revealed in place: the open file's own imports and calls only`,control:{kind:`button`,testId:`reset-reveal`},check:j,apply:e=>({...e,reveal:[]})},toggleFolder:{description:`Open or close a folder in a large group on the Imports tab`,control:{kind:`canvas`,testId:`toggle-folder`},check:O(`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:O(`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:j,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:O(`id`,!0),apply:(e,t)=>({...e,only:t.id??null})},setGrouping:{description:`Group the project map by its packages and folders (declared), or by how its files connect (connected)`,control:{kind:`select`,testId:`set-grouping`},check:k(`grouping`,[`declared`,`connected`]),apply:(e,t)=>t.grouping===e.grouping?e:{...e,grouping:t.grouping,differences:t.grouping===`connected`&&e.differences,group:null,pick:null,area:null,expand:[],only:null}},toggleDifferences:{description:`Mark, on the map grouped by how files connect, the declared groups it splits or merges`,control:{kind:`toggle`,testId:`toggle-differences`},check:j,apply:e=>({...e,differences:!e.differences})},togglePending:{description:`Show or hide imports waiting for another source (pending)`,control:{kind:`toggle`,testId:`toggle-pending`},check:j,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:j,apply:e=>({...e,showUnresolved:!e.showUnresolved})}},N=class extends Error{code;fields;constructor(e,t,n=[]){super(t),this.code=e,this.fields=n}};function P(e,t){let n=Object.hasOwn(M,t.name)?M[t.name]:void 0;if(!n)throw new N(`unknown-command`,`no command ${t.name}`);let r=t.args??{},i=n.check(r);if(i.length>0)throw new N(`invalid-arguments`,`invalid arguments for ${t.name}: ${i.join(`, `)}`,i);let a=n.apply(e,r);return a.file!==e.file&&a.unfold.length>0?{...a,unfold:[]}:a}function F(e=D){return{past:[],present:e,future:[]}}function I(e,t){let n=P(e.present,t);return JSON.stringify(n)===JSON.stringify(e.present)?e:{past:[...e.past,e.present].slice(-200),present:n,future:[]}}function L(e){let t=e.past.at(-1);return t?{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}:e}function R(e){let t=e.future[0];return t?{past:[...e.past,e.present],present:t,future:e.future.slice(1)}:e}function z(e){return encodeURIComponent(JSON.stringify(e))}function B(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 V(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 H(e){if(!e)return D;let t;try{t=JSON.parse(decodeURIComponent(e))}catch{return D}if(!t||typeof t!=`object`||t.v!==1)return D;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:D.showUnresolved,tab:t.tab===`imports`?`imports`:t.tab===`reach`&&V(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:B(t.compare),only:n(t.only),area:n(t.area),reach:V(t.reach),grouping:t.grouping===`connected`?`connected`:`declared`,differences:t.grouping===`connected`&&t.differences===!0,expand:Array.isArray(t.expand)?t.expand.filter(e=>typeof e==`string`&&e.length>0):[],unfold:Array.isArray(t.unfold)?t.unfold.filter(e=>typeof e==`string`&&e.length>0):[],allCallbacks:t.allCallbacks===!0,reveal:Array.isArray(t.reveal)?t.reveal.flatMap(e=>e&&typeof e==`object`&&n(e.file)&&n(e.from)?[{file:e.file,from:e.from,...e.side===`left`?{side:`left`}:{}}]:[]):[]}}var U={addFolder:{description:`Add a folder to the project and analyze it`,control:{kind:`button`,testId:`add-folder`},check:O(`root`)},analyze:{description:`Analyze the project again`,control:{kind:`button`,testId:`reanalyze`},check:j},analyzeDraft:{description:`Analyze the working tree's uncommitted edits as a draft, beside the current graph`,control:{kind:`button`,testId:`analyze-draft`},check:j},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:O(`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:O(`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:O(`question`)},openSettings:{description:`Set the model provider: base URL, API key and model name`,control:{kind:`button`,testId:`settings`},check:j},analyzeSource:{description:`Analyze one repository again (the others stay at their commits)`,control:{kind:`button`,testId:`repo-analyze`},check:O(`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:A(O(`source`),O(`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?[]:k(`tab`,[`repositories`,`analysis`,`license`])(e))}};function W(e,t={}){let n=Object.hasOwn(U,e)?U[e]:void 0;if(!n)throw new N(`unknown-command`,`no action ${e}`);let r=n.check(t);if(r.length>0)throw new N(`invalid-arguments`,`invalid arguments for ${e}: ${r.join(`, `)}`,r)}function ee(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 te(e){return e?.details?.kind===`run`}function ne(e){G=e}async function K(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 q=e=>`/api/projects/${encodeURIComponent(e)}`,J=e=>new URLSearchParams(e).toString(),Y={projects:(e=!1)=>K(`/api/projects${e?`?findings=1`:``}`),createProject:(e,t)=>K(`/api/projects`,{method:`POST`,body:JSON.stringify(t===void 0?{name:e}:{name:e,root:t})}),projectDisk:e=>K(`${q(e)}/disk`),deleteProject:e=>K(q(e),{method:`DELETE`,body:`{}`}),addSource:(e,t)=>K(`${q(e)}/sources`,{method:`POST`,body:JSON.stringify({root:t})}),analyze:e=>K(`${q(e)}/runs`,{method:`POST`,body:`{}`}),history:e=>K(`${q(e)}/history?limit=200`),diff:(e,t,n)=>K(`${q(e)}/diff?${J({a:String(t),b:String(n),limit:`5000`})}`),cancelRun:e=>K(`${q(e)}/runs/cancel`,{method:`POST`,body:`{}`}),analyzeDraft:e=>K(`${q(e)}/runs?draft=true`,{method:`POST`,body:`{}`}),analyzeFrom:(e,t)=>K(`${q(e)}/runs?${J({from:t})}`,{method:`POST`,body:`{}`}),analyzeDebug:(e,t)=>K(`${q(e)}/runs?${J({debug:`true`,until:t})}`,{method:`POST`,body:`{}`}),stages:e=>K(`${q(e)}/stages`),status:e=>K(`${q(e)}/status`),files:e=>K(`${q(e)}/files`),search:(e,t,n,r=6)=>K(`${q(e)}/search?${J({label:t,text:n,limit:String(r)})}`),aggregate:(e,t,n,r=5,i=!1)=>K(`${q(e)}/aggregate?${J({label:t,groupBy:n,limit:String(r),...i?{ownCode:`true`}:{}})}`),fileCounts:e=>K(`${q(e)}/file-counts`),stale:e=>K(`${q(e)}/stale`),groups:(e,t,n=`declared`)=>{let r=new URLSearchParams;t&&r.set(`source`,t),n!==`declared`&&r.set(`grouping`,n);let i=r.toString();return K(`${q(e)}/groups${i?`?${i}`:``}`)},group:(e,t,n,r,i=`declared`)=>{let a=new URLSearchParams({group:t});for(let e of n)a.append(`expand`,e);return r&&a.set(`pending`,`true`),i!==`declared`&&a.set(`grouping`,i),K(`${q(e)}/group?${a.toString()}`)},libraries:(e,t)=>K(`${q(e)}/libraries${t?`?${J({source:t})}`:``}`),library:(e,t,n,r)=>K(`${q(e)}/library?${J({name:t,ecosystem:n,...r?{source:r}:{}})}`),imports:(e,t,n=`declared`)=>K(`${q(e)}/imports?${J({file:t,...n===`declared`?{}:{grouping:n}})}`),fileSummary:(e,t)=>K(`${q(e)}/file-summary?${J({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`),n.grouping&&n.grouping!==`declared`&&a.set(`grouping`,n.grouping),n.groupBy&&a.set(`groupBy`,n.groupBy),n.cause&&a.set(`cause`,n.cause),K(`${q(e)}/findings?${a.toString()}`)},callsBetween:(e,t,n,r=0,i=`declared`)=>{let a=new URLSearchParams;i!==`declared`&&a.set(`grouping`,i);for(let e of t)a.append(`from`,e);for(let e of n)a.append(`to`,e);return a.set(`limit`,`200`),r&&a.set(`offset`,String(r)),K(`${q(e)}/cross-file-calls?${a.toString()}`)},crossFileCalls:(e,t,n)=>K(`${q(e)}/cross-file-calls?${J({file:t,direction:n,limit:`500`})}`),totals:(e,t=10,n,r=!1)=>K(`${q(e)}/totals?${J({top:String(t),...n?{source:n}:{},...r?{own:`true`}:{}})}`),reach:(e,t,n)=>K(`${q(e)}/reach?${J({...t.split(`:`).length>2?{function:t}:{file:t},direction:n})}`),references:(e,t,n=`out`)=>K(`${q(e)}/references?${J({function:t,direction:n,limit:`500`})}`),siteLinks:(e,t)=>K(`${q(e)}/site-links?${J({file:t})}`),explain:(e,t)=>K(`${q(e)}/explain?${J({id:t})}`),fileGraph:(e,t)=>K(`${q(e)}/file-graph?${J({file:t})}`),unresolved:(e,t,n)=>K(`${q(e)}/unresolved?${J({...t?{file:t}:{},...n?{limit:String(n.limit),offset:String(n.offset??0)}:{}})}`),snippet:(e,t,n)=>K(`${q(e)}/snippet`,{method:`POST`,body:JSON.stringify({file:t,span:n})}),ask:(e,t,n,r,i,a)=>K(`${q(e)}/ask`,{method:`POST`,body:JSON.stringify({question:t,...n?{mode:n}:{},...r?{file:r}:{},...a?{source:a}:{}}),...i?{signal:i}:{}}),suggestions:e=>K(`${q(e)}/suggestions`),settings:()=>K(`/api/settings`),saveSettings:e=>K(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),testSettings:(e={})=>K(`/api/settings/test`,{method:`POST`,body:JSON.stringify(e)}),sources:e=>K(`${q(e)}/sources`),select:(e,t,n,r,i=!1)=>K(`${q(e)}/sources/${encodeURIComponent(t)}/select`,{method:`POST`,body:JSON.stringify({paths:n,selected:r,...i?{keep:i}:{}})}),browse:(e,t,n)=>K(`${q(e)}/sources/${encodeURIComponent(t)}/browse?${J({dir:n})}`),updateSource:(e,t,n)=>K(`${q(e)}/sources/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(n)}),removeSource:(e,t)=>K(`${q(e)}/sources/${encodeURIComponent(t)}`,{method:`DELETE`,body:`{}`}),analyzeSource:(e,t)=>K(`${q(e)}/runs?${J({source:t})}`,{method:`POST`,body:`{}`}),license:e=>K(e?`${q(e)}/license`:`/api/license`),installLicense:e=>K(`/api/license`,{method:`PUT`,body:JSON.stringify({key:e})}),refreshLicense:()=>K(`/api/license/refresh`,{method:`POST`,body:`{}`}),projectSettings:e=>K(`${q(e)}/settings`),saveProjectSettings:(e,t)=>K(`${q(e)}/settings`,{method:`PUT`,body:JSON.stringify(t)})};function re(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 ie(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 ae(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 oe(e,t,n){if(!e.includes(`<`))return{name:e,parent:``};let r=ie(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>`?ae(i):ae(i,t),parent:a?r.map(e=>ae(e)).join(` › `):r.join(`.`)}}function se(e,t,n){let{name:r,parent:i}=oe(e,t,n);return i?`${r} (in ${i})`:r}var ce=/^<(callback|iife|anonymous)(?::([^>]*))?>(?:#\d+)?$/;function le(e){return ce.exec(ie(e).pop()??``)}function ue(e){return le(e)!==null}var de=new Set([`call`,`iife`]),fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),pe=24,me=e=>e.length>pe?e.startsWith(`(`)?`(…)`:`…`:e;function he(e){let t=/^(async\s+)?(?:<[^<>]*>\s*)?(\([^()]*\)|[\w$]+)\s*(?::\s*[^=()]+?)?\s*=>/.exec(e);if(t)return{text:`${t[1]??``}${me(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}(${me(n[4])}) {…}`,arrow:!1}}return null}function ge(e,t){let n=fe(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 _e(e,t,n){let r=le(e);if(!r||!t||n)return null;let i=he(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=ge(o,t.before);return s?.jsx?`${o}={${i.text}}`:!s&&de.has(o)?i.text:`${s?.call??o}(${s?.extra?`…, `:``}${i.text})`}function ve(e,t){let n=t instanceof Set?t:new Set(t),r=ie(e);for(r.pop();r.length>0;){let e=r.join(`.`);if(n.has(e))return e;r.pop()}return ue(e)&&n.has(`<module>`)&&e!==`<module>`?`<module>`:null}function ye(e,t,n,r){let i=le(e);if(!i)return null;let[,a,o]=i,s=!r||r===`<module>`,c=s?`the file's top level`:se(r),l=t?he(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?ge(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 be(e){let t=oe(e.qualifiedName,e.evidence.span.start.line,e.title);return{name:_e(e.qualifiedName,e.code,e.title)??t.name,parent:t.parent,unnamed:ue(e.qualifiedName)&&!e.title}}function xe(e){let t=oe(e.name,e.line,e.title),n=_e(e.name,e.code,e.title),r=ue(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 Se(e){let{name:t,parent:n}=xe(e);return n?`${t} (in ${n})`:t}function Ce(e){return{stage1:`in-file analysis (Stage 1)`,"template-link":`template linking`,stage2:`import analysis (Stage 2)`}[e]??e}function we(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 Te(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 Ee=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=Ee()}))(),De=/^(who calls|callers of|what does|where is|functions in|open questions in)\s+(\S{2,})$/i;function Oe({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)([]);(0,y.useEffect)(()=>{f(``),m(!1),g(null),v(!1)},[e]);let 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=De.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||De.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 ke(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 Ae=`<(?:callback|module|iife|anonymous|object)(?::[^<>\\s]*)?>(?:#\\d+)?`,je=RegExp(`(?<![\\w$])(?:[A-Za-z_$][\\w$]*(?:\\.(?:[\\w$]+|${Ae}))*\\.${Ae}(?:\\.(?:[\\w$]+|${Ae}))*|${Ae})`,`g`);function Me({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(je,e=>se(e,r.get(e),i.get(e))),o=(e,r)=>ke(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 Ne=20;function Pe({r:e,active:t,onOpen:n}){let r=e.kind===`function`||e.kind===`call`?oe(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:Le[e.kind]}),` `,r]}),e.detail&&(0,X.jsx)(`small`,{children:e.detail})]})}function Fe(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 Ie({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,Ne),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:Fe(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)(Me,{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)(Pe,{r:e,active:e.id===a,onOpen:c})},`${e.kind}:${e.id}`))})]}),e.results.length>Ne&&!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)(Pe,{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 Le={function:`ƒ`,call:`→`,file:`▤`,site:`?`,group:`#`};function Re({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 ze=[[`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`]],Be={javascript:`JavaScript`,typescript:`TypeScript`,python:`Python`,go:`Go`,rust:`Rust`,java:`Java`,kotlin:`Kotlin`},Ve=new Set([`javascript`,`typescript`,`python`,`go`]);function He({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 Ue({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)(He,{...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(Be).filter(e=>u.languages.includes(e)).map(e=>Be[e]).join(`, `)}),u.languages.some(e=>e in Be&&!Ve.has(e))&&(0,X.jsx)(`p`,{className:`muted small`,"data-testid":`license-languages-note`,children:`veoflow analyzes JavaScript, TypeScript, Python and Go 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:ze.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 We({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 Ge={selector:`.only-out`,style:{display:`none`}};function Ke(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)}var qe=()=>typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`):null;function Z(e){return typeof document>`u`?``:getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim()}function Je(){return(0,y.useSyncExternalStore)(e=>{let t=qe();return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>qe()?.matches?`dark`:`light`,()=>`light`)}function Ye(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 Xe=e=>e?`diff-${e}`:``,Ze=()=>[{selector:`node.diff-added`,style:{"border-width":3,"border-color":Z(`blue-52`),"border-style":`solid`}},{selector:`node.diff-removed`,style:{"border-width":2,"border-color":Z(`orange-66`),"border-style":`dashed`,opacity:.75}},{selector:`node.diff-changed`,style:{"border-width":4,"border-color":Z(`purple-51`),"border-style":`double`}},{selector:`edge.diff-added`,style:{"line-color":Z(`blue-52`),"target-arrow-color":Z(`blue-52`),width:3}},{selector:`edge.diff-removed`,style:{"line-color":Z(`orange-66`),"target-arrow-color":Z(`orange-66`),"line-style":`dashed`,width:2}},{selector:`edge.diff-changed`,style:{"line-color":Z(`purple-51`),"target-arrow-color":Z(`purple-51`),"line-style":`dotted`,width:3}}];function Qe(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 $e(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 et(e){if(Array.isArray(e))return e}function tt(e){if(Array.isArray(e))return $e(e)}function nt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rt(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,mt(r.key),r)}}function it(e,t,n){return t&&rt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function at(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=gt(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
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 ot(e,t,n){return(t=mt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ct(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 lt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
12
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ut(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
13
13
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(e,t){return et(e)||ct(e,t)||gt(e,t)||lt()}function ft(e){return tt(e)||st(e)||gt(e)||ut()}function pt(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 mt(e){var t=pt(e,`string`);return typeof t==`symbol`?t:t+``}function ht(e){"@babel/helpers - typeof";return ht=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},ht(e)}function gt(e,t){if(e){if(typeof e==`string`)return $e(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)?$e(e,t):void 0}}var _t=typeof window>`u`?null:window,vt=_t?_t.navigator:null;_t&&_t.document;var yt=ht(``),bt=ht({}),xt=ht(function(){}),St=typeof HTMLElement>`u`?`undefined`:ht(HTMLElement),Ct=function(e){return e&&e.instanceString&&Tt(e.instanceString)?e.instanceString():null},wt=function(e){return e!=null&&ht(e)==yt},Tt=function(e){return e!=null&&ht(e)===xt},Et=function(e){return!jt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Dt=function(e){return e!=null&&ht(e)===bt&&!Et(e)&&e.constructor===Object},Ot=function(e){return e!=null&&ht(e)===bt},Q=function(e){return e!=null&&ht(e)===ht(1)&&!isNaN(e)},kt=function(e){return Q(e)&&Math.floor(e)===e},At=function(e){if(St!==`undefined`)return e!=null&&e instanceof HTMLElement},jt=function(e){return Mt(e)||Nt(e)},Mt=function(e){return Ct(e)===`collection`&&e._private.single},Nt=function(e){return Ct(e)===`collection`&&!e._private.single},Pt=function(e){return Ct(e)===`core`},Ft=function(e){return Ct(e)===`stylesheet`},It=function(e){return Ct(e)===`event`},Lt=function(e){return!!(e==null||e===``||e.match(/^\s+$/))},Rt=function(e){return typeof HTMLElement>`u`?!1:e instanceof HTMLElement},zt=function(e){return Dt(e)&&Q(e.x1)&&Q(e.x2)&&Q(e.y1)&&Q(e.y2)},Bt=function(e){return Ot(e)&&Tt(e.then)},Vt=function(){return vt&&vt.userAgent.match(/msie|trident|edge/i)},Ht=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},Ut=Ht(function(e){return e.replace(/([A-Z])/g,function(e){return`-`+e.toLowerCase()})}),Wt=Ht(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Gt=Ht(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+`$`+t}),Kt=function(e){return Lt(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},qt=function(e,t){return e.slice(-1*t.length)===t},Jt=`(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))`,Yt=`rgb[a]?\\((`+Jt+`[%]?)\\s*,\\s*(`+Jt+`[%]?)\\s*,\\s*(`+Jt+`[%]?)(?:\\s*,\\s*(`+Jt+`))?\\)`,Xt=`rgb[a]?\\((?:`+Jt+`[%]?)\\s*,\\s*(?:`+Jt+`[%]?)\\s*,\\s*(?:`+Jt+`[%]?)(?:\\s*,\\s*(?:`+Jt+`))?\\)`,Zt=`hsl[a]?\\((`+Jt+`)\\s*,\\s*(`+Jt+`[%])\\s*,\\s*(`+Jt+`[%])(?:\\s*,\\s*(`+Jt+`))?\\)`,Qt=`hsl[a]?\\((?:`+Jt+`)\\s*,\\s*(?:`+Jt+`[%])\\s*,\\s*(?:`+Jt+`[%])(?:\\s*,\\s*(?:`+Jt+`))?\\)`,$t=`\\#[0-9a-fA-F]{3}`,en=`\\#[0-9a-fA-F]{6}`,tn=function(e,t){return e<t?-1:+(e>t)},nn=function(e,t){return-1*tn(e,t)},rn=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),an=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]}},on=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(`^`+Zt+`$`).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},sn=function(e){var t,n=RegExp(`^`+Yt+`$`).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},cn=function(e){return un[e.toLowerCase()]},ln=function(e){return(Et(e)?e:null)||cn(e)||an(e)||sn(e)||on(e)},un={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]},dn=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Dt(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}},fn=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(Dt(a))throw Error(`Tried to get map with object key`);if(t=t[a],t==null)return t}return t},pn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var hn,gn;function _n(){if(gn)return hn;gn=1;function e(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}return hn=e,hn}var vn,yn;function bn(){return yn?vn:(yn=1,vn=typeof pn==`object`&&pn&&pn.Object===Object&&pn,vn)}var xn,Sn;function Cn(){if(Sn)return xn;Sn=1;var e=bn(),t=typeof self==`object`&&self&&self.Object===Object&&self;return xn=e||t||Function(`return this`)(),xn}var wn,Tn;function En(){if(Tn)return wn;Tn=1;var e=Cn();return wn=function(){return e.Date.now()},wn}var Dn,On;function kn(){if(On)return Dn;On=1;var e=/\s/;function t(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}return Dn=t,Dn}var An,jn;function Mn(){if(jn)return An;jn=1;var e=kn(),t=/^\s+/;function n(n){return n&&n.slice(0,e(n)+1).replace(t,``)}return An=n,An}var Nn,Pn;function Fn(){return Pn?Nn:(Pn=1,Nn=Cn().Symbol,Nn)}var In,Ln;function Rn(){if(Ln)return In;Ln=1;var e=Fn(),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 In=a,In}var zn,Bn;function Vn(){if(Bn)return zn;Bn=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return zn=t,zn}var Hn,Un;function Wn(){if(Un)return Hn;Un=1;var e=Fn(),t=Rn(),n=Vn(),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 Hn=o,Hn}var Gn,Kn;function qn(){if(Kn)return Gn;Kn=1;function e(e){return typeof e==`object`&&!!e}return Gn=e,Gn}var Jn,Yn;function Xn(){if(Yn)return Jn;Yn=1;var e=Wn(),t=qn(),n=`[object Symbol]`;function r(r){return typeof r==`symbol`||t(r)&&e(r)==n}return Jn=r,Jn}var Zn,Qn;function $n(){if(Qn)return Zn;Qn=1;var e=Mn(),t=_n(),n=Xn(),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 Zn=c,Zn}var er,tr;function nr(){if(tr)return er;tr=1;var e=_n(),t=En(),n=$n(),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 er=o,er}var rr=mn(nr()),ir=_t?_t.performance:null,ar=ir&&ir.now?function(){return ir.now()}:function(){return Date.now()},or=function(){if(_t){if(_t.requestAnimationFrame)return function(e){_t.requestAnimationFrame(e)};if(_t.mozRequestAnimationFrame)return function(e){_t.mozRequestAnimationFrame(e)};if(_t.webkitRequestAnimationFrame)return function(e){_t.webkitRequestAnimationFrame(e)};if(_t.msRequestAnimationFrame)return function(e){_t.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(ar())},1e3/60)}}(),sr=function(e){return or(e)},cr=ar,lr=9261,ur=65599,dr=5381,fr=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lr,n;n=e.next(),!n.done;)t=t*ur+n.value|0;return t},pr=function(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:lr)*ur+e|0},mr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dr;return(t<<5)+t+e|0},hr=function(e,t){return e*2097152+t},gr=function(e){return e[0]*2097152+e[1]},_r=function(e,t){return[pr(e[0],t[0]),mr(e[1],t[1])]},vr=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return fr({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},yr=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return fr({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},br=function(){return xr(arguments)},xr=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=n===0?yr(r):yr(r,t)}return t};function Sr(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 Cr=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}};function wr(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=Sr(e.x,e.y,r,i,n),c=Cr(s.x,s.y,r,i,a,o);return{x:c.x,y:c.y}}var Tr=!0,Er=console.warn!=null,Dr=console.trace!=null,Or=2**53-1||9007199254740991,kr=function(){return!0},Ar=function(){return!1},jr=function(){return 0},Mr=function(){},Nr=function(e){throw Error(e)},Pr=function(e){if(e!==void 0)Tr=!!e;else return Tr},Fr=function(e){Pr()&&(Er?console.warn(e):(console.log(e),Dr&&console.trace()))},Ir=function(e){return rn({},e)},Lr=function(e){return e==null?e:Et(e)?e.slice():Dt(e)?Ir(e):e},Rr=function(e){return e.slice()},zr=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},Br={},Vr=function(){return Br},Hr=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}},Ur=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},Wr=function(e){e.splice(0,e.length)},Gr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},Kr=function(e,t,n){return n&&(t=Gt(n,t)),e[t]},qr=function(e,t,n,r){n&&(t=Gt(n,t)),e[t]=r},Jr=typeof Map<`u`?Map:function(){function e(){nt(this,e),this._obj={}}return it(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]}}])}(),Yr=`undefined`,Xr=function(){function e(t){if(nt(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 it(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)}}])}(),Zr=(typeof Set>`u`?`undefined`:ht(Set))===Yr?Xr:Set,Qr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Pt(e)){Nr(`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`){Nr("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 Zr,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=[];Et(t.classes)?c=t.classes:wt(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&&(Fr("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f))},$r=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;Dt(t)&&!jt(t)&&(i=t,t=i.roots||i.root,n=i.visit,r=i.directed),r=arguments.length===2&&!Tt(n)?n:r,n=Tt(n)?n:function(){};for(var a=this._private.cy,o=t=wt(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)}}},ei={breadthFirstSearch:$r({bfs:!0}),depthFirstSearch:$r({dfs:!0})};ei.bfs=ei.breadthFirstSearch,ei.dfs=ei.depthFirstSearch;var ti={exports:{}},ni=ti.exports,ri;function ii(){return ri?ti.exports:(ri=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(ni)})(ti),ti.exports)}var ai,oi;function si(){return oi?ai:(oi=1,ai=ii(),ai)}var ci=mn(si()),li=Hr({root:null,weight:function(e){return 1},directed:!1}),ui={dijkstra:function(e){if(!Dt(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=li(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,c=wt(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 ci(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[(wt(e)?p.filter(e)[0]:e[0]).id()]},pathTo:function(e){var t=wt(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)}}}},di={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}},fi=Hr({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),pi={aStar:function(e){var t=this.cy(),n=fi(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 ci(function(e,t){return d[e.id()]-d[t.id()]}),m=new Zr,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}}},mi=Hr({weight:function(e){return 1},directed:!1}),hi={floydWarshall:function(e){for(var t=this.cy(),n=mi(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(wt(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}}}},gi=Hr({weight:function(e){return 1},directed:!1,root:null}),_i={bellmanFord:function(e){var t=this,n=gi(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 Jr,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(wt(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||=(Fr(`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 ee=H[W],G=[ee];G.push(_(ee).edge);for(var te=_(ee).pred;G.indexOf(te)===-1;)G.push(te),G.push(_(te).edge),te=_(te).pred;G=G.slice(G.indexOf(te));for(var ne=G[0].id(),K=0,q=2;q<G.length;q+=2)G[q].id()<ne&&(ne=G[q].id(),K=q);G=G.slice(K).concat(G.slice(0,K)),G.push(G[0]);var J=G.map(function(e){return e.id()}).join(`,`);P.indexOf(J)===-1&&(h.push(s.spawn(G)),P.push(J))}}else break}}return{distanceTo:y,pathTo:b,hasNegativeWeightCycle:m,negativeWeightCycles:h}}},vi=Math.sqrt(2),yi=function(e,t,n){n.length===0&&Nr(`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},bi=function(e,t,n,r){for(;n>r;)t=yi(Math.floor(Math.random()*t.length),e,t),n--;return t},xi={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/vi);if(i<2){Nr(`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=bi(m,c.slice(),i,s),b=y.slice();g(m,h);var x=bi(m,y,s,2),S=bi(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}}},Si=function(e){return{x:e.x,y:e.y}},Ci=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},wi=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Ti=function(e){return{x:e[0],y:e[1]}},Ei=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},Di=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},Oi=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},ki=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]},Ai=function(e,t){return t===0?e:Ai(t,e%t)},ji=function(e){for(var t=e[0],n=0;n<e.length;n++)if(kt(e[n]))n>0&&(t=Ai(t,e[n]));else return 0;return t},Mi=function(e){return Math.PI*e/180},Ni=function(e,t){return Math.atan2(t,e)-Math.PI/2},Pi=Math.log2||function(e){return Math.log(e)/Math.log(2)},Fi=function(e){return e>0?1:e<0?-1:0},Ii=function(e,t){return Math.sqrt(Li(e,t))},Li=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Ri=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},zi=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Bi=function(e,t,n,r){return{x:zi(e.x,t.x,n.x,r),y:zi(e.y,t.y,n.y,r)}},Vi=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=Ii(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}},Hi=function(e,t,n){return Math.max(e,Math.min(n,t))},Ui=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}}},Wi=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Gi=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Ki=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},qi=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},Ji=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},Yi=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=dt(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},Xi=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},Zi=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)},Qi=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},$i=function(e,t){return Qi(e,t.x,t.y)},ea=function(e,t){return Qi(e,t.x1,t.y1)&&Qi(e,t.x2,t.y2)},ta=Math.hypot??function(e,t){return Math.sqrt(e*e+t*t)};function na(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=ta(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 ra(e,t,n,r,i,a){var o=na(xa(e,t,n,r,i),a),s=Ui();return o.forEach(function(e){return qi(s,e.x,e.y)}),s}var ia=function(e,t,n,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:`auto`,c=s===`auto`?Oa(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=ba(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=ba(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=ba(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=ba(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=va(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=va(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=va(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=va(e,t,n,r,D,O,c+o),b.length>0&&b[0]<=D&&b[1]>=O?[b[0],b[1]]:[]},aa=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},oa=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)},sa=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]},ca=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)},la=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=[];ca(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},ua=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},da=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},fa=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 da(e,t,c>0?ma(ha(l,-c)):l)},pa=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 da(e,t,c)},ma=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=ba(n,r,i,a,o,s,c,l,!0);t[u*2]=d[0],t[u*2+1]=d[1]}return t},ha=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},ga=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]},_a=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},va=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]},ya=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ba=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?ya(e,n,o)===o?[o,s]:ya(e,n,i)===i?[i,a]:ya(i,o,n)===n?[n,r]:[]:[]},xa=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},Sa=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?ma(ha(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=ba(e,t,r,i,m,h,g,_),l.length!==0&&c.push(l[0],l[1]);return c},Ca=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=va(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=ba(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},wa=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]]},Ta=function(e,t){var n=Da(e,t);return n=Ea(n),n},Ea=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},Da=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},Oa=function(e,t){return Math.min(e/4,t/4,8)},ka=function(e,t){return Math.min(e/10,t/10,8)},Aa=function(){return 8},ja=function(e,t,n){return[e-2*t+n,2*(t-e),e]},Ma=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Na(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=at(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=at([].concat(ft(n(e)),ft(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 Pa=Hr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Fa={pageRank:function(e){for(var t=Pa(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]}Ri(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)]}}}},Ia=Hr({root:null,weight:function(e){return 1},directed:!1,alpha:0}),La={degreeCentralityNormalized:function(e){e=Ia(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:(wt(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return s===0?0:(wt(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:(wt(e)&&(e=t.filter(e)),f[e.id()]/p)}}},degreeCentrality:function(e){e=Ia(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}}};La.dc=La.degreeCentrality,La.dcn=La.degreeCentralityNormalised=La.degreeCentralityNormalized;var Ra=Hr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),za={closenessCentralityNormalized:function(e){for(var t=Ra(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=wt(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=Ra(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}};za.cc=za.closenessCentrality,za.ccn=za.closenessCentralityNormalised=za.closenessCentralityNormalized;var Ba=Hr({weight:null,directed:!1}),Va={betweennessCentrality:function(e){for(var t=Ba(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 ci(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}};Va.bc=Va.betweennessCentrality;var Ha=Hr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Ua=function(e){return Ha(e)},Wa=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Ga=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},Ka=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}},qa=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},Ja=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=qa(e,r,t);return e},Ya=function(e,t,n){for(var r=Array(t*t),i=0;i<t*t;i++)r[i]=e[i]**+n;return Ka(r,t),r},Xa=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},Za=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},Qa=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},$a=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Qa(e[t],e[n])&&e.splice(n,1);return e},eo=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=Ua(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=Wa(p,i.attributes);l[m*s+h]+=g,l[h*s+m]+=g}Ga(l,s,i.multFactor),Ka(l,s);for(var _=!0,v=0;_&&v<i.maxIterations;)_=!1,u=Ja(l,s,i.expandFactor),l=Ya(u,s,i.inflateFactor),Xa(l,u,c,4)||(_=!0),v++;var y=Za(l,s,t,r);return y=$a(y),y},to={markovClustering:eo,mcl:eo},no=function(e){return e},ro=function(e,t){return Math.abs(t-e)},io=function(e,t,n){return e+ro(t,n)},ao=function(e,t,n){return e+(n-t)**2},oo=function(e){return Math.sqrt(e)},so=function(e,t,n){return Math.max(e,ro(t,n))},co=function(e,t,n,r,i){for(var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:no,o=r,s,c,l=0;l<e;l++)s=t(l),c=n(l),o=i(o,s,c);return a(o)},lo={euclidean:function(e,t,n){return e>=2?co(e,t,n,0,ao,oo):co(e,t,n,0,io)},squaredEuclidean:function(e,t,n){return co(e,t,n,0,ao)},manhattan:function(e,t,n){return co(e,t,n,0,io)},max:function(e,t,n){return co(e,t,n,-1/0,so)}};lo[`squared-euclidean`]=lo.squaredEuclidean,lo.squaredeuclidean=lo.squaredEuclidean;function uo(e,t,n,r,i,a){var o=Tt(e)?e:lo[e]||lo.euclidean;return t===0&&Tt(e)?o(i,a):o(t,n,r,i,a)}var fo=Hr({k:2,m:2,sensitivityThreshold:1e-4,distance:`euclidean`,maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),po=function(e){return fo(e)},mo=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 uo(e,r.length,a,o,s,c)},ho=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},go=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var c=mo(n,e,t[s],r,i);c<a&&(a=c,o=s)}return o},_o=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},vo=function(e,t,n){return Math.abs(t-e)<=n},yo=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},bo=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},xo=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)];bo(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},So=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=mo(`manhattan`,t[i],e,n,`kMedoids`);return r},Co=function(e){var t=this.cy(),n=this.nodes(),r=null,i=po(e),a=Array(i.k),o={},s;i.testMode?typeof i.testCentroids==`number`?(i.testCentroids,s=ho(n,i.k,i.attributes)):s=ht(i.testCentroids)===`object`?i.testCentroids:ho(n,i.k,i.attributes):s=ho(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()]=go(r,s,i.distance,i.attributes,`kMeans`);c=!1;for(var d=0;d<i.k;d++){var f=_o(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,vo(h[_],m[_],i.sensitivityThreshold)||(c=!0)}s[d]=h,a[d]=t.collection(f)}}l++}return a},wo=function(e){var t=this.cy(),n=this.nodes(),r=null,i=po(e),a=Array(i.k),o,s={},c,l=Array(i.k);i.testMode?typeof i.testCentroids==`number`||(o=ht(i.testCentroids)===`object`?i.testCentroids:xo(n,i.k)):o=xo(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()]=go(r,o,i.distance,i.attributes,`kMedoids`);u=!1;for(var p=0;p<o.length;p++){var m=_o(p,n,s);if(m.length!==0){l[p]=So(o[p],m,i.attributes);for(var h=0;h<m.length;h++)c=So(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},To=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}},Eo=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=mo(i.distance,r[d],n[u],i.attributes,`cmeans`),c=mo(i.distance,r[d],n[f],i.attributes,`cmeans`),o+=(s/c)**+l;e[d][u]=1/o}},Do=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},Oo=function(e){for(var t=this.cy(),n=this.nodes(),r=po(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,To(a,n,o,c,r),Eo(o,s,a,n,r),yo(o,s,r.sensitivityThreshold)||(_=!0),v++;return i=Do(n,o,r,t),{clusters:i,degreeOfMembership:o}},ko={kMeans:Co,kMedoids:wo,fuzzyCMeans:Oo,fcm:Oo},Ao=Hr({distance:`euclidean`,linkage:`min`,mode:`threshold`,threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),jo={single:`min`,complete:`max`},Mo=function(e){var t=Ao(e),n=jo[t.linkage];return n!=null&&(t.linkage=n),t},No=function(e,t,n,r,i){for(var a=0,o=1/0,s,c=i.attributes,l=function(e,t){return uo(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},Po=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Po(e.left,t),e.right&&Po(e.right,t)))},Fo=function(e,t){if(!e)return``;if(e.left&&e.right){var n=Fo(e.left,t),r=Fo(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()},Io=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return t===0?(e.left&&Po(e.left,r),e.right&&Po(e.right,i),a=r.concat(i),[n.collection(a)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Po(e.left,r),e.right&&Po(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=Io(e.left,t-1,n)),e.right&&(i=Io(e.right,t-1,n)),r.concat(i))},Lo=function(e){for(var t=this.cy(),n=this.nodes(),r=Mo(e),i=r.attributes,a=function(e,t){return uo(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=No(o,l,s,c,r);h;)h=No(o,l,s,c,r);var g;return r.mode===`dendrogram`?(g=Io(o[0],r.dendrogramDepth,t),r.addDendrogram&&Fo(o[0],t)):(g=Array(o.length),o.forEach(function(e,n){e.key=e.index=null,g[n]=t.collection(e.value)})),g},Ro={hierarchicalClustering:Lo,hca:Lo},zo=Hr({distance:`euclidean`,preference:`median`,damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Bo=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Nr(`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)||Nr(`Preference must be one of [${r.map(function(e){return`'${e}'`}).join(`, `)}] or a number. Got: ${n}`),zo(e)},Vo=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-uo(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},Ho=function(e,t){var n=null;return n=t===`median`?ki(e):t===`mean`?Oi(e):t===`min`?Ei(e):t===`max`?Di(e):t,n},Uo=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},Wo=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},Go=function(e,t,n){for(var r=Wo(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=Wo(e,t,n),r},Ko=function(e){for(var t=this.cy(),n=this.nodes(),r=Bo(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]=Vo(r.distance,n[p],n[m],r.attributes));l=Ho(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=Uo(o,u,d),U=Go(o,c,H),W={},ee=0;ee<H.length;ee++)W[H[ee]]=[];for(var G=0;G<n.length;G++){var te=U[i[n[G].id()]];te!=null&&W[te].push(n[G])}for(var ne=Array(H.length),K=0;K<H.length;K++)ne[K]=t.collection(W[H[K]]);return ne},qo={affinityPropagation:Ko,ap:Ko},Jo=Hr({root:void 0,directed:!1}),Yo={hierholzer:function(e){if(!Dt(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=Jo(e),r=n.root,i=n.directed,a=this,o=!1,s,c,l;r&&(l=wt(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}},Xo=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}},Zo={hopcroftTarjanBiconnected:Xo,htbc:Xo,htb:Xo,hopcroftTarjanBiconnectedComponents:Xo},Qo=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}},$o={tarjanStronglyConnected:Qo,tsc:Qo,tscc:Qo,tarjanStronglyConnectedComponents:Qo},es={};[ei,ui,di,pi,hi,_i,xi,Fa,La,za,Va,to,ko,Ro,qo,Yo,Zo,$o].forEach(function(e){rn(es,e)});var ts=0,ns=1,rs=2,is=function(e){if(!(this instanceof is))return new is(e);this.id=`Thenable/1.0.7`,this.state=ts,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))};is.prototype={fulfill:function(e){return as(this,ns,`fulfillValue`,e)},reject:function(e){return as(this,rs,`rejectReason`,e)},then:function(e,t){var n=this,r=new is;return n.onFulfilled.push(cs(e,r,`fulfill`)),n.onRejected.push(cs(t,r,`reject`)),os(n),r.proxy}};var as=function(e,t,n,r){return e.state===ts&&(e.state=t,e[n]=r,os(e)),e},os=function(e){e.state===ns?ss(e,`onFulfilled`,e.fulfillValue):e.state===rs&&ss(e,`onRejected`,e.rejectReason)},ss=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)}},cs=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}ls(t,i)}}},ls=function(e,t){if(e===t||e.proxy===t){e.reject(TypeError(`cannot resolve promise with itself`));return}var n;if(ht(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`)):ls(e,n))},function(t){r||(r=!0,e.reject(t))})}catch(t){r||e.reject(t)}return}e.fulfill(t)};is.all=function(e){return new is(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)})},is.resolve=function(e){return new is(function(t,n){t(e)})},is.reject=function(e){return new is(function(t,n){n(e)})};var us=typeof Promise<`u`?Promise:is,ds=function(e,t,n){var r=Pt(e),i=!r,a=this._private=rn({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&&Tt(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},fs=ds.prototype;rn(fs,{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),jt(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 us(function(e,t){n.push(function(){e()})})}}),fs.complete=fs.completed,fs.run=fs.play,fs.running=fs.playing;var ps={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=rn({},e,t),Object.keys(e).length===0)return new ds(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=wi(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&&Dt(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 ds(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=rn({},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}}},ms,hs;function gs(){return hs?ms:(hs=1,ms=Array.isArray,ms)}var _s,vs;function ys(){if(vs)return _s;vs=1;var e=gs(),t=Xn(),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 _s=i,_s}var bs,xs;function Ss(){if(xs)return bs;xs=1;var e=Wn(),t=_n(),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 bs=o,bs}var Cs,ws;function Ts(){return ws?Cs:(ws=1,Cs=Cn()[`__core-js_shared__`],Cs)}var Es,Ds;function Os(){if(Ds)return Es;Ds=1;var e=Ts(),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 Es=n,Es}var ks,As;function js(){if(As)return ks;As=1;var e=Function.prototype.toString;function t(t){if(t!=null){try{return e.call(t)}catch{}try{return t+``}catch{}}return``}return ks=t,ks}var Ms,Ns;function Ps(){if(Ns)return Ms;Ns=1;var e=Ss(),t=Os(),n=_n(),r=js(),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 Ms=d,Ms}var Fs,Is;function Ls(){if(Is)return Fs;Is=1;function e(e,t){return e?.[t]}return Fs=e,Fs}var Rs,zs;function Bs(){if(zs)return Rs;zs=1;var e=Ps(),t=Ls();function n(n,r){var i=t(n,r);return e(i)?i:void 0}return Rs=n,Rs}var Vs,Hs;function Us(){return Hs?Vs:(Hs=1,Vs=Bs()(Object,`create`),Vs)}var Ws,Gs;function Ks(){if(Gs)return Ws;Gs=1;var e=Us();function t(){this.__data__=e?e(null):{},this.size=0}return Ws=t,Ws}var qs,Js;function Ys(){if(Js)return qs;Js=1;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}return qs=e,qs}var Xs,Zs;function Qs(){if(Zs)return Xs;Zs=1;var e=Us(),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 Xs=r,Xs}var $s,ec;function tc(){if(ec)return $s;ec=1;var e=Us(),t=Object.prototype.hasOwnProperty;function n(n){var r=this.__data__;return e?r[n]!==void 0:t.call(r,n)}return $s=n,$s}var nc,rc;function ic(){if(rc)return nc;rc=1;var e=Us(),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 nc=n,nc}var ac,oc;function sc(){if(oc)return ac;oc=1;var e=Ks(),t=Ys(),n=Qs(),r=tc(),i=ic();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,ac=a,ac}var cc,lc;function uc(){if(lc)return cc;lc=1;function e(){this.__data__=[],this.size=0}return cc=e,cc}var dc,fc;function pc(){if(fc)return dc;fc=1;function e(e,t){return e===t||e!==e&&t!==t}return dc=e,dc}var mc,hc;function gc(){if(hc)return mc;hc=1;var e=pc();function t(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}return mc=t,mc}var _c,vc;function yc(){if(vc)return _c;vc=1;var e=gc(),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 _c=n,_c}var bc,xc;function Sc(){if(xc)return bc;xc=1;var e=gc();function t(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}return bc=t,bc}var Cc,wc;function Tc(){if(wc)return Cc;wc=1;var e=gc();function t(t){return e(this.__data__,t)>-1}return Cc=t,Cc}var Ec,Dc;function Oc(){if(Dc)return Ec;Dc=1;var e=gc();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 Ec=t,Ec}var kc,Ac;function jc(){if(Ac)return kc;Ac=1;var e=uc(),t=yc(),n=Sc(),r=Tc(),i=Oc();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,kc=a,kc}var Mc,Nc;function Pc(){return Nc?Mc:(Nc=1,Mc=Bs()(Cn(),`Map`),Mc)}var Fc,Ic;function Lc(){if(Ic)return Fc;Ic=1;var e=sc(),t=jc(),n=Pc();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Fc=r,Fc}var Rc,zc;function Bc(){if(zc)return Rc;zc=1;function e(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}return Rc=e,Rc}var Vc,Hc;function Uc(){if(Hc)return Vc;Hc=1;var e=Bc();function t(t,n){var r=t.__data__;return e(n)?r[typeof n==`string`?`string`:`hash`]:r.map}return Vc=t,Vc}var Wc,Gc;function Kc(){if(Gc)return Wc;Gc=1;var e=Uc();function t(t){var n=e(this,t).delete(t);return this.size-=+!!n,n}return Wc=t,Wc}var qc,Jc;function Yc(){if(Jc)return qc;Jc=1;var e=Uc();function t(t){return e(this,t).get(t)}return qc=t,qc}var Xc,Zc;function Qc(){if(Zc)return Xc;Zc=1;var e=Uc();function t(t){return e(this,t).has(t)}return Xc=t,Xc}var $c,el;function tl(){if(el)return $c;el=1;var e=Uc();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 $c=t,$c}var nl,rl;function il(){if(rl)return nl;rl=1;var e=Lc(),t=Kc(),n=Yc(),r=Qc(),i=tl();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,nl=a,nl}var al,ol;function sl(){if(ol)return al;ol=1;var e=il(),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,al=n,al}var cl,ll;function ul(){if(ll)return cl;ll=1;var e=sl(),t=500;function n(n){var r=e(n,function(e){return i.size===t&&i.clear(),e}),i=r.cache;return r}return cl=n,cl}var dl,fl;function pl(){if(fl)return dl;fl=1;var e=ul(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g;return dl=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}),dl}var ml,hl;function gl(){if(hl)return ml;hl=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 ml=e,ml}var _l,vl;function yl(){if(vl)return _l;vl=1;var e=Fn(),t=gl(),n=gs(),r=Xn(),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 _l=o,_l}var bl,xl;function Sl(){if(xl)return bl;xl=1;var e=yl();function t(t){return t==null?``:e(t)}return bl=t,bl}var Cl,wl;function Tl(){if(wl)return Cl;wl=1;var e=gs(),t=ys(),n=pl(),r=Sl();function i(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return Cl=i,Cl}var El,Dl;function Ol(){if(Dl)return El;Dl=1;var e=Xn();function t(t){if(typeof t==`string`||e(t))return t;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n}return El=t,El}var kl,Al;function jl(){if(Al)return kl;Al=1;var e=Tl(),t=Ol();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 kl=n,kl}var Ml,Nl;function Pl(){if(Nl)return Ml;Nl=1;var e=jl();function t(t,n,r){var i=t==null?void 0:e(t,n);return i===void 0?r:i}return Ml=t,Ml}var Fl=mn(Pl()),Il,Ll;function Rl(){if(Ll)return Il;Ll=1;var e=Bs();return Il=function(){try{var t=e(Object,`defineProperty`);return t({},``,{}),t}catch{}}(),Il}var zl,Bl;function Vl(){if(Bl)return zl;Bl=1;var e=Rl();function t(t,n,r){n==`__proto__`&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}return zl=t,zl}var Hl,Ul;function Wl(){if(Ul)return Hl;Ul=1;var e=Vl(),t=pc(),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 Hl=r,Hl}var Gl,Kl;function ql(){if(Kl)return Gl;Kl=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 Gl=n,Gl}var Jl,Yl;function Xl(){if(Yl)return Jl;Yl=1;var e=Wl(),t=Tl(),n=ql(),r=_n(),i=Ol();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 Jl=a,Jl}var Zl,Ql;function $l(){if(Ql)return Zl;Ql=1;var e=Xl();function t(t,n,r){return t==null?t:e(t,n,r)}return Zl=t,Zl}var eu=mn($l()),tu,nu;function ru(){if(nu)return tu;nu=1;function e(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}return tu=e,tu}var iu,au;function ou(){if(au)return iu;au=1;var e=gl(),t=ru(),n=gs(),r=Xn(),i=pl(),a=Ol(),o=Sl();function s(s){return n(s)?e(s,a):r(s)?[s]:t(i(o(s)))}return iu=s,iu}var su=mn(ou()),cu={data:function(e){return e=rn({},{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(wt(t)){var c=t.indexOf(`.`)!==-1&&su(t);if(r.allowGetting&&n===void 0){var l;return s&&(r.beforeGet(s),l=c&&s._private[r.field][t]===void 0?Fl(s._private[r.field],c):s._private[r.field][t]),l}if(r.allowSetting&&n!==void 0&&!r.immutableKeys[t]){var u=ot({},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?eu(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&&Dt(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&&Tt(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=rn({},{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(wt(t)){for(var a=t.split(/\s+/),o=a.length,s=0;s<o;s++){var c=a[s];if(!Lt(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}}},lu={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 us(function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)})}}},uu={};[ps,cu,lu].forEach(function(e){rn(uu,e)});var du={animate:uu.animate(),animation:uu.animation(),animated:uu.animated(),clearQueue:uu.clearQueue(),delay:uu.delay(),delayAnimation:uu.delayAnimation(),stop:uu.stop()},fu={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}Et(e)||(e=(e||``).match(/\S+/g)||[]);for(var r=[],i=new Zr(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){Et(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}};fu.className=fu.classNames=fu.classes;var pu={metaChar:`[\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\\`\\{\\|\\}\\~]`,comparatorOp:`=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=`,boolOp:`\\?|\\!|\\^`,string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Jt,meta:`degree|indegree|outdegree`,separator:`\\s*,\\s*`,descendant:`\\s+`,child:`\\s+>\\s+`,subject:`\\$`,group:`node|edge|\\*`,directedEdge:`\\s+->\\s+`,undirectedEdge:`\\s+<->\\s+`};pu.variable=`(?:[\\w-.]|(?:\\\\`+pu.metaChar+`))+`,pu.className=`(?:[\\w-]|(?:\\\\`+pu.metaChar+`))+`,pu.value=pu.string+`|`+pu.number,pu.id=pu.variable,(function(){for(var e=pu.comparatorOp.split(`|`),t,n=0;n<e.length;n++)t=e[n],pu.comparatorOp+=`|@`+t;for(e=pu.comparatorOp.split(`|`),n=0;n<e.length;n++)t=e[n],!(t.indexOf(`!`)>=0)&&t!==`=`&&(pu.comparatorOp+=`|\\!`+t)})();var mu=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},hu=[{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 nn(e.selector,t.selector)}),gu=function(){for(var e={},t,n=0;n<hu.length;n++)t=hu[n],e[t.selector]=t.matches;return e}(),_u=function(e,t){return gu[e](t)},vu=`(`+hu.map(function(e){return e.selector}).join(`|`)+`)`,yu=function(e){return e.replace(RegExp(`\\\\(`+pu.metaChar+`)`,`g`),function(e,t){return t})},bu=function(e,t,n){e[e.length-1]=n},xu=[{name:`group`,query:!0,regex:`(`+pu.group+`)`,populate:function(e,t,n){var r=dt(n,1)[0];t.checks.push({type:$.GROUP,value:r===`*`?r:r+`s`})}},{name:`state`,query:!0,regex:vu,populate:function(e,t,n){var r=dt(n,1)[0];t.checks.push({type:$.STATE,value:r})}},{name:`id`,query:!0,regex:`\\#(`+pu.id+`)`,populate:function(e,t,n){var r=dt(n,1)[0];t.checks.push({type:$.ID,value:yu(r)})}},{name:`className`,query:!0,regex:`\\.(`+pu.className+`)`,populate:function(e,t,n){var r=dt(n,1)[0];t.checks.push({type:$.CLASS,value:yu(r)})}},{name:`dataExists`,query:!0,regex:`\\[\\s*(`+pu.variable+`)\\s*\\]`,populate:function(e,t,n){var r=dt(n,1)[0];t.checks.push({type:$.DATA_EXIST,field:yu(r)})}},{name:`dataCompare`,query:!0,regex:`\\[\\s*(`+pu.variable+`)\\s*(`+pu.comparatorOp+`)\\s*(`+pu.value+`)\\s*\\]`,populate:function(e,t,n){var r=dt(n,3),i=r[0],a=r[1],o=r[2];o=RegExp(`^`+pu.string+`$`).exec(o)==null?parseFloat(o):o.substring(1,o.length-1),t.checks.push({type:$.DATA_COMPARE,field:yu(i),operator:a,value:o})}},{name:`dataBool`,query:!0,regex:`\\[\\s*(`+pu.boolOp+`)\\s*(`+pu.variable+`)\\s*\\]`,populate:function(e,t,n){var r=dt(n,2),i=r[0],a=r[1];t.checks.push({type:$.DATA_BOOL,field:yu(a),operator:i})}},{name:`metaCompare`,query:!0,regex:`\\[\\[\\s*(`+pu.meta+`)\\s*(`+pu.comparatorOp+`)\\s*(`+pu.number+`)\\s*\\]\\]`,populate:function(e,t,n){var r=dt(n,3),i=r[0],a=r[1],o=r[2];t.checks.push({type:$.META_COMPARE,field:yu(i),operator:a,value:parseFloat(o)})}},{name:`nextQuery`,separator:!0,regex:pu.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++]=mu()}},{name:`directedEdge`,separator:!0,regex:pu.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=mu(),r=t,i=mu();return n.checks.push({type:$.DIRECTED_EDGE,source:r,target:i}),bu(e,t,n),e.edgeCount++,i}var a=mu(),o=t,s=mu();return a.checks.push({type:$.NODE_SOURCE,source:o,target:s}),bu(e,t,a),e.edgeCount++,s}},{name:`undirectedEdge`,separator:!0,regex:pu.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=mu(),r=t,i=mu();return n.checks.push({type:$.UNDIRECTED_EDGE,nodes:[r,i]}),bu(e,t,n),e.edgeCount++,i}var a=mu(),o=t,s=mu();return a.checks.push({type:$.NODE_NEIGHBOR,node:o,neighbor:s}),bu(e,t,a),s}},{name:`child`,separator:!0,regex:pu.child,populate:function(e,t){if(e.currentSubject==null){var n=mu(),r=mu(),i=e[e.length-1];return n.checks.push({type:$.CHILD,parent:i,child:r}),bu(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=mu(),o=e[e.length-1],s=mu(),c=mu(),l=mu(),u=mu();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}),bu(e,o,a),e.currentSubject=c,e.compoundCount++,l}var d=mu(),f=mu(),p=[{type:$.PARENT,parent:d,child:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:`descendant`,separator:!0,regex:pu.descendant,populate:function(e,t){if(e.currentSubject==null){var n=mu(),r=mu(),i=e[e.length-1];return n.checks.push({type:$.DESCENDANT,ancestor:i,descendant:r}),bu(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=mu(),o=e[e.length-1],s=mu(),c=mu(),l=mu(),u=mu();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}),bu(e,o,a),e.currentSubject=c,e.compoundCount++,l}var d=mu(),f=mu(),p=[{type:$.ANCESTOR,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:`subject`,modifier:!0,regex:pu.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Fr("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)}}];xu.forEach(function(e){return e.regexObj=RegExp(`^`+e.regex)});var Su=function(e){for(var t,n,r,i=0;i<xu.length;i++){var a=xu[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}},Cu=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},wu={parse:function(e){var t=this,n=t.inputText=e,r=t[0]=mu();for(t.length=1,n=Cu(n);;){var i=Su(n);if(i.expr==null)return Fr("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 Fr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return Fr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;l.edgeCount===1&&Fr("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 wt(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}},Tu=function(e,t,n){var r,i=wt(e),a=Q(e),o=wt(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},Eu=function(e,t){switch(t){case`?`:return!!e;case`!`:return!e;case`^`:return e===void 0}},Du=function(e){return e!==void 0},Ou=function(e,t){return e.data(t)},ku=function(e,t){return e[t]()},Au=[],ju=function(e,t){return e.checks.every(function(e){return Au[e.type](e,t)})};Au[$.GROUP]=function(e,t){var n=e.value;return n===`*`||n===t.group()},Au[$.STATE]=function(e,t){var n=e.value;return _u(n,t)},Au[$.ID]=function(e,t){var n=e.value;return t.id()===n},Au[$.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)},Au[$.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Tu(ku(t,n),r,i)},Au[$.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Tu(Ou(t,n),r,i)},Au[$.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return Eu(Ou(t,n),r)},Au[$.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,Du(Ou(t,n))},Au[$.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return ju(n,i)&&ju(r,a)||ju(r,i)&&ju(n,a)},Au[$.NODE_NEIGHBOR]=function(e,t){return ju(e.node,t)&&t.neighborhood().some(function(t){return t.isNode()&&ju(e.neighbor,t)})},Au[$.DIRECTED_EDGE]=function(e,t){return ju(e.source,t.source())&&ju(e.target,t.target())},Au[$.NODE_SOURCE]=function(e,t){return ju(e.source,t)&&t.outgoers().some(function(t){return t.isNode()&&ju(e.target,t)})},Au[$.NODE_TARGET]=function(e,t){return ju(e.target,t)&&t.incomers().some(function(t){return t.isNode()&&ju(e.source,t)})},Au[$.CHILD]=function(e,t){return ju(e.child,t)&&ju(e.parent,t.parent())},Au[$.PARENT]=function(e,t){return ju(e.parent,t)&&t.children().some(function(t){return ju(e.child,t)})},Au[$.DESCENDANT]=function(e,t){return ju(e.descendant,t)&&t.ancestors().some(function(t){return ju(e.ancestor,t)})},Au[$.ANCESTOR]=function(e,t){return ju(e.ancestor,t)&&t.descendants().some(function(t){return ju(e.descendant,t)})},Au[$.COMPOUND_SPLIT]=function(e,t){return ju(e.subject,t)&&ju(e.left,t)&&ju(e.right,t)},Au[$.TRUE]=function(){return!0},Au[$.COLLECTION]=function(e,t){return e.value.has(t)},Au[$.FILTER]=function(e,t){var n=e.value;return n(t)};var Mu={matches:function(e){for(var t=this,n=0;n<t.length;n++){var r=t[n];if(ju(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(ju(r,e))return!0}return!1};return t.text()??(n=function(){return!0}),e.filter(n)}},Nu=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||wt(e)&&e.match(/^\s*$/)||(jt(e)?this.addQuery({checks:[{type:$.COLLECTION,value:e.collection()}]}):Tt(e)?this.addQuery({checks:[{type:$.FILTER,value:e}]}):wt(e)?this.parse(e)||(this.invalid=!0):Nr(`A selector must be created from a string; found `))},Pu=Nu.prototype;[wu,Mu].forEach(function(e){return rn(Pu,e)}),Pu.text=function(){return this.inputText},Pu.size=function(){return this.length},Pu.eq=function(e){return this[e]},Pu.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Pu.addQuery=function(e){this[this.length++]=e},Pu.selector=Pu.toString;var Fu={allAre:function(e){var t=new Nu(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new Nu(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())})}};Fu.allAreNeighbours=Fu.allAreNeighbors,Fu.has=Fu.contains,Fu.equal=Fu.equals=Fu.same;var Iu=function(e,t){return function(n,r,i,a){var o=n,s=this,c;if(o==null?c=``:jt(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=yr(c);return d[f]||(d[f]=e.call(s,n,r,i,a))}return e.call(s,n,r,i,a)}},Lu={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:Iu(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 Ru(e,t,n,r){for(var i=[],a=new Zr,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 zu(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)}}Lu.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ru(this,e,t,zu)};function Bu(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}Lu.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ru(this,e,t,Bu)};function Vu(e,t,n){Bu(e,t,n),zu(e,t,n)}Lu.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ru(this,e,t,Vu)},Lu.ancestors=Lu.parents;var Hu=Uu={data:uu.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:uu.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:uu.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:uu.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),rscratch:uu.data({field:`rscratch`,allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:uu.removeData({field:`rscratch`,triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Uu;Hu.attr=Hu.data,Hu.removeAttr=Hu.removeData;var Wu=Uu,Gu={};function Ku(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}}}rn(Gu,{degree:Ku(function(e,t){return t.source().same(t.target())?2:1}),indegree:Ku(function(e,t){return+!!t.target().same(e)}),outdegree:Ku(function(e,t){return+!!t.source().same(e)})});function qu(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}}rn(Gu,{minDegree:qu(`degree`,function(e,t){return e<t}),maxDegree:qu(`degree`,function(e,t){return e>t}),minIndegree:qu(`indegree`,function(e,t){return e<t}),maxIndegree:qu(`indegree`,function(e,t){return e>t}),minOutdegree:qu(`outdegree`,function(e,t){return e<t}),maxOutdegree:qu(`outdegree`,function(e,t){return e>t})}),rn(Gu,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Ju,Yu,Xu=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()}}},Zu={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){Xu(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Ju=Yu={position:uu.data(Zu),silentPosition:uu.data(rn({},Zu,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Xu(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Dt(e))t?this.silentPosition(e):this.position(e);else if(Tt(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(Dt(e)?(r={x:Q(e.x)?e.x:0,y:Q(e.y)?e.y:0},n=t):wt(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 Dt(e)?this.shift(e,!0):wt(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=Dt(e)?e:void 0,s=o!==void 0||t!==void 0&&wt(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(wi(o,i,a)):l.position(e,(t-a[e])/i)}else return o=Ci(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=Dt(e)?e:void 0,a=i!==void 0||t!==void 0&&wt(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}},Ju.modelPosition=Ju.point=Ju.position,Ju.modelPositions=Ju.points=Ju.positions,Ju.renderedPoint=Ju.renderedPosition,Ju.relativePoint=Ju.relativePosition;var Qu=Yu,$u=function(e){switch(e){case`left`:case`right-inside`:return`left`;case`right`:case`left-inside`:return`right`;default:return`center`}},ed=function(e){switch(e){case`top`:case`bottom-inside`:return`top`;case`bottom`:case`top-inside`:return`bottom`;default:return`center`}},td=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`}},nd=rd={},rd;rd.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}},rd.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},rd.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 id=function(e){return e===1/0||e===-1/0?0:e},ad=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)},od=function(e,t){return t==null?e:ad(e,t.x1,t.y1,t.x2,t.y2)},sd=function(e,t,n){return Kr(e,t,n)},cd=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,Ji(u,1),ad(e,u.x1,u.y1,u.x2,u.y2)}}},ld=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=sd(a,`labelWidth`,n),l=sd(a,`labelHeight`,n),u=sd(a,`labelX`,n),d=sd(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($u(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(ed(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?sd(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($u(o.value)){case`left`:B=T;break;case`right`:B=w}switch(ed(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),ee=H(T,E),G=H(T,D);w=Math.min(U.x,W.x,ee.x,G.x),T=Math.max(U.x,W.x,ee.x,G.x),E=Math.min(U.y,W.y,ee.y,G.y),D=Math.max(U.y,W.y,ee.y,G.y)}var te=M+`Rot`,ne=N[te]=N[te]||{};ne.x1=w,ne.y1=E,ne.x2=T,ne.y2=D,ne.w=T-w,ne.h=D-E,ad(e,w,E,T,D),ad(i.labelBounds.all,w,E,T,D)}return e}},ud=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;dd(e,t,n,r,`outside`,r/2)}},dd=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),od(e,s.miterBounds(l,u,d,f,r))):a!=null&&a>0&&Yi(e,[a,a,a,a])}}},fd=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;dd(e,t,n,r,i)}},pd=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=Ui(),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,ad(a,l,d,u,f),r&&ud(a,e),r&&t.includeOutlines&&!i&&ud(a,e),r&&fd(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,ad(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}ad(a,l-T,d-T,u+T,f+T)}}else if(k===`bezier`||k===`unbundled-bezier`||qt(k,`segments`)||qt(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,ad(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,ad(a,l,d,u,f)}}if(r&&t.includeEdges&&c&&(cd(a,e,`mid-source`),cd(a,e,`mid-target`),cd(a,e,`source`),cd(a,e,`target`)),r&&e.pstyle(`ghost`).value===`yes`){var B=e.pstyle(`ghost-offset-x`).pfValue,V=e.pstyle(`ghost-offset-y`).pfValue;ad(a,a.x1+B,a.y1+V,a.x2+B,a.y2+V)}var H=o.bodyBounds=o.bodyBounds||{};Xi(H,a),Yi(H,g),Ji(H,1),r&&(l=a.x1,u=a.x2,d=a.y1,f=a.y2,ad(a,l-C,d-C,u+C,f+C));var U=o.overlayBounds=o.overlayBounds||{};Xi(U,a),Yi(U,g),Ji(U,1);var W=o.labelBounds=o.labelBounds||{};W.all==null?W.all=Ui():Gi(W.all),r&&t.includeLabels&&(t.includeMainLabels&&ld(a,e,null),c&&(t.includeSourceLabels&&ld(a,e,`source`),t.includeTargetLabels&&ld(a,e,`target`)))}return a.x1=id(a.x1),a.y1=id(a.y1),a.x2=id(a.x2),a.y2=id(a.y2),a.w=id(a.x2-a.x1),a.h=id(a.y2-a.y1),a.w>0&&a.h>0&&v&&(Yi(a,g),Ji(a,1)),a},md=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},hd=function(e){var t=function(e){return Math.round(e)};if(e.isEdge()){var n=e.source().position(),r=e.target().position();return vr([t(n.x),t(n.y),t(r.x),t(r.y)])}var i=e.position();return vr([t(i.x),t(i.y)])},gd=function(e,t){var n=e._private,r,i=e.isEdge(),a=(t==null?vd:md(t))===vd;if(n.bbCache==null?(r=pd(e,_d),n.bbCache=r,n.bbCachePosKey=hd(e)):r=n.bbCache,!a){var o=e.isNode();r=Ui(),(t.includeNodes&&o||t.includeEdges&&!o)&&(t.includeOverlays?od(r,n.overlayBounds):od(r,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?od(r,n.labelBounds.all):(t.includeMainLabels&&od(r,n.labelBounds.mainRot),t.includeSourceLabels&&od(r,n.labelBounds.sourceRot),t.includeTargetLabels&&od(r,n.labelBounds.targetRot))),r.w=r.x2-r.x1,r.h=r.y2-r.y1}return r},_d={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},vd=md(_d),yd=Hr(_d);rd.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=Ht(function(e){var t=e._private;return t.bbCache==null||t.styleDirty||t.bbCachePosKey!==hd(e)},function(e){return e.id()});if(n&&this.length===1&&!r(this[0]))e=e===void 0?_d:yd(e),t=gd(this[0],e);else{t=Ui(),e||=_d;var i=yd(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(),od(t,gd(c,i))}}return t.x1=id(t.x1),t.y1=id(t.y1),t.x2=id(t.x2),t.y2=id(t.y2),t.w=id(t.x2-t.x1),t.h=id(t.y2-t.y1),t},rd.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},rd.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)),Dt(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=Wi(this.boundingBox({useCache:!1}));return t.silentPositions(s),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),c},nd.boundingbox=nd.bb=nd.boundingBox,nd.renderedBoundingbox=nd.renderedBoundingBox;var bd=rd,xd=Sd={},Sd,Cd=function(e){e.uppercaseName=Kt(e.name),e.autoName=`auto`+e.uppercaseName,e.labelName=`label`+e.uppercaseName,e.outerName=`outer`+e.uppercaseName,e.uppercaseOuterName=Kt(e.outerName),xd[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}},xd[`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}},xd[`rendered`+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},xd[`rendered`+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Cd({name:`width`}),Cd({name:`height`}),Sd.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},Sd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},Sd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var wd=Sd,Td=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},Ed=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return Ci(t(e),n.zoom(),n.pan())}},Dd=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 Ci(e,i,r)})}},Od={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)}}},kd=function(e){return`rendered`+e[0].toUpperCase()+e.substr(1)},Ad=rn({},Qu,bd,wd,Object.keys(Od).reduce(function(e,t){var n=Od[t],r=kd(t);return e[t]=function(){return Td(this,n.get)},e[r]=n.mult?function(){return Dd(this,n.get)}:function(){return Ed(this,n.get)},e},{})),jd=function(e,t){this.recycle(e,t)};function Md(){return!1}function Nd(){return!0}jd.prototype={instanceString:function(){return`event`},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Md,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Nd:Md):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=Nd;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Nd;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Nd,this.stopPropagation()},isDefaultPrevented:Md,isPropagationStopped:Md,isImmediatePropagationStopped:Md};var Pd=/^([^.]+)(\.(?:[^.]+))?$/,Fd=`.*`,Id={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},Ld=Object.keys(Id),Rd={};function zd(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rd,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ld.length;n++){var r=Ld[n];this[r]=e[r]||Id[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Bd=zd.prototype,Vd=function(e,t,n,r,i,a,o){Tt(r)&&(i=r,r=null),o&&(a=a==null?o:rn({},a,o));for(var s=Et(n)?n:n.split(/\s+/),c=0;c<s.length;c++){var l=s[c];if(!Lt(l)){var u=l.match(Pd);if(u){var d=u[1];if(t(e,l,d,u[2]?u[2]:null,r,i,a)===!1)break}}}},Hd=function(e,t){return e.addEventFields(e.context,t),new jd(t.type,t)},Ud=function(e,t,n){if(It(n)){t(e,n);return}if(Dt(n)){t(e,Hd(e,n));return}for(var r=Et(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!Lt(a)){var o=a.match(Pd);if(o){var s=o[1];t(e,Hd(e,{type:s,namespace:o[2]?o[2]:null,target:e.context}))}}}};Bd.on=Bd.addListener=function(e,t,n,r,i){return Vd(this,function(e,t,n,r,i,a,o){Tt(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})},e,t,n,r,i),this},Bd.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Bd.removeListener=Bd.off=function(e,t,n,r){var i=this;this.emitting!==0&&(this.listeners=Rr(this.listeners));for(var a=this.listeners,o=function(o){var s=a[o];Vd(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},Bd.removeAllListeners=function(){return this.removeListener(`*`)},Bd.emit=Bd.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,Et(t)||(t=[t]),Ud(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===Fd)&&e.eventMatches(e.context,n,a)){var i=[a];t!=null&&Gr(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 Wd={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&&Mt(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()}},Gd=function(e){return wt(e)?new Nu(e):e},Kd={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||=new zd(Wd,t)}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Gd(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=Gd(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=Gd(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=Gd(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}};uu.eventAliasesOn(Kd);var qd={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(wt(e)||jt(e))return new Nu(e).filter(this);if(Tt(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){wt(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(wt(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;wt(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;wt(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(wt(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&&wt(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&&wt(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}}},Jd=qd;Jd.u=Jd[`|`]=Jd[`+`]=Jd.union=Jd.or=Jd.add,Jd[`\\`]=Jd[`!`]=Jd[`-`]=Jd.difference=Jd.relativeComplement=Jd.subtract=Jd.not,Jd.n=Jd[`&`]=Jd[`.`]=Jd.and=Jd.intersection=Jd.intersect,Jd[`^`]=Jd[`(+)`]=Jd[`(-)`]=Jd.symmetricDifference=Jd.symdiff=Jd.xor,Jd.fnFilter=Jd.filterFn=Jd.stdFilter=Jd.filter,Jd.complement=Jd.abscomp=Jd.absoluteComplement;var Yd={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}},Xd=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`?Or: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},Zd={forEach:function(e,t){if(Tt(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(!Tt(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Xd)},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:Or-1}var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}};Zd.each=Zd.forEach,(function(){var e=`undefined`;(typeof Symbol>`u`?`undefined`:ht(Symbol))!=e&&ht(Symbol.iterator)!=e&&(Zd[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return ot({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})})})();var Qd=Hr({nodeDimensionsIncludeLabels:!1}),$d={layoutDimensions:function(e){e=Qd(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=Ht(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=Ui(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);qi(e,i.x,i.y)}return e}(),d=Ht(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}),us.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(rn({},e,{eles:this}))}};$d.createLayout=$d.makeLayout=$d.layout;function ef(e,t,n){var r=n._private,i=r.styleCache=r.styleCache||[],a;return(a=i[e])??(a=i[e]=t(n)),a}function tf(e,t){return e=yr(e),function(n){return ef(e,t,n)}}function nf(e,t){e=yr(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return ef(e,n,t)}}var rf={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(Dt(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify(`style`)}else if(wt(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 af(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 of(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||af(i,r);var s=o.source,c=o.target;return n(s)&&(!a||af(s,n))&&(s===c||n(c)&&(!a||af(c,n)))}}}var sf=tf(`eleTakesUpSpace`,function(e){return e.pstyle(`display`).value===`element`&&e.width()!==0&&(!e.isNode()||e.height()!==0)});rf.takesUpSpace=nf(`takesUpSpace`,of({ok:sf})),rf.interactive=nf(`interactive`,of({ok:tf(`eleInteractive`,function(e){return e.pstyle(`events`).value===`yes`&&e.pstyle(`visibility`).value===`visible`&&sf(e)}),parentOk:tf(`parentInteractive`,function(e){return e.pstyle(`visibility`).value===`visible`&&sf(e)}),edgeOkViaNode:sf})),rf.noninteractive=function(){var e=this[0];if(e)return!e.interactive()},rf.visible=nf(`visible`,of({ok:tf(`eleVisible`,function(e){return e.pstyle(`visibility`).value===`visible`&&e.pstyle(`opacity`).pfValue!==0&&sf(e)}),edgeOkViaNode:sf})),rf.hidden=function(){var e=this[0];if(e)return!e.visible()},rf.isBundledBezier=nf(`isBundledBezier`,function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle(`curve-style`).value===`bezier`&&this.takesUpSpace():!1}),rf.bypass=rf.css=rf.style,rf.renderedCss=rf.renderedStyle,rf.removeBypass=rf.removeCss=rf.removeStyle,rf.pstyle=rf.parsedStyle;var cf={};function lf(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&&Tt(t[0])){var a=t[0];this.on(e.event,a)}else if(t.length===0||t.length===1&&Et(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 uf(e){cf[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]}},cf[e.on]=lf({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),cf[e.off]=lf({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}uf({field:`locked`,overrideField:function(e){return e.cy().autolock()?!0:void 0},on:`lock`,off:`unlock`}),uf({field:`grabbable`,overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:`grabify`,off:`ungrabify`}),uf({field:`selected`,ableField:`selectable`,overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:`select`,off:`unselect`}),uf({field:`selectable`,overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:`selectify`,off:`unselectify`}),cf.deselect=cf.unselect,cf.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},uf({field:`active`,on:`activate`,off:`unactivate`}),uf({field:`pannable`,on:`panify`,off:`unpanify`}),cf.inactive=function(){var e=this[0];if(e)return!e._private.active};var df={},ff=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)}},pf=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)}},mf=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)}};df.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},rn(df,{roots:ff({noIncomingEdges:!0}),leaves:ff({noOutgoingEdges:!0}),outgoers:Iu(pf({outgoing:!0}),`outgoers`),successors:mf({outgoing:!0}),incomers:Iu(pf({incoming:!0}),`incomers`),predecessors:mf({})}),rn(df,{neighborhood:Iu(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)}}),df.neighbourhood=df.neighborhood,df.closedNeighbourhood=df.closedNeighborhood,df.openNeighbourhood=df.openNeighborhood,rn(df,{source:Iu(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},`source`),target:Iu(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},`target`),sources:hf({attr:`source`}),targets:hf({attr:`target`})});function hf(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)}}rn(df,{edgesWith:Iu(gf(),`edgesWith`),edgesTo:Iu(gf({thisIsSrc:!0}),`edgesTo`)});function gf(e){return function(t){var n=[],r=this._private.cy,i=e||{};wt(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)}}rn(df,{connectedEdges:Iu(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:Iu(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:Iu(_f(),`parallelEdges`),codirectedEdges:Iu(_f({codirected:!0}),`codirectedEdges`)});function _f(e){return e=rn({},{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)}}rn(df,{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]}}),df.componentsOf=df.components;var vf=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){Nr(`A collection must have a reference to the core`);return}var i=new Jr,a=!1;if(!t)t=[];else if(t.length>0&&Dt(t[0])&&!Mt(t[0])){a=!0;for(var o=[],s=new Zr,c=0,l=t.length;c<l;c++){var u=t[c];u.data??={};var d=u.data;if(d.id==null)d.id=zr();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var f=new Qr(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 Jr,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()},yf=Qr.prototype=vf.prototype=Object.create(Array.prototype);yf.instanceString=function(){return`collection`},yf.spawn=function(e,t){return new vf(this.cy(),e,t)},yf.spawnSelf=function(){return this.spawn(this)},yf.cy=function(){return this._private.cy},yf.renderer=function(){return this._private.cy.renderer()},yf.element=function(){return this[0]},yf.collection=function(){return Nt(this)?this:new vf(this._private.cy,[this])},yf.unique=function(){return new vf(this._private.cy,this,!0)},yf.hasElementWithId=function(e){return e=``+e,this._private.map.has(e)},yf.getElementById=function(e){e=``+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new vf(t)},yf.$id=yf.getElementById,yf.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},yf.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},yf.indexOfId=function(e){return e=``+e,this._private.map.get(e).index},yf.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(Dt(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:Lr(r.data),position:Lr(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}}},yf.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},yf.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=new Qr(e,this[n].json(),!1);t.push(r)}return new vf(e,t)},yf.copy=yf.clone,yf.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=zr();else if(Q(h.id))h.id=``+h.id;else if(Lt(h.id)||!wt(h.id)){Nr("Can not create element with invalid string ID `"+h.id+"`"),f();continue}else if(r.hasElementWithId(h.id)){Nr("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===``?(Nr("Can not create edge `"+g+"` with unspecified "+C),x=!0):r.hasElementWithId(w)||(Nr("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 Jr,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())Fr(`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 vf(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},yf.removed=function(){var e=this[0];return e&&e._private.removed},yf.inside=function(){var e=this[0];return e&&!e._private.removed},yf.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;Ur(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();Ur(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 vf(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},yf.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},[es,du,fu,Fu,Lu,Wu,Gu,Ad,Kd,qd,Yd,Zd,$d,rf,cf,df].forEach(function(e){rn(yf,e)});var bf={add:function(e){var t,n=this;if(jt(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 vf(n,i)}}else if(Et(e))t=new vf(n,e);else if(Dt(e)&&(Et(e.nodes)||Et(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(Et(p))for(var m=0,h=p.length;m<h;m++){var g=rn({group:f},p[m]);c.push(g)}}t=new vf(n,c)}else t=new Qr(n,e).collection();return t},remove:function(e){if(!jt(e)&&wt(e)){var t=e;e=this.$(t)}return e.remove()}};function xf(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 Sf=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}}(),Cf=function(e,t,n,r){var i=xf(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},wf={linear:function(e,t,n){return e+(t-e)*n},ease:Cf(.25,.1,.25,1),"ease-in":Cf(.42,0,1,1),"ease-out":Cf(0,0,.58,1),"ease-in-out":Cf(.42,0,.58,1),"ease-in-sine":Cf(.47,0,.745,.715),"ease-out-sine":Cf(.39,.575,.565,1),"ease-in-out-sine":Cf(.445,.05,.55,.95),"ease-in-quad":Cf(.55,.085,.68,.53),"ease-out-quad":Cf(.25,.46,.45,.94),"ease-in-out-quad":Cf(.455,.03,.515,.955),"ease-in-cubic":Cf(.55,.055,.675,.19),"ease-out-cubic":Cf(.215,.61,.355,1),"ease-in-out-cubic":Cf(.645,.045,.355,1),"ease-in-quart":Cf(.895,.03,.685,.22),"ease-out-quart":Cf(.165,.84,.44,1),"ease-in-out-quart":Cf(.77,0,.175,1),"ease-in-quint":Cf(.755,.05,.855,.06),"ease-out-quint":Cf(.23,1,.32,1),"ease-in-out-quint":Cf(.86,0,.07,1),"ease-in-expo":Cf(.95,.05,.795,.035),"ease-out-expo":Cf(.19,1,.22,1),"ease-in-out-expo":Cf(1,0,0,1),"ease-in-circ":Cf(.6,.04,.98,.335),"ease-out-circ":Cf(.075,.82,.165,1),"ease-in-out-circ":Cf(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return wf.linear;var r=Sf(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":Cf};function Tf(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 Ef(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!==`%`)?e.pfValue:e.value:e}function Df(e,t,n,r,i){var a=i==null?null:i.type;n<0?n=0:n>1&&(n=1);var o=Ef(e,i),s=Ef(t,i);if(Q(o)&&Q(s))return Tf(a,o,s,n,r);if(Et(o)&&Et(s)){for(var c=[],l=0;l<s.length;l++){var u=o[l],d=s[l];if(u!=null&&d!=null){var f=Tf(a,u,d,n,r);c.push(f)}else c.push(d)}return c}}function Of(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=wf.linear;else{var u=wt(s)?l.parse(`transition-timing-function`,s).value:s,d,f;wt(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=wf[d].apply(null,f)):o.easingImpl=wf[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 _={};kf(h.x,g.x)&&(_.x=Df(h.x,g.x,m,p)),kf(h.y,g.y)&&(_.y=Df(h.y,g.y,m,p)),e.position(_)}var v=o.startPan,y=o.pan,b=a.pan,x=y!=null&&r;x&&(kf(v.x,y.x)&&(b.x=Df(v.x,y.x,m,p)),kf(v.y,y.y)&&(b.y=Df(v.y,y.y,m,p)),e.emit(`pan`));var S=o.startZoom,C=o.zoom,w=C!=null&&r;w&&(kf(S,C)&&(a.zoom=Hi(a.minZoom,Df(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=Df(A,k,m,p,j);l.overrideBypass(e,O,M)}e.emit(`style`)}}return o.progress=m,m}function kf(e,t){return e==null||t==null?!1:!!(Q(e)&&Q(t)||e&&t)}function Af(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function jf(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||Af(t,d,e),Of(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 Mf={animate:uu.animate(),animation:uu.animation(),animated:uu.animated(),clearQueue:uu.clearQueue(),delay:uu.delay(),delayAnimation:uu.delayAnimation(),stop:uu.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&&sr(function(n){jf(n,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(t,n){jf(n,e)},n.beforeRenderPriorities.animations):t()}},Nf={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&&Mt(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}},Pf=function(e){return wt(e)?new Nu(e):e},Ff={createEmitter:function(){var e=this._private;return e.emitter||=new zd(Nf,this),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Pf(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Pf(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Pf(t),n),this},once:function(e,t,n){return this.emitter().one(e,Pf(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}};uu.eventAliasesOn(Ff);var If={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)}};If.jpeg=If.jpg;var Lf={layout:function(e){var t=this;if(e==null){Nr(`Layout options must be specified to make a layout`);return}if(e.name==null){Nr("A `name` must be specified to make a layout");return}var n=e.name,r=t.extension(`layout`,n);if(r==null){Nr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}return new r(rn({},e,{cy:t,eles:wt(e.eles)?t.$(e.eles):e.eles==null?t.$():e.eles}))}};Lf.createLayout=Lf.makeLayout=Lf.layout;var Rf={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)}})}},zf=Hr({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]}),Bf={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){Nr(`Can not initialise: No such renderer \`${e.name}\` found. Did you forget to import it and \`cytoscape.use()\` it?`);return}e.wheelSensitivity!==void 0&&Fr(`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=zf(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)}};Bf.invalidateDimensions=Bf.resize;var Vf={collection:function(e,t){return wt(e)?this.$(e):jt(e)?e.collection():Et(e)?(t||={},new vf(this,e,t.unique,t.removed)):new vf(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}};Vf.elements=Vf.filter=Vf.$;var Hf={},Uf=`t`,Wf=`f`;Hf.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},Hf.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]===Uf,d=t[c]===Uf,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]===Uf&&(v=b.properties[g.name]!=null,v))break}!s[_]&&!v&&(s[_]=!0,o.push(_))}}}return r[i]=o,o},Hf.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+=Uf:n+=Wf}return r=t.getPropertiesDiff(i,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Hf.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]===Uf)for(var s=0;s<o.properties.length;s++){var c=o.properties[s];i[c.name]=c}}return r[t]=i,i},Hf.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}},Hf.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]=[lr,dr]}for(var d=function(e,n){return t.styleKeys[n][0]=pr(e,t.styleKeys[n][0])},f=function(e,n){return t.styleKeys[n][1]=mr(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=[lr,dr],k=0;k<i.length;k++){var A=i[k],j=t.styleKeys[A];O[0]=pr(j[0],O[0]),O[1]=mr(j[1],O[1])}t.styleKey=hr(O[0],O[1]);var M=t.styleKeys;t.labelDimsKey=gr(M.labelDimensions);var N=a(e,[`label`],M.labelDimensions);if(t.labelKey=gr(N),t.labelStyleKey=gr(_r(M.commonLabel,N)),!s){var P=a(e,[`source-label`],M.labelDimensions);t.sourceLabelKey=gr(P),t.sourceLabelStyleKey=gr(_r(M.commonLabel,P));var F=a(e,[`target-label`],M.labelDimensions);t.targetLabelKey=gr(F),t.targetLabelStyleKey=gr(_r(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=gr([L,R,z,B,V,H,U].filter(function(e){return e!=null}).reduce(_r,[lr,dr])),t.hasPie=H!=null&&H[0]!==lr&&H[1]!==dr,t.hasStripe=U!=null&&U[0]!==lr&&U[1]!==dr}return o!==t.styleKey},Hf.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},Hf.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(){Fr("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 Fr("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 Fr("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 Fr("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=Lr(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},Hf.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)}}},Hf.update=function(){this._private.cy.mutableElements().updateStyle()},Hf.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):Et(p.value)&&Et(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 us(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)},Hf.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)},Hf.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)})},Hf.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},Hf.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()})})},Hf.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()})})},Hf.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 Gf={};Gf.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(wt(t)){var u=this.parse(t,n,!0);u&&a.push(u)}else if(Dt(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[Wt(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,Lr(C))||_,r&&(x.next=y.pstyle(C.name))}_&&this.updateStyleHints(y),r&&this.updateTransitions(y,b,o)}return _},Gf.overrideBypass=function(e,t,n){t=Ut(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)}},Gf.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},Gf.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 Kf={};Kf.getEmSizeInPixels=function(){var e=this.containerCss(`font-size`);return e==null?1:parseFloat(e)},Kf.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 qf={};qf.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},qf.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[Wt(a.name)]=o)}return r}},qf.getIndexedStyle=function(e,t,n,r){return e.pstyle(t)[n][r]??e.cy().style().getDefaultProperty(t)[n][0]},qf.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=Et(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 wt(e)?e:``+d(e)}).join(` `):``+d(s)}if(l!=null)return l}return null}},qf.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=Dt(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},qf.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[Ut(s)],u=this.parse(l.name,c);u&&n.push(u)}return n},qf.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]=pr(s,r[0]),r[1]=mr(s,r[1]);else for(o=a.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),r[0]=pr(s,r[0]),r[1]=mr(s,r[1])}return r},qf.getPropertiesHash=qf.getNonDefaultPropertiesHash;var Jf={};Jf.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},Jf.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},Jf.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 Yf={};Yf.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){Fr(`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 Nu(u).invalid){Fr(`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){Fr(`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]){Fr(`Skipping property: Invalid property name in: `+o),c();continue}if(!n.parse(h,g)){Fr(`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},Yf.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var Xf={};(function(){var e=Jt,t=Xt,n=Qt,r=$t,i=en,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)$`,`^(.+)$`];Xf.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 wt(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=Lt(e),r=Lt(t);return n&&!r||!n&&r}},l=Xf.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=[];Xf.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<=Xf.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=[];Xf.stripeBackgroundN=16,j.push({name:`stripe-size`,type:l.sizeMaybePercent}),j.push({name:`stripe-direction`,type:l.axisDirectionPrimary});for(var M=1;M<=Xf.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=Xf.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=Xf.properties=[].concat(h,y,g,_,v,D,m,p,u,d,f,x,S,C,w,k,j,T,E,N,O),I=Xf.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=Xf.propertyGroupNames={};(Xf.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=Xf.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`}];Xf.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}})(),Xf.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Xf.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=rn({"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<=Xf.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<=Xf.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 Xf.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},Xf.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 Zf={};Zf.parse=function(e,t,n,r){var i=this;if(Tt(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=br(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=Lr(l),l&&(l.value=Lr(l.value))),l},Zf.parseImplWarn=function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return!i&&t!=null&&Fr(`The style property \`${e}: ${t}\` is invalid`),i&&(i.name===`width`||i.name===`height`)&&t===`label`&&Fr("The style value of `label` is deprecated for `"+i.name+"`"),i},Zf.parseImpl=function(e,t,n,r){var i=this;e=Ut(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=wt(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(Tt(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 Fr("`"+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+/):Et(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||=wt(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&&wt(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(`^(`+Jt+`)(`+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&&!kt(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:Mi(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):Fr("`"+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=ln(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 Qf=function(e){if(!(this instanceof Qf))return new Qf(e);if(!Pt(e)){Nr(`A style must have a core reference`);return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},$f=Qf.prototype;$f.instanceString=function(){return`style`},$f.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},$f.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},$f.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},$f.selector=function(e){var t=e===`core`?null:new Nu(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},$f.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[Wt(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else t.length===2&&this.cssRule(t[0],t[1]);return this},$f.style=$f.css,$f.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},$f.append=function(e){return Ft(e)?e.appendToStyle(this):Et(e)?this.appendFromJson(e):wt(e)&&this.appendFromString(e),this},Qf.fromJson=function(e,t){var n=new Qf(e);return n.fromJson(t),n},Qf.fromString=function(e,t){return new Qf(e).fromString(t)},[Hf,Gf,Kf,qf,Jf,Yf,Xf,Zf].forEach(function(e){rn($f,e)}),Qf.types=$f.types,Qf.properties=$f.properties,Qf.propertyGroups=$f.propertyGroups,Qf.propertyGroupNames=$f.propertyGroupNames,Qf.propertyGroupKeys=$f.propertyGroupKeys;var ep={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=Ft(e)?e.generateStyle(this):Et(e)?Qf.fromJson(this,e):wt(e)?Qf.fromString(this,e):Qf(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},tp=`single`,np={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??=tp,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(wt(e[0]))return n=e[0],t[n];if(Dt(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:Dt(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(wt(e)){var r=e;e=this.$(r)}else if(zt(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 jt(e)||(e=this.mutableElements());if(!(jt(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:Dt(e)&&(a=e.level,e.position==null?e.renderedPosition!=null&&(i=e.renderedPosition):i=Ci(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),Dt(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(wt(e)){var n=e;e=this.mutableElements().filter(n)}else jt(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}};np.centre=np.center,np.autolockNodes=np.autolock,np.autoungrabifyNodes=np.autoungrabify;var rp={data:uu.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeData:uu.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),scratch:uu.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:uu.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0})};rp.attr=rp.data,rp.removeAttr=rp.removeData;var ip=function(e){var t=this;e=rn({},e);var n=e.container;n&&!At(n)&&At(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=_t!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=rn({name:a?`grid`:`null`},o.layout),o.renderer=rn({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 vf(this),listeners:[],aniEles:new vf(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:Dt(o.pan)&&Q(o.pan.x)?o.pan.x:0,y:Dt(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(Bt))return us.all(e).then(t);t(e)};c.styleEnabled&&t.setStyle([]);var u=rn({},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&&(Dt(e)||Et(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=rn({},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,Tt(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)})},ap=ip.prototype;rn(ap,{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 _t;var e=this._private.container.ownerDocument;return e===void 0||e==null?_t:e.defaultView||_t},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!At(e)&&At(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(rn({},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 Lr(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),i=function(e){return t.getElementById(e.id())};if(Dt(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){Fr(`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(Et(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];Et(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=Lr(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=Lr(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=Lr(_.renderer),g.hideEdgesOnViewport=_.hideEdgesOnViewport,g.textureOnViewport=_.textureOnViewport,g.wheelSensitivity=_.wheelSensitivity,g.motionBlur=_.motionBlur,g.multiClickDebounceTime=_.multiClickDebounceTime,g}}),ap.$id=ap.getElementById,[bf,Mf,Ff,If,Lf,Rf,Bf,Vf,ep,np,rp].forEach(function(e){rn(ap,e)});var op={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}},sp={maximal:!1,acyclic:!1},cp=function(e){return e.scratch(`breadthfirst`)},lp=function(e,t){return e.scratch(`breadthfirst`,t)};function up(e){this.options=rn({},op,sp,e)}up.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=Ui(s?e.boundingBox:structuredClone(t.extent())),l;if(jt(e.roots))l=e.roots;else if(Et(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(wt(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),lp(e,{index:n,depth:t})},b=function(e,t){var n=cp(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}lp(r,{depth:e,index:n})}},T=function(t,r){for(var i=cp(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=cp(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){Fr("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=cp(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=cp(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?tn(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,ee=0;ee<B;ee++)W=Math.max(_[ee].length,W);var G={x:c.x1+c.w/2,y:c.y1+c.h/2},te=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}),ne=Math.max(B===1?0:s?(c.h-e.padding*2-te.h)/(B-1):(c.h-e.padding*2-te.h)/(B+1),M),K=_.reduce(function(e,t){return Math.max(e,t.length)},0),q=function(t){var n=cp(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:G.x+o*Math.cos(l),y:G.y+o*Math.sin(l)}}var u=_[r].length,d=Math.max(u===1?0:s?(c.w-e.padding*2-te.w)/((e.grid?K:u)-1):(c.w-e.padding*2-te.w)/((e.grid?K:u)+1),M);return{x:G.x+(i+1-(u+1)/2)*d,y:G.y+(r+1-(B+1)/2)*ne}},J={downward:0,leftward:90,upward:180,rightward:-90};return Object.keys(J).indexOf(e.direction)===-1&&Nr(`Invalid direction '${e.direction}' specified for breadthfirst layout. Valid values are: ${Object.keys(J).join(`, `)}`),n.nodes().layoutPositions(this,e,function(t){return wr(q(t),c,J[e.direction])}),this};var dp={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 fp(e){this.options=rn({},dp,e)}fp.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=Ui(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 pp={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 mp(e){this.options=rn({},pp,e)}mp.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=Ui(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 hp,gp={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 _p(e){this.options=rn({},gp,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)}_p.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}),hp=!0===e.debug;var r=vp(t,n,e);hp&&xp(r),e.randomize&&Sp(r);var i=cr(),a=function(){wp(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter||(Tp(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=Cp(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?(cr()-i>=e.animationThreshold&&a(),sr(u)):(Lp(r,e),s())};u()}else{for(;l;)l=o(c),c++;Lp(r,e),s()}return this},_p.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit(`layoutstop`),this},_p.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vp=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=Ui(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=Tt(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=Tt(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,k=Tt(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=yp(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},yp=function(e,t,n){var r=bp(e,t,0,n);return 2>r.count?0:r.graph},bp=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=bp(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}},xp,Sp=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)}},Cp=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}}},wp=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=Cp(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one(`layoutready`,n.ready),r.emit({type:`layoutready`,layout:this}))},Tp=function(e,t,n){Ep(e,t),jp(e),Mp(e,t),Np(e),Pp(e)},Ep=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]]];Op(o,c,e,t)}},Dp=function(e){return-e+2*e*Math.random()},Op=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=Dp(o),a=Dp(o));var s=kp(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=Ap(e,i,a),p=Ap(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)}},kp=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},Ap=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},jp=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=Ap(a,c,l),d=Ap(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-=_)}}},Mp=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}}}}},Np=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}}},Pp=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=Fp(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,Ip(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)}},Fp=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},Ip=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 Ip(r,t)}},Lp=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)}}},Rp={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 zp(e){this.options=rn({},Rp,e)}zp.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=Ui(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 Bp={ready:function(){},stop:function(){}};function Vp(e){this.options=rn({},Bp,e)}Vp.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},Vp.prototype.stop=function(){return this};var Hp={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 Up(e){this.options=rn({},Hp,e)}Up.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=Tt(e.positions);function r(t){return e.positions==null?Si(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 Wp={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 Gp(e){this.options=rn({},Wp,e)}Gp.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=Ui(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 Kp=[{name:`breadthfirst`,impl:up},{name:`circle`,impl:fp},{name:`concentric`,impl:mp},{name:`cose`,impl:_p},{name:`grid`,impl:zp},{name:`null`,impl:Vp},{name:`preset`,impl:Up},{name:`random`,impl:Gp}];function qp(e){this.options=e,this.notifications=0}var Jp=function(){},Yp=function(){throw Error(`A headless instance can not render images`)};qp.prototype={recalculateRenderedStyle:Jp,notify:function(){this.notifications++},init:Jp,isHeadless:function(){return!0},png:Yp,jpg:Yp};var Xp={};Xp.arrowShapeWidth=.3,Xp.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){wt(s)&&(s=e[s]),e[r]=rn({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){return da(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:Ar,roughCollide:Ar,draw:Mr,spacing:jr,gap:jr}),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 da(e,t,l)||da(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 da(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 da(e,t,l)||da(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 Zp={};Zp.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]},Zp.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]},Zp.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Zp.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},Zp.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(aa(e,t,b[x],b[x+1],b[x+2],b[x+3],m)&&p>(y=ua(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(oa(e,t,b[x],b[x+1],b[x+2],b[x+3],b[x+4],b[x+5],m)&&p>(y=la(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 Kr(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(da(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(Qi(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},Zp.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=Ui({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 Kr(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&&Na(E,f)&&(o.push(y),T=!0)}!T&&ea(d,w)&&o.push(y)}else if(x===`overlap`&&Zi(d,w)){var D=y.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(Na([{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&&Na(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&&!Qi(d,j.startX,j.startY)||j.endX!=null&&j.endY!=null&&!Qi(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(!$i(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&&(Qi(d,j.startX,j.startY)||Qi(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($i(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=dt(p[U],2),ee=W[0],G=W[1];if(g(V,H,ee,G)){o.push(k),I=!0;break}}if(I)break}}}}}return o};var Qp={};Qp.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,_=zi(g[0],g[2],g[4],.1),v=zi(g[1],g[3],g[5],.1);c=u-_,l=d-v}else c=u-m,l=d-h;t.srcArrowAngle=Ni(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=zi(g[E],g[D],g[O],0),C=zi(g[E+1],g[D+1],g[O+1],0),w=zi(g[E],g[D],g[O],1e-4),T=zi(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=zi(g[E],g[D],g[O],.4999),C=zi(g[E+1],g[D+1],g[O+1],.4999),w=zi(g[E],g[D],g[O],.5),T=zi(g[E+1],g[D+1],g[O+1],.5)}c=w-S,l=T-C}if(t.midtgtArrowAngle=Ni(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=Ni(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,_=zi(g[A-6],g[A-4],g[A-2],.9),v=zi(g[A-5],g[A-3],g[A-1],.9);c=f-_,l=p-v}else c=f-m,l=p-h;t.tgtArrowAngle=Ni(c,l)},Qp.getArrowWidth=Qp.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 $p,em,tm={},nm={},rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm=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)},ym=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},bm=function(e,t,n,r,i){if(e===_m?ym(nm,tm):vm(t,e,tm),vm(t,n,nm),rm=tm.nx*nm.ny-tm.ny*nm.nx,im=tm.nx*nm.nx-tm.ny*-nm.ny,sm=Math.asin(Math.max(-1,Math.min(1,rm))),Math.abs(sm)<1e-6){$p=t.x,em=t.y,lm=dm=0;return}am=1,om=!1,im<0?sm<0?sm=Math.PI+sm:(sm=Math.PI-sm,am=-1,om=!0):sm>0&&(am=-1,om=!0),dm=t.radius===void 0?r:t.radius,cm=sm/2,fm=Math.min(tm.len/2,nm.len/2),i?(um=Math.abs(Math.cos(cm)*dm/Math.sin(cm)),um>fm?(um=fm,lm=Math.abs(um*Math.sin(cm)/Math.cos(cm))):lm=dm):(um=Math.min(fm,dm),lm=Math.abs(um*Math.sin(cm)/Math.cos(cm))),hm=t.x+nm.nx*um,gm=t.y+nm.ny*um,$p=hm-nm.ny*lm*am,em=gm+nm.nx*lm*am,pm=t.x+tm.nx*um,mm=t.y+tm.ny*um,_m=t};function xm(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 Sm(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}:(bm(e,t,n,r,i),{cx:$p,cy:em,radius:lm,startX:pm,startY:mm,stopX:hm,stopY:gm,startAngle:tm.ang+Math.PI/2*am,endAngle:nm.ang-Math.PI/2*am,counterClockwise:om})}var Cm=.01,wm=Math.sqrt(2*Cm),Tm={};Tm.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=dt(this.manualEndptToPx(e.source()[0],o),2),d=u[0],f=u[1],p=dt(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 Fr(`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}},Tm.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)}},Tm.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`)}},Tm.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)]},Tm.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*Cm)),S=Math.max(b,Math.log(l*Cm));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]},Tm.findStraightEdgePoints=function(e){e._private.rscratch.edgeType=`straight`},Tm.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=Fi(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*_)}},Tm.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=Fi(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,ee=Math.abs(E)<=m/2;if(W){var G=(u.y1+u.y2)/2;n.segpts=[u.x1,G,u.x2,G]}else if(ee){var te=(u.x1+u.x2)/2;n.segpts=[te,u.y1,te,u.y2]}else n.segpts=[u.x2,u.y1]}}else if(j){var ne=u.y1+I+(h?f/2*P:0);n.segpts=[u.x1,ne,u.x2,ne]}else{var K=u.x1+I+(h?d/2*P:0);n.segpts=[K,u.y1,K,u.y2]}if(n.isRound){var q=e.pstyle(`taxi-radius`).value,J=e.pstyle(`radius-type`).value[0]===`arc-radius`;n.radii=Array(n.segpts.length/2).fill(q),n.isArcRadius=Array(n.segpts.length/2).fill(J)}},Tm.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=Ii({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=b<y,S=Ii({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)}},Tm.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=zi(t.allpts[r],t.allpts[r+2],t.allpts[r+4],i),t.midY=zi(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(Sm({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}}}}},Tm.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,Fr("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."))},Tm.findEdgeControlPoints=function(e){var t=this;if(e&&e.length!==0){for(var n=this,r=n.cy.hasCompoundNodes(),i=new Jr,a=function(e,t){return[].concat(ft(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`||qt(d,`segments`)||d===`straight`||d===`straight-triangle`||qt(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()});Wr(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`||qt(N,`segments`)||qt(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>=wm||(W=Math.sqrt(Math.max(U*U,Cm)+Math.max(H*H,Cm)));var ee=u.vector={x:U,y:H},G=u.vectorNorm={x:ee.x/W,y:ee.y/W},te={x:-G.y,y:G.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=te,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:-ee.x,y:-ee.y},vectorNorm:{x:-G.x,y:-G.y},vectorNormInverse:{x:-te.x,y:-te.y}}}var ne=F?d:u;M.nodesOverlap=ne.nodesOverlap,M.srcIntn=ne.srcIntn,M.tgtIntn=ne.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,ne,A,P):m===h?t.findLoopPoints(j,ne,A,P):N.endsWith(`segments`)?t.findSegmentsPoints(j,ne):N.endsWith(`taxi`)?t.findTaxiPoints(j,ne):N===`straight`||!P&&u.eles.length%2==1&&A===Math.floor(u.eles.length/2)?t.findStraightEdgePoints(j):t.findBezierPoints(j,ne,A,P,F),t.findEndpoints(j),t.tryToCorrectInvalidPoints(j,ne),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 Em(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}}Tm.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(this.recalculateRenderedStyle(e),t.edgeType===`segments`)return Em(t.segpts)},Tm.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 Em(t.ctrlpts)},Tm.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Dm={};Dm.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)},Dm.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=qt(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,ee=V/2,G=H/2,te=o.pstyle(`text-valign`).value;te=ed(te),te===`top`?W-=G:te===`bottom`&&(W+=G);var ne=o.pstyle(`text-halign`).value;ne=$u(ne),ne===`left`?U-=ee:ne===`right`&&(U+=ee);var K=Sa(P[0],P[1],[U-ee,W-G,U+ee,W-G,U+ee,W+G,U-ee,W+G],c.x,c.y);if(K.length>0){var q=s,J=Li(q,Ti(i)),Y=Li(q,Ti(K)),re=J;Y<J&&(i=K,re=Y),K.length>2&&Li(q,{x:K[2],y:K[3]})<re&&(i=[K[2],K[3]])}}var ie=wa(i,M,r.arrowShapes[l].spacing(e)+d),ae=wa(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=ed(pe),pe===`top`?ue-=fe:pe===`bottom`&&(ue+=fe);var me=a.pstyle(`text-halign`).value;me=$u(me),me===`left`?le-=de:me===`right`&&(le+=de);var he=Sa(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=Li(ge,Ti(i)),ve=Li(ge,Ti(he)),ye=_e;ve<_e&&(i=[he[0],he[1]],ye=ve),he.length>2&&Li(ge,{x:he[2],y:he[3]})<ye&&(i=[he[2],he[3]])}}var be=wa(i,N,r.arrowShapes[u].spacing(e)+f),xe=wa(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))},Dm.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}}},Dm.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 Om={};function km(e,t,n){for(var r=function(e,t,n,r){return zi(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)})}}Om.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)km(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},Om.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Am={};Am.recalculateNodeLabelProjection=function(e){var t=e.pstyle(`label`).strValue;if(!Lt(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 jm=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n*=-1),n},Mm=function(e,t){return jm(t.x-e.x,t.y-e.y)},Nm=function(e,t,n,r){var i=Hi(0,r-.001,1),a=Hi(0,r+.001,1);return Mm(Bi(e,t,n,i),Bi(e,t,n,a))};Am.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){qr(n.rscratch,e,t,r),qr(n.rstyle,e,t,r)};o(`labelX`,null,t.x),o(`labelY`,null,t.y),o(`labelAutoAngle`,null,jm(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=Ii(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=Hi(0,C,1),t=Bi(y.p0,y.p1,y.p2,C),i=Nm(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=Ii(D,O),E=w,w+=T,!(w>=l));A+=2);var j=(l-E)/T;j=Hi(0,j,1),t=Vi(D,O,j),i=Mm(D,O)}o(`labelX`,n,t.x),o(`labelY`,n,t.y),o(`labelAutoAngle`,n,i)}};c(`source`),c(`target`),this.applyLabelDimensions(e)}},Am.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,`source`),this.applyPrefixedLabelDimensions(e,`target`))},Am.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=yr(r,e._private.labelDimsKey);if(Kr(n.rscratch,`prefixedLabelDimsKey`,t)!==i){qr(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=Kr(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;qr(n.rstyle,`labelWidth`,t,f),qr(n.rscratch,`labelWidth`,t,f),qr(n.rstyle,`labelHeight`,t,p),qr(n.rscratch,`labelHeight`,t,p),qr(n.rscratch,`labelLineHeight`,t,d),qr(n.rscratch,`labelActualDescent`,t,a.labelActualDescent)}},Am.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?(qr(n.rscratch,e,t,r),r):Kr(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(`
|
|
@@ -340,4 +340,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
340
340
|
`),[b]),S=(0,y.useRef)(b);S.current=b;let C=(0,y.useRef)(null),w=Je();(0,y.useEffect)(()=>{C.current?.style(SE())},[w]);let T=(0,y.useRef)(l);T.current=l;let E=(0,y.useRef)(u);E.current=u,(0,y.useEffect)(()=>{C.current&&Ke(C.current,l)},[l]);let D=(0,y.useRef)(0),O=(0,y.useRef)(null),[k,A]=(0,y.useState)(!1),[j,M]=(0,y.useState)(null),[N,P]=(0,y.useState)(0);(0,y.useEffect)(()=>{let{rep:n,callbacks:a}=S.current,o=e=>n.get(e)??e,s=e.functions.filter(e=>o(e.id)===e.id),c=new Set(s.map(e=>e.id)),l=new Map;for(let t of e.calls){if(!t.crossFile)continue;let e=n.has(t.from)?t.to:t.from;if(c.has(e)||l.has(e))continue;let r=t.function.path.split(`/`).pop()??t.function.path;l.set(e,`${r} › ${oe(t.function.qualifiedName,void 0,t.function.title).name}`)}for(let e of l.keys())c.add(e);let u=new Set(e.calls.filter(e=>e.from===e.to&&o(e.from)===e.from).map(e=>e.from)),f=new Map;for(let t of e.calls){let e=o(t.from),n=o(t.to);if(e===n||!c.has(e)||!c.has(n))continue;let r=iE(e,n),i=f.get(r);i?i.calls.push(t.id):f.set(r,{from:e,to:n,calls:[t.id]})}let m=e=>(a.get(e)??[]).filter(e=>o(e)!==e).length,h=s.map(e=>{let t=be(e);return t.unnamed?`λ ${t.name}`:t.name}),g=new Map(e.functions.map(e=>[e.id,e.qualifiedName])),v=new Map(e.functions.map(e=>[e.id,e])),y=$T(e).filter(e=>c.has(e.child)&&c.has(e.parent)),b=eE(e),x=e=>{let t=b.get(e);return t===void 0?null:g.get(t)??null},w=new Set(h.filter((e,t)=>h.indexOf(e)!==t)),D=[...s.map((e,t)=>{let n=h[t],r=w.has(n)&&!n.includes(`· line`)?`${n} · line ${e.evidence.span.start.line}`:n,i=m(e.id),a=i>0?`${r} · ${i} λ`:r,o=ye(e.qualifiedName,e.code,e.evidence.span.start.line,x(e.id));return{data:{id:e.id,label:u.has(e.id)?`${a} ↻`:a,kind:`function`,...i>0?{folded:i}:{},...o?{hover:o}:{}},classes:e.qualifiedName===`<module>`?`module`:be(e).unnamed?`unnamed`:``}}),...[...l].map(([e,t])=>({data:{id:e,label:t,kind:`port`},classes:`port`})),...y.map(e=>{let t=g.get(e.parent)??``,n=v.get(e.child),r=n?_e(n.qualifiedName,n.code,n.title)??se(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`:se(t)}. A dotted line shows where a function is written, not a call.`},classes:`inside`}}),...[...f].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 n=new Map;for(let r of e.unresolved){let e=o(r.enclosingFn);if(!c.has(e)||!(t&&p(r))&&r.id!==d)continue;let i=`${e}\u0000${r.expression}\u0000${r.status}`,a=n.get(i);a?a.ids.push(r.id):n.set(i,{fn:e,expression:r.expression,ids:[r.id],status:r.status})}for(let e of n.values()){let t=rE(e.ids[0]),n=e.expression.length>40?`${e.expression.slice(0,39)}…`:e.expression;D.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 k=J_({container:_.current,elements:D,autounselectify:!0,layout:{name:`preset`},minZoom:lE,maxZoom:3,style:SE()});k.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]})}),k.on(`tap`,e=>{e.target===k&&i()}),k.on(`mouseover`,`node, edge`,e=>{let t=e.target.data(`hover`),n=e.renderedPosition??e.target.renderedMidpoint?.()??{x:0,y:0};M(t?{text:t,x:n.x,y:n.y}:null)}),k.on(`mouseout`,`node, edge`,()=>M(null)),k.on(`pan zoom drag remove`,()=>M(null)),k.on(`scrollzoom pinchzoom dragpan`,()=>{O.current=null});let A={w:k.width(),h:k.height()},j=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>{if(C.current!==k)return;k.resize();let e={w:k.width(),h:k.height()};(e.w!==A.w||e.h!==A.h)&&(A=e,O.current?.())});return _.current&&j?.observe(_.current),C.current=k,Ke(k,T.current),k.on(`cxttap`,`node, edge`,e=>{let t=e.target.data(),n=t.kind===`function`?`function`:t.kind===`call`?`edge`:null;if(!n||!_.current)return;let r=_.current.getBoundingClientRect(),i=e.renderedPosition??{x:0,y:0};E.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})}),_.current&&(_.current.veoCy=k),()=>{j?.disconnect(),O.current=null,C.current=null,M(null),k.destroy()}},[e,t,r,i,d,x]);let F=(c?.removed??[]).filter(t=>t.file===e.file.id&&(t.type===`Function`||t.type===`CALLS`)).map(e=>e.id).join(`
|
|
341
341
|
`);(0,y.useEffect)(()=>{let t=C.current;t&&t.batch(()=>{if(t.elements(`.ghost`).remove(),t.elements().removeClass(`diff-added diff-removed diff-changed`),!c)return;let{rep:n}=S.current,r=new Set([...n].filter(([e,t])=>e!==t&&c.byId.has(e)).map(([,e])=>e));t.nodes(`[kind = "function"]`).forEach(e=>{let t=c.byId.get(e.id());t?e.addClass(Xe(t)):r.has(e.id())&&e.addClass(`diff-changed`)}),t.edges(`[kind = "call"]`).forEach(e=>{let t=e.data(`calls`).map(e=>c.byId.get(e)).find(Boolean);t&&e.addClass(Xe(t))});let i=new Set(t.nodes().map(e=>e.id())),a=new Set,o=[];for(let t of c.removed){if(t.type!==`Function`||t.file!==e.file.id||i.has(t.id))continue;let n=t.fact;!m&&n.qualifiedName&&ue(n.qualifiedName)||(a.add(t.id),o.push({data:{id:t.id,label:`${n.qualifiedName??n.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,r={from:t.from===void 0?void 0:n.get(t.from)??t.from,to:t.to===void 0?void 0:n.get(t.to)??t.to},s=e=>!!e&&(i.has(e)||a.has(e));s(r.from)&&s(r.to)&&r.from!==r.to&&o.push({data:{id:`gone:${e.id}`,source:r.from,target:r.to,kind:`ghost-call`,label:``},classes:`diff-removed ghost`})}o.length&&t.add(o)})},[c,e,t,d,x,m]);let I=a&&o?b.rep.get(o)??o:null;return(0,y.useEffect)(()=>{let e=C.current;if(!e)return;e.batch(()=>{if(e.elements().removeClass(`hidden`),a){let t=new Set([...a].map(e=>S.current.rep.get(e)??e)),n=e.nodes().filter(e=>e.data(`kind`)===`function`?!t.has(e.id()):e.incomers(`node`).first().id()!==I);n.addClass(`hidden`),n.connectedEdges().addClass(`hidden`)}});let t=++D.current;if(mE(e).connected.nodes().length<=hE){_E(e),yE(e),O.current=()=>yE(e),T.current&&Ke(e,T.current),A(!1);return}A(!0),qT(gE(e)).then(n=>{t===D.current&&C.current===e&&(_E(e,n),yE(e),O.current=()=>yE(e),T.current&&Ke(e,T.current),A(!1),P(e=>e+1))})},[a,e,t,I,F,d,x]),(0,y.useEffect)(()=>{let t=C.current;if(!t)return;t.batch(()=>{t.elements().removeClass(`picked faded`)}),_.current?.setAttribute(`data-picked`,``);let r=()=>yE(t);if(!n){O.current&&=r;return}let i=n.kind===`site`?t.nodes(`[kind = "site"]`).filter(e=>e.data(`ids`).includes(n.id)):t.getElementById(n.id);if(i.empty()&&n.kind===`call`&&(i=t.edges().filter(e=>(e.data(`calls`)??[]).includes(n.id)),i.empty())){let r=e.calls.find(e=>e.id===n.id);r&&(i=t.getElementById(S.current.rep.get(r.from)??r.from))}if(i.empty()){O.current&&=r;return}_.current?.setAttribute(`data-picked`,`${n.kind}:${n.id}`);let o=i.union(i.nodes().closedNeighborhood()).union(i.edges().connectedNodes());t.batch(()=>{i.addClass(`picked`),a||t.elements().not(o).addClass(`faded`)}),bE(t,i),O.current=()=>{r(),bE(t,i)}},[n,e,t,a,N,d,x]),(0,y.useEffect)(()=>{let e=C.current;e&&e.batch(()=>{e.nodes().removeClass(`answered`),s&&e.nodes().filter(e=>s.has(e.id())).addClass(`answered`)})},[s,e,t,a,d,x]),(0,X.jsxs)(`div`,{className:`graph-wrap`,children:[(0,X.jsx)(`div`,{className:`graph`,ref:_,"data-testid":`graph`,"data-laying-out":k||void 0}),k&&(0,X.jsx)(`div`,{className:`laying-out`,children:`Laying out…`}),j&&(0,X.jsx)(`div`,{className:`graph-hover`,role:`tooltip`,"data-testid":`graph-hover`,style:{left:j.x+12,top:j.y+12},children:j.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`})]})]})]}),(()=>{let e=v?b.callbacks.get(v)??[]:[];return b.callbacks.size>0?(0,X.jsxs)(`div`,{className:`callbacks-bar`,"data-testid":`callbacks-bar`,children:[v&&e.length>0&&!m&&(0,X.jsx)(`button`,{"data-command":`toggle-callbacks`,"data-id":v,"aria-pressed":f.includes(v),onClick:()=>h?.(v),children:f.includes(v)?`Fold its callbacks`:`Show its ${e.length} callback${e.length===1?``:`s`}`}),(0,X.jsxs)(`label`,{className:`toggle small`,children:[(0,X.jsx)(`input`,{type:`checkbox`,"data-command":`all-callbacks`,checked:m,onChange:e=>g?.(e.target.checked)}),`All callbacks`]})]}):null})(),(0,X.jsx)(`button`,{className:`fit`,title:`Fit the graph to the view`,"aria-label":`Fit the graph to the view`,onClick:()=>{let e=C.current;if(!e)return;let t=()=>vE(e,e.elements().not(`.hidden`),!0);t(),O.current=t},children:`Fit`})]})}function SE(){return[{selector:`node`,style:{label:`data(label)`,"font-size":12,"text-valign":`center`,"text-halign":`center`,shape:`round-rectangle`,width:pE,height:22,"background-color":Z(`gray-95`),"border-width":1,"border-color":Z(`blue-62`),color:Z(`gray-26`)}},{selector:`node.module`,style:{"background-color":Z(`gray-95-2`),"border-color":Z(`gray-66`),"font-weight":`bold`}},{selector:`node.unnamed`,style:{"font-style":`italic`,"background-color":Z(`gray-96-7`),"border-color":Z(`purple-66`),"border-style":`dashed`}},{selector:`node.port`,style:{"background-color":Z(`gray-100`),"border-style":`dashed`,"border-color":Z(`blue-63`),color:Z(`gray-45`)}},{selector:`node.site`,style:{"background-color":Z(`gray-100`),"border-style":`dashed`,"border-color":Z(`orange-64`),color:Z(`amber-51`)}},{selector:`node.site.awaiting-link, node.site.external`,style:{"border-color":Z(`gray-68`),color:Z(`gray-57`)}},{selector:`edge`,style:{width:1.5,"curve-style":`bezier`,"target-arrow-shape":`triangle`,"line-color":Z(`blue-72`),"target-arrow-color":Z(`blue-72`),label:`data(label)`,"font-size":10,color:Z(`gray-51`),"text-background-color":Z(`gray-99`),"text-background-opacity":1,"text-background-padding":`2px`}},{selector:`edge.inside`,style:{"line-style":`dotted`,width:1.5,"line-color":Z(`purple-70`),"target-arrow-shape":`none`}},{selector:`edge.site-edge`,style:{"line-style":`dashed`,"line-color":Z(`amber-74`),"target-arrow-color":Z(`amber-74`)}},...Ze(),Ge,{selector:`.hidden`,style:{display:`none`}},{selector:`node.answered`,style:{"border-width":2,"border-color":Z(`amber-73`),"background-color":Z(`amber-97`)}},{selector:`.faded`,style:{opacity:.22}},{selector:`node.picked`,style:{"border-width":2,"border-color":Z(`blue-51`),"background-color":Z(`gray-91`)}},{selector:`edge.picked`,style:{"line-color":Z(`blue-51`),"target-arrow-color":Z(`blue-51`),width:3}}]}var CE=(e,t,n)=>(e.find(e=>e.id===t)?.kept??[]).some(e=>n===e||n.startsWith(`${e}/`)),wE={installed:`installed packages`,packages:`copied packages with their own manifests`,banners:`library banners or versioned names`},TE=3,EE=(e,t)=>`veoflow.librariesLater.${e}.${t}`,DE=(e,t)=>`veoflow.librariesSeen.${e}.${t}`,OE=e=>{try{return localStorage.getItem(e)===`1`}catch{return!1}};function kE({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?OE(EE(e,t.runId)):!1),[f,p]=(0,y.useState)(()=>!t||!OE(DE(e,t.runId)));(0,y.useEffect)(()=>{if(t)try{localStorage.setItem(DE(e,t.runId),`1`)}catch{}},[e,t?.runId]);let m=(t?.sources??[]).flatMap(e=>(e.libraries??[]).filter(t=>!CE(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(EE(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,TE).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:[`(`,wE[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>TE&&(0,X.jsxs)(`button`,{className:`link`,onClick:()=>a(h[TE].source),children:[h.length-TE,` 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 AE=e=>/ looks like .*third-party librar/.test(e);function jE({run:e,quiet:t=!1}){let n=e?.sources??[],r=n.flatMap(e=>(e.notices??[]).filter(e=>!AE(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 ME({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 NE({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]=fS();(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=>_T(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=>_T(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)(jE,{run:n,quiet:!0}),f?.analysis?.outdated.length?(0,X.jsx)(ME,{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:uC(f.completeness)}),(0,X.jsxs)(`small`,{children:[dC(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:[oe(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 PE({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 FE(e,t){if(t.type===`undo`)return L(e);if(t.type===`redo`)return R(e);if(t.type===`load`)return z(t.view)===z(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:I(F(e.present),n).present}:I(e,n)}catch(t){return console.warn(t),e}}var IE=[{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 LE(){let[e,t]=(0,y.useReducer)(FE,void 0,()=>F(H(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),[j,N]=(0,y.useState)(!1),[P,I]=(0,y.useState)(null),[L,R]=(0,y.useState)(null),[B,V]=(0,y.useState)(null),[G,K]=(0,y.useState)([]),[q,J]=(0,y.useState)([]),ie=(0,y.useMemo)(()=>new Set(q.flatMap(e=>[...e.changed,...e.removed].map(t=>`${e.sourceId}:${t}`))),[q]),[ae,se]=(0,y.useState)(`pending`),ce=(0,y.useRef)(!1);ce.current=ae===`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,we]=(0,y.useState)(null),[Ee,De]=(0,y.useReducer)(e=>e+1,0);ne(n.run);let ke=(0,y.useRef)(!0);(0,y.useEffect)(()=>{if(ke.current){ke.current=!1;return}De()},[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??P,Me=VS(n.project,n.compare,Ee),Ne=(0,y.useMemo)(()=>Ye(Me.data),[Me.data]),{groups:Pe}=bS(n.project,je,0,n.source),Fe=(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`),n.grouping!==`declared`&&r(`setGrouping`,{grouping:`declared`}),r(`openGroup`,{group:e.id});case`DEPENDS_ON`:return i(`imports`),n.grouping!==`declared`&&r(`setGrouping`,{grouping:`declared`}),r(`openGroup`,{group:String(e.fact.from)})}t&&(i(`file`),r(`openFile`,{file:t}))},[r,n.tab,n.grouping,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,Ke]=(0,y.useState)(!1),[qe,Z]=(0,y.useState)([]),[Je,Xe]=(0,y.useState)([]),[Ze,Qe]=(0,y.useState)(null),[$e,et]=(0,y.useState)(!1),[tt,nt]=(0,y.useState)(!1),[rt,it]=(0,y.useState)(0),at=(0,y.useRef)(null),ot=(0,y.useRef)(null),[st,ct]=(0,y.useState)(!1),[lt,ut]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(it(0),!Ge)return;let e=Date.now(),t=setInterval(()=>it(Math.round((Date.now()-e)/1e3)),1e3);return()=>clearInterval(t)},[Ge,Be]),(0,y.useEffect)(()=>{Y.settings().then(e=>Qe(e.model),()=>void 0)},[]);let dt=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=`#${z(n)}`,t=JSON.stringify([n.project,n.file,n.selection,n.tab,n.group,n.fileLevel]);if(location.hash!==e){let r=z(H(location.hash.slice(1)))===z(n);dt.current!==null&&dt.current!==t&&!r?window.history.pushState(null,``,e):window.history.replaceState(null,``,e)}dt.current=t},[n]),(0,y.useEffect)(()=>{let e=()=>t({type:`load`,view:H(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 Xe([]);let e=!1;return Y.suggestions(n.project).then(t=>!e&&Xe(t.suggestions),()=>!e&&Xe([])),()=>{e=!0}},[n.project,Ee]),(0,y.useEffect)(()=>{u([]),f({}),ze(null),Ke(!1),Ve(null),wt.current++,ue(``),O(null),A(!1),N(!1),I(null),se(`pending`),R(null),V(null),K([]),J([])},[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),R(n.draft??null),V(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(J([]),!n.project||P===null)return;let e=n.project,t=!1,r=()=>!ce.current&&void Y.stale(e).then(e=>!t&&J(e.committedRun===P?e.sources:[]),()=>void 0);return r(),window.addEventListener(`focus`,r),()=>{t=!0,window.removeEventListener(`focus`,r)}},[n.project,P]);let[ft,pt]=(0,y.useState)([]),mt=(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:ft.find(e=>e.id===n.source)?.name}:null,[n.file,n.tab,n.fileLevel,n.group,n.source,ft]);(0,y.useEffect)(()=>{if(!n.project)return pt([]);let e=!1;return Y.sources(n.project).then(t=>!e&&pt(t.sources.map(e=>({...e,optIn:e.optIn??[]}))),()=>void 0),()=>{e=!0}},[n.project,Ee]),(0,y.useEffect)(()=>{n.source&&ft.length>0&&!ft.some(e=>e.id===n.source)&&t({type:`reset`,name:`scopeSource`,args:{}})},[n.source,ft]);let{data:ht}=jS(n.project,je,g===`project`?null:mt,[],Ee,n.grouping),gt=ht?ht.counts.broken+ht.counts.notAnalyzed+ht.counts.openCalls:null,[_t,vt]=(0,y.useState)(null),yt=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!n.project||!n.file){h(null);return}n.file!==yt.current&&ge(``),yt.current=n.file,h(e=>e&&e.file.id===n.file?e:null),ct(!1);let e=!1,r=n.file;return Y.fileGraph(n.project,r).then(t=>!e&&h(t),r=>{e||te(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)(()=>re(De,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`)&&De();return}e.projectId===n.project&&(e.type===`run.started`?(se(`running`),ue(`Analyzing…`)):e.type===`stage.completed`?ue(`Analyzing…`):e.type===`run.committed`?(J([]),se(`done`),ue(`Analyzed just now`),De()):e.type===`run.failed`&&(se(`failed`),ue(`Analysis failed: ${String(e.error)}`),De()))}),[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 bt=(0,y.useCallback)(e=>r(`select`,e),[r]),xt=(0,y.useCallback)(()=>r(`clearSelection`),[r]),St=(0,y.useCallback)(()=>{_(`file`),r(`showPanel`,{panel:`questions`})},[r]),Ct=async(e,t)=>{if(b(``),!ZE(e)){b(`Enter an absolute path (for example /Users/you/app), not "${e}"`);return}let i=t?ye??n.project:null;try{W(`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))}De()},wt=(0,y.useRef)(0),Tt=(0,y.useRef)(null),Et=async(e,i)=>{if(!n.project)return;W(`ask`,{question:e});let a=++wt.current,o=n.project;Tt.current?.abort();let s=new AbortController;Tt.current=s,t({type:`reset`,name:`showPanel`,args:{panel:`answer`}}),Ke(!0),Ve(e),Z(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!==wt.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),Ke(!1),Ve(null)},Dt=e=>{for(let t of ee(e))r(t.name,t.args);t({type:`reset`,name:`showPanel`,args:{panel:`answer`}})},Ot=()=>{Tt.current?.abort(),wt.current++,Ke(!1),Ve(null)},Q=()=>{n.project&&(W(`analyzeDraft`),me(``),ue(`Analyzing your uncommitted edits as a draft…`),Y.analyzeDraft(n.project).catch(e=>{me(e.message),De()}))},kt=e=>{n.project&&(W(`analyzeFrom`,{from:e}),me(``),ue(`Analyzing again from ${e}…`),Y.analyzeFrom(n.project,e).catch(e=>{me(e.message),De()}))},At=e=>{n.project&&(W(`analyzeDebug`,{until:e}),me(``),ue(`Debug run: analyzing up to ${e}…`),Y.analyzeDebug(n.project,e).catch(e=>{me(e.message),De()}))};(0,y.useEffect)(()=>{if(!n.project)return;let e=!1;return Y.stages(n.project).then(t=>!e&&K(t.pipeline),()=>!e&&K([])),()=>{e=!0}},[n.project]);let[jt,Mt]=(0,y.useState)(null),Nt=(0,y.useCallback)(()=>Mt(null),[]),Pt=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:()=>we({source:e,...t?{path:t}:{}})}),s=e=>({label:`Re-analyze its repository`,command:`analyzeSource`,run:()=>void Ft(e)}),c=e=>({label:`Broken imports in it`,command:`showPanel`,run:()=>{e(),vt(`broken`),r(`showPanel`,{panel:`questions`})}});if(e.kind===`group`&&e.id.startsWith(`area|`)){let t=e.id.slice(5);return{title:String(e.data.label??t).split(`
|
|
342
342
|
`)[0],entries:[{label:`Open`,command:`openArea`,run:()=>r(`openArea`,{area:t})},{label:`Show only its links`,command:`showOnlyLinks`,run:()=>r(`showOnlyLinks`,{id:e.id})}]}}if(e.kind===`group`){let[,t=``,i=``]=e.id.split(`|`);return{title:String(e.data.label??e.id).split(`
|
|
343
|
-
`)[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),.../^(cluster|module|shared):/.test(i)?[]:[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`&&Qt===`graph`?[{label:`Show only its links`,command:`showOnlyLinks`,run:()=>r(`showOnlyLinks`,{id:e.id})}]:[],{label:`Who calls it`,command:`ask`,run:()=>void Et(`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:fw(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,Mt(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 Ft=async e=>{if(n.project){try{await Y.analyzeSource(n.project,e)}catch(e){me(e.message??String(e))}De()}},It=()=>{n.project&&(W(`analyze`),me(``),se(`running`),Y.analyze(n.project).catch(e=>{me(e.message),De()}))},Lt=(0,y.useCallback)(e=>_C(e,{view:n,projects:i.map(e=>({id:e.id,name:e.name})),sources:ft.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:ft.some(e=>e.analysis?.kind===`git`),stages:P===null?[]:G,command:(e,t)=>r(e,t??{}),action:(e,t)=>{e!==`addFolder`&&W(e,t??{}),e===`analyze`?It():e===`analyzeSource`?Ft(String(t?.source)):e===`chooseFiles`?we({source:String(t?.source),...t?.path?{path:String(t.path)}:{}}):e===`analyzeDraft`?Q():e===`analyzeDebug`?At(String(t?.until)):e===`analyzeFrom`?kt(String(t?.from)):e===`addFolder`?ve(!0):e===`openSettings`?et(!0):e===`openProjectSettings`&&Se(t?.tab??`repositories`)}}),[n,i,ft,l,Pe,r]),Rt=m!==null&&m.functions.length>80&&!st,zt=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,Bt=zt&&m?.functions.some(e=>e.id===zt)?zt:null,Vt=n.selection?.kind===`call`?m?.calls.find(e=>e.id===n.selection.id):void 0,Ht=Vt?[Vt.from,Vt.to]:null,Ut=Ht?.join(`|`)??``,Wt=(0,y.useMemo)(()=>Rt&&m?JT(m.functions,new Set(n.unfold),n.allCallbacks,n.selection?.kind===`function`?n.selection.id:null).rep:null,[Rt,m,n.unfold,n.allCallbacks,n.selection]),Gt=(0,y.useMemo)(()=>Rt&&m?nE(m,Bt,Ut?Ut.split(`|`):null,Wt):null,[Rt,m,Bt,Ut,Wt]),Kt=m?m.unresolved.filter(p).length:0,qt=n.selection?.kind===`site`?m?.unresolved.find(e=>e.id===n.selection.id):void 0,Jt=qt&&!(n.showUnresolved&&p(qt))?qt.id:null,Yt=(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]),Xt=Bt?(()=>{let e=m?.functions.find(e=>e.id===Bt);return oe(e?.qualifiedName??``,void 0,e?.title).name})():``,Zt=Bt?new Set((m?.calls??[]).flatMap(e=>e.from===Bt&&e.to!==Bt?[e.to]:e.to===Bt&&e.from!==Bt?[e.from]:[])).size:0,Qt=lt??(m&&m.calls.length===0?`list`:`graph`),$t=n.tab===`file`&&!n.file&&n.panel===`answer`&&(Re!==null||Ge),en=n.tab===`imports`&&P!==null&&l.length>0,tn=(0,X.jsx)(Ie,{answer:Re,busy:Ge,pending:Be,elapsed:rt,modelConfigured:Ze?.configured??!1,selectedId:n.selection?.id??null,wide:tt,onWide:nt,onOpen:Dt,onAsk:(e,t)=>void Et(e,t),onCancel:Ot,onTemplate:e=>ot.current?.prefill(e),onSettings:()=>et(!0),onShowQuestions:e=>{r(`openFile`,{file:e}),_(`file`),t({type:`reset`,name:`showPanel`,args:{panel:`questions`}})}});return(0,X.jsx)(pS.Provider,{value:n.grouping,children:(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:M.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)(qE,{tab:n.tab,reach:n.reach!==null,onTab:e=>r(`showTab`,{tab:e})}),(0,X.jsxs)(`button`,{"data-testid":`add-folder`,className:`quiet`,title:U.addFolder.description,"aria-label":`Add a folder`,onClick:()=>ve(!0),children:[`+`,(0,X.jsx)(`span`,{className:`wide-only`,children:` Add folder`})]}),(0,X.jsx)(Oe,{project:n.project,modelName:Ze?.configured?Ze.model:null,disabled:!n.project||l.length===0,loading:!!n.project&&l.length===0&&!k,suggestions:Je,recent:qe,busy:Ge,onAsk:e=>void Et(e),handle:ot,palette:Lt,onOpenFunction:Fe}),n.project&&(0,X.jsx)(RE,{stage1:ae,message:le,progress:ae===`running`?de.get(n.project)??null:null,...ae!==`running`&&D?.errorCode===`stage-inputs-changed`?{onFullRun:It}:{},latest:D,loading:!!n.project&&!k,...n.project&&ae===`running`?{onCancel:()=>{let e=n.project;le!==`Cancelling…`&&(ue(`Cancelling…`),Y.cancelRun(e).then(()=>{ue(``),De()},e=>ue(`Couldn't cancel: ${e.message}`)))}}:{}}),n.project&&ft.some(e=>e.analysis?.kind===`git`)&&(0,X.jsx)(`button`,{"data-testid":`analyze-draft`,className:`icon`,title:U.analyzeDraft.description,"aria-label":`Analyze uncommitted edits`,onClick:Q,children:`✎`}),n.project&&(0,X.jsx)(`button`,{"data-testid":`reanalyze`,className:`icon`,title:`${U.analyze.description}`,"aria-label":`Analyze again`,onClick:It,children:`↻`}),n.project&&(0,X.jsx)(`button`,{"data-command":`toggle-history`,className:`quiet${n.history?` active`:``}`,"aria-pressed":n.history,title:M.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:U.openProjectSettings.description,onClick:()=>{W(`openProjectSettings`),Se(`repositories`)},children:`Repositories`}),(0,X.jsx)(`button`,{"data-testid":`settings`,className:`icon`,title:U.openSettings.description,"aria-label":`Settings`,ref:at,onClick:()=>{W(`openSettings`),et(!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.startsWith(`area|`)?n.only.split(`|`).slice(2).join(`|`)?`${n.only.split(`|`).slice(2).join(`|`)}/`: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!==P)?(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&&P!==null&&!n.compare&&(0,X.jsx)(`button`,{"data-command":`compare-runs`,"data-testid":`debug-compare`,onClick:()=>r(`compareRuns`,{a:P,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&&q.length>0&&ae!==`running`&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`stale-evidence`,children:[(0,X.jsx)(`span`,{children:$E(q)}),(0,X.jsx)(`button`,{onClick:It,"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)(zE,{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 Ct(e,t),onCancel:()=>{ve(!1),be(null),b(``)},error:v}),xe&&n.project&&(0,X.jsx)(nC,{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=>we({source:e}),onAnalyzeAll:It,onChanged:De,covered:Ce!==null},xe),jt&&(()=>{let e=Pt(jt);return(0,X.jsx)(mC,{title:e.title,entries:e.entries,x:jt.x,y:jt.y,onClose:Nt})})(),Ce!==null&&n.project&&(0,X.jsx)(sC,{project:n.project,only:Ce.source,...Ce.path?{at:Ce.path}:{},files:l,run:D,onAnalyze:()=>{It(),we(null)},onClose:()=>we(null)}),$e&&(0,X.jsx)(PE,{onClose:()=>{et(!1),at.current?.focus()},onSaved:e=>Qe(e)}),!n.project&&(0,X.jsx)(fC,{projects:i,progress:de,loading:!s,onOpen:e=>r(`selectProject`,{project:e}),onCreated:e=>{De(),r(`selectProject`,{project:e}),be(e),ve(!0)},onAddFolder:()=>ve(!0),onDeleted:()=>De()}),n.project&&(0,X.jsxs)(`main`,{className:[tt&&n.panel===`answer`&&!$t?`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 ${en?`groups`:`files`} pane ( [ )`,"aria-label":`Show the ${en?`groups`:`files`} pane`,onClick:()=>T(!1),children:`⟩`})}):en?(0,X.jsx)(NC,{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:Mt,sources:ft,onScope:e=>r(`scopeSource`,e?{source:e}:{}),area:n.area??null}):null,(0,X.jsx)(AT,{hidden:C||en,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:Mt,run:D,onAnalyze:()=>{n.project&&(se(`running`),Y.analyze(n.project).catch(e=>me(e.message)))},sources:ft,scope:n.source,onScope:e=>r(`scopeSource`,e?{source:e}:{})},n.project??``),(0,X.jsxs)(`section`,{className:`center`,children:[(0,X.jsx)(kE,{project:n.project,run:D?.runId===P?D:null,sources:ft,onAnalyze:It,onKept:()=>{_S(),De()},onChooseFiles:e=>we({source:e})},`${n.project}:${P}`),n.project&&n.tab===`reach`&&n.reach&&P!==null?(0,X.jsx)(jw,{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:Mt}):n.project&&n.tab===`reach`&&P===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&&en?(0,X.jsx)(xw,{marks:Ne,only:n.only,onContext:Mt,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,grouping:n.grouping,differences:n.differences,onSetGrouping:e=>r(`setGrouping`,{grouping:e}),onToggleDifferences:()=>r(`toggleDifferences`),reveal:n.reveal,onReveal:(e,t,n)=>r(`revealFile`,n?{file:e,from:t,side:n}:{file:e,from:t}),onResetReveal:()=>r(`resetReveal`),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,onFileFindings:St}):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:Te(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":Qt===`graph`,"data-testid":`show-graph`,onClick:()=>ut(`graph`),children:`Graph`}),(0,X.jsx)(`button`,{"aria-pressed":Qt===`list`,"data-testid":`show-list`,onClick:()=>ut(`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): ${Kt} of the ${m.unresolved.length} unresolved calls here; the rest are imports or built-ins.${ht&&n.file&&g===`file`&&mt?.kind===`file`&&ht.counts.openCalls!==Kt?` Findings lists ${ht.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&&Kt>0,disabled:Kt===0,onChange:()=>r(`toggleUnresolved`)}),`Open questions (`,QE(Kt),`)`]}),m.functions.length>80&&Qt===`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:st,onChange:e=>ct(e.target.checked)}),`Whole file`]})]})]}),m.file.status!==`not_analyzed`&&n.project&&(0,X.jsx)(yw,{project:n.project,file:m.file.id,version:je,onImports:()=>r(`openImportsFile`,{file:m.file.id}),onFindings:St}),Gt&&Qt===`graph`&&(0,X.jsxs)(`p`,{className:`focus-note`,"data-testid":`focus-note`,children:[Bt?Zt===0?`${Xt} calls nothing else in this file, and nothing here calls it. `:`${Xt} and ${Math.min(Zt,Gt.size-1)} of its ${Zt} direct neighbours${Gt.size-1>Zt?`, with some of theirs`:``}. `:Ht?`This call, its two functions and a few of their neighbours. `:`The ${Gt.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:()=>ut(`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:VE(m.file.reason)}):Qt===`graph`?(0,X.jsx)(xE,{marks:Ne,only:n.only,onContext:Mt,graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:bt,onClear:xt,focus:Gt,sitesFor:Bt,answered:Yt,extraSite:Jt,unfold:n.unfold,allCallbacks:n.allCallbacks,onToggleCallbacks:e=>r(`toggleCallbacks`,{fn:e}),onAllCallbacks:e=>r(`setAllCallbacks`,{all:e})}):(0,X.jsx)(BE,{graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:bt,extraSite:Jt,onContext:Mt})]}):n.file?(0,X.jsxs)(`p`,{className:`hint`,"data-testid":`loading-file`,children:[`Loading `,l.find(e=>e.id===n.file)?.path??`the file`,`…`]}):$t?(0,X.jsx)(`div`,{className:`centre-answer`,children:tn}):n.project&&l.length>0?(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(NE,{project:n.project,files:l,run:D?.runId===P?D:null,counts:d,source:n.source??null,sources:ft,onOpen:e=>r(`openFile`,{file:e}),onQuestions:()=>{vt(`open-call`),r(`showPanel`,{panel:`questions`})}})}):n.project&&k&&j&&P!==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)(jE,{run:D?.runId===P?D:null})]}):(0,X.jsx)(`p`,{className:`hint`,children:n.project&&(!k||!j)?`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)(XS,{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:G,onDebug:At,onFrom:kt}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`tabs`,role:`tablist`,children:[(Re||Ge||n.panel===`answer`)&&!$t&&(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:en?`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:mt&&g===`file`?`What the analysis couldn't settle in this ${mt.kind}`:`What the analysis couldn't settle in the project`,onClick:()=>r(`showPanel`,{panel:`questions`}),children:[mt&&g===`file`?`Findings here`:`Findings`,gt===null?``:` (${QE(gt)})`]})]}),n.panel===`answer`&&!$t?tn:n.panel===`evidence`||n.panel===`answer`?(0,X.jsxs)(X.Fragment,{children:[Re&&!$t&&(0,X.jsx)(`button`,{className:`link back`,onClick:()=>t({type:`reset`,name:`showPanel`,args:{panel:`answer`}}),children:`← Back to the answer`}),en&&n.project?(0,X.jsx)(Uw,{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)(HE,{project:n.project,graph:m,changedOnDisk:ie,selection:n.selection,onClear:xt,onSelect:bt,onOpenFunction:e=>r(`select`,{kind:`function`,...e}),onShowImports:()=>r(`showTab`,{tab:`imports`}),sources:ft})]}):n.project&&(0,X.jsx)(MS,{project:n.project,run:je,scope:mt,wholeProject:g===`project`,canScope:mt!==null,counts:ht?.counts??null,showPending:n.showPending,refresh:Ee,onWholeProject:e=>_(e?`project`:`file`),onTogglePending:()=>r(`togglePending`),filter:_t,onFilter:vt,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:()=>{W(`openProjectSettings`,{tab:`license`}),Se(`license`)}})]})})]})]})})}function RE({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?` ${we(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)&&IE.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 zE({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 BE({graph:e,showUnresolved:t,selection:n,onSelect:r,extraSite:i=null,onContext:a}){let o=new Map(e.functions.map(e=>[e.id,be(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=be(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)??XE(e)} → ${o.get(e.to)??XE(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 VE(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 HE({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&&oe(e.qualifiedName,void 0,e.title);return e&&n&&{title:`function ${n.name}`,parent:n.parent,detail:[e.kind===`module`?WE.module:e.kind===`function`?``:WE[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?oe(n.qualifiedName,void 0,n.title).name:e};return e&&{title:`${n(e.from)} calls ${n(e.to)}`,parent:``,detail:`${GE[e.form]??`${e.form} call`} on line ${e.evidence.span.start.line}${e.resolution===`static-exact`?``:`, ${KE[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:JE(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?oe(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-UE+1));return{frame:e,panel:s<=UE?e:{start:{...e.start,line:c},end:{...e.end,line:Math.min(e.end.line,c+UE-1)}},marks:o,focusLine:n.start.line,clipped:s>UE}},[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)(bC,{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)?YE(`${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)(zC,{project:e,graph:t,fn:r.id,onOpen:o,onShowImports:s}),e&&t&&r?.kind===`function`&&(0,X.jsx)(FC,{project:e,fn:r.id,run:t.committedRun,onOpen:o}),e&&r&&r.kind!==`function`&&(0,X.jsx)(Re,{project:e,id:r.id},r.id),_.provenance&&(0,X.jsxs)(`p`,{className:`muted small`,"data-testid":`evidence-provenance`,children:[`Found by `,Ce(_.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)(Rw,{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)(zw,{title:_.title,location:`${E}:${w.start.line}`,snippet:C,marks:v.marks,focusLine:v.focusLine,onClose:()=>{f(!1),h.current?.focus()}})]})}var UE=400,WE={function:`Function`,method:`Method`,arrow:`Arrow function`,constructor:`Constructor`,getter:`Getter`,setter:`Setter`,module:`The file's top-level code`},GE={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`},KE={"static-exact":`resolved exactly`,"static-inferred":`resolved by inference`,"dynamic-only":`seen only at run time`,"runtime-confirmed":`confirmed at run time`};function qE({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 JE(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 YE(e){let t=e.replace(/\\/g,`/`);return encodeURI(t.startsWith(`/`)?t:`/${t}`).replace(/#/g,`%23`).replace(/\?/g,`%3F`)}function XE(e){return`${oe(e.function.qualifiedName,void 0,e.function.title).name} (${e.function.path})`}function ZE(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function QE(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 $E(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)(LE,{})}));
|
|
343
|
+
`)[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),.../^(cluster|module|shared):/.test(i)?[]:[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`&&Qt===`graph`?[{label:`Show only its links`,command:`showOnlyLinks`,run:()=>r(`showOnlyLinks`,{id:e.id})}]:[],{label:`Who calls it`,command:`ask`,run:()=>void Et(`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:fw(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,Mt(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 Ft=async e=>{if(n.project){try{await Y.analyzeSource(n.project,e)}catch(e){me(e.message??String(e))}De()}},It=()=>{n.project&&(W(`analyze`),me(``),se(`running`),Y.analyze(n.project).catch(e=>{me(e.message),De()}))},Lt=(0,y.useCallback)(e=>_C(e,{view:n,projects:i.map(e=>({id:e.id,name:e.name})),sources:ft.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:ft.some(e=>e.analysis?.kind===`git`),stages:P===null?[]:G,command:(e,t)=>r(e,t??{}),action:(e,t)=>{e!==`addFolder`&&W(e,t??{}),e===`analyze`?It():e===`analyzeSource`?Ft(String(t?.source)):e===`chooseFiles`?we({source:String(t?.source),...t?.path?{path:String(t.path)}:{}}):e===`analyzeDraft`?Q():e===`analyzeDebug`?At(String(t?.until)):e===`analyzeFrom`?kt(String(t?.from)):e===`addFolder`?ve(!0):e===`openSettings`?et(!0):e===`openProjectSettings`&&Se(t?.tab??`repositories`)}}),[n,i,ft,l,Pe,r]),Rt=m!==null&&m.functions.length>80&&!st,zt=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,Bt=zt&&m?.functions.some(e=>e.id===zt)?zt:null,Vt=n.selection?.kind===`call`?m?.calls.find(e=>e.id===n.selection.id):void 0,Ht=Vt?[Vt.from,Vt.to]:null,Ut=Ht?.join(`|`)??``,Wt=(0,y.useMemo)(()=>Rt&&m?JT(m.functions,new Set(n.unfold),n.allCallbacks,n.selection?.kind===`function`?n.selection.id:null).rep:null,[Rt,m,n.unfold,n.allCallbacks,n.selection]),Gt=(0,y.useMemo)(()=>Rt&&m?nE(m,Bt,Ut?Ut.split(`|`):null,Wt):null,[Rt,m,Bt,Ut,Wt]),Kt=m?m.unresolved.filter(p).length:0,qt=n.selection?.kind===`site`?m?.unresolved.find(e=>e.id===n.selection.id):void 0,Jt=qt&&!(n.showUnresolved&&p(qt))?qt.id:null,Yt=(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]),Xt=Bt?(()=>{let e=m?.functions.find(e=>e.id===Bt);return oe(e?.qualifiedName??``,void 0,e?.title).name})():``,Zt=Bt?new Set((m?.calls??[]).flatMap(e=>e.from===Bt&&e.to!==Bt?[e.to]:e.to===Bt&&e.from!==Bt?[e.from]:[])).size:0,Qt=lt??(m&&m.calls.length===0?`list`:`graph`),$t=n.tab===`file`&&!n.file&&n.panel===`answer`&&(Re!==null||Ge),en=n.tab===`imports`&&P!==null&&l.length>0,tn=(0,X.jsx)(Ie,{answer:Re,busy:Ge,pending:Be,elapsed:rt,modelConfigured:Ze?.configured??!1,selectedId:n.selection?.id??null,wide:tt,onWide:nt,onOpen:Dt,onAsk:(e,t)=>void Et(e,t),onCancel:Ot,onTemplate:e=>ot.current?.prefill(e),onSettings:()=>et(!0),onShowQuestions:e=>{r(`openFile`,{file:e}),_(`file`),t({type:`reset`,name:`showPanel`,args:{panel:`questions`}})}});return(0,X.jsx)(pS.Provider,{value:n.grouping,children:(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:M.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)(qE,{tab:n.tab,reach:n.reach!==null,onTab:e=>r(`showTab`,{tab:e})}),(0,X.jsxs)(`button`,{"data-testid":`add-folder`,className:`quiet`,title:U.addFolder.description,"aria-label":`Add a folder`,onClick:()=>ve(!0),children:[`+`,(0,X.jsx)(`span`,{className:`wide-only`,children:` Add folder`})]}),(0,X.jsx)(Oe,{project:n.project,modelName:Ze?.configured?Ze.model:null,disabled:!n.project||l.length===0,loading:!!n.project&&l.length===0&&!k,suggestions:Je,recent:qe,busy:Ge,onAsk:e=>void Et(e),handle:ot,palette:Lt,onOpenFunction:Fe}),n.project&&(0,X.jsx)(RE,{stage1:ae,message:le,progress:ae===`running`?de.get(n.project)??null:null,...ae!==`running`&&D?.errorCode===`stage-inputs-changed`?{onFullRun:It}:{},latest:D,loading:!!n.project&&!k,...n.project&&ae===`running`?{onCancel:()=>{let e=n.project;le!==`Cancelling…`&&(ue(`Cancelling…`),Y.cancelRun(e).then(()=>{ue(``),De()},e=>ue(`Couldn't cancel: ${e.message}`)))}}:{}}),n.project&&ft.some(e=>e.analysis?.kind===`git`)&&(0,X.jsx)(`button`,{"data-testid":`analyze-draft`,className:`icon`,title:U.analyzeDraft.description,"aria-label":`Analyze uncommitted edits`,onClick:Q,children:`✎`}),n.project&&(0,X.jsx)(`button`,{"data-testid":`reanalyze`,className:`icon`,title:`${U.analyze.description}`,"aria-label":`Analyze again`,onClick:It,children:`↻`}),n.project&&(0,X.jsx)(`button`,{"data-command":`toggle-history`,className:`quiet${n.history?` active`:``}`,"aria-pressed":n.history,title:M.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:U.openProjectSettings.description,onClick:()=>{W(`openProjectSettings`),Se(`repositories`)},children:`Repositories`}),(0,X.jsx)(`button`,{"data-testid":`settings`,className:`icon`,title:U.openSettings.description,"aria-label":`Settings`,ref:at,onClick:()=>{W(`openSettings`),et(!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.startsWith(`area|`)?n.only.split(`|`).slice(2).join(`|`)?`${n.only.split(`|`).slice(2).join(`|`)}/`: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!==P)?(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&&P!==null&&!n.compare&&(0,X.jsx)(`button`,{"data-command":`compare-runs`,"data-testid":`debug-compare`,onClick:()=>r(`compareRuns`,{a:P,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&&q.length>0&&ae!==`running`&&(0,X.jsxs)(`div`,{className:`notice`,role:`status`,"data-testid":`stale-evidence`,children:[(0,X.jsx)(`span`,{children:$E(q)}),(0,X.jsx)(`button`,{onClick:It,"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)(zE,{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 Ct(e,t),onCancel:()=>{ve(!1),be(null),b(``)},error:v}),xe&&n.project&&(0,X.jsx)(nC,{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=>we({source:e}),onAnalyzeAll:It,onChanged:De,covered:Ce!==null},xe),jt&&(()=>{let e=Pt(jt);return(0,X.jsx)(mC,{title:e.title,entries:e.entries,x:jt.x,y:jt.y,onClose:Nt})})(),Ce!==null&&n.project&&(0,X.jsx)(sC,{project:n.project,only:Ce.source,...Ce.path?{at:Ce.path}:{},files:l,run:D,onAnalyze:()=>{It(),we(null)},onClose:()=>we(null)}),$e&&(0,X.jsx)(PE,{onClose:()=>{et(!1),at.current?.focus()},onSaved:e=>Qe(e)}),!n.project&&(0,X.jsx)(fC,{projects:i,progress:de,loading:!s,onOpen:e=>r(`selectProject`,{project:e}),onCreated:e=>{De(),r(`selectProject`,{project:e}),be(e),ve(!0)},onAddFolder:()=>ve(!0),onDeleted:()=>De()}),n.project&&(0,X.jsxs)(`main`,{className:[tt&&n.panel===`answer`&&!$t?`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 ${en?`groups`:`files`} pane ( [ )`,"aria-label":`Show the ${en?`groups`:`files`} pane`,onClick:()=>T(!1),children:`⟩`})}):en?(0,X.jsx)(NC,{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:Mt,sources:ft,onScope:e=>r(`scopeSource`,e?{source:e}:{}),area:n.area??null}):null,(0,X.jsx)(AT,{hidden:C||en,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:Mt,run:D,onAnalyze:()=>{n.project&&(se(`running`),Y.analyze(n.project).catch(e=>me(e.message)))},sources:ft,scope:n.source,onScope:e=>r(`scopeSource`,e?{source:e}:{})},n.project??``),(0,X.jsxs)(`section`,{className:`center`,children:[(0,X.jsx)(kE,{project:n.project,run:D?.runId===P?D:null,sources:ft,onAnalyze:It,onKept:()=>{_S(),De()},onChooseFiles:e=>we({source:e})},`${n.project}:${P}`),n.project&&n.tab===`reach`&&n.reach&&P!==null?(0,X.jsx)(jw,{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:Mt}):n.project&&n.tab===`reach`&&P===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&&en?(0,X.jsx)(xw,{marks:Ne,only:n.only,onContext:Mt,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,grouping:n.grouping,differences:n.differences,onSetGrouping:e=>r(`setGrouping`,{grouping:e}),onToggleDifferences:()=>r(`toggleDifferences`),reveal:n.reveal,onReveal:(e,t,n)=>r(`revealFile`,n?{file:e,from:t,side:n}:{file:e,from:t}),onResetReveal:()=>r(`resetReveal`),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,onFileFindings:St}):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:Te(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":Qt===`graph`,"data-testid":`show-graph`,onClick:()=>ut(`graph`),children:`Graph`}),(0,X.jsx)(`button`,{"aria-pressed":Qt===`list`,"data-testid":`show-list`,onClick:()=>ut(`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): ${Kt} of the ${m.unresolved.length} unresolved calls here; the rest are imports or built-ins.${ht&&n.file&&g===`file`&&mt?.kind===`file`&&ht.counts.openCalls!==Kt?` Findings lists ${ht.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&&Kt>0,disabled:Kt===0,onChange:()=>r(`toggleUnresolved`)}),`Open questions (`,QE(Kt),`)`]}),m.functions.length>80&&Qt===`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:st,onChange:e=>ct(e.target.checked)}),`Whole file`]})]})]}),m.file.status!==`not_analyzed`&&n.project&&(0,X.jsx)(yw,{project:n.project,file:m.file.id,version:je,onImports:()=>r(`openImportsFile`,{file:m.file.id}),onFindings:St}),Gt&&Qt===`graph`&&(0,X.jsxs)(`p`,{className:`focus-note`,"data-testid":`focus-note`,children:[Bt?Zt===0?`${Xt} calls nothing else in this file, and nothing here calls it. `:`${Xt} and ${Math.min(Zt,Gt.size-1)} of its ${Zt} direct neighbours${Gt.size-1>Zt?`, with some of theirs`:``}. `:Ht?`This call, its two functions and a few of their neighbours. `:`The ${Gt.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:()=>ut(`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:VE(m.file.reason)}):Qt===`graph`?(0,X.jsx)(xE,{marks:Ne,only:n.only,onContext:Mt,graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:bt,onClear:xt,focus:Gt,sitesFor:Bt,answered:Yt,extraSite:Jt,unfold:n.unfold,allCallbacks:n.allCallbacks,onToggleCallbacks:e=>r(`toggleCallbacks`,{fn:e}),onAllCallbacks:e=>r(`setAllCallbacks`,{all:e})}):(0,X.jsx)(BE,{graph:m,showUnresolved:n.showUnresolved,selection:n.selection,onSelect:bt,extraSite:Jt,onContext:Mt})]}):n.file?(0,X.jsxs)(`p`,{className:`hint`,"data-testid":`loading-file`,children:[`Loading `,l.find(e=>e.id===n.file)?.path??`the file`,`…`]}):$t?(0,X.jsx)(`div`,{className:`centre-answer`,children:tn}):n.project&&l.length>0?(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(NE,{project:n.project,files:l,run:D?.runId===P?D:null,counts:d,source:n.source??null,sources:ft,onOpen:e=>r(`openFile`,{file:e}),onQuestions:()=>{vt(`open-call`),r(`showPanel`,{panel:`questions`})}})}):n.project&&k&&j&&P!==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)(jE,{run:D?.runId===P?D:null})]}):(0,X.jsx)(`p`,{className:`hint`,children:n.project&&(!k||!j)?`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)(XS,{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:G,onDebug:At,onFrom:kt}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`tabs`,role:`tablist`,children:[(Re||Ge||n.panel===`answer`)&&!$t&&(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:en?`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:mt&&g===`file`?`What the analysis couldn't settle in this ${mt.kind}`:`What the analysis couldn't settle in the project`,onClick:()=>r(`showPanel`,{panel:`questions`}),children:[mt&&g===`file`?`Findings here`:`Findings`,gt===null?``:` (${QE(gt)})`]})]}),n.panel===`answer`&&!$t?tn:n.panel===`evidence`||n.panel===`answer`?(0,X.jsxs)(X.Fragment,{children:[Re&&!$t&&(0,X.jsx)(`button`,{className:`link back`,onClick:()=>t({type:`reset`,name:`showPanel`,args:{panel:`answer`}}),children:`← Back to the answer`}),en&&n.project?(0,X.jsx)(Uw,{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)(HE,{project:n.project,graph:m,changedOnDisk:ie,selection:n.selection,onClear:xt,onSelect:bt,onOpenFunction:e=>r(`select`,{kind:`function`,...e}),onShowImports:()=>r(`showTab`,{tab:`imports`}),sources:ft})]}):n.project&&(0,X.jsx)(MS,{project:n.project,run:je,scope:mt,wholeProject:g===`project`,canScope:mt!==null,counts:ht?.counts??null,showPending:n.showPending,refresh:Ee,onWholeProject:e=>_(e?`project`:`file`),onTogglePending:()=>r(`togglePending`),filter:_t,onFilter:vt,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:()=>{W(`openProjectSettings`,{tab:`license`}),Se(`license`)}})]})})]})]})})}function RE({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?` ${we(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)&&IE.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 zE({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 BE({graph:e,showUnresolved:t,selection:n,onSelect:r,extraSite:i=null,onContext:a}){let o=new Map(e.functions.map(e=>[e.id,be(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=be(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)??XE(e)} → ${o.get(e.to)??XE(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 VE(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 HE({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&&oe(e.qualifiedName,void 0,e.title);return e&&n&&{title:`function ${n.name}`,parent:n.parent,detail:[e.kind===`module`?WE.module:e.kind===`function`?``:WE[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?oe(n.qualifiedName,void 0,n.title).name:e};return e&&{title:`${n(e.from)} calls ${n(e.to)}`,parent:``,detail:`${GE[e.form]??`${e.form} call`} on line ${e.evidence.span.start.line}${e.resolution===`static-exact`?``:`, ${KE[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:JE(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?oe(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-UE+1));return{frame:e,panel:s<=UE?e:{start:{...e.start,line:c},end:{...e.end,line:Math.min(e.end.line,c+UE-1)}},marks:o,focusLine:n.start.line,clipped:s>UE}},[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)(bC,{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)?YE(`${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)(zC,{project:e,graph:t,fn:r.id,onOpen:o,onShowImports:s}),e&&t&&r?.kind===`function`&&(0,X.jsx)(FC,{project:e,fn:r.id,run:t.committedRun,onOpen:o}),e&&r&&r.kind!==`function`&&(0,X.jsx)(Re,{project:e,id:r.id},r.id),_.provenance&&(0,X.jsxs)(`p`,{className:`muted small`,"data-testid":`evidence-provenance`,children:[`Found by `,Ce(_.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)(Rw,{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)(zw,{title:_.title,location:`${E}:${w.start.line}`,snippet:C,marks:v.marks,focusLine:v.focusLine,onClose:()=>{f(!1),h.current?.focus()}})]})}var UE=400,WE={function:`Function`,method:`Method`,arrow:`Arrow function`,constructor:`Constructor`,getter:`Getter`,setter:`Setter`,module:`The file's top-level code`},GE={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`},KE={"static-exact":`resolved exactly`,"static-inferred":`resolved by inference`,"dynamic-only":`seen only at run time`,"runtime-confirmed":`confirmed at run time`};function qE({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 JE(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`package-symbol`:return`In its package: declared in another file of the same package (Go), which Stage 2 links.`;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 YE(e){let t=e.replace(/\\/g,`/`);return encodeURI(t.startsWith(`/`)?t:`/${t}`).replace(/#/g,`%23`).replace(/\?/g,`%3F`)}function XE(e){return`${oe(e.function.qualifiedName,void 0,e.function.title).name} (${e.function.path})`}function ZE(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function QE(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 $E(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)(LE,{})}));
|