@johnz4021/illuminate 0.5.4 → 0.5.5
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/README.md +4 -0
- package/dist/cli.mjs +15 -4
- package/package.json +1 -1
- package/viewer/assets/{elk.bundled-BIfdAZMH.js → elk.bundled-ClrxtgES.js} +2 -2
- package/viewer/assets/{elk.bundled-BIfdAZMH.js.map → elk.bundled-ClrxtgES.js.map} +1 -1
- package/viewer/assets/{index-Bcn6ZqFw.css → index-DN2wM_Ci.css} +1 -1
- package/viewer/assets/index-DP2A86We.js +71 -0
- package/viewer/assets/index-DP2A86We.js.map +1 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-yqlrfm1R.js +0 -71
- package/viewer/assets/index-yqlrfm1R.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Wj=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zh={exports:{}},Js={},Ah={exports:{}},le={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ii=Symbol.for("react.element"),sv=Symbol.for("react.portal"),lv=Symbol.for("react.fragment"),av=Symbol.for("react.strict_mode"),uv=Symbol.for("react.profiler"),cv=Symbol.for("react.provider"),dv=Symbol.for("react.context"),fv=Symbol.for("react.forward_ref"),hv=Symbol.for("react.suspense"),pv=Symbol.for("react.memo"),mv=Symbol.for("react.lazy"),td=Symbol.iterator;function gv(e){return e===null||typeof e!="object"?null:(e=td&&e[td]||e["@@iterator"],typeof e=="function"?e:null)}var Rh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dh=Object.assign,Oh={};function qr(e,t,n){this.props=e,this.context=t,this.refs=Oh,this.updater=n||Rh}qr.prototype.isReactComponent={};qr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};qr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fh(){}Fh.prototype=qr.prototype;function Iu(e,t,n){this.props=e,this.context=t,this.refs=Oh,this.updater=n||Rh}var Tu=Iu.prototype=new Fh;Tu.constructor=Iu;Dh(Tu,qr.prototype);Tu.isPureReactComponent=!0;var nd=Array.isArray,Hh=Object.prototype.hasOwnProperty,Lu={current:null},Bh={key:!0,ref:!0,__self:!0,__source:!0};function Vh(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Hh.call(t,r)&&!Bh.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:ii,type:e,key:i,ref:s,props:o,_owner:Lu.current}}function yv(e,t){return{$$typeof:ii,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function zu(e){return typeof e=="object"&&e!==null&&e.$$typeof===ii}function vv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var rd=/\/+/g;function Ll(e,t){return typeof e=="object"&&e!==null&&e.key!=null?vv(""+e.key):t.toString(36)}function qi(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ii:case sv:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ll(s,0):r,nd(o)?(n="",e!=null&&(n=e.replace(rd,"$&/")+"/"),qi(o,t,n,"",function(u){return u})):o!=null&&(zu(o)&&(o=yv(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(rd,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",nd(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Ll(i,l);s+=qi(i,t,n,a,o)}else if(a=gv(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Ll(i,l++),s+=qi(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Si(e,t,n){if(e==null)return e;var r=[],o=0;return qi(e,r,"","",function(i){return t.call(n,i,o++)}),r}function xv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ye={current:null},Zi={transition:null},wv={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:Zi,ReactCurrentOwner:Lu};function Wh(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:Si,forEach:function(e,t,n){Si(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Si(e,function(){t++}),t},toArray:function(e){return Si(e,function(t){return t})||[]},only:function(e){if(!zu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=qr;le.Fragment=lv;le.Profiler=uv;le.PureComponent=Iu;le.StrictMode=av;le.Suspense=hv;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wv;le.act=Wh;le.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Dh({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Lu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Hh.call(t,a)&&!Bh.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:ii,type:e.type,key:o,ref:i,props:r,_owner:s}};le.createContext=function(e){return e={$$typeof:dv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:cv,_context:e},e.Consumer=e};le.createElement=Vh;le.createFactory=function(e){var t=Vh.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:fv,render:e}};le.isValidElement=zu;le.lazy=function(e){return{$$typeof:mv,_payload:{_status:-1,_result:e},_init:xv}};le.memo=function(e,t){return{$$typeof:pv,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=Zi.transition;Zi.transition={};try{e()}finally{Zi.transition=t}};le.unstable_act=Wh;le.useCallback=function(e,t){return Ye.current.useCallback(e,t)};le.useContext=function(e){return Ye.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)};le.useEffect=function(e,t){return Ye.current.useEffect(e,t)};le.useId=function(){return Ye.current.useId()};le.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)};le.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Ye.current.useMemo(e,t)};le.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)};le.useRef=function(e){return Ye.current.useRef(e)};le.useState=function(e){return Ye.current.useState(e)};le.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)};le.useTransition=function(){return Ye.current.useTransition()};le.version="18.3.1";Ah.exports=le;var b=Ah.exports;const kv=Lh(b);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Sv=b,Nv=Symbol.for("react.element"),Ev=Symbol.for("react.fragment"),_v=Object.prototype.hasOwnProperty,Cv=Sv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jv={key:!0,ref:!0,__self:!0,__source:!0};function Uh(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_v.call(t,r)&&!jv.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Nv,type:e,key:i,ref:s,props:o,_owner:Cv.current}}Js.Fragment=Ev;Js.jsx=Uh;Js.jsxs=Uh;zh.exports=Js;var h=zh.exports,Yh={exports:{}},ct={},Xh={exports:{}},Kh={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(P,M){var z=P.length;P.push(M);e:for(;0<z;){var O=z-1>>>1,Y=P[O];if(0<o(Y,M))P[O]=M,P[z]=Y,z=O;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var M=P[0],z=P.pop();if(z!==M){P[0]=z;e:for(var O=0,Y=P.length,ne=Y>>>1;O<ne;){var B=2*(O+1)-1,F=P[B],Z=B+1,q=P[Z];if(0>o(F,z))Z<Y&&0>o(q,F)?(P[O]=q,P[Z]=z,O=Z):(P[O]=F,P[B]=z,O=B);else if(Z<Y&&0>o(q,z))P[O]=q,P[Z]=z,O=Z;else break e}}return M}function o(P,M){var z=P.sortIndex-M.sortIndex;return z!==0?z:P.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,p=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(P){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=P)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function w(P){if(x=!1,m(P),!y)if(n(a)!==null)y=!0,L(_);else{var M=n(u);M!==null&&A(w,M.startTime-P)}}function _(P,M){y=!1,x&&(x=!1,g(j),j=-1),p=!0;var z=f;try{for(m(M),d=n(a);d!==null&&(!(d.expirationTime>M)||P&&!D());){var O=d.callback;if(typeof O=="function"){d.callback=null,f=d.priorityLevel;var Y=O(d.expirationTime<=M);M=e.unstable_now(),typeof Y=="function"?d.callback=Y:d===n(a)&&r(a),m(M)}else r(a);d=n(a)}if(d!==null)var ne=!0;else{var B=n(u);B!==null&&A(w,B.startTime-M),ne=!1}return ne}finally{d=null,f=z,p=!1}}var S=!1,C=null,j=-1,I=5,R=-1;function D(){return!(e.unstable_now()-R<I)}function W(){if(C!==null){var P=e.unstable_now();R=P;var M=!0;try{M=C(!0,P)}finally{M?H():(S=!1,C=null)}}else S=!1}var H;if(typeof v=="function")H=function(){v(W)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,T=N.port2;N.port1.onmessage=W,H=function(){T.postMessage(null)}}else H=function(){k(W,0)};function L(P){C=P,S||(S=!0,H())}function A(P,M){j=k(function(){P(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,L(_))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var z=f;f=M;try{return P()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,M){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=f;f=P;try{return M()}finally{f=z}},e.unstable_scheduleCallback=function(P,M,z){var O=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?O+z:O):z=O,P){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,P={id:c++,callback:M,priorityLevel:P,startTime:z,expirationTime:Y,sortIndex:-1},z>O?(P.sortIndex=z,t(u,P),n(a)===null&&P===n(u)&&(x?(g(j),j=-1):x=!0,A(w,z-O))):(P.sortIndex=Y,t(a,P),y||p||(y=!0,L(_))),P},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(P){var M=f;return function(){var z=f;f=M;try{return P.apply(this,arguments)}finally{f=z}}}})(Kh);Xh.exports=Kh;var Mv=Xh.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var $v=b,at=Mv;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Gh=new Set,bo={};function ir(e,t){zr(e,t),zr(e+"Capture",t)}function zr(e,t){for(bo[e]=t,e=0;e<t.length;e++)Gh.add(t[e])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wa=Object.prototype.hasOwnProperty,bv=/^[: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]*$/,od={},id={};function Pv(e){return wa.call(id,e)?!0:wa.call(od,e)?!1:bv.test(e)?id[e]=!0:(od[e]=!0,!1)}function Iv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Tv(e,t,n,r){if(t===null||typeof t>"u"||Iv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Au=/[\-:]([a-z])/g;function Ru(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Au,Ru);Ae[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Au,Ru);Ae[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Au,Ru);Ae[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Du(e,t,n,r){var o=Ae.hasOwnProperty(t)?Ae[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Tv(t,n,o,r)&&(n=null),r||o===null?Pv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var an=$v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ni=Symbol.for("react.element"),pr=Symbol.for("react.portal"),mr=Symbol.for("react.fragment"),Ou=Symbol.for("react.strict_mode"),ka=Symbol.for("react.profiler"),Qh=Symbol.for("react.provider"),qh=Symbol.for("react.context"),Fu=Symbol.for("react.forward_ref"),Sa=Symbol.for("react.suspense"),Na=Symbol.for("react.suspense_list"),Hu=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),Zh=Symbol.for("react.offscreen"),sd=Symbol.iterator;function eo(e){return e===null||typeof e!="object"?null:(e=sd&&e[sd]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,zl;function co(e){if(zl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zl=t&&t[1]||""}return`
|
|
34
|
+
`+zl+e}var Al=!1;function Rl(e,t){if(!e||Al)return"";Al=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{Al=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?co(e):""}function Lv(e){switch(e.tag){case 5:return co(e.type);case 16:return co("Lazy");case 13:return co("Suspense");case 19:return co("SuspenseList");case 0:case 2:case 15:return e=Rl(e.type,!1),e;case 11:return e=Rl(e.type.render,!1),e;case 1:return e=Rl(e.type,!0),e;default:return""}}function Ea(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case mr:return"Fragment";case pr:return"Portal";case ka:return"Profiler";case Ou:return"StrictMode";case Sa:return"Suspense";case Na:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qh:return(e.displayName||"Context")+".Consumer";case Qh:return(e._context.displayName||"Context")+".Provider";case Fu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Hu:return t=e.displayName||null,t!==null?t:Ea(e.type)||"Memo";case fn:t=e._payload,e=e._init;try{return Ea(e(t))}catch{}}return null}function zv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ea(t);case 8:return t===Ou?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Av(e){var t=Jh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ei(e){e._valueTracker||(e._valueTracker=Av(e))}function ep(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Jh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ms(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _a(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ld(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$n(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function tp(e,t){t=t.checked,t!=null&&Du(e,"checked",t,!1)}function Ca(e,t){tp(e,t);var n=$n(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ja(e,t.type,n):t.hasOwnProperty("defaultValue")&&ja(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ad(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ja(e,t,n){(t!=="number"||ms(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var fo=Array.isArray;function jr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$n(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ma(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ud(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(fo(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$n(n)}}function np(e,t){var n=$n(t.value),r=$n(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function cd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function rp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $a(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?rp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _i,op=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_i=_i||document.createElement("div"),_i.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_i.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rv=["Webkit","ms","Moz","O"];Object.keys(vo).forEach(function(e){Rv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vo[t]=vo[e]})});function ip(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||vo.hasOwnProperty(e)&&vo[e]?(""+t).trim():t+"px"}function sp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=ip(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Dv=we({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ba(e,t){if(t){if(Dv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Pa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ia=null;function Bu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ta=null,Mr=null,$r=null;function dd(e){if(e=ai(e)){if(typeof Ta!="function")throw Error(J(280));var t=e.stateNode;t&&(t=ol(t),Ta(e.stateNode,e.type,t))}}function lp(e){Mr?$r?$r.push(e):$r=[e]:Mr=e}function ap(){if(Mr){var e=Mr,t=$r;if($r=Mr=null,dd(e),t)for(e=0;e<t.length;e++)dd(t[e])}}function up(e,t){return e(t)}function cp(){}var Dl=!1;function dp(e,t,n){if(Dl)return e(t,n);Dl=!0;try{return up(e,t,n)}finally{Dl=!1,(Mr!==null||$r!==null)&&(cp(),ap())}}function Io(e,t){var n=e.stateNode;if(n===null)return null;var r=ol(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(J(231,t,typeof n));return n}var La=!1;if(tn)try{var to={};Object.defineProperty(to,"passive",{get:function(){La=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{La=!1}function Ov(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var xo=!1,gs=null,ys=!1,za=null,Fv={onError:function(e){xo=!0,gs=e}};function Hv(e,t,n,r,o,i,s,l,a){xo=!1,gs=null,Ov.apply(Fv,arguments)}function Bv(e,t,n,r,o,i,s,l,a){if(Hv.apply(this,arguments),xo){if(xo){var u=gs;xo=!1,gs=null}else throw Error(J(198));ys||(ys=!0,za=u)}}function sr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function fp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fd(e){if(sr(e)!==e)throw Error(J(188))}function Vv(e){var t=e.alternate;if(!t){if(t=sr(e),t===null)throw Error(J(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return fd(o),e;if(i===r)return fd(o),t;i=i.sibling}throw Error(J(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function hp(e){return e=Vv(e),e!==null?pp(e):null}function pp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pp(e);if(t!==null)return t;e=e.sibling}return null}var mp=at.unstable_scheduleCallback,hd=at.unstable_cancelCallback,Wv=at.unstable_shouldYield,Uv=at.unstable_requestPaint,Ee=at.unstable_now,Yv=at.unstable_getCurrentPriorityLevel,Vu=at.unstable_ImmediatePriority,gp=at.unstable_UserBlockingPriority,vs=at.unstable_NormalPriority,Xv=at.unstable_LowPriority,yp=at.unstable_IdlePriority,el=null,Ft=null;function Kv(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(el,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:qv,Gv=Math.log,Qv=Math.LN2;function qv(e){return e>>>=0,e===0?32:31-(Gv(e)/Qv|0)|0}var Ci=64,ji=4194304;function ho(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function xs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=ho(l):(i&=s,i!==0&&(r=ho(i)))}else s=n&~o,s!==0?r=ho(s):i!==0&&(r=ho(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Mt(t),o=1<<n,r|=e[n],t&=~o;return r}function Zv(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Mt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=Zv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function Aa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function vp(){var e=Ci;return Ci<<=1,!(Ci&4194240)&&(Ci=64),e}function Ol(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function si(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function ex(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Mt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Wu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var de=0;function xp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wp,Uu,kp,Sp,Np,Ra=!1,Mi=[],kn=null,Sn=null,Nn=null,To=new Map,Lo=new Map,gn=[],tx="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 submit".split(" ");function pd(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":To.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lo.delete(t.pointerId)}}function no(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=ai(t),t!==null&&Uu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nx(e,t,n,r,o){switch(t){case"focusin":return kn=no(kn,e,t,n,r,o),!0;case"dragenter":return Sn=no(Sn,e,t,n,r,o),!0;case"mouseover":return Nn=no(Nn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return To.set(i,no(To.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Lo.set(i,no(Lo.get(i)||null,e,t,n,r,o)),!0}return!1}function Ep(e){var t=Rn(e.target);if(t!==null){var n=sr(t);if(n!==null){if(t=n.tag,t===13){if(t=fp(n),t!==null){e.blockedOn=t,Np(e.priority,function(){kp(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 Ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Da(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ia=r,n.target.dispatchEvent(r),Ia=null}else return t=ai(n),t!==null&&Uu(t),e.blockedOn=n,!1;t.shift()}return!0}function md(e,t,n){Ji(e)&&n.delete(t)}function rx(){Ra=!1,kn!==null&&Ji(kn)&&(kn=null),Sn!==null&&Ji(Sn)&&(Sn=null),Nn!==null&&Ji(Nn)&&(Nn=null),To.forEach(md),Lo.forEach(md)}function ro(e,t){e.blockedOn===t&&(e.blockedOn=null,Ra||(Ra=!0,at.unstable_scheduleCallback(at.unstable_NormalPriority,rx)))}function zo(e){function t(o){return ro(o,e)}if(0<Mi.length){ro(Mi[0],e);for(var n=1;n<Mi.length;n++){var r=Mi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(kn!==null&&ro(kn,e),Sn!==null&&ro(Sn,e),Nn!==null&&ro(Nn,e),To.forEach(t),Lo.forEach(t),n=0;n<gn.length;n++)r=gn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gn.length&&(n=gn[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&gn.shift()}var br=an.ReactCurrentBatchConfig,ws=!0;function ox(e,t,n,r){var o=de,i=br.transition;br.transition=null;try{de=1,Yu(e,t,n,r)}finally{de=o,br.transition=i}}function ix(e,t,n,r){var o=de,i=br.transition;br.transition=null;try{de=4,Yu(e,t,n,r)}finally{de=o,br.transition=i}}function Yu(e,t,n,r){if(ws){var o=Da(e,t,n,r);if(o===null)Gl(e,t,r,ks,n),pd(e,r);else if(nx(o,e,t,n,r))r.stopPropagation();else if(pd(e,r),t&4&&-1<tx.indexOf(e)){for(;o!==null;){var i=ai(o);if(i!==null&&wp(i),i=Da(e,t,n,r),i===null&&Gl(e,t,r,ks,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Gl(e,t,r,null,n)}}var ks=null;function Da(e,t,n,r){if(ks=null,e=Bu(r),e=Rn(e),e!==null)if(t=sr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=fp(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 ks=e,null}function _p(e){switch(e){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"resize":case"seeked":case"submit":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"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Yv()){case Vu:return 1;case gp:return 4;case vs:case Xv:return 16;case yp:return 536870912;default:return 16}default:return 16}}var xn=null,Xu=null,es=null;function Cp(){if(es)return es;var e,t=Xu,n=t.length,r,o="value"in xn?xn.value:xn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return es=o.slice(e,1<r?1-r:void 0)}function ts(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 $i(){return!0}function gd(){return!1}function dt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$i:gd,this.isPropagationStopped=gd,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$i)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$i)},persist:function(){},isPersistent:$i}),t}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ku=dt(Zr),li=we({},Zr,{view:0,detail:0}),sx=dt(li),Fl,Hl,oo,tl=we({},li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gu,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!==oo&&(oo&&e.type==="mousemove"?(Fl=e.screenX-oo.screenX,Hl=e.screenY-oo.screenY):Hl=Fl=0,oo=e),Fl)},movementY:function(e){return"movementY"in e?e.movementY:Hl}}),yd=dt(tl),lx=we({},tl,{dataTransfer:0}),ax=dt(lx),ux=we({},li,{relatedTarget:0}),Bl=dt(ux),cx=we({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),dx=dt(cx),fx=we({},Zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hx=dt(fx),px=we({},Zr,{data:0}),vd=dt(px),mx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gx={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"},yx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yx[e])?!!t[e]:!1}function Gu(){return vx}var xx=we({},li,{key:function(e){if(e.key){var t=mx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ts(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gu,charCode:function(e){return e.type==="keypress"?ts(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ts(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wx=dt(xx),kx=we({},tl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xd=dt(kx),Sx=we({},li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gu}),Nx=dt(Sx),Ex=we({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),_x=dt(Ex),Cx=we({},tl,{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}),jx=dt(Cx),Mx=[9,13,27,32],Qu=tn&&"CompositionEvent"in window,wo=null;tn&&"documentMode"in document&&(wo=document.documentMode);var $x=tn&&"TextEvent"in window&&!wo,jp=tn&&(!Qu||wo&&8<wo&&11>=wo),wd=" ",kd=!1;function Mp(e,t){switch(e){case"keyup":return Mx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $p(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gr=!1;function bx(e,t){switch(e){case"compositionend":return $p(t);case"keypress":return t.which!==32?null:(kd=!0,wd);case"textInput":return e=t.data,e===wd&&kd?null:e;default:return null}}function Px(e,t){if(gr)return e==="compositionend"||!Qu&&Mp(e,t)?(e=Cp(),es=Xu=xn=null,gr=!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 jp&&t.locale!=="ko"?null:t.data;default:return null}}var Ix={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 Sd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ix[e.type]:t==="textarea"}function bp(e,t,n,r){lp(r),t=Ss(t,"onChange"),0<t.length&&(n=new Ku("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ko=null,Ao=null;function Tx(e){Hp(e,0)}function nl(e){var t=xr(e);if(ep(t))return e}function Lx(e,t){if(e==="change")return t}var Pp=!1;if(tn){var Vl;if(tn){var Wl="oninput"in document;if(!Wl){var Nd=document.createElement("div");Nd.setAttribute("oninput","return;"),Wl=typeof Nd.oninput=="function"}Vl=Wl}else Vl=!1;Pp=Vl&&(!document.documentMode||9<document.documentMode)}function Ed(){ko&&(ko.detachEvent("onpropertychange",Ip),Ao=ko=null)}function Ip(e){if(e.propertyName==="value"&&nl(Ao)){var t=[];bp(t,Ao,e,Bu(e)),dp(Tx,t)}}function zx(e,t,n){e==="focusin"?(Ed(),ko=t,Ao=n,ko.attachEvent("onpropertychange",Ip)):e==="focusout"&&Ed()}function Ax(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nl(Ao)}function Rx(e,t){if(e==="click")return nl(t)}function Dx(e,t){if(e==="input"||e==="change")return nl(t)}function Ox(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Ox;function Ro(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 o=n[r];if(!wa.call(t,o)||!bt(e[o],t[o]))return!1}return!0}function _d(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cd(e,t){var n=_d(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_d(n)}}function Tp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lp(){for(var e=window,t=ms();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ms(e.document)}return t}function qu(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")}function Fx(e){var t=Lp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tp(n.ownerDocument.documentElement,n)){if(r!==null&&qu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Cd(n,i);var s=Cd(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Hx=tn&&"documentMode"in document&&11>=document.documentMode,yr=null,Oa=null,So=null,Fa=!1;function jd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fa||yr==null||yr!==ms(r)||(r=yr,"selectionStart"in r&&qu(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}),So&&Ro(So,r)||(So=r,r=Ss(Oa,"onSelect"),0<r.length&&(t=new Ku("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}function bi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vr={animationend:bi("Animation","AnimationEnd"),animationiteration:bi("Animation","AnimationIteration"),animationstart:bi("Animation","AnimationStart"),transitionend:bi("Transition","TransitionEnd")},Ul={},zp={};tn&&(zp=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);function rl(e){if(Ul[e])return Ul[e];if(!vr[e])return e;var t=vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zp)return Ul[e]=t[n];return e}var Ap=rl("animationend"),Rp=rl("animationiteration"),Dp=rl("animationstart"),Op=rl("transitionend"),Fp=new Map,Md="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");function Pn(e,t){Fp.set(e,t),ir(t,[e])}for(var Yl=0;Yl<Md.length;Yl++){var Xl=Md[Yl],Bx=Xl.toLowerCase(),Vx=Xl[0].toUpperCase()+Xl.slice(1);Pn(Bx,"on"+Vx)}Pn(Ap,"onAnimationEnd");Pn(Rp,"onAnimationIteration");Pn(Dp,"onAnimationStart");Pn("dblclick","onDoubleClick");Pn("focusin","onFocus");Pn("focusout","onBlur");Pn(Op,"onTransitionEnd");zr("onMouseEnter",["mouseout","mouseover"]);zr("onMouseLeave",["mouseout","mouseover"]);zr("onPointerEnter",["pointerout","pointerover"]);zr("onPointerLeave",["pointerout","pointerover"]);ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ir("onBeforeInput",["compositionend","keypress","textInput","paste"]);ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var po="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(" "),Wx=new Set("cancel close invalid load scroll toggle".split(" ").concat(po));function $d(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Bv(r,t,void 0,e),e.currentTarget=null}function Hp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;$d(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;$d(o,l,u),i=a}}}if(ys)throw e=za,ys=!1,za=null,e}function pe(e,t){var n=t[Ua];n===void 0&&(n=t[Ua]=new Set);var r=e+"__bubble";n.has(r)||(Bp(t,e,2,!1),n.add(r))}function Kl(e,t,n){var r=0;t&&(r|=4),Bp(n,e,r,t)}var Pi="_reactListening"+Math.random().toString(36).slice(2);function Do(e){if(!e[Pi]){e[Pi]=!0,Gh.forEach(function(n){n!=="selectionchange"&&(Wx.has(n)||Kl(n,!1,e),Kl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pi]||(t[Pi]=!0,Kl("selectionchange",!1,t))}}function Bp(e,t,n,r){switch(_p(t)){case 1:var o=ox;break;case 4:o=ix;break;default:o=Yu}n=o.bind(null,t,n,e),o=void 0,!La||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Gl(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Rn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}dp(function(){var u=i,c=Bu(n),d=[];e:{var f=Fp.get(e);if(f!==void 0){var p=Ku,y=e;switch(e){case"keypress":if(ts(n)===0)break e;case"keydown":case"keyup":p=wx;break;case"focusin":y="focus",p=Bl;break;case"focusout":y="blur",p=Bl;break;case"beforeblur":case"afterblur":p=Bl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=ax;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Nx;break;case Ap:case Rp:case Dp:p=dx;break;case Op:p=_x;break;case"scroll":p=sx;break;case"wheel":p=jx;break;case"copy":case"cut":case"paste":p=hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=xd}var x=(t&4)!==0,k=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var v=u,m;v!==null;){m=v;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,g!==null&&(w=Io(v,g),w!=null&&x.push(Oo(v,w,m)))),k)break;v=v.return}0<x.length&&(f=new p(f,y,null,n,c),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Ia&&(y=n.relatedTarget||n.fromElement)&&(Rn(y)||y[nn]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Rn(y):null,y!==null&&(k=sr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(x=yd,w="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=xd,w="onPointerLeave",g="onPointerEnter",v="pointer"),k=p==null?f:xr(p),m=y==null?f:xr(y),f=new x(w,v+"leave",p,n,c),f.target=k,f.relatedTarget=m,w=null,Rn(c)===u&&(x=new x(g,v+"enter",y,n,c),x.target=m,x.relatedTarget=k,w=x),k=w,p&&y)t:{for(x=p,g=y,v=0,m=x;m;m=ar(m))v++;for(m=0,w=g;w;w=ar(w))m++;for(;0<v-m;)x=ar(x),v--;for(;0<m-v;)g=ar(g),m--;for(;v--;){if(x===g||g!==null&&x===g.alternate)break t;x=ar(x),g=ar(g)}x=null}else x=null;p!==null&&bd(d,f,p,x,!1),y!==null&&k!==null&&bd(d,k,y,x,!0)}}e:{if(f=u?xr(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var _=Lx;else if(Sd(f))if(Pp)_=Dx;else{_=Ax;var S=zx}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=Rx);if(_&&(_=_(e,u))){bp(d,_,n,c);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&ja(f,"number",f.value)}switch(S=u?xr(u):window,e){case"focusin":(Sd(S)||S.contentEditable==="true")&&(yr=S,Oa=u,So=null);break;case"focusout":So=Oa=yr=null;break;case"mousedown":Fa=!0;break;case"contextmenu":case"mouseup":case"dragend":Fa=!1,jd(d,n,c);break;case"selectionchange":if(Hx)break;case"keydown":case"keyup":jd(d,n,c)}var C;if(Qu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else gr?Mp(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(jp&&n.locale!=="ko"&&(gr||j!=="onCompositionStart"?j==="onCompositionEnd"&&gr&&(C=Cp()):(xn=c,Xu="value"in xn?xn.value:xn.textContent,gr=!0)),S=Ss(u,j),0<S.length&&(j=new vd(j,e,null,n,c),d.push({event:j,listeners:S}),C?j.data=C:(C=$p(n),C!==null&&(j.data=C)))),(C=$x?bx(e,n):Px(e,n))&&(u=Ss(u,"onBeforeInput"),0<u.length&&(c=new vd("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}Hp(d,t)})}function Oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ss(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Io(e,n),i!=null&&r.unshift(Oo(e,i,o)),i=Io(e,t),i!=null&&r.push(Oo(e,i,o))),e=e.return}return r}function ar(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bd(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Io(n,i),a!=null&&s.unshift(Oo(n,a,l))):o||(a=Io(n,i),a!=null&&s.push(Oo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Ux=/\r\n?/g,Yx=/\u0000|\uFFFD/g;function Pd(e){return(typeof e=="string"?e:""+e).replace(Ux,`
|
|
38
|
+
`).replace(Yx,"")}function Ii(e,t,n){if(t=Pd(t),Pd(e)!==t&&n)throw Error(J(425))}function Ns(){}var Ha=null,Ba=null;function Va(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wa=typeof setTimeout=="function"?setTimeout:void 0,Xx=typeof clearTimeout=="function"?clearTimeout:void 0,Id=typeof Promise=="function"?Promise:void 0,Kx=typeof queueMicrotask=="function"?queueMicrotask:typeof Id<"u"?function(e){return Id.resolve(null).then(e).catch(Gx)}:Wa;function Gx(e){setTimeout(function(){throw e})}function Ql(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),zo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);zo(t)}function En(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==="$?")break;if(t==="/$")return null}}return e}function Td(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jr=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Jr,Fo="__reactProps$"+Jr,nn="__reactContainer$"+Jr,Ua="__reactEvents$"+Jr,Qx="__reactListeners$"+Jr,qx="__reactHandles$"+Jr;function Rn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nn]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Td(e);e!==null;){if(n=e[Rt])return n;e=Td(e)}return t}e=n,n=e.parentNode}return null}function ai(e){return e=e[Rt]||e[nn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function ol(e){return e[Fo]||null}var Ya=[],wr=-1;function In(e){return{current:e}}function me(e){0>wr||(e.current=Ya[wr],Ya[wr]=null,wr--)}function fe(e,t){wr++,Ya[wr]=e.current,e.current=t}var bn={},He=In(bn),Ze=In(!1),Gn=bn;function Ar(e,t){var n=e.type.contextTypes;if(!n)return bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Je(e){return e=e.childContextTypes,e!=null}function Es(){me(Ze),me(He)}function Ld(e,t,n){if(He.current!==bn)throw Error(J(168));fe(He,t),fe(Ze,n)}function Vp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(J(108,zv(e)||"Unknown",o));return we({},n,r)}function _s(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bn,Gn=He.current,fe(He,e),fe(Ze,Ze.current),!0}function zd(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Vp(e,t,Gn),r.__reactInternalMemoizedMergedChildContext=e,me(Ze),me(He),fe(He,e)):me(Ze),fe(Ze,n)}var Gt=null,il=!1,ql=!1;function Wp(e){Gt===null?Gt=[e]:Gt.push(e)}function Zx(e){il=!0,Wp(e)}function Tn(){if(!ql&&Gt!==null){ql=!0;var e=0,t=de;try{var n=Gt;for(de=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Gt=null,il=!1}catch(o){throw Gt!==null&&(Gt=Gt.slice(e+1)),mp(Vu,Tn),o}finally{de=t,ql=!1}}return null}var kr=[],Sr=0,Cs=null,js=0,ht=[],pt=0,Qn=null,Qt=1,qt="";function Ln(e,t){kr[Sr++]=js,kr[Sr++]=Cs,Cs=e,js=t}function Up(e,t,n){ht[pt++]=Qt,ht[pt++]=qt,ht[pt++]=Qn,Qn=e;var r=Qt;e=qt;var o=32-Mt(r)-1;r&=~(1<<o),n+=1;var i=32-Mt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Qt=1<<32-Mt(t)+o|n<<o|r,qt=i+e}else Qt=1<<i|n<<o|r,qt=e}function Zu(e){e.return!==null&&(Ln(e,1),Up(e,1,0))}function Ju(e){for(;e===Cs;)Cs=kr[--Sr],kr[Sr]=null,js=kr[--Sr],kr[Sr]=null;for(;e===Qn;)Qn=ht[--pt],ht[pt]=null,qt=ht[--pt],ht[pt]=null,Qt=ht[--pt],ht[pt]=null}var lt=null,st=null,ye=!1,Nt=null;function Yp(e,t){var n=mt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ad(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,lt=e,st=En(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,st=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qn!==null?{id:Qt,overflow:qt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,lt=e,st=null,!0):!1;default:return!1}}function Xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ka(e){if(ye){var t=st;if(t){var n=t;if(!Ad(e,t)){if(Xa(e))throw Error(J(418));t=En(n.nextSibling);var r=lt;t&&Ad(e,t)?Yp(r,n):(e.flags=e.flags&-4097|2,ye=!1,lt=e)}}else{if(Xa(e))throw Error(J(418));e.flags=e.flags&-4097|2,ye=!1,lt=e}}}function Rd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function Ti(e){if(e!==lt)return!1;if(!ye)return Rd(e),ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Va(e.type,e.memoizedProps)),t&&(t=st)){if(Xa(e))throw Xp(),Error(J(418));for(;t;)Yp(e,t),t=En(t.nextSibling)}if(Rd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){st=En(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}st=null}}else st=lt?En(e.stateNode.nextSibling):null;return!0}function Xp(){for(var e=st;e;)e=En(e.nextSibling)}function Rr(){st=lt=null,ye=!1}function ec(e){Nt===null?Nt=[e]:Nt.push(e)}var Jx=an.ReactCurrentBatchConfig;function io(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(J(309));var r=n.stateNode}if(!r)throw Error(J(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Li(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dd(e){var t=e._init;return t(e._payload)}function Kp(e){function t(g,v){if(e){var m=g.deletions;m===null?(g.deletions=[v],g.flags|=16):m.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function o(g,v){return g=Mn(g,v),g.index=0,g.sibling=null,g}function i(g,v,m){return g.index=m,e?(m=g.alternate,m!==null?(m=m.index,m<v?(g.flags|=2,v):m):(g.flags|=2,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,v,m,w){return v===null||v.tag!==6?(v=oa(m,g.mode,w),v.return=g,v):(v=o(v,m),v.return=g,v)}function a(g,v,m,w){var _=m.type;return _===mr?c(g,v,m.props.children,w,m.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===fn&&Dd(_)===v.type)?(w=o(v,m.props),w.ref=io(g,v,m),w.return=g,w):(w=as(m.type,m.key,m.props,null,g.mode,w),w.ref=io(g,v,m),w.return=g,w)}function u(g,v,m,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==m.containerInfo||v.stateNode.implementation!==m.implementation?(v=ia(m,g.mode,w),v.return=g,v):(v=o(v,m.children||[]),v.return=g,v)}function c(g,v,m,w,_){return v===null||v.tag!==7?(v=Vn(m,g.mode,w,_),v.return=g,v):(v=o(v,m),v.return=g,v)}function d(g,v,m){if(typeof v=="string"&&v!==""||typeof v=="number")return v=oa(""+v,g.mode,m),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ni:return m=as(v.type,v.key,v.props,null,g.mode,m),m.ref=io(g,null,v),m.return=g,m;case pr:return v=ia(v,g.mode,m),v.return=g,v;case fn:var w=v._init;return d(g,w(v._payload),m)}if(fo(v)||eo(v))return v=Vn(v,g.mode,m,null),v.return=g,v;Li(g,v)}return null}function f(g,v,m,w){var _=v!==null?v.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return _!==null?null:l(g,v,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ni:return m.key===_?a(g,v,m,w):null;case pr:return m.key===_?u(g,v,m,w):null;case fn:return _=m._init,f(g,v,_(m._payload),w)}if(fo(m)||eo(m))return _!==null?null:c(g,v,m,w,null);Li(g,m)}return null}function p(g,v,m,w,_){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(m)||null,l(v,g,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ni:return g=g.get(w.key===null?m:w.key)||null,a(v,g,w,_);case pr:return g=g.get(w.key===null?m:w.key)||null,u(v,g,w,_);case fn:var S=w._init;return p(g,v,m,S(w._payload),_)}if(fo(w)||eo(w))return g=g.get(m)||null,c(v,g,w,_,null);Li(v,w)}return null}function y(g,v,m,w){for(var _=null,S=null,C=v,j=v=0,I=null;C!==null&&j<m.length;j++){C.index>j?(I=C,C=null):I=C.sibling;var R=f(g,C,m[j],w);if(R===null){C===null&&(C=I);break}e&&C&&R.alternate===null&&t(g,C),v=i(R,v,j),S===null?_=R:S.sibling=R,S=R,C=I}if(j===m.length)return n(g,C),ye&&Ln(g,j),_;if(C===null){for(;j<m.length;j++)C=d(g,m[j],w),C!==null&&(v=i(C,v,j),S===null?_=C:S.sibling=C,S=C);return ye&&Ln(g,j),_}for(C=r(g,C);j<m.length;j++)I=p(C,g,j,m[j],w),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?j:I.key),v=i(I,v,j),S===null?_=I:S.sibling=I,S=I);return e&&C.forEach(function(D){return t(g,D)}),ye&&Ln(g,j),_}function x(g,v,m,w){var _=eo(m);if(typeof _!="function")throw Error(J(150));if(m=_.call(m),m==null)throw Error(J(151));for(var S=_=null,C=v,j=v=0,I=null,R=m.next();C!==null&&!R.done;j++,R=m.next()){C.index>j?(I=C,C=null):I=C.sibling;var D=f(g,C,R.value,w);if(D===null){C===null&&(C=I);break}e&&C&&D.alternate===null&&t(g,C),v=i(D,v,j),S===null?_=D:S.sibling=D,S=D,C=I}if(R.done)return n(g,C),ye&&Ln(g,j),_;if(C===null){for(;!R.done;j++,R=m.next())R=d(g,R.value,w),R!==null&&(v=i(R,v,j),S===null?_=R:S.sibling=R,S=R);return ye&&Ln(g,j),_}for(C=r(g,C);!R.done;j++,R=m.next())R=p(C,g,j,R.value,w),R!==null&&(e&&R.alternate!==null&&C.delete(R.key===null?j:R.key),v=i(R,v,j),S===null?_=R:S.sibling=R,S=R);return e&&C.forEach(function(W){return t(g,W)}),ye&&Ln(g,j),_}function k(g,v,m,w){if(typeof m=="object"&&m!==null&&m.type===mr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ni:e:{for(var _=m.key,S=v;S!==null;){if(S.key===_){if(_=m.type,_===mr){if(S.tag===7){n(g,S.sibling),v=o(S,m.props.children),v.return=g,g=v;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===fn&&Dd(_)===S.type){n(g,S.sibling),v=o(S,m.props),v.ref=io(g,S,m),v.return=g,g=v;break e}n(g,S);break}else t(g,S);S=S.sibling}m.type===mr?(v=Vn(m.props.children,g.mode,w,m.key),v.return=g,g=v):(w=as(m.type,m.key,m.props,null,g.mode,w),w.ref=io(g,v,m),w.return=g,g=w)}return s(g);case pr:e:{for(S=m.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===m.containerInfo&&v.stateNode.implementation===m.implementation){n(g,v.sibling),v=o(v,m.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=ia(m,g.mode,w),v.return=g,g=v}return s(g);case fn:return S=m._init,k(g,v,S(m._payload),w)}if(fo(m))return y(g,v,m,w);if(eo(m))return x(g,v,m,w);Li(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,v!==null&&v.tag===6?(n(g,v.sibling),v=o(v,m),v.return=g,g=v):(n(g,v),v=oa(m,g.mode,w),v.return=g,g=v),s(g)):n(g,v)}return k}var Dr=Kp(!0),Gp=Kp(!1),Ms=In(null),$s=null,Nr=null,tc=null;function nc(){tc=Nr=$s=null}function rc(e){var t=Ms.current;me(Ms),e._currentValue=t}function Ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Pr(e,t){$s=e,tc=Nr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function yt(e){var t=e._currentValue;if(tc!==e)if(e={context:e,memoizedValue:t,next:null},Nr===null){if($s===null)throw Error(J(308));Nr=e,$s.dependencies={lanes:0,firstContext:e}}else Nr=Nr.next=e;return t}var Dn=null;function oc(e){Dn===null?Dn=[e]:Dn.push(e)}function Qp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,oc(t)):(n.next=o.next,o.next=n),t.interleaved=n,rn(e,r)}function rn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var hn=!1;function ic(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,rn(e,n)}return o=r.interleaved,o===null?(t.next=t,oc(r)):(t.next=o.next,o.next=t),r.interleaved=t,rn(e,n)}function ns(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wu(e,n)}}function Od(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bs(e,t,n,r){var o=e.updateQueue;hn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(f=t,p=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=we({},d,f);break e;case 2:hn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=d):c=c.next=p,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Zn|=s,e.lanes=s,e.memoizedState=d}}function Fd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(J(191,o));o.call(r)}}}var ui={},Ht=In(ui),Ho=In(ui),Bo=In(ui);function On(e){if(e===ui)throw Error(J(174));return e}function sc(e,t){switch(fe(Bo,t),fe(Ho,e),fe(Ht,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$a(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$a(t,e)}me(Ht),fe(Ht,t)}function Or(){me(Ht),me(Ho),me(Bo)}function Zp(e){On(Bo.current);var t=On(Ht.current),n=$a(t,e.type);t!==n&&(fe(Ho,e),fe(Ht,n))}function lc(e){Ho.current===e&&(me(Ht),me(Ho))}var ve=In(0);function Ps(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Zl=[];function ac(){for(var e=0;e<Zl.length;e++)Zl[e]._workInProgressVersionPrimary=null;Zl.length=0}var rs=an.ReactCurrentDispatcher,Jl=an.ReactCurrentBatchConfig,qn=0,xe=null,je=null,be=null,Is=!1,No=!1,Vo=0,ew=0;function Re(){throw Error(J(321))}function uc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function cc(e,t,n,r,o,i){if(qn=i,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rs.current=e===null||e.memoizedState===null?ow:iw,e=n(r,o),No){i=0;do{if(No=!1,Vo=0,25<=i)throw Error(J(301));i+=1,be=je=null,t.updateQueue=null,rs.current=sw,e=n(r,o)}while(No)}if(rs.current=Ts,t=je!==null&&je.next!==null,qn=0,be=je=xe=null,Is=!1,t)throw Error(J(300));return e}function dc(){var e=Vo!==0;return Vo=0,e}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return be===null?xe.memoizedState=be=e:be=be.next=e,be}function vt(){if(je===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=je.next;var t=be===null?xe.memoizedState:be.next;if(t!==null)be=t,je=e;else{if(e===null)throw Error(J(310));je=e,e={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},be===null?xe.memoizedState=be=e:be=be.next=e}return be}function Wo(e,t){return typeof t=="function"?t(e):t}function ea(e){var t=vt(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=je,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((qn&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,xe.lanes|=c,Zn|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,bt(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,xe.lanes|=i,Zn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ta(e){var t=vt(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);bt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Jp(){}function em(e,t){var n=xe,r=vt(),o=t(),i=!bt(r.memoizedState,o);if(i&&(r.memoizedState=o,Qe=!0),r=r.queue,fc(rm.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||be!==null&&be.memoizedState.tag&1){if(n.flags|=2048,Uo(9,nm.bind(null,n,r,o,t),void 0,null),Pe===null)throw Error(J(349));qn&30||tm(n,t,o)}return o}function tm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nm(e,t,n,r){t.value=n,t.getSnapshot=r,om(t)&&im(e)}function rm(e,t,n){return n(function(){om(t)&&im(e)})}function om(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function im(e){var t=rn(e,1);t!==null&&$t(t,e,1,-1)}function Hd(e){var t=zt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t.queue=e,e=e.dispatch=rw.bind(null,xe,e),[t.memoizedState,e]}function Uo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function sm(){return vt().memoizedState}function os(e,t,n,r){var o=zt();xe.flags|=e,o.memoizedState=Uo(1|t,n,void 0,r===void 0?null:r)}function sl(e,t,n,r){var o=vt();r=r===void 0?null:r;var i=void 0;if(je!==null){var s=je.memoizedState;if(i=s.destroy,r!==null&&uc(r,s.deps)){o.memoizedState=Uo(t,n,i,r);return}}xe.flags|=e,o.memoizedState=Uo(1|t,n,i,r)}function Bd(e,t){return os(8390656,8,e,t)}function fc(e,t){return sl(2048,8,e,t)}function lm(e,t){return sl(4,2,e,t)}function am(e,t){return sl(4,4,e,t)}function um(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cm(e,t,n){return n=n!=null?n.concat([e]):null,sl(4,4,um.bind(null,t,e),n)}function hc(){}function dm(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fm(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function hm(e,t,n){return qn&21?(bt(n,t)||(n=vp(),xe.lanes|=n,Zn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function tw(e,t){var n=de;de=n!==0&&4>n?n:4,e(!0);var r=Jl.transition;Jl.transition={};try{e(!1),t()}finally{de=n,Jl.transition=r}}function pm(){return vt().memoizedState}function nw(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},mm(e))gm(t,n);else if(n=Qp(e,t,n,r),n!==null){var o=Ue();$t(n,e,r,o),ym(n,t,r)}}function rw(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(mm(e))gm(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,bt(l,s)){var a=t.interleaved;a===null?(o.next=o,oc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Qp(e,t,o,r),n!==null&&(o=Ue(),$t(n,e,r,o),ym(n,t,r))}}function mm(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function gm(e,t){No=Is=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ym(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wu(e,n)}}var Ts={readContext:yt,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},ow={readContext:yt,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Bd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,os(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){return os(4,2,e,t)},useMemo:function(e,t){var n=zt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=nw.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:Hd,useDebugValue:hc,useDeferredValue:function(e){return zt().memoizedState=e},useTransition:function(){var e=Hd(!1),t=e[0];return e=tw.bind(null,e[1]),zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,o=zt();if(ye){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),Pe===null)throw Error(J(349));qn&30||tm(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Bd(rm.bind(null,r,i,e),[e]),r.flags|=2048,Uo(9,nm.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=zt(),t=Pe.identifierPrefix;if(ye){var n=qt,r=Qt;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ew++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},iw={readContext:yt,useCallback:dm,useContext:yt,useEffect:fc,useImperativeHandle:cm,useInsertionEffect:lm,useLayoutEffect:am,useMemo:fm,useReducer:ea,useRef:sm,useState:function(){return ea(Wo)},useDebugValue:hc,useDeferredValue:function(e){var t=vt();return hm(t,je.memoizedState,e)},useTransition:function(){var e=ea(Wo)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Jp,useSyncExternalStore:em,useId:pm,unstable_isNewReconciler:!1},sw={readContext:yt,useCallback:dm,useContext:yt,useEffect:fc,useImperativeHandle:cm,useInsertionEffect:lm,useLayoutEffect:am,useMemo:fm,useReducer:ta,useRef:sm,useState:function(){return ta(Wo)},useDebugValue:hc,useDeferredValue:function(e){var t=vt();return je===null?t.memoizedState=e:hm(t,je.memoizedState,e)},useTransition:function(){var e=ta(Wo)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Jp,useSyncExternalStore:em,useId:pm,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ll={isMounted:function(e){return(e=e._reactInternals)?sr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ue(),o=jn(e),i=Jt(r,o);i.payload=t,n!=null&&(i.callback=n),t=_n(e,i,o),t!==null&&($t(t,e,o,r),ns(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ue(),o=jn(e),i=Jt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_n(e,i,o),t!==null&&($t(t,e,o,r),ns(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ue(),r=jn(e),o=Jt(n,r);o.tag=2,t!=null&&(o.callback=t),t=_n(e,o,r),t!==null&&($t(t,e,r,n),ns(t,e,r))}};function Vd(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Ro(n,r)||!Ro(o,i):!0}function vm(e,t,n){var r=!1,o=bn,i=t.contextType;return typeof i=="object"&&i!==null?i=yt(i):(o=Je(t)?Gn:He.current,r=t.contextTypes,i=(r=r!=null)?Ar(e,o):bn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ll,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Wd(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&&ll.enqueueReplaceState(t,t.state,null)}function qa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},ic(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=yt(i):(i=Je(t)?Gn:He.current,o.context=Ar(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Qa(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ll.enqueueReplaceState(o,o.state,null),bs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Fr(e,t){try{var n="",r=t;do n+=Lv(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function na(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Za(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var lw=typeof WeakMap=="function"?WeakMap:Map;function xm(e,t,n){n=Jt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zs||(zs=!0,au=r),Za(e,t)},n}function wm(e,t,n){n=Jt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Za(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Za(e,t),typeof r!="function"&&(Cn===null?Cn=new Set([this]):Cn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Ud(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new lw;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=kw.bind(null,e,t,n),t.then(e,e))}function Yd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jt(-1,1),t.tag=2,_n(n,t,1))),n.lanes|=1),e)}var aw=an.ReactCurrentOwner,Qe=!1;function We(e,t,n,r){t.child=e===null?Gp(t,null,n,r):Dr(t,e.child,n,r)}function Kd(e,t,n,r,o){n=n.render;var i=t.ref;return Pr(t,o),r=cc(e,t,n,r,i,o),n=dc(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,on(e,t,o)):(ye&&n&&Zu(t),t.flags|=1,We(e,t,r,o),t.child)}function Gd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!kc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,km(e,t,i,r,o)):(e=as(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ro,n(s,r)&&e.ref===t.ref)return on(e,t,o)}return t.flags|=1,e=Mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function km(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ro(i,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,on(e,t,o)}return Ja(e,t,n,r,o)}function Sm(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(_r,ot),ot|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(_r,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,fe(_r,ot),ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,fe(_r,ot),ot|=r;return We(e,t,o,n),t.child}function Nm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ja(e,t,n,r,o){var i=Je(n)?Gn:He.current;return i=Ar(t,i),Pr(t,o),n=cc(e,t,n,r,i,o),r=dc(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,on(e,t,o)):(ye&&r&&Zu(t),t.flags|=1,We(e,t,n,o),t.child)}function Qd(e,t,n,r,o){if(Je(n)){var i=!0;_s(t)}else i=!1;if(Pr(t,o),t.stateNode===null)is(e,t),vm(t,n,r),qa(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=yt(u):(u=Je(n)?Gn:He.current,u=Ar(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Wd(t,s,r,u),hn=!1;var f=t.memoizedState;s.state=f,bs(t,r,s,o),a=t.memoizedState,l!==r||f!==a||Ze.current||hn?(typeof c=="function"&&(Qa(t,n,c,r),a=t.memoizedState),(l=hn||Vd(t,n,l,r,f,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,qp(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:wt(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=yt(a):(a=Je(n)?Gn:He.current,a=Ar(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Wd(t,s,r,a),hn=!1,f=t.memoizedState,s.state=f,bs(t,r,s,o);var y=t.memoizedState;l!==d||f!==y||Ze.current||hn?(typeof p=="function"&&(Qa(t,n,p,r),y=t.memoizedState),(u=hn||Vd(t,n,u,r,f,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return eu(e,t,n,r,i,o)}function eu(e,t,n,r,o,i){Nm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&zd(t,n,!1),on(e,t,i);r=t.stateNode,aw.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Dr(t,e.child,null,i),t.child=Dr(t,null,l,i)):We(e,t,l,i),t.memoizedState=r.state,o&&zd(t,n,!0),t.child}function Em(e){var t=e.stateNode;t.pendingContext?Ld(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ld(e,t.context,!1),sc(e,t.containerInfo)}function qd(e,t,n,r,o){return Rr(),ec(o),t.flags|=256,We(e,t,n,r),t.child}var tu={dehydrated:null,treeContext:null,retryLane:0};function nu(e){return{baseLanes:e,cachePool:null,transitions:null}}function _m(e,t,n){var r=t.pendingProps,o=ve.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),fe(ve,o&1),e===null)return Ka(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=cl(s,r,0,null),e=Vn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=nu(n),t.memoizedState=tu,e):pc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return uw(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Mn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Mn(l,i):(i=Vn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?nu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=tu,r}return i=e.child,e=i.sibling,r=Mn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function pc(e,t){return t=cl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zi(e,t,n,r){return r!==null&&ec(r),Dr(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uw(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=na(Error(J(422))),zi(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=cl({mode:"visible",children:r.children},o,0,null),i=Vn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Dr(t,e.child,null,s),t.child.memoizedState=nu(s),t.memoizedState=tu,i);if(!(t.mode&1))return zi(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=na(i,r,void 0),zi(e,t,s,r)}if(l=(s&e.childLanes)!==0,Qe||l){if(r=Pe,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,rn(e,o),$t(r,e,o,-1))}return wc(),r=na(Error(J(421))),zi(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Sw.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,st=En(o.nextSibling),lt=t,ye=!0,Nt=null,e!==null&&(ht[pt++]=Qt,ht[pt++]=qt,ht[pt++]=Qn,Qt=e.id,qt=e.overflow,Qn=t),t=pc(t,r.children),t.flags|=4096,t)}function Zd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ga(e.return,t,n)}function ra(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Cm(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(We(e,t,r.children,n),r=ve.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zd(e,n,t);else if(e.tag===19)Zd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fe(ve,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ps(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ra(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ps(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ra(t,!0,n,null,i);break;case"together":ra(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function is(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function on(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=Mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cw(e,t,n){switch(t.tag){case 3:Em(t),Rr();break;case 5:Zp(t);break;case 1:Je(t.type)&&_s(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;fe(Ms,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?_m(e,t,n):(fe(ve,ve.current&1),e=on(e,t,n),e!==null?e.sibling:null);fe(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Cm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),fe(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Sm(e,t,n)}return on(e,t,n)}var jm,ru,Mm,$m;jm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ru=function(){};Mm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,On(Ht.current);var i=null;switch(n){case"input":o=_a(e,o),r=_a(e,r),i=[];break;case"select":o=we({},o,{value:void 0}),r=we({},r,{value:void 0}),i=[];break;case"textarea":o=Ma(e,o),r=Ma(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ns)}ba(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(bo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&pe("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};$m=function(e,t,n,r){n!==r&&(t.flags|=4)};function so(e,t){if(!ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var 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}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dw(e,t,n){var r=t.pendingProps;switch(Ju(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return Je(t.type)&&Es(),De(t),null;case 3:return r=t.stateNode,Or(),me(Ze),me(He),ac(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ti(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Nt!==null&&(du(Nt),Nt=null))),ru(e,t),De(t),null;case 5:lc(t);var o=On(Bo.current);if(n=t.type,e!==null&&t.stateNode!=null)Mm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return De(t),null}if(e=On(Ht.current),Ti(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rt]=t,r[Fo]=i,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(o=0;o<po.length;o++)pe(po[o],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":ld(r,i),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},pe("invalid",r);break;case"textarea":ud(r,i),pe("invalid",r)}ba(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Ii(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Ii(r.textContent,l,e),o=["children",""+l]):bo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&pe("scroll",r)}switch(n){case"input":Ei(r),ad(r,i,!0);break;case"textarea":Ei(r),cd(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ns)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=rp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Rt]=t,e[Fo]=r,jm(e,t,!1,!1),t.stateNode=e;e:{switch(s=Pa(n,r),n){case"dialog":pe("cancel",e),pe("close",e),o=r;break;case"iframe":case"object":case"embed":pe("load",e),o=r;break;case"video":case"audio":for(o=0;o<po.length;o++)pe(po[o],e);o=r;break;case"source":pe("error",e),o=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),o=r;break;case"details":pe("toggle",e),o=r;break;case"input":ld(e,r),o=_a(e,r),pe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=we({},r,{value:void 0}),pe("invalid",e);break;case"textarea":ud(e,r),o=Ma(e,r),pe("invalid",e);break;default:o=r}ba(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?sp(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&op(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Po(e,a):typeof a=="number"&&Po(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(bo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&pe("scroll",e):a!=null&&Du(e,i,a,s))}switch(n){case"input":Ei(e),ad(e,r,!1);break;case"textarea":Ei(e),cd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$n(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?jr(e,!!r.multiple,i,!1):r.defaultValue!=null&&jr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ns)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return De(t),null;case 6:if(e&&t.stateNode!=null)$m(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=On(Bo.current),On(Ht.current),Ti(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rt]=t,(i=r.nodeValue!==n)&&(e=lt,e!==null))switch(e.tag){case 3:Ii(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ii(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rt]=t,t.stateNode=r}return De(t),null;case 13:if(me(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ye&&st!==null&&t.mode&1&&!(t.flags&128))Xp(),Rr(),t.flags|=98560,i=!1;else if(i=Ti(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[Rt]=t}else Rr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else Nt!==null&&(du(Nt),Nt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ve.current&1?Me===0&&(Me=3):wc())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return Or(),ru(e,t),e===null&&Do(t.stateNode.containerInfo),De(t),null;case 10:return rc(t.type._context),De(t),null;case 17:return Je(t.type)&&Es(),De(t),null;case 19:if(me(ve),i=t.memoizedState,i===null)return De(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)so(i,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ps(e),s!==null){for(t.flags|=128,so(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ee()>Hr&&(t.flags|=128,r=!0,so(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ps(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),so(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ye)return De(t),null}else 2*Ee()-i.renderingStartTime>Hr&&n!==1073741824&&(t.flags|=128,r=!0,so(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=ve.current,fe(ve,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return xc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function fw(e,t){switch(Ju(t),t.tag){case 1:return Je(t.type)&&Es(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Or(),me(Ze),me(He),ac(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lc(t),null;case 13:if(me(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(ve),null;case 4:return Or(),null;case 10:return rc(t.type._context),null;case 22:case 23:return xc(),null;case 24:return null;default:return null}}var Ai=!1,Fe=!1,hw=typeof WeakSet=="function"?WeakSet:Set,re=null;function Er(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function ou(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Jd=!1;function pw(e,t){if(Ha=ws,e=Lp(),qu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ba={focusedElem:e,selectionRange:n},ws=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,k=y.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:wt(t.type,x),k);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(w){Se(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return y=Jd,Jd=!1,y}function Eo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ou(t,n,i)}o=o.next}while(o!==r)}}function al(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function bm(e){var t=e.alternate;t!==null&&(e.alternate=null,bm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Fo],delete t[Ua],delete t[Qx],delete t[qx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Pm(e){return e.tag===5||e.tag===3||e.tag===4}function ef(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pm(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function su(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ns));else if(r!==4&&(e=e.child,e!==null))for(su(e,t,n),e=e.sibling;e!==null;)su(e,t,n),e=e.sibling}function lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lu(e,t,n),e=e.sibling;e!==null;)lu(e,t,n),e=e.sibling}var Le=null,kt=!1;function un(e,t,n){for(n=n.child;n!==null;)Im(e,t,n),n=n.sibling}function Im(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(el,n)}catch{}switch(n.tag){case 5:Fe||Er(n,t);case 6:var r=Le,o=kt;Le=null,un(e,t,n),Le=r,kt=o,Le!==null&&(kt?(e=Le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Le.removeChild(n.stateNode));break;case 18:Le!==null&&(kt?(e=Le,n=n.stateNode,e.nodeType===8?Ql(e.parentNode,n):e.nodeType===1&&Ql(e,n),zo(e)):Ql(Le,n.stateNode));break;case 4:r=Le,o=kt,Le=n.stateNode.containerInfo,kt=!0,un(e,t,n),Le=r,kt=o;break;case 0:case 11:case 14:case 15:if(!Fe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ou(n,t,s),o=o.next}while(o!==r)}un(e,t,n);break;case 1:if(!Fe&&(Er(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}un(e,t,n);break;case 21:un(e,t,n);break;case 22:n.mode&1?(Fe=(r=Fe)||n.memoizedState!==null,un(e,t,n),Fe=r):un(e,t,n);break;default:un(e,t,n)}}function tf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hw),t.forEach(function(r){var o=Nw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Le=l.stateNode,kt=!1;break e;case 3:Le=l.stateNode.containerInfo,kt=!0;break e;case 4:Le=l.stateNode.containerInfo,kt=!0;break e}l=l.return}if(Le===null)throw Error(J(160));Im(i,s,o),Le=null,kt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Se(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Tm(t,e),t=t.sibling}function Tm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xt(t,e),Lt(e),r&4){try{Eo(3,e,e.return),al(3,e)}catch(x){Se(e,e.return,x)}try{Eo(5,e,e.return)}catch(x){Se(e,e.return,x)}}break;case 1:xt(t,e),Lt(e),r&512&&n!==null&&Er(n,n.return);break;case 5:if(xt(t,e),Lt(e),r&512&&n!==null&&Er(n,n.return),e.flags&32){var o=e.stateNode;try{Po(o,"")}catch(x){Se(e,e.return,x)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&tp(o,i),Pa(l,s);var u=Pa(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?sp(o,d):c==="dangerouslySetInnerHTML"?op(o,d):c==="children"?Po(o,d):Du(o,c,d,u)}switch(l){case"input":Ca(o,i);break;case"textarea":np(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?jr(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?jr(o,!!i.multiple,i.defaultValue,!0):jr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Fo]=i}catch(x){Se(e,e.return,x)}}break;case 6:if(xt(t,e),Lt(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){Se(e,e.return,x)}}break;case 3:if(xt(t,e),Lt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zo(t.containerInfo)}catch(x){Se(e,e.return,x)}break;case 4:xt(t,e),Lt(e);break;case 13:xt(t,e),Lt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(yc=Ee())),r&4&&tf(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Fe=(u=Fe)||c,xt(t,e),Fe=u):xt(t,e),Lt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(re=e,c=e.child;c!==null;){for(d=re=c;re!==null;){switch(f=re,p=f.child,f.tag){case 0:case 11:case 14:case 15:Eo(4,f,f.return);break;case 1:Er(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){Se(r,n,x)}}break;case 5:Er(f,f.return);break;case 22:if(f.memoizedState!==null){rf(d);continue}}p!==null?(p.return=f,re=p):rf(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=ip("display",s))}catch(x){Se(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Se(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:xt(t,e),Lt(e),r&4&&tf(e);break;case 21:break;default:xt(t,e),Lt(e)}}function Lt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Pm(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Po(o,""),r.flags&=-33);var i=ef(e);lu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=ef(e);su(e,l,s);break;default:throw Error(J(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mw(e,t,n){re=e,Lm(e)}function Lm(e,t,n){for(var r=(e.mode&1)!==0;re!==null;){var o=re,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ai;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Fe;l=Ai;var u=Fe;if(Ai=s,(Fe=a)&&!u)for(re=o;re!==null;)s=re,a=s.child,s.tag===22&&s.memoizedState!==null?of(o):a!==null?(a.return=s,re=a):of(o);for(;i!==null;)re=i,Lm(i),i=i.sibling;re=o,Ai=l,Fe=u}nf(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,re=i):nf(e)}}function nf(e){for(;re!==null;){var t=re;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Fe||al(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Fe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:wt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Fd(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Fd(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&zo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Fe||t.flags&512&&iu(t)}catch(f){Se(t,t.return,f)}}if(t===e){re=null;break}if(n=t.sibling,n!==null){n.return=t.return,re=n;break}re=t.return}}function rf(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}function of(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{al(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Se(t,o,a)}}var i=t.return;try{iu(t)}catch(a){Se(t,i,a)}break;case 5:var s=t.return;try{iu(t)}catch(a){Se(t,s,a)}}}catch(a){Se(t,t.return,a)}if(t===e){re=null;break}var l=t.sibling;if(l!==null){l.return=t.return,re=l;break}re=t.return}}var gw=Math.ceil,Ls=an.ReactCurrentDispatcher,mc=an.ReactCurrentOwner,gt=an.ReactCurrentBatchConfig,ue=0,Pe=null,_e=null,ze=0,ot=0,_r=In(0),Me=0,Yo=null,Zn=0,ul=0,gc=0,_o=null,Ke=null,yc=0,Hr=1/0,Kt=null,zs=!1,au=null,Cn=null,Ri=!1,wn=null,As=0,Co=0,uu=null,ss=-1,ls=0;function Ue(){return ue&6?Ee():ss!==-1?ss:ss=Ee()}function jn(e){return e.mode&1?ue&2&&ze!==0?ze&-ze:Jx.transition!==null?(ls===0&&(ls=vp()),ls):(e=de,e!==0||(e=window.event,e=e===void 0?16:_p(e.type)),e):1}function $t(e,t,n,r){if(50<Co)throw Co=0,uu=null,Error(J(185));si(e,n,r),(!(ue&2)||e!==Pe)&&(e===Pe&&(!(ue&2)&&(ul|=n),Me===4&&yn(e,ze)),et(e,r),n===1&&ue===0&&!(t.mode&1)&&(Hr=Ee()+500,il&&Tn()))}function et(e,t){var n=e.callbackNode;Jv(e,t);var r=xs(e,e===Pe?ze:0);if(r===0)n!==null&&hd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&hd(n),t===1)e.tag===0?Zx(sf.bind(null,e)):Wp(sf.bind(null,e)),Kx(function(){!(ue&6)&&Tn()}),n=null;else{switch(xp(r)){case 1:n=Vu;break;case 4:n=gp;break;case 16:n=vs;break;case 536870912:n=yp;break;default:n=vs}n=Bm(n,zm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function zm(e,t){if(ss=-1,ls=0,ue&6)throw Error(J(327));var n=e.callbackNode;if(Ir()&&e.callbackNode!==n)return null;var r=xs(e,e===Pe?ze:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Rs(e,r);else{t=r;var o=ue;ue|=2;var i=Rm();(Pe!==e||ze!==t)&&(Kt=null,Hr=Ee()+500,Bn(e,t));do try{xw();break}catch(l){Am(e,l)}while(!0);nc(),Ls.current=i,ue=o,_e!==null?t=0:(Pe=null,ze=0,t=Me)}if(t!==0){if(t===2&&(o=Aa(e),o!==0&&(r=o,t=cu(e,o))),t===1)throw n=Yo,Bn(e,0),yn(e,r),et(e,Ee()),n;if(t===6)yn(e,r);else{if(o=e.current.alternate,!(r&30)&&!yw(o)&&(t=Rs(e,r),t===2&&(i=Aa(e),i!==0&&(r=i,t=cu(e,i))),t===1))throw n=Yo,Bn(e,0),yn(e,r),et(e,Ee()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:zn(e,Ke,Kt);break;case 3:if(yn(e,r),(r&130023424)===r&&(t=yc+500-Ee(),10<t)){if(xs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ue(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wa(zn.bind(null,e,Ke,Kt),t);break}zn(e,Ke,Kt);break;case 4:if(yn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Mt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gw(r/1960))-r,10<r){e.timeoutHandle=Wa(zn.bind(null,e,Ke,Kt),r);break}zn(e,Ke,Kt);break;case 5:zn(e,Ke,Kt);break;default:throw Error(J(329))}}}return et(e,Ee()),e.callbackNode===n?zm.bind(null,e):null}function cu(e,t){var n=_o;return e.current.memoizedState.isDehydrated&&(Bn(e,t).flags|=256),e=Rs(e,t),e!==2&&(t=Ke,Ke=n,t!==null&&du(t)),e}function du(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function yw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!bt(i(),o))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 yn(e,t){for(t&=~gc,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mt(t),r=1<<n;e[n]=-1,t&=~r}}function sf(e){if(ue&6)throw Error(J(327));Ir();var t=xs(e,0);if(!(t&1))return et(e,Ee()),null;var n=Rs(e,t);if(e.tag!==0&&n===2){var r=Aa(e);r!==0&&(t=r,n=cu(e,r))}if(n===1)throw n=Yo,Bn(e,0),yn(e,t),et(e,Ee()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zn(e,Ke,Kt),et(e,Ee()),null}function vc(e,t){var n=ue;ue|=1;try{return e(t)}finally{ue=n,ue===0&&(Hr=Ee()+500,il&&Tn())}}function Jn(e){wn!==null&&wn.tag===0&&!(ue&6)&&Ir();var t=ue;ue|=1;var n=gt.transition,r=de;try{if(gt.transition=null,de=1,e)return e()}finally{de=r,gt.transition=n,ue=t,!(ue&6)&&Tn()}}function xc(){ot=_r.current,me(_r)}function Bn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Xx(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(Ju(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Es();break;case 3:Or(),me(Ze),me(He),ac();break;case 5:lc(r);break;case 4:Or();break;case 13:me(ve);break;case 19:me(ve);break;case 10:rc(r.type._context);break;case 22:case 23:xc()}n=n.return}if(Pe=e,_e=e=Mn(e.current,null),ze=ot=t,Me=0,Yo=null,gc=ul=Zn=0,Ke=_o=null,Dn!==null){for(t=0;t<Dn.length;t++)if(n=Dn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Dn=null}return e}function Am(e,t){do{var n=_e;try{if(nc(),rs.current=Ts,Is){for(var r=xe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Is=!1}if(qn=0,be=je=xe=null,No=!1,Vo=0,mc.current=null,n===null||n.return===null){Me=1,Yo=t,_e=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=ze,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Yd(s);if(p!==null){p.flags&=-257,Xd(p,s,l,i,t),p.mode&1&&Ud(i,u,t),t=p,a=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(a),t.updateQueue=x}else y.add(a);break e}else{if(!(t&1)){Ud(i,u,t),wc();break e}a=Error(J(426))}}else if(ye&&l.mode&1){var k=Yd(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Xd(k,s,l,i,t),ec(Fr(a,l));break e}}i=a=Fr(a,l),Me!==4&&(Me=2),_o===null?_o=[i]:_o.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=xm(i,a,t);Od(i,g);break e;case 1:l=a;var v=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Cn===null||!Cn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=wm(i,l,t);Od(i,w);break e}}i=i.return}while(i!==null)}Om(n)}catch(_){t=_,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(!0)}function Rm(){var e=Ls.current;return Ls.current=Ts,e===null?Ts:e}function wc(){(Me===0||Me===3||Me===2)&&(Me=4),Pe===null||!(Zn&268435455)&&!(ul&268435455)||yn(Pe,ze)}function Rs(e,t){var n=ue;ue|=2;var r=Rm();(Pe!==e||ze!==t)&&(Kt=null,Bn(e,t));do try{vw();break}catch(o){Am(e,o)}while(!0);if(nc(),ue=n,Ls.current=r,_e!==null)throw Error(J(261));return Pe=null,ze=0,Me}function vw(){for(;_e!==null;)Dm(_e)}function xw(){for(;_e!==null&&!Wv();)Dm(_e)}function Dm(e){var t=Hm(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?Om(e):_e=t,mc.current=null}function Om(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fw(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,_e=null;return}}else if(n=dw(n,t,ot),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Me===0&&(Me=5)}function zn(e,t,n){var r=de,o=gt.transition;try{gt.transition=null,de=1,ww(e,t,n,r)}finally{gt.transition=o,de=r}return null}function ww(e,t,n,r){do Ir();while(wn!==null);if(ue&6)throw Error(J(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ex(e,i),e===Pe&&(_e=Pe=null,ze=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ri||(Ri=!0,Bm(vs,function(){return Ir(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=gt.transition,gt.transition=null;var s=de;de=1;var l=ue;ue|=4,mc.current=null,pw(e,n),Tm(n,e),Fx(Ba),ws=!!Ha,Ba=Ha=null,e.current=n,mw(n),Uv(),ue=l,de=s,gt.transition=i}else e.current=n;if(Ri&&(Ri=!1,wn=e,As=o),i=e.pendingLanes,i===0&&(Cn=null),Kv(n.stateNode),et(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(zs)throw zs=!1,e=au,au=null,e;return As&1&&e.tag!==0&&Ir(),i=e.pendingLanes,i&1?e===uu?Co++:(Co=0,uu=e):Co=0,Tn(),null}function Ir(){if(wn!==null){var e=xp(As),t=gt.transition,n=de;try{if(gt.transition=null,de=16>e?16:e,wn===null)var r=!1;else{if(e=wn,wn=null,As=0,ue&6)throw Error(J(331));var o=ue;for(ue|=4,re=e.current;re!==null;){var i=re,s=i.child;if(re.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(re=u;re!==null;){var c=re;switch(c.tag){case 0:case 11:case 15:Eo(8,c,i)}var d=c.child;if(d!==null)d.return=c,re=d;else for(;re!==null;){c=re;var f=c.sibling,p=c.return;if(bm(c),c===u){re=null;break}if(f!==null){f.return=p,re=f;break}re=p}}}var y=i.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var k=x.sibling;x.sibling=null,x=k}while(x!==null)}}re=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,re=s;else e:for(;re!==null;){if(i=re,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Eo(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,re=g;break e}re=i.return}}var v=e.current;for(re=v;re!==null;){s=re;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,re=m;else e:for(s=v;re!==null;){if(l=re,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:al(9,l)}}catch(_){Se(l,l.return,_)}if(l===s){re=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,re=w;break e}re=l.return}}if(ue=o,Tn(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(el,e)}catch{}r=!0}return r}finally{de=n,gt.transition=t}}return!1}function lf(e,t,n){t=Fr(n,t),t=xm(e,t,1),e=_n(e,t,1),t=Ue(),e!==null&&(si(e,1,t),et(e,t))}function Se(e,t,n){if(e.tag===3)lf(e,e,n);else for(;t!==null;){if(t.tag===3){lf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Cn===null||!Cn.has(r))){e=Fr(n,e),e=wm(t,e,1),t=_n(t,e,1),e=Ue(),t!==null&&(si(t,1,e),et(t,e));break}}t=t.return}}function kw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ue(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(ze&n)===n&&(Me===4||Me===3&&(ze&130023424)===ze&&500>Ee()-yc?Bn(e,0):gc|=n),et(e,t)}function Fm(e,t){t===0&&(e.mode&1?(t=ji,ji<<=1,!(ji&130023424)&&(ji=4194304)):t=1);var n=Ue();e=rn(e,t),e!==null&&(si(e,t,n),et(e,n))}function Sw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fm(e,n)}function Nw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),Fm(e,n)}var Hm;Hm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ze.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,cw(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,ye&&t.flags&1048576&&Up(t,js,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;is(e,t),e=t.pendingProps;var o=Ar(t,He.current);Pr(t,n),o=cc(null,t,r,e,o,n);var i=dc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Je(r)?(i=!0,_s(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ic(t),o.updater=ll,t.stateNode=o,o._reactInternals=t,qa(t,r,e,n),t=eu(null,t,r,!0,i,n)):(t.tag=0,ye&&i&&Zu(t),We(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(is(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_w(r),e=wt(r,e),o){case 0:t=Ja(null,t,r,e,n);break e;case 1:t=Qd(null,t,r,e,n);break e;case 11:t=Kd(null,t,r,e,n);break e;case 14:t=Gd(null,t,r,wt(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wt(r,o),Ja(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wt(r,o),Qd(e,t,r,o,n);case 3:e:{if(Em(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,qp(e,t),bs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fr(Error(J(423)),t),t=qd(e,t,r,n,o);break e}else if(r!==o){o=Fr(Error(J(424)),t),t=qd(e,t,r,n,o);break e}else for(st=En(t.stateNode.containerInfo.firstChild),lt=t,ye=!0,Nt=null,n=Gp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Rr(),r===o){t=on(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return Zp(t),e===null&&Ka(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Va(r,o)?s=null:i!==null&&Va(r,i)&&(t.flags|=32),Nm(e,t),We(e,t,s,n),t.child;case 6:return e===null&&Ka(t),null;case 13:return _m(e,t,n);case 4:return sc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Dr(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wt(r,o),Kd(e,t,r,o,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,fe(Ms,r._currentValue),r._currentValue=s,i!==null)if(bt(i.value,s)){if(i.children===o.children&&!Ze.current){t=on(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Jt(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Ga(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(J(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ga(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}We(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Pr(t,n),o=yt(o),r=r(o),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,o=wt(r,t.pendingProps),o=wt(r.type,o),Gd(e,t,r,o,n);case 15:return km(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wt(r,o),is(e,t),t.tag=1,Je(r)?(e=!0,_s(t)):e=!1,Pr(t,n),vm(t,r,o),qa(t,r,o,n),eu(null,t,r,!0,e,n);case 19:return Cm(e,t,n);case 22:return Sm(e,t,n)}throw Error(J(156,t.tag))};function Bm(e,t){return mp(e,t)}function Ew(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.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 mt(e,t,n,r){return new Ew(e,t,n,r)}function kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _w(e){if(typeof e=="function")return kc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fu)return 11;if(e===Hu)return 14}return 2}function Mn(e,t){var n=e.alternate;return n===null?(n=mt(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&14680064,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}function as(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")kc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case mr:return Vn(n.children,o,i,t);case Ou:s=8,o|=8;break;case ka:return e=mt(12,n,t,o|2),e.elementType=ka,e.lanes=i,e;case Sa:return e=mt(13,n,t,o),e.elementType=Sa,e.lanes=i,e;case Na:return e=mt(19,n,t,o),e.elementType=Na,e.lanes=i,e;case Zh:return cl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qh:s=10;break e;case qh:s=9;break e;case Fu:s=11;break e;case Hu:s=14;break e;case fn:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=mt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Vn(e,t,n,r){return e=mt(7,e,r,t),e.lanes=n,e}function cl(e,t,n,r){return e=mt(22,e,r,t),e.elementType=Zh,e.lanes=n,e.stateNode={isHidden:!1},e}function oa(e,t,n){return e=mt(6,e,null,t),e.lanes=n,e}function ia(e,t,n){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cw(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Sc(e,t,n,r,o,i,s,l,a){return e=new Cw(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=mt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ic(i),e}function jw(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Vm(e){if(!e)return bn;e=e._reactInternals;e:{if(sr(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Je(n))return Vp(e,n,t)}return t}function Wm(e,t,n,r,o,i,s,l,a){return e=Sc(n,r,!0,e,o,i,s,l,a),e.context=Vm(null),n=e.current,r=Ue(),o=jn(n),i=Jt(r,o),i.callback=t??null,_n(n,i,o),e.current.lanes=o,si(e,o,r),et(e,r),e}function dl(e,t,n,r){var o=t.current,i=Ue(),s=jn(o);return n=Vm(n),t.context===null?t.context=n:t.pendingContext=n,t=Jt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=_n(o,t,s),e!==null&&($t(e,o,s,i),ns(e,o,s)),s}function Ds(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function af(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Nc(e,t){af(e,t),(e=e.alternate)&&af(e,t)}function Mw(){return null}var Um=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ec(e){this._internalRoot=e}fl.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));dl(e,t,null,null)};fl.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jn(function(){dl(null,e,null,null)}),t[nn]=null}};function fl(e){this._internalRoot=e}fl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gn.length&&t!==0&&t<gn[n].priority;n++);gn.splice(n,0,e),n===0&&Ep(e)}};function _c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function uf(){}function $w(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ds(s);i.call(u)}}var s=Wm(t,r,e,0,null,!1,!1,"",uf);return e._reactRootContainer=s,e[nn]=s.current,Do(e.nodeType===8?e.parentNode:e),Jn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=Ds(a);l.call(u)}}var a=Sc(e,0,!1,null,null,!1,!1,"",uf);return e._reactRootContainer=a,e[nn]=a.current,Do(e.nodeType===8?e.parentNode:e),Jn(function(){dl(t,a,n,r)}),a}function pl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=Ds(s);l.call(a)}}dl(t,s,e,o)}else s=$w(n,t,e,o,r);return Ds(s)}wp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ho(t.pendingLanes);n!==0&&(Wu(t,n|1),et(t,Ee()),!(ue&6)&&(Hr=Ee()+500,Tn()))}break;case 13:Jn(function(){var r=rn(e,1);if(r!==null){var o=Ue();$t(r,e,1,o)}}),Nc(e,1)}};Uu=function(e){if(e.tag===13){var t=rn(e,134217728);if(t!==null){var n=Ue();$t(t,e,134217728,n)}Nc(e,134217728)}};kp=function(e){if(e.tag===13){var t=jn(e),n=rn(e,t);if(n!==null){var r=Ue();$t(n,e,t,r)}Nc(e,t)}};Sp=function(){return de};Np=function(e,t){var n=de;try{return de=e,t()}finally{de=n}};Ta=function(e,t,n){switch(t){case"input":if(Ca(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=ol(r);if(!o)throw Error(J(90));ep(r),Ca(r,o)}}}break;case"textarea":np(e,n);break;case"select":t=n.value,t!=null&&jr(e,!!n.multiple,t,!1)}};up=vc;cp=Jn;var bw={usingClientEntryPoint:!1,Events:[ai,xr,ol,lp,ap,vc]},lo={findFiberByHostInstance:Rn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pw={bundleType:lo.bundleType,version:lo.version,rendererPackageName:lo.rendererPackageName,rendererConfig:lo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:an.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hp(e),e===null?null:e.stateNode},findFiberByHostInstance:lo.findFiberByHostInstance||Mw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Di=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Di.isDisabled&&Di.supportsFiber)try{el=Di.inject(Pw),Ft=Di}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bw;ct.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_c(t))throw Error(J(200));return jw(e,t,null,n)};ct.createRoot=function(e,t){if(!_c(e))throw Error(J(299));var n=!1,r="",o=Um;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Sc(e,1,!1,null,null,n,!1,r,o),e[nn]=t.current,Do(e.nodeType===8?e.parentNode:e),new Ec(t)};ct.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=hp(t),e=e===null?null:e.stateNode,e};ct.flushSync=function(e){return Jn(e)};ct.hydrate=function(e,t,n){if(!hl(t))throw Error(J(200));return pl(null,e,t,!0,n)};ct.hydrateRoot=function(e,t,n){if(!_c(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Um;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Wm(t,null,e,1,n??null,o,!1,i,s),e[nn]=t.current,Do(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new fl(t)};ct.render=function(e,t,n){if(!hl(t))throw Error(J(200));return pl(null,e,t,!1,n)};ct.unmountComponentAtNode=function(e){if(!hl(e))throw Error(J(40));return e._reactRootContainer?(Jn(function(){pl(null,null,e,!1,function(){e._reactRootContainer=null,e[nn]=null})}),!0):!1};ct.unstable_batchedUpdates=vc;ct.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hl(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return pl(e,t,n,!1,r)};ct.version="18.3.1-next-f1338f8080-20240426";function Ym(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ym)}catch(e){console.error(e)}}Ym(),Yh.exports=ct;var Xm=Yh.exports,Km,cf=Xm;Km=cf.createRoot,cf.hydrateRoot;function Ce(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ce(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Iw={value:()=>{}};function ml(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new us(n)}function us(e){this._=e}function Tw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}us.prototype=ml.prototype={constructor:us,on:function(e,t){var n=this._,r=Tw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Lw(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=df(n[o],e.name,t);else if(t==null)for(o in n)n[o]=df(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new us(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Lw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function df(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Iw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fu="http://www.w3.org/1999/xhtml";const ff={svg:"http://www.w3.org/2000/svg",xhtml:fu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ff.hasOwnProperty(t)?{space:ff[t],local:e}:e}function zw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fu&&t.documentElement.namespaceURI===fu?t.createElement(e):t.createElementNS(n,e)}}function Aw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gm(e){var t=gl(e);return(t.local?Aw:zw)(t)}function Rw(){}function Cc(e){return e==null?Rw:function(){return this.querySelector(e)}}function Dw(e){typeof e!="function"&&(e=Cc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new ut(r,this._parents)}function Ow(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fw(){return[]}function Qm(e){return e==null?Fw:function(){return this.querySelectorAll(e)}}function Hw(e){return function(){return Ow(e.apply(this,arguments))}}function Bw(e){typeof e=="function"?e=Hw(e):e=Qm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new ut(r,o)}function qm(e){return function(){return this.matches(e)}}function Zm(e){return function(t){return t.matches(e)}}var Vw=Array.prototype.find;function Ww(e){return function(){return Vw.call(this.children,e)}}function Uw(){return this.firstElementChild}function Yw(e){return this.select(e==null?Uw:Ww(typeof e=="function"?e:Zm(e)))}var Xw=Array.prototype.filter;function Kw(){return Array.from(this.children)}function Gw(e){return function(){return Xw.call(this.children,e)}}function Qw(e){return this.selectAll(e==null?Kw:Gw(typeof e=="function"?e:Zm(e)))}function qw(e){typeof e!="function"&&(e=qm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new ut(r,this._parents)}function Jm(e){return new Array(e.length)}function Zw(){return new ut(this._enter||this._groups.map(Jm),this._parents)}function Os(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Os.prototype={constructor:Os,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Jw(e){return function(){return e}}function e1(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Os(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function t1(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(f[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<d;++l)p=s.call(e,i[l],l,i)+"",(a=u.get(p))?(r[l]=a,a.__data__=i[l],u.delete(p)):n[l]=new Os(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function n1(e){return e.__data__}function r1(e,t){if(!arguments.length)return Array.from(this,n1);var n=t?t1:e1,r=this._parents,o=this._groups;typeof e!="function"&&(e=Jw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,p=o1(e.call(c,c&&c.__data__,u,r)),y=p.length,x=l[u]=new Array(y),k=s[u]=new Array(y),g=a[u]=new Array(f);n(c,d,x,k,g,p,t);for(var v=0,m=0,w,_;v<y;++v)if(w=x[v]){for(v>=m&&(m=v+1);!(_=k[m])&&++m<y;);w._next=_||null}}return s=new ut(s,r),s._enter=l,s._exit=a,s}function o1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function i1(){return new ut(this._exit||this._groups.map(Jm),this._parents)}function s1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function l1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),p,y=0;y<d;++y)(p=u[y]||c[y])&&(f[y]=p);for(;a<o;++a)l[a]=n[a];return new ut(l,this._parents)}function a1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function u1(e){e||(e=c1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new ut(o,this._parents).order()}function c1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function f1(){return Array.from(this)}function h1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function p1(){let e=0;for(const t of this)++e;return e}function m1(){return!this.node()}function g1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function y1(e){return function(){this.removeAttribute(e)}}function v1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function x1(e,t){return function(){this.setAttribute(e,t)}}function w1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function k1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function S1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function N1(e,t){var n=gl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?v1:y1:typeof t=="function"?n.local?S1:k1:n.local?w1:x1)(n,t))}function eg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function E1(e){return function(){this.style.removeProperty(e)}}function _1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function C1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function j1(e,t,n){return arguments.length>1?this.each((t==null?E1:typeof t=="function"?C1:_1)(e,t,n??"")):Br(this.node(),e)}function Br(e,t){return e.style.getPropertyValue(t)||eg(e).getComputedStyle(e,null).getPropertyValue(t)}function M1(e){return function(){delete this[e]}}function $1(e,t){return function(){this[e]=t}}function b1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function P1(e,t){return arguments.length>1?this.each((t==null?M1:typeof t=="function"?b1:$1)(e,t)):this.node()[e]}function tg(e){return e.trim().split(/^|\s+/)}function jc(e){return e.classList||new ng(e)}function ng(e){this._node=e,this._names=tg(e.getAttribute("class")||"")}ng.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function rg(e,t){for(var n=jc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function og(e,t){for(var n=jc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function I1(e){return function(){rg(this,e)}}function T1(e){return function(){og(this,e)}}function L1(e,t){return function(){(t.apply(this,arguments)?rg:og)(this,e)}}function z1(e,t){var n=tg(e+"");if(arguments.length<2){for(var r=jc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?L1:t?I1:T1)(n,t))}function A1(){this.textContent=""}function R1(e){return function(){this.textContent=e}}function D1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function O1(e){return arguments.length?this.each(e==null?A1:(typeof e=="function"?D1:R1)(e)):this.node().textContent}function F1(){this.innerHTML=""}function H1(e){return function(){this.innerHTML=e}}function B1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function V1(e){return arguments.length?this.each(e==null?F1:(typeof e=="function"?B1:H1)(e)):this.node().innerHTML}function W1(){this.nextSibling&&this.parentNode.appendChild(this)}function U1(){return this.each(W1)}function Y1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function X1(){return this.each(Y1)}function K1(e){var t=typeof e=="function"?e:Gm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function G1(){return null}function Q1(e,t){var n=typeof e=="function"?e:Gm(e),r=t==null?G1:typeof t=="function"?t:Cc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function q1(){var e=this.parentNode;e&&e.removeChild(this)}function Z1(){return this.each(q1)}function J1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ek(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tk(e){return this.select(e?ek:J1)}function nk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rk(e){return function(t){e.call(this,t,this.__data__)}}function ok(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ik(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function sk(e,t,n){return function(){var r=this.__on,o,i=rk(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function lk(e,t,n){var r=ok(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?sk:ik,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function ig(e,t,n){var r=eg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function ak(e,t){return function(){return ig(this,e,t)}}function uk(e,t){return function(){return ig(this,e,t.apply(this,arguments))}}function ck(e,t){return this.each((typeof t=="function"?uk:ak)(e,t))}function*dk(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var sg=[null];function ut(e,t){this._groups=e,this._parents=t}function ci(){return new ut([[document.documentElement]],sg)}function fk(){return this}ut.prototype=ci.prototype={constructor:ut,select:Dw,selectAll:Bw,selectChild:Yw,selectChildren:Qw,filter:qw,data:r1,enter:Zw,exit:i1,join:s1,merge:l1,selection:fk,order:a1,sort:u1,call:d1,nodes:f1,node:h1,size:p1,empty:m1,each:g1,attr:N1,style:j1,property:P1,classed:z1,text:O1,html:V1,raise:U1,lower:X1,append:K1,insert:Q1,remove:Z1,clone:tk,datum:nk,on:lk,dispatch:ck,[Symbol.iterator]:dk};function it(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],sg)}function hk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function St(e,t){if(e=hk(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const pk={passive:!1},Xo={capture:!0,passive:!1};function sa(e){e.stopImmediatePropagation()}function Tr(e){e.preventDefault(),e.stopImmediatePropagation()}function lg(e){var t=e.document.documentElement,n=it(e).on("dragstart.drag",Tr,Xo);"onselectstart"in t?n.on("selectstart.drag",Tr,Xo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ag(e,t){var n=e.document.documentElement,r=it(e).on("dragstart.drag",null);t&&(r.on("click.drag",Tr,Xo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Oi=e=>()=>e;function hu(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}hu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mk(e){return!e.ctrlKey&&!e.button}function gk(){return this.parentNode}function yk(e,t){return t??{x:e.x,y:e.y}}function vk(){return navigator.maxTouchPoints||"ontouchstart"in this}function ug(){var e=mk,t=gk,n=yk,r=vk,o={},i=ml("start","drag","end"),s=0,l,a,u,c,d=0;function f(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",k).on("touchmove.drag",g,pk).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,_){if(!(c||!e.call(this,w,_))){var S=m(this,t.call(this,w,_),w,_,"mouse");S&&(it(w.view).on("mousemove.drag",y,Xo).on("mouseup.drag",x,Xo),lg(w.view),sa(w),u=!1,l=w.clientX,a=w.clientY,S("start",w))}}function y(w){if(Tr(w),!u){var _=w.clientX-l,S=w.clientY-a;u=_*_+S*S>d}o.mouse("drag",w)}function x(w){it(w.view).on("mousemove.drag mouseup.drag",null),ag(w.view,u),Tr(w),o.mouse("end",w)}function k(w,_){if(e.call(this,w,_)){var S=w.changedTouches,C=t.call(this,w,_),j=S.length,I,R;for(I=0;I<j;++I)(R=m(this,C,w,_,S[I].identifier,S[I]))&&(sa(w),R("start",w,S[I]))}}function g(w){var _=w.changedTouches,S=_.length,C,j;for(C=0;C<S;++C)(j=o[_[C].identifier])&&(Tr(w),j("drag",w,_[C]))}function v(w){var _=w.changedTouches,S=_.length,C,j;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<S;++C)(j=o[_[C].identifier])&&(sa(w),j("end",w,_[C]))}function m(w,_,S,C,j,I){var R=i.copy(),D=St(I||S,_),W,H,N;if((N=n.call(w,new hu("beforestart",{sourceEvent:S,target:f,identifier:j,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:R}),C))!=null)return W=N.x-D[0]||0,H=N.y-D[1]||0,function T(L,A,P){var M=D,z;switch(L){case"start":o[j]=T,z=s++;break;case"end":delete o[j],--s;case"drag":D=St(P||A,_),z=s;break}R.call(L,w,new hu(L,{sourceEvent:A,subject:N,target:f,identifier:j,active:z,x:D[0]+W,y:D[1]+H,dx:D[0]-M[0],dy:D[1]-M[1],dispatch:R}),C)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Oi(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Oi(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Oi(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Oi(!!w),f):r},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function Mc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function cg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function di(){}var Ko=.7,Fs=1/Ko,Lr="\\s*([+-]?\\d+)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xk=/^#([0-9a-f]{3,8})$/,wk=new RegExp(`^rgb\\(${Lr},${Lr},${Lr}\\)$`),kk=new RegExp(`^rgb\\(${Bt},${Bt},${Bt}\\)$`),Sk=new RegExp(`^rgba\\(${Lr},${Lr},${Lr},${Go}\\)$`),Nk=new RegExp(`^rgba\\(${Bt},${Bt},${Bt},${Go}\\)$`),Ek=new RegExp(`^hsl\\(${Go},${Bt},${Bt}\\)$`),_k=new RegExp(`^hsla\\(${Go},${Bt},${Bt},${Go}\\)$`),hf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Mc(di,er,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pf,formatHex:pf,formatHex8:Ck,formatHsl:jk,formatRgb:mf,toString:mf});function pf(){return this.rgb().formatHex()}function Ck(){return this.rgb().formatHex8()}function jk(){return dg(this).formatHsl()}function mf(){return this.rgb().formatRgb()}function er(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xk.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gf(t):n===3?new qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wk.exec(e))?new qe(t[1],t[2],t[3],1):(t=kk.exec(e))?new qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sk.exec(e))?Fi(t[1],t[2],t[3],t[4]):(t=Nk.exec(e))?Fi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ek.exec(e))?xf(t[1],t[2]/100,t[3]/100,1):(t=_k.exec(e))?xf(t[1],t[2]/100,t[3]/100,t[4]):hf.hasOwnProperty(e)?gf(hf[e]):e==="transparent"?new qe(NaN,NaN,NaN,0):null}function gf(e){return new qe(e>>16&255,e>>8&255,e&255,1)}function Fi(e,t,n,r){return r<=0&&(e=t=n=NaN),new qe(e,t,n,r)}function Mk(e){return e instanceof di||(e=er(e)),e?(e=e.rgb(),new qe(e.r,e.g,e.b,e.opacity)):new qe}function pu(e,t,n,r){return arguments.length===1?Mk(e):new qe(e,t,n,r??1)}function qe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Mc(qe,pu,cg(di,{brighter(e){return e=e==null?Fs:Math.pow(Fs,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,e),new qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qe(Wn(this.r),Wn(this.g),Wn(this.b),Hs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yf,formatHex:yf,formatHex8:$k,formatRgb:vf,toString:vf}));function yf(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}`}function $k(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}${Fn((isNaN(this.opacity)?1:this.opacity)*255)}`}function vf(){const e=Hs(this.opacity);return`${e===1?"rgb(":"rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${e===1?")":`, ${e})`}`}function Hs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fn(e){return e=Wn(e),(e<16?"0":"")+e.toString(16)}function xf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function dg(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof di||(e=er(e)),!e)return new Et;if(e instanceof Et)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Et(s,l,a,e.opacity)}function bk(e,t,n,r){return arguments.length===1?dg(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Mc(Et,bk,cg(di,{brighter(e){return e=e==null?Fs:Math.pow(Fs,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,e),new Et(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new qe(la(e>=240?e-240:e+120,o,r),la(e,o,r),la(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Et(wf(this.h),Hi(this.s),Hi(this.l),Hs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Hs(this.opacity);return`${e===1?"hsl(":"hsla("}${wf(this.h)}, ${Hi(this.s)*100}%, ${Hi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wf(e){return e=(e||0)%360,e<0?e+360:e}function Hi(e){return Math.max(0,Math.min(1,e||0))}function la(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $c=e=>()=>e;function Pk(e,t){return function(n){return e+n*t}}function Ik(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Tk(e){return(e=+e)==1?fg:function(t,n){return n-t?Ik(t,n,e):$c(isNaN(t)?n:t)}}function fg(e,t){var n=t-e;return n?Pk(e,n):$c(isNaN(e)?t:e)}const Bs=function e(t){var n=Tk(t);function r(o,i){var s=n((o=pu(o)).r,(i=pu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=fg(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Lk(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function zk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ak(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=jo(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function Rk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function At(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dk(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=jo(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var mu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,aa=new RegExp(mu.source,"g");function Ok(e){return function(){return e}}function Fk(e){return function(t){return e(t)+""}}function hg(e,t){var n=mu.lastIndex=aa.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=mu.exec(e))&&(o=aa.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:At(r,o)})),n=aa.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?Fk(a[0].x):Ok(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function jo(e,t){var n=typeof t,r;return t==null||n==="boolean"?$c(t):(n==="number"?At:n==="string"?(r=er(t))?(t=r,Bs):hg:t instanceof er?Bs:t instanceof Date?Rk:zk(t)?Lk:Array.isArray(t)?Ak:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Dk:At)(e,t)}var kf=180/Math.PI,gu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pg(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*kf,skewX:Math.atan(a)*kf,scaleX:s,scaleY:l}}var Bi;function Hk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?gu:pg(t.a,t.b,t.c,t.d,t.e,t.f)}function Bk(e){return e==null||(Bi||(Bi=document.createElementNS("http://www.w3.org/2000/svg","g")),Bi.setAttribute("transform",e),!(e=Bi.transform.baseVal.consolidate()))?gu:(e=e.matrix,pg(e.a,e.b,e.c,e.d,e.e,e.f))}function mg(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,p,y){if(u!==d||c!==f){var x=p.push("translate(",null,t,null,n);y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:At(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:At(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,p,y){if(u!==d||c!==f){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,f)})}else(d!==1||f!==1)&&p.push(o(p)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(p){for(var y=-1,x=f.length,k;++y<x;)d[(k=f[y]).i]=k.x(p);return d.join("")}}}var Vk=mg(Hk,"px, ","px)","deg)"),Wk=mg(Bk,", ",")",")"),Uk=1e-12;function Sf(e){return((e=Math.exp(e))+1/e)/2}function Yk(e){return((e=Math.exp(e))-1/e)/2}function Xk(e){return((e=Math.exp(2*e))-1)/(e+1)}const cs=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],p=c-l,y=d-a,x=p*p+y*y,k,g;if(x<Uk)g=Math.log(f/u)/t,k=function(C){return[l+C*p,a+C*y,u*Math.exp(t*C*g)]};else{var v=Math.sqrt(x),m=(f*f-u*u+r*x)/(2*u*n*v),w=(f*f-u*u-r*x)/(2*f*n*v),_=Math.log(Math.sqrt(m*m+1)-m),S=Math.log(Math.sqrt(w*w+1)-w);g=(S-_)/t,k=function(C){var j=C*g,I=Sf(_),R=u/(n*v)*(I*Xk(t*j+_)-Yk(_));return[l+R*p,a+R*y,u*I/Sf(t*j+_)]}}return k.duration=g*1e3*t/Math.SQRT2,k}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Vr=0,mo=0,ao=0,gg=1e3,Vs,go,Ws=0,tr=0,yl=0,Qo=typeof performance=="object"&&performance.now?performance:Date,yg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function bc(){return tr||(yg(Kk),tr=Qo.now()+yl)}function Kk(){tr=0}function Us(){this._call=this._time=this._next=null}Us.prototype=vg.prototype={constructor:Us,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?bc():+n)+(t==null?0:+t),!this._next&&go!==this&&(go?go._next=this:Vs=this,go=this),this._call=e,this._time=n,yu()},stop:function(){this._call&&(this._call=null,this._time=1/0,yu())}};function vg(e,t,n){var r=new Us;return r.restart(e,t,n),r}function Gk(){bc(),++Vr;for(var e=Vs,t;e;)(t=tr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vr}function Nf(){tr=(Ws=Qo.now())+yl,Vr=mo=0;try{Gk()}finally{Vr=0,qk(),tr=0}}function Qk(){var e=Qo.now(),t=e-Ws;t>gg&&(yl-=t,Ws=e)}function qk(){for(var e,t=Vs,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Vs=n);go=e,yu(r)}function yu(e){if(!Vr){mo&&(mo=clearTimeout(mo));var t=e-tr;t>24?(e<1/0&&(mo=setTimeout(Nf,e-Qo.now()-yl)),ao&&(ao=clearInterval(ao))):(ao||(Ws=Qo.now(),ao=setInterval(Qk,gg)),Vr=1,yg(Nf))}}function Ef(e,t,n){var r=new Us;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Zk=ml("start","end","cancel","interrupt"),Jk=[],xg=0,_f=1,vu=2,ds=3,Cf=4,xu=5,fs=6;function vl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;eS(e,n,{name:t,index:r,group:o,on:Zk,tween:Jk,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:xg})}function Pc(e,t){var n=It(e,t);if(n.state>xg)throw new Error("too late; already scheduled");return n}function Wt(e,t){var n=It(e,t);if(n.state>ds)throw new Error("too late; already running");return n}function It(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eS(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=vg(i,0,n.time);function i(u){n.state=_f,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,p;if(n.state!==_f)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ds)return Ef(s);p.state===Cf?(p.state=fs,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=fs,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(Ef(function(){n.state===ds&&(n.state=Cf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=vu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===vu){for(n.state=ds,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=p);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=xu,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===xu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=fs,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function hs(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>vu&&r.state<xu,r.state=fs,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function tS(e){return this.each(function(){hs(this,e)})}function nS(e,t){var n,r;return function(){var o=Wt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function rS(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Wt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function oS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=It(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?nS:rS)(n,e,t))}function Ic(e,t,n){var r=e._id;return e.each(function(){var o=Wt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return It(o,r).value[t]}}function wg(e,t){var n;return(typeof t=="number"?At:t instanceof er?Bs:(n=er(t))?(t=n,Bs):hg)(e,t)}function iS(e){return function(){this.removeAttribute(e)}}function sS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function aS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function uS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function cS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function dS(e,t){var n=gl(e),r=n==="transform"?Wk:wg;return this.attrTween(e,typeof t=="function"?(n.local?cS:uS)(n,r,Ic(this,"attr."+e,t)):t==null?(n.local?sS:iS)(n):(n.local?aS:lS)(n,r,t))}function fS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&hS(e,i)),n}return o._value=t,o}function mS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&fS(e,i)),n}return o._value=t,o}function gS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=gl(e);return this.tween(n,(r.local?pS:mS)(r,t))}function yS(e,t){return function(){Pc(this,e).delay=+t.apply(this,arguments)}}function vS(e,t){return t=+t,function(){Pc(this,e).delay=t}}function xS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yS:vS)(t,e)):It(this.node(),t).delay}function wS(e,t){return function(){Wt(this,e).duration=+t.apply(this,arguments)}}function kS(e,t){return t=+t,function(){Wt(this,e).duration=t}}function SS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wS:kS)(t,e)):It(this.node(),t).duration}function NS(e,t){if(typeof t!="function")throw new Error;return function(){Wt(this,e).ease=t}}function ES(e){var t=this._id;return arguments.length?this.each(NS(t,e)):It(this.node(),t).ease}function _S(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Wt(this,e).ease=n}}function CS(e){if(typeof e!="function")throw new Error;return this.each(_S(this._id,e))}function jS(e){typeof e!="function"&&(e=qm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new sn(r,this._parents,this._name,this._id)}function MS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,p=0;p<c;++p)(f=a[p]||u[p])&&(d[p]=f);for(;l<r;++l)s[l]=t[l];return new sn(s,this._parents,this._name,this._id)}function $S(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function bS(e,t,n){var r,o,i=$S(t)?Pc:Wt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function PS(e,t){var n=this._id;return arguments.length<2?It(this.node(),n).on.on(e):this.each(bS(n,e,t))}function IS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function TS(){return this.on("end.remove",IS(this._id))}function LS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,vl(u[f],t,n,f,u,It(c,n)));return new sn(i,this._parents,t,n)}function zS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),p,y=It(c,n),x=0,k=f.length;x<k;++x)(p=f[x])&&vl(p,t,n,x,f,y);i.push(f),s.push(c)}return new sn(i,s,t,n)}var AS=ci.prototype.constructor;function RS(){return new AS(this._groups,this._parents)}function DS(e,t){var n,r,o;return function(){var i=Br(this,e),s=(this.style.removeProperty(e),Br(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function kg(e){return function(){this.style.removeProperty(e)}}function OS(e,t,n){var r,o=n+"",i;return function(){var s=Br(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function FS(e,t,n){var r,o,i;return function(){var s=Br(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Br(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function HS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Wt(this,e),u=a.on,c=a.value[i]==null?l||(l=kg(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function BS(e,t,n){var r=(e+="")=="transform"?Vk:wg;return t==null?this.styleTween(e,DS(e,r)).on("end.style."+e,kg(e)):typeof t=="function"?this.styleTween(e,FS(e,r,Ic(this,"style."+e,t))).each(HS(this._id,e)):this.styleTween(e,OS(e,r,t),n).on("end.style."+e,null)}function VS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function WS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&VS(e,s,n)),r}return i._value=t,i}function US(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,WS(e,t,n??""))}function YS(e){return function(){this.textContent=e}}function XS(e){return function(){var t=e(this);this.textContent=t??""}}function KS(e){return this.tween("text",typeof e=="function"?XS(Ic(this,"text",e)):YS(e==null?"":e+""))}function GS(e){return function(t){this.textContent=e.call(this,t)}}function QS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&GS(o)),t}return r._value=e,r}function qS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,QS(e))}function ZS(){for(var e=this._name,t=this._id,n=Sg(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=It(a,t);vl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new sn(r,this._parents,e,n)}function JS(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Wt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var eN=0;function sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Sg(){return++eN}var Xt=ci.prototype;sn.prototype={constructor:sn,select:LS,selectAll:zS,selectChild:Xt.selectChild,selectChildren:Xt.selectChildren,filter:jS,merge:MS,selection:RS,transition:ZS,call:Xt.call,nodes:Xt.nodes,node:Xt.node,size:Xt.size,empty:Xt.empty,each:Xt.each,on:PS,attr:dS,attrTween:gS,style:BS,styleTween:US,text:KS,textTween:qS,remove:TS,tween:oS,delay:xS,duration:SS,ease:ES,easeVarying:CS,end:JS,[Symbol.iterator]:Xt[Symbol.iterator]};function tN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nN={time:null,delay:0,duration:250,ease:tN};function rN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function oN(e){var t,n;e instanceof sn?(t=e._id,e=e._name):(t=Sg(),(n=nN).time=bc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&vl(a,e,t,u,s,n||rN(a,t));return new sn(r,this._parents,e,t)}ci.prototype.interrupt=tS;ci.prototype.transition=oN;const Vi=e=>()=>e;function iN(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Zt(e,t,n){this.k=e,this.x=t,this.y=n}Zt.prototype={constructor:Zt,scale:function(e){return e===1?this:new Zt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Zt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xl=new Zt(1,0,0);Ng.prototype=Zt.prototype;function Ng(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xl;return e.__zoom}function ua(e){e.stopImmediatePropagation()}function uo(e){e.preventDefault(),e.stopImmediatePropagation()}function sN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function jf(){return this.__zoom||xl}function aN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uN(){return navigator.maxTouchPoints||"ontouchstart"in this}function cN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Eg(){var e=sN,t=lN,n=cN,r=aN,o=uN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=cs,u=ml("start","zoom","end"),c,d,f,p=500,y=150,x=0,k=10;function g(N){N.property("__zoom",jf).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(N,T,L,A){var P=N.selection?N.selection():N;P.property("__zoom",jf),N!==P?_(N,T,L,A):P.interrupt().each(function(){S(this,arguments).event(A).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},g.scaleBy=function(N,T,L,A){g.scaleTo(N,function(){var P=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return P*M},L,A)},g.scaleTo=function(N,T,L,A){g.transform(N,function(){var P=t.apply(this,arguments),M=this.__zoom,z=L==null?w(P):typeof L=="function"?L.apply(this,arguments):L,O=M.invert(z),Y=typeof T=="function"?T.apply(this,arguments):T;return n(m(v(M,Y),z,O),P,s)},L,A)},g.translateBy=function(N,T,L,A){g.transform(N,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),s)},null,A)},g.translateTo=function(N,T,L,A,P){g.transform(N,function(){var M=t.apply(this,arguments),z=this.__zoom,O=A==null?w(M):typeof A=="function"?A.apply(this,arguments):A;return n(xl.translate(O[0],O[1]).scale(z.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof L=="function"?-L.apply(this,arguments):-L),M,s)},A,P)};function v(N,T){return T=Math.max(i[0],Math.min(i[1],T)),T===N.k?N:new Zt(T,N.x,N.y)}function m(N,T,L){var A=T[0]-L[0]*N.k,P=T[1]-L[1]*N.k;return A===N.x&&P===N.y?N:new Zt(N.k,A,P)}function w(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function _(N,T,L,A){N.on("start.zoom",function(){S(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(A).end()}).tween("zoom",function(){var P=this,M=arguments,z=S(P,M).event(A),O=t.apply(P,M),Y=L==null?w(O):typeof L=="function"?L.apply(P,M):L,ne=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),B=P.__zoom,F=typeof T=="function"?T.apply(P,M):T,Z=a(B.invert(Y).concat(ne/B.k),F.invert(Y).concat(ne/F.k));return function(q){if(q===1)q=F;else{var E=Z(q),$=ne/E[2];q=new Zt($,Y[0]-E[0]*$,Y[1]-E[1]*$)}z.zoom(null,q)}})}function S(N,T,L){return!L&&N.__zooming||new C(N,T)}function C(N,T){this.that=N,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,T),this.taps=0}C.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,T){return this.mouse&&N!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var T=it(this.that).datum();u.call(N,this.that,new iN(N,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),T)}};function j(N,...T){if(!e.apply(this,arguments))return;var L=S(this,T).event(N),A=this.__zoom,P=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),M=St(N);if(L.wheel)(L.mouse[0][0]!==M[0]||L.mouse[0][1]!==M[1])&&(L.mouse[1]=A.invert(L.mouse[0]=M)),clearTimeout(L.wheel);else{if(A.k===P)return;L.mouse=[M,A.invert(M)],hs(this),L.start()}uo(N),L.wheel=setTimeout(z,y),L.zoom("mouse",n(m(v(A,P),L.mouse[0],L.mouse[1]),L.extent,s));function z(){L.wheel=null,L.end()}}function I(N,...T){if(f||!e.apply(this,arguments))return;var L=N.currentTarget,A=S(this,T,!0).event(N),P=it(N.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ne,!0),M=St(N,L),z=N.clientX,O=N.clientY;lg(N.view),ua(N),A.mouse=[M,this.__zoom.invert(M)],hs(this),A.start();function Y(B){if(uo(B),!A.moved){var F=B.clientX-z,Z=B.clientY-O;A.moved=F*F+Z*Z>x}A.event(B).zoom("mouse",n(m(A.that.__zoom,A.mouse[0]=St(B,L),A.mouse[1]),A.extent,s))}function ne(B){P.on("mousemove.zoom mouseup.zoom",null),ag(B.view,A.moved),uo(B),A.event(B).end()}}function R(N,...T){if(e.apply(this,arguments)){var L=this.__zoom,A=St(N.changedTouches?N.changedTouches[0]:N,this),P=L.invert(A),M=L.k*(N.shiftKey?.5:2),z=n(m(v(L,M),A,P),t.apply(this,T),s);uo(N),l>0?it(this).transition().duration(l).call(_,z,A,N):it(this).call(g.transform,z,A,N)}}function D(N,...T){if(e.apply(this,arguments)){var L=N.touches,A=L.length,P=S(this,T,N.changedTouches.length===A).event(N),M,z,O,Y;for(ua(N),z=0;z<A;++z)O=L[z],Y=St(O,this),Y=[Y,this.__zoom.invert(Y),O.identifier],P.touch0?!P.touch1&&P.touch0[2]!==Y[2]&&(P.touch1=Y,P.taps=0):(P.touch0=Y,M=!0,P.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(P.taps<2&&(d=Y[0],c=setTimeout(function(){c=null},p)),hs(this),P.start())}}function W(N,...T){if(this.__zooming){var L=S(this,T).event(N),A=N.changedTouches,P=A.length,M,z,O,Y;for(uo(N),M=0;M<P;++M)z=A[M],O=St(z,this),L.touch0&&L.touch0[2]===z.identifier?L.touch0[0]=O:L.touch1&&L.touch1[2]===z.identifier&&(L.touch1[0]=O);if(z=L.that.__zoom,L.touch1){var ne=L.touch0[0],B=L.touch0[1],F=L.touch1[0],Z=L.touch1[1],q=(q=F[0]-ne[0])*q+(q=F[1]-ne[1])*q,E=(E=Z[0]-B[0])*E+(E=Z[1]-B[1])*E;z=v(z,Math.sqrt(q/E)),O=[(ne[0]+F[0])/2,(ne[1]+F[1])/2],Y=[(B[0]+Z[0])/2,(B[1]+Z[1])/2]}else if(L.touch0)O=L.touch0[0],Y=L.touch0[1];else return;L.zoom("touch",n(m(z,O,Y),L.extent,s))}}function H(N,...T){if(this.__zooming){var L=S(this,T).event(N),A=N.changedTouches,P=A.length,M,z;for(ua(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),M=0;M<P;++M)z=A[M],L.touch0&&L.touch0[2]===z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(z=St(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<k)){var O=it(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return g.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Vi(+N),g):r},g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Vi(!!N),g):e},g.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Vi(!!N),g):o},g.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Vi([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),g):t},g.scaleExtent=function(N){return arguments.length?(i[0]=+N[0],i[1]=+N[1],g):[i[0],i[1]]},g.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(N){return arguments.length?(n=N,g):n},g.duration=function(N){return arguments.length?(l=+N,g):l},g.interpolate=function(N){return arguments.length?(a=N,g):a},g.on=function(){var N=u.on.apply(u,arguments);return N===u?g:N},g.clickDistance=function(N){return arguments.length?(x=(N=+N)*N,g):Math.sqrt(x)},g.tapDistance=function(N){return arguments.length?(k=+N,g):k},g}const Pt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},qo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_g=["Enter"," ","Escape"],Cg={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Wr;(function(e){e.Strict="strict",e.Loose="loose"})(Wr||(Wr={}));var Un;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Un||(Un={}));var Zo;(function(e){e.Partial="partial",e.Full="full"})(Zo||(Zo={}));const jg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var vn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(vn||(vn={}));var Jo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jo||(Jo={}));var oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(oe||(oe={}));const Mf={[oe.Left]:oe.Right,[oe.Right]:oe.Left,[oe.Top]:oe.Bottom,[oe.Bottom]:oe.Top},Mg=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,dN=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Tc=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),fi=(e,t=[0,0])=>{const{width:n,height:r}=Tt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},fN=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((o,i)=>{const s=typeof i=="string";let l=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(l=s?t.nodeLookup.get(i):Tc(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,wl(o,Ys(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?kl(r):{x:0,y:0,width:0,height:0}},hi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=wl(n,Ys(o)),r=!0)}),r?kl(n):{x:0,y:0,width:0,height:0}},Lc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const f of e.values()){const{measured:p,selectable:y=!0,hidden:x=!1}=f;if(s&&!y||x)continue;const k=p.width??f.width??f.initialWidth??0,g=p.height??f.height??f.initialHeight??0,{x:v,y:m}=f.internals.positionAbsolute,w=Ig(l,a,u,c,v,m,k,g),_=k*g,S=i&&w>0;(!f.internals.handleBounds||S||w>=_||f.dragging)&&d.push(f)}return d},hN=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function pN(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=Tt(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function mN({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=pN(e,s),a=hi(l),u=Ac(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function $g({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Pt.error005());else{const{width:p,height:y}=Tt(l);p&&y&&(d=[[a,u],[a+p,u+y]])}else l&&rr(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=rr(d)?nr(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Pt.error015())),{position:{x:f.x-a+(s.measured.width??0)*c[0],y:f.y-u+(s.measured.height??0)*c[1]},positionAbsolute:f}}async function gN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),y=!p&&f.parentId&&s.find(x=>x.id===f.parentId);(p||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),c=hN(s,a);for(const f of a)l.has(f.id)&&!c.find(y=>y.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const Ur=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),nr=(e={x:0,y:0},t,n)=>({x:Ur(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ur(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function bg(e,t,n){const{width:r,height:o}=Tt(n),{x:i,y:s}=n.internals.positionAbsolute;return nr(e,[[i,s],[i+r,s+o]],t)}const $f=(e,t,n)=>e<t?Ur(Math.abs(e-t),1,t)/t:e>n?-Ur(Math.abs(e-n),1,t)/t:0,zc=(e,t,n=15,r=40)=>{const o=$f(e.x,r,t.width-r)*n,i=$f(e.y,r,t.height-r)*n;return[o,i]},wl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),wu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),kl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ei=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Tc(e)?e.internals.positionAbsolute:fi(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Ys=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Tc(e)?e.internals.positionAbsolute:fi(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Pg=(e,t)=>kl(wl(wu(e),wu(t))),Ig=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},Xs=(e,t)=>Ig(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),bf=e=>Ct(e.width)&&Ct(e.height)&&Ct(e.x)&&Ct(e.y),Ct=e=>!isNaN(e)&&isFinite(e),Tg=(e,t)=>(n,r)=>{},pi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),mi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?pi(l,s):l},Yr=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function ur(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ur(e,n),o=ur(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=ur(e.top??e.y??0,n),o=ur(e.bottom??e.y??0,n),i=ur(e.left??e.x??0,t),s=ur(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vN(e,t,n,r,o,i){const{x:s,y:l}=Yr(e,[t,n,r]),{x:a,y:u}=Yr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const Ac=(e,t,n,r,o,i)=>{const s=yN(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Ur(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,y=n/2-f*c,x=vN(e,p,y,c,t,n),k={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:p-k.left+k.right,y:y-k.top+k.bottom,zoom:c}},ti=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function rr(e){return e!=null&&e!=="parent"}function Tt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Lg(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function zg(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Pf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function xN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function wN(e){return{...Cg,...e||{}}}function Ag(e){return e===null?null:e?"valid":"invalid"}function Mo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=jt(e),l=mi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?pi(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const Rc=e=>({width:e.offsetWidth,height:e.offsetHeight}),Rg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},kN=["INPUT","SELECT","TEXTAREA"];function Dg(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:kN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Og=e=>"clientX"in e,jt=(e,t)=>{var i,s;const n=Og(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},If=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Rc(s)}})};function Fg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function Wi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Tf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case oe.Left:return[t-Wi(t-r,i),n];case oe.Right:return[t+Wi(r-t,i),n];case oe.Top:return[t,n-Wi(n-o,i)];case oe.Bottom:return[t,n+Wi(o-n,i)]}}function Dc({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,curvature:s=.25}){const[l,a]=Tf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Tf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,p,y]=Fg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,p,y]}function Hg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function SN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function NN({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=wl(Ys(e),Ys(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Xs(s,kl(i))>0}const EN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,_N=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),CN=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Pt.error006()),t;const r=n.getEdgeId||EN;let o;return Mg(e)?o={...e}:o={...e,id:r(e)},_N(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Bg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Hg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const Lf={[oe.Left]:{x:-1,y:0},[oe.Right]:{x:1,y:0},[oe.Top]:{x:0,y:-1},[oe.Bottom]:{x:0,y:1}},jN=({source:e,sourcePosition:t=oe.Bottom,target:n})=>t===oe.Left||t===oe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},zf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function MN({source:e,sourcePosition:t=oe.Bottom,target:n,targetPosition:r=oe.Top,center:o,offset:i,stepPosition:s}){const l=Lf[t],a=Lf[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=jN({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let y=[],x,k;const g={x:0,y:0},v={x:0,y:0},[,,m,w]=Hg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(x=o.x??u.x+(c.x-u.x)*s,k=o.y??(u.y+c.y)/2):(x=o.x??(u.x+c.x)/2,k=o.y??u.y+(c.y-u.y)*s);const j=[{x,y:u.y},{x,y:c.y}],I=[{x:u.x,y:k},{x:c.x,y:k}];l[f]===p?y=f==="x"?j:I:y=f==="x"?I:j}else{const j=[{x:u.x,y:c.y}],I=[{x:c.x,y:u.y}];if(f==="x"?y=l.x===p?I:j:y=l.y===p?j:I,t===r){const N=Math.abs(e[f]-n[f]);if(N<=i){const T=Math.min(i-1,i-N);l[f]===p?g[f]=(u[f]>e[f]?-1:1)*T:v[f]=(c[f]>n[f]?-1:1)*T}}if(t!==r){const N=f==="x"?"y":"x",T=l[f]===a[N],L=u[N]>c[N],A=u[N]<c[N];(l[f]===1&&(!T&&L||T&&A)||l[f]!==1&&(!T&&A||T&&L))&&(y=f==="x"?j:I)}const R={x:u.x+g.x,y:u.y+g.y},D={x:c.x+v.x,y:c.y+v.y},W=Math.max(Math.abs(R.x-y[0].x),Math.abs(D.x-y[0].x)),H=Math.max(Math.abs(R.y-y[0].y),Math.abs(D.y-y[0].y));W>=H?(x=(R.x+D.x)/2,k=y[0].y):(x=y[0].x,k=(R.y+D.y)/2)}const _={x:u.x+g.x,y:u.y+g.y},S={x:c.x+v.x,y:c.y+v.y};return[[e,..._.x!==y[0].x||_.y!==y[0].y?[_]:[],...y,...S.x!==y[y.length-1].x||S.y!==y[y.length-1].y?[S]:[],n],x,k,m,w]}function $N(e,t,n,r){const o=Math.min(zf(e,t)/2,zf(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Ks({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,f,p,y,x]=MN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let k=`M${d[0].x} ${d[0].y}`;for(let g=1;g<d.length-1;g++)k+=$N(d[g-1],d[g],d[g+1],s);return k+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[k,f,p,y,x]}function Af(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function bN(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Af(t)||!Af(n))return null;const r=t.internals.handleBounds||Rf(t.handles),o=n.internals.handleBounds||Rf(n.handles),i=Df((r==null?void 0:r.source)??[],e.sourceHandle),s=Df(e.connectionMode===Wr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Pt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||oe.Bottom,a=(s==null?void 0:s.position)||oe.Top,u=or(t,i,l),c=or(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function Rf(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function or(e,t,n=oe.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Tt(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case oe.Top:return{x:o+s/2,y:i};case oe.Right:return{x:o+s,y:i+l/2};case oe.Bottom:return{x:o+s/2,y:i+l};case oe.Left:return{x:o,y:i+l/2}}}function Df(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ku(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function PN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=ku(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Vg=1e3,IN=10,Oc={nodeOrigin:[0,0],nodeExtent:qo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},TN={...Oc,checkEquality:!0};function Fc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function LN(e,t,n){const r=Fc(Oc,n);for(const o of e.values())if(o.parentId)Bc(o,e,t,r);else{const i=fi(o,r.nodeOrigin),s=rr(o.extent)?o.extent:r.nodeExtent,l=nr(i,s,Tt(o));o.internals.positionAbsolute=l}}function zN(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function Hc(e){return e==="manual"}function Su(e,t,n,r={}){var c,d;const o=Fc(TN,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!Hc(o.zIndexMode)?Vg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let p=s.get(f.id);if(o.checkEquality&&f===(p==null?void 0:p.internals.userNode))t.set(f.id,p);else{const y=fi(f,o.nodeOrigin),x=rr(f.extent)?f.extent:o.nodeExtent,k=nr(y,x,Tt(f));p={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:k,handleBounds:zN(f,p),z:Wg(f,l,o.zIndexMode),userNode:f}},t.set(f.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),f.parentId&&Bc(p,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function AN(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Bc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=Fc(Oc,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}AN(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*IN),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!Hc(a)?Vg:0,{x:f,y:p,z:y}=RN(e,c,s,l,d,a),{positionAbsolute:x}=e.internals,k=f!==x.x||p!==x.y;(k||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:f,y:p}:x,z:y}})}function Wg(e,t,n){const r=Ct(e.zIndex)?e.zIndex:0;return Hc(n)?r:r+(e.selected?t:0)}function RN(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Tt(e),u=fi(e,n),c=rr(e.extent)?nr(u,e.extent,a):u;let d=nr({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=bg(d,a,t));const f=Wg(e,o,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Vc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??ei(a),c=Pg(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var m;const c=a.internals.positionAbsolute,d=Tt(a),f=a.origin??r,p=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,x=Math.max(d.width,Math.round(l.width)),k=Math.max(d.height,Math.round(l.height)),g=(x-d.width)*f[0],v=(k-d.height)*f[1];(p>0||y>0||g||v)&&(o.push({id:u,type:"position",position:{x:a.position.x-p+g,y:a.position.y-y+v}}),(m=n.get(u))==null||m.forEach(w=>{e.some(_=>_.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||p||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?f[0]*p-g:0),height:k+(y?f[1]*y-v:0)}})}),o}function DN(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const p of e.values()){const y=t.get(p.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const x=Rc(p.nodeElement),k=y.measured.width!==x.width||y.measured.height!==x.height;if(!!(x.width&&x.height&&(k||!y.internals.handleBounds||p.force))){const v=p.nodeElement.getBoundingClientRect(),m=rr(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const S=t.get(y.parentId);S&&(w=bg(w,x,S))}else m&&(w=nr(w,m,x));const _={...y,measured:x,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:If("source",p.nodeElement,v,d,y.id),target:If("target",p.nodeElement,v,d,y.id)}}};t.set(y.id,_),y.parentId&&Bc(_,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,k&&(u.push({id:y.id,type:"dimensions",dimensions:x}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:ei(_,o)}))}}if(f.length>0){const p=Vc(f,t,n,o);u.push(...p)}return{changes:u,updatedInternals:a}}async function ON({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function Of(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function Ug(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;Of("source",a,c,e,o,s),Of("target",a,u,e,i,l),t.set(r.id,r)}}function Yg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Yg(n,t):!1}function Ff(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function FN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Yg(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function ca({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function HN({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=pi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function BN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,f=null,p=!1,y=!1,x=null;function k({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:_,nodeId:S,nodeClickDistance:C=0}){f=it(w);function j({x:W,y:H}){const{nodeLookup:N,nodeExtent:T,snapGrid:L,snapToGrid:A,nodeOrigin:P,onNodeDrag:M,onSelectionDrag:z,onError:O,updateNodePositions:Y}=t();i={x:W,y:H};let ne=!1;const B=l.size>1,F=B&&T?wu(hi(l)):null,Z=B&&A?HN({dragItems:l,snapGrid:L,x:W,y:H}):null;for(const[q,E]of l){if(!N.has(q))continue;let $={x:W-E.distance.x,y:H-E.distance.y};A&&($=Z?{x:Math.round($.x+Z.x),y:Math.round($.y+Z.y)}:pi($,L));let X=null;if(B&&T&&!E.extent&&F){const{positionAbsolute:U}=E.internals,G=U.x-F.x+T[0][0],te=U.x+E.measured.width-F.x2+T[1][0],V=U.y-F.y+T[0][1],ee=U.y+E.measured.height-F.y2+T[1][1];X=[[G,V],[te,ee]]}const{position:Q,positionAbsolute:K}=$g({nodeId:q,nextPosition:$,nodeLookup:N,nodeExtent:X||T,nodeOrigin:P,onError:O});ne=ne||E.position.x!==Q.x||E.position.y!==Q.y,E.position=Q,E.internals.positionAbsolute=K}if(y=y||ne,!!ne&&(Y(l,!0),x&&(r||M||!S&&z))){const[q,E]=ca({nodeId:S,dragItems:l,nodeLookup:N});r==null||r(x,l,q,E),M==null||M(x,q,E),S||z==null||z(x,E)}}async function I(){if(!c)return;const{transform:W,panBy:H,autoPanSpeed:N,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[L,A]=zc(u,c,N);(L!==0||A!==0)&&(i.x=(i.x??0)-L/W[2],i.y=(i.y??0)-A/W[2],await H({x:L,y:A})&&j(i)),s=requestAnimationFrame(I)}function R(W){var B;const{nodeLookup:H,multiSelectionActive:N,nodesDraggable:T,transform:L,snapGrid:A,snapToGrid:P,selectNodesOnDrag:M,onNodeDragStart:z,onSelectionDragStart:O,unselectNodesAndEdges:Y}=t();d=!0,(!M||!_)&&!N&&S&&((B=H.get(S))!=null&&B.selected||Y()),_&&M&&S&&(e==null||e(S));const ne=Mo(W.sourceEvent,{transform:L,snapGrid:A,snapToGrid:P,containerBounds:c});if(i=ne,l=FN(H,T,ne,S),l.size>0&&(n||z||!S&&O)){const[F,Z]=ca({nodeId:S,dragItems:l,nodeLookup:H});n==null||n(W.sourceEvent,l,F,Z),z==null||z(W.sourceEvent,F,Z),S||O==null||O(W.sourceEvent,Z)}}const D=ug().clickDistance(C).on("start",W=>{const{domNode:H,nodeDragThreshold:N,transform:T,snapGrid:L,snapToGrid:A}=t();c=(H==null?void 0:H.getBoundingClientRect())||null,p=!1,y=!1,x=W.sourceEvent,N===0&&R(W),i=Mo(W.sourceEvent,{transform:T,snapGrid:L,snapToGrid:A,containerBounds:c}),u=jt(W.sourceEvent,c)}).on("drag",W=>{const{autoPanOnNodeDrag:H,transform:N,snapGrid:T,snapToGrid:L,nodeDragThreshold:A,nodeLookup:P}=t(),M=Mo(W.sourceEvent,{transform:N,snapGrid:T,snapToGrid:L,containerBounds:c});if(x=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||S&&!P.has(S))&&(p=!0),!p){if(!a&&H&&d&&(a=!0,I()),!d){const z=jt(W.sourceEvent,c),O=z.x-u.x,Y=z.y-u.y;Math.sqrt(O*O+Y*Y)>A&&R(W)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(u=jt(W.sourceEvent,c),j(M))}}).on("end",W=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:H,updateNodePositions:N,onNodeDragStop:T,onSelectionDragStop:L}=t();if(y&&(N(l,!1),y=!1),o||T||!S&&L){const[A,P]=ca({nodeId:S,dragItems:l,nodeLookup:H,dragging:!1});o==null||o(W.sourceEvent,l,A,P),T==null||T(W.sourceEvent,A,P),S||L==null||L(W.sourceEvent,P)}}}).filter(W=>{const H=W.target;return!W.button&&(!v||!Ff(H,`.${v}`,w))&&(!m||Ff(H,m,w))});f.call(D)}function g(){f==null||f.on(".drag",null)}return{update:k,destroy:g}}function VN(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Xs(o,ei(i))>0&&r.push(i);return r}const WN=250;function UN(e,t,n,r){var l,a;let o=[],i=1/0;const s=VN(e,n,t+WN);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=or(u,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));y>t||(y<i?(o=[{...d,x:f,y:p}],i=y):y===i&&o.push({...d,x:f,y:p}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function Xg(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...or(s,a,a.position,!0)}:a}function Kg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function YN(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Gg=()=>!0;function XN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:p,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:g=Gg,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:_,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:j}){const I=Rg(e.target);let R=0,D;const{x:W,y:H}=jt(e),N=Kg(i,j),T=l==null?void 0:l.getBoundingClientRect();let L=!1;if(!T||!N)return;const A=Xg(o,N,r,a,t);if(!A)return;let P=jt(e,T),M=!1,z=null,O=!1,Y=null;function ne(){if(!c||!T)return;const[Q,K]=zc(P,T,S);f({x:Q,y:K}),R=requestAnimationFrame(ne)}const B={...A,nodeId:o,type:N,position:A.position},F=a.get(o);let q={inProgress:!0,isValid:null,from:or(F,B,oe.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:F,to:P,toHandle:null,toPosition:Mf[B.position],toNode:null,pointer:P};function E(){L=!0,m(q),y==null||y(e,{nodeId:o,handleId:r,handleType:N})}C===0&&E();function $(Q){if(!L){const{x:ee,y:se}=jt(Q),ce=ee-W,he=se-H;if(!(ce*ce+he*he>C*C))return;E()}if(!_()||!B){X(Q);return}const K=w();P=jt(Q,T),D=UN(mi(P,K,!1,[1,1]),n,a,B),M||(ne(),M=!0);const U=Qg(Q,{handle:D,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:g,doc:I,lib:u,flowId:d,nodeLookup:a});Y=U.handleDomNode,z=U.connection,O=YN(!!D,U.isValid);const G=a.get(o),te=G?or(G,B,oe.Left,!0):q.from,V={...q,from:te,isValid:O,to:U.toHandle&&O?Yr({x:U.toHandle.x,y:U.toHandle.y},K):P,toHandle:U.toHandle,toPosition:O&&U.toHandle?U.toHandle.position:Mf[B.position],toNode:U.toHandle?a.get(U.toHandle.nodeId):null,pointer:P};m(V),q=V}function X(Q){if(!("touches"in Q&&Q.touches.length>0)){if(L){(D||Y)&&z&&O&&(x==null||x(z));const{inProgress:K,...U}=q,G={...U,toPosition:q.toHandle?q.toPosition:null};k==null||k(Q,G),i&&(v==null||v(Q,G))}p(),cancelAnimationFrame(R),M=!1,O=!1,z=null,Y=null,I.removeEventListener("mousemove",$),I.removeEventListener("mouseup",X),I.removeEventListener("touchmove",$),I.removeEventListener("touchend",X)}}I.addEventListener("mousemove",$),I.addEventListener("mouseup",X),I.addEventListener("touchmove",$),I.addEventListener("touchend",X)}function Qg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=Gg,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y}=jt(e),x=s.elementFromPoint(p,y),k=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:f,g={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const v=Kg(void 0,k),m=k.getAttribute("data-nodeid"),w=k.getAttribute("data-handleid"),_=k.classList.contains("connectable"),S=k.classList.contains("connectableend");if(!m||!v)return g;const C={source:d?m:r,sourceHandle:d?w:o,target:d?r:m,targetHandle:d?o:w};g.connection=C;const I=_&&S&&(n===Wr.Strict?d&&v==="source"||!d&&v==="target":m!==r||w!==o);g.isValid=I&&u(C),g.toHandle=Xg(m,v,w,c,n,!0)}return g}const Nu={onPointerDown:XN,isValid:Qg};function KN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=it(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const y=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const w=n(),_=m.sourceEvent.ctrlKey&&ti()?10:1,S=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*c,C=w[2]*Math.pow(2,S*_);t.scaleTo(C)};let x=[0,0];const k=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(x=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},g=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const _=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],S=[_[0]-x[0],_[1]-x[1]];x=_;const C=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),j={x:w[0]-S[0]*C,y:w[1]-S[1]*C},I=[[0,0],[a,u]];t.setViewportConstrained({x:j.x,y:j.y,zoom:w[2]},I,l)},v=Eg().on("start",k).on("zoom",d?g:null).on("zoom.wheel",f?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:St}}const Sl=e=>({x:e.x,y:e.y,zoom:e.k}),da=({x:e,y:t,zoom:n})=>xl.translate(e,t).scale(n),pn=(e,t)=>e.target.closest(`.${t}`),qg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),GN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fa=(e,t=0,n=GN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Zg=e=>{const t=e.ctrlKey&&ti()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function QN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(pn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const k=St(c),g=Zg(c),v=d*Math.pow(2,g);r.scaleTo(n,v,k,c);return}const f=c.deltaMode===1?20:1;let p=o===Un.Vertical?0:c.deltaX*f,y=o===Un.Horizontal?0:c.deltaY*f;!ti()&&c.shiftKey&&o!==Un.Vertical&&(p=c.deltaY*f,y=0),r.translateBy(n,-(p/d)*i,-(y/d)*i,{internal:!0});const x=Sl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,x):(e.isPanScrolling=!0,l==null||l(c,x)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,x),e.isPanScrolling=!1},150)}}function qN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=pn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function ZN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Sl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function JN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&qg(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Sl(i.transform)))}}function eE({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&qg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=Sl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function tE({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:d}){return f=>{var g;const p=t||n,y=r&&f.ctrlKey,x=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(pn(f,`${c}-flow__node`)||pn(f,`${c}-flow__edge`)||pn(f,`${c}-flow__selection`)||pn(f,`${c}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!s&&!r||l||d&&!x||pn(f,a)&&x||pn(f,u)&&(!x||i&&x&&!t)||!r&&f.ctrlKey&&x)return!1;if(!r&&f.type==="touchstart"&&((g=f.touches)==null?void 0:g.length)>1)return f.preventDefault(),!1;if(!p&&!i&&!y&&x||!o&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(o)&&!o.includes(f.button)&&f.type==="mousedown")return!1;const k=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||x||e)&&k}}function nE({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const N=H[0];N&&(d=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null;f==null||f.observe(e);const p=Eg().extent(()=>d).scaleExtent([t,n]).translateExtent(r),y=it(e).call(p);w({x:o.x,y:o.y,zoom:Ur(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=y.on("wheel.zoom"),k=y.on("dblclick.zoom");p.wheelDelta(Zg);async function g(H,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?jo:cs).transform(fa(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),H)}):!1}function v({noWheelClassName:H,noPanClassName:N,onPaneContextMenu:T,userSelectionActive:L,panOnScroll:A,panOnDrag:P,panOnScrollMode:M,panOnScrollSpeed:z,preventScrolling:O,zoomOnPinch:Y,zoomOnScroll:ne,zoomOnDoubleClick:B,panActivationKeyPressed:F=!1,zoomActivationKeyPressed:Z,lib:q,onTransformChange:E,connectionInProgress:$,paneClickDistance:X,selectionOnDrag:Q}){L&&!u.isZoomingOrPanning&&m();const K=A&&!Z&&!L;p.clickDistance(Q?1/0:!Ct(X)||X<0?0:X);const U=K?QN({zoomPanValues:u,noWheelClassName:H,d3Selection:y,d3Zoom:p,panOnScrollMode:M,panOnScrollSpeed:z,zoomOnPinch:Y,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):qN({noWheelClassName:H,preventScrolling:O,d3ZoomHandler:x});y.on("wheel.zoom",U,{passive:!1});const G=ZN({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});p.on("start",G);const te=JN({zoomPanValues:u,panOnDrag:P,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:E});p.on("zoom",te);const V=eE({zoomPanValues:u,panOnDrag:P,panOnScroll:A,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});p.on("end",V);const ee=tE({panActivationKeyPressed:F,zoomActivationKeyPressed:Z,panOnDrag:P,zoomOnScroll:ne,panOnScroll:A,zoomOnDoubleClick:B,zoomOnPinch:Y,userSelectionActive:L,noPanClassName:N,noWheelClassName:H,lib:q,connectionInProgress:$});p.filter(ee),B?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function m(){p.on("zoom",null)}async function w(H,N,T){const L=da(H),A=p==null?void 0:p.constrain()(L,N,T);return A&&await g(A),A}async function _(H,N){const T=da(H);return await g(T,N),T}function S(H){if(y){const N=da(H),T=y.property("__zoom");(T.k!==H.zoom||T.x!==H.x||T.y!==H.y)&&(p==null||p.transform(y,N,null,{sync:!0}))}}function C(){const H=y?Ng(y.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function j(H,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?jo:cs).scaleTo(fa(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),H)}):!1}async function I(H,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?jo:cs).scaleBy(fa(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),H)}):!1}function R(H){p==null||p.scaleExtent(H)}function D(H){p==null||p.translateExtent(H)}function W(H){const N=!Ct(H)||H<0?0:H;p==null||p.clickDistance(N)}return{update:v,destroy:m,setViewport:_,setViewportConstrained:w,getViewport:C,scaleTo:j,scaleBy:I,setScaleExtent:R,setTranslateExtent:D,syncViewport:S,setClickDistance:W}}var Xr;(function(e){e.Line="line",e.Handle="handle"})(Xr||(Xr={}));function rE({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function Hf(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function cn(e,t){return Math.max(0,t-e)}function dn(e,t){return Math.max(0,e-t)}function Ui(e,t,n){return Math.max(0,t-e,e-n)}function Bf(e,t){return e?!t:t}function oE(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:p,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:g,maxHeight:v}=r,{x:m,y:w,width:_,height:S,aspectRatio:C}=e;let j=Math.floor(c?p-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const R=_+(a?-j:j),D=S+(u?-I:I),W=-i[0]*_,H=-i[1]*S;let N=Ui(R,x,k),T=Ui(D,g,v);if(s){let P=0,M=0;a&&j<0?P=cn(m+j+W,s[0][0]):!a&&j>0&&(P=dn(m+R+W,s[1][0])),u&&I<0?M=cn(w+I+H,s[0][1]):!u&&I>0&&(M=dn(w+D+H,s[1][1])),N=Math.max(N,P),T=Math.max(T,M)}if(l){let P=0,M=0;a&&j>0?P=dn(m+j,l[0][0]):!a&&j<0&&(P=cn(m+R,l[1][0])),u&&I>0?M=dn(w+I,l[0][1]):!u&&I<0&&(M=cn(w+D,l[1][1])),N=Math.max(N,P),T=Math.max(T,M)}if(o){if(c){const P=Ui(R/C,g,v)*C;if(N=Math.max(N,P),s){let M=0;!a&&!u||a&&!u&&f?M=dn(w+H+R/C,s[1][1])*C:M=cn(w+H+(a?j:-j)/C,s[0][1])*C,N=Math.max(N,M)}if(l){let M=0;!a&&!u||a&&!u&&f?M=cn(w+R/C,l[1][1])*C:M=dn(w+(a?j:-j)/C,l[0][1])*C,N=Math.max(N,M)}}if(d){const P=Ui(D*C,x,k)/C;if(T=Math.max(T,P),s){let M=0;!a&&!u||u&&!a&&f?M=dn(m+D*C+W,s[1][0])/C:M=cn(m+(u?I:-I)*C+W,s[0][0])/C,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&f?M=cn(m+D*C,l[1][0])/C:M=dn(m+(u?I:-I)*C,l[0][0])/C,T=Math.max(T,M)}}}I=I+(I<0?T:-T),j=j+(j<0?N:-N),o&&(f?R>D*C?I=(Bf(a,u)?-j:j)/C:j=(Bf(a,u)?-I:I)*C:c?(I=j/C,u=a):(j=I*C,a=u));const L=a?m+j:m,A=u?w+I:w;return{width:_+(a?-j:j),height:S+(u?-I:I),x:i[0]*j*(a?-1:1)+L,y:i[1]*I*(u?-1:1)+A}}const Jg={width:0,height:0,x:0,y:0},iE={...Jg,pointerX:0,pointerY:0,aspectRatio:1};function sE(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function lE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=it(e);let s={controlDirection:Hf("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:y,onResizeEnd:x,shouldResize:k}){let g={...Jg},v={...iE};s={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:Hf(u)};let m,w=null,_=[],S,C,j;const I=ug().on("start",R=>{const{nodeLookup:D,transform:W,snapGrid:H,snapToGrid:N,nodeOrigin:T,paneDomNode:L}=n();if(m=D.get(t),!m)return;w=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:P}=Mo(R.sourceEvent,{transform:W,snapGrid:H,snapToGrid:N,containerBounds:w});g={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},v={...g,pointerX:A,pointerY:P,aspectRatio:g.width/g.height},S=void 0,C=rr(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(S=D.get(m.parentId)),S&&m.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),_=[],j=void 0;for(const[M,z]of D)if(z.parentId===t&&(_.push({id:M,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const O=sE(z,m,z.origin??T);j?j=[[Math.min(O[0][0],j[0][0]),Math.min(O[0][1],j[0][1])],[Math.max(O[1][0],j[1][0]),Math.max(O[1][1],j[1][1])]]:j=O}p==null||p(R,{...g})}).on("drag",R=>{const{transform:D,snapGrid:W,snapToGrid:H,nodeOrigin:N}=n(),T=Mo(R.sourceEvent,{transform:D,snapGrid:W,snapToGrid:H,containerBounds:w}),L=[];if(!m)return;const{x:A,y:P,width:M,height:z}=g,O={},Y=m.origin??N,{width:ne,height:B,x:F,y:Z}=oE(v,s.controlDirection,T,s.boundaries,s.keepAspectRatio,Y,C,j),q=ne!==M,E=B!==z,$=F!==A&&q,X=Z!==P&&E;if(!$&&!X&&!q&&!E)return;const Q={prevValues:{...g},startX:v.x,startY:v.y,childNodes:_.map(te=>({...te,position:{...te.position}}))};if(($||X||Y[0]===1||Y[1]===1)&&(O.x=$?F:g.x,O.y=X?Z:g.y,g.x=O.x,g.y=O.y,_.length>0)){const te=F-A,V=Z-P;for(const ee of _)ee.position={x:ee.position.x-te+Y[0]*(ne-M),y:ee.position.y-V+Y[1]*(B-z)},L.push(ee)}if((q||E)&&(O.width=q&&(!s.resizeDirection||s.resizeDirection==="horizontal")?ne:g.width,O.height=E&&(!s.resizeDirection||s.resizeDirection==="vertical")?B:g.height,g.width=O.width,g.height=O.height),S&&m.expandParent){const te=Y[0]*(O.width??0);O.x&&O.x<te&&(g.x=te,v.x=v.x-(O.x-te));const V=Y[1]*(O.height??0);O.y&&O.y<V&&(g.y=V,v.y=v.y-(O.y-V))}const K=rE({width:g.width,prevWidth:M,height:g.height,prevHeight:z,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),U={...g,direction:K};if((k==null?void 0:k(R,U))===!1){g=Q.prevValues,v.x=Q.startX,v.y=Q.startY,_.forEach((te,V)=>{te.position=Q.childNodes[V].position});return}y==null||y(R,U),r(O,L)}).on("end",R=>{x==null||x(R,{...g}),o==null||o({...g})});i.call(I)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var e0={exports:{}},t0={},n0={exports:{}},r0={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Kr=b;function aE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uE=typeof Object.is=="function"?Object.is:aE,cE=Kr.useState,dE=Kr.useEffect,fE=Kr.useLayoutEffect,hE=Kr.useDebugValue;function pE(e,t){var n=t(),r=cE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return fE(function(){o.value=n,o.getSnapshot=t,ha(o)&&i({inst:o})},[e,n,t]),dE(function(){return ha(o)&&i({inst:o}),e(function(){ha(o)&&i({inst:o})})},[e]),hE(n),n}function ha(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uE(e,n)}catch{return!0}}function mE(e,t){return t()}var gE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mE:pE;r0.useSyncExternalStore=Kr.useSyncExternalStore!==void 0?Kr.useSyncExternalStore:gE;n0.exports=r0;var yE=n0.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var Nl=b,vE=yE;function xE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wE=typeof Object.is=="function"?Object.is:xE,kE=vE.useSyncExternalStore,SE=Nl.useRef,NE=Nl.useEffect,EE=Nl.useMemo,_E=Nl.useDebugValue;t0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=SE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=EE(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&s.hasValue){var y=s.value;if(o(y,p))return d=y}return d=p}if(y=d,wE(c,p))return y;var x=r(p);return o!==void 0&&o(y,x)?(c=p,y):(c=p,d=x)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=kE(e,i[0],i[1]);return NE(function(){s.hasValue=!0,s.value=l},[l]),_E(l),l};e0.exports=t0;var CE=e0.exports;const jE=Lh(CE),ME={},Vf=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(ME?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},$E=e=>e?Vf(e):Vf,{useDebugValue:bE}=kv,{useSyncExternalStoreWithSelector:PE}=jE,IE=e=>e;function o0(e,t=IE,n){const r=PE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return bE(r),r}const Wf=(e,t)=>{const n=$E(e),r=(o,i=t)=>o0(n,o,i);return Object.assign(r,n),r},TE=(e,t)=>e?Wf(e,t):Wf;function ke(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const El=b.createContext(null),LE=El.Provider,i0=Pt.error001("react");function ae(e,t){const n=b.useContext(El);if(n===null)throw new Error(i0);return o0(n,e,t)}function ge(){const e=b.useContext(El);if(e===null)throw new Error(i0);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Uf={display:"none"},zE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},s0="react-flow__node-desc",l0="react-flow__edge-desc",AE="react-flow__aria-live",RE=e=>e.ariaLiveMessage,DE=e=>e.ariaLabelConfig;function OE({rfId:e}){const t=ae(RE);return h.jsx("div",{id:`${AE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zE,children:t})}function FE({rfId:e,disableKeyboardA11y:t}){const n=ae(DE);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${s0}-${e}`,style:Uf,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${l0}-${e}`,style:Uf,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(OE,{rfId:e})]})}const gi=b.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return h.jsx("div",{className:Ce(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});gi.displayName="Panel";const Yf="https://reactflow.dev?utm_source=attribution";function HE({proOptions:e,position:t="bottom-right"}){return b.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:h.jsx(gi,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Yf}`,children:h.jsx("a",{href:Yf,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const BE=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Yi=e=>e.id;function VE(e,t){return ke(e.selectedNodes.map(Yi),t.selectedNodes.map(Yi))&&ke(e.selectedEdges.map(Yi),t.selectedEdges.map(Yi))}function WE({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=ae(BE,VE);return b.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const UE=e=>!!e.onSelectionChangeHandlers;function YE({onSelectionChange:e}){const t=ae(UE);return e||t?h.jsx(WE,{onSelectionChange:e}):null}const a0=[0,0],XE={x:0,y:0,zoom:1},KE=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Xf=[...KE,"rfId"],GE=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Kf={translateExtent:qo,nodeOrigin:a0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function QE(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=ae(GE,ke),u=ge();b.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Kf,l()}),[]);const c=b.useRef(Kf);return b.useEffect(()=>{for(const d of Xf){const f=e[d],p=c.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?o(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:wN(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},Xf.map(d=>e[d])),null}function Gf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function qE(e){var r;const[t,n]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){n(e);return}const o=Gf(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Gf())!=null&&r.matches?"dark":"light"}const Qf=typeof document<"u"?document:null;function ni(e=null,t={target:Qf,actInsideInputWithModifier:!0}){const[n,r]=b.useState(!1),o=b.useRef(!1),i=b.useRef(new Set([])),[s,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace(/\+/g,`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return b.useEffect(()=>{const a=(t==null?void 0:t.target)??Qf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var k,g;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&Dg(p))return!1;const x=Zf(p.code,l);if(i.current.add(p[x]),qf(s,i.current,!1)){const v=((g=(k=p.composedPath)==null?void 0:k.call(p))==null?void 0:g[0])||p.target,m=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!m)&&p.preventDefault(),r(!0)}},d=p=>{const y=Zf(p.code,l);qf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[y]),p.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function qf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Zf(e,t){return t.includes(e)?"code":"key"}const ZE=()=>{const e=ge();return b.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=Ac(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return mi(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Yr(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function u0(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)JE(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function JE(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function e_(e,t){return u0(e,t)}function t_(e,t){return u0(e,t)}function An(e,t){return{id:e,type:"select",selected:t}}function Cr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(An(i.id,s)))}return r}function Jf({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function eh(e){return{id:e.id,type:"remove"}}const n_=Tg();function r_(e,t,n={}){return CN(e,t,{...n,onError:n.onError??n_})}const th=e=>dN(e),o_=e=>Mg(e);function c0(e){return b.forwardRef(e)}const d0=typeof window<"u"?b.useLayoutEffect:b.useEffect;function nh(e){const[t,n]=b.useState(BigInt(0)),[r]=b.useState(()=>i_(()=>n(o=>o+BigInt(1))));return d0(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function i_(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const f0=b.createContext(null);function s_({children:e}){const t=ge(),n=b.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:y}=t.getState();let x=a;for(const g of l)x=typeof g=="function"?g(x):g;let k=Jf({items:x,lookup:f});for(const g of y.values())k=g(k);c&&u(x),k.length>0?d==null||d(k):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:v,setNodes:m}=t.getState();g&&m(v)})},[]),r=nh(n),o=b.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;c?u(p):d&&d(Jf({items:p,lookup:f}))},[]),i=nh(o),s=b.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(f0.Provider,{value:s,children:e})}function l_(){const e=b.useContext(f0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a_=e=>!!e.panZoom;function yi(){const e=ZE(),t=ge(),n=l_(),r=ae(a_),o=b.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var g,v;const{nodeLookup:f,nodeOrigin:p}=t.getState(),y=th(d)?d:f.get(d.id),x=y.parentId?zg(y.position,y.measured,y.parentId,f,p):y.position,k={...y,position:x,width:((g=y.measured)==null?void 0:g.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return ei(k)},u=(d,f,p={replace:!1})=>{s(y=>y.map(x=>{if(x.id===d){const k=typeof f=="function"?f(x):f;return p.replace&&th(k)?k:{...x,...k}}return x}))},c=(d,f,p={replace:!1})=>{l(y=>y.map(x=>{if(x.id===d){const k=typeof f=="function"?f(x):f;return p.replace&&o_(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[y,x,k]=p;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:g,triggerEdgeChanges:v,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:_,edges:S}=await gN({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:y,onBeforeDelete:w}),C=S.length>0,j=_.length>0;if(C){const I=S.map(eh);k==null||k(S),v(I)}if(j){const I=_.map(eh);x==null||x(_),g(I)}return(j||C)&&(m==null||m({nodes:_,edges:S})),{deletedNodes:_,deletedEdges:S}},getIntersectingNodes:(d,f=!0,p)=>{const y=bf(d),x=y?d:a(d),k=p!==void 0;return x?(p||t.getState().nodes).filter(g=>{const v=t.getState().nodeLookup.get(g.id);if(v&&!y&&(g.id===d.id||!v.internals.positionAbsolute))return!1;const m=ei(k?g:v),w=Xs(m,x);return f&&w>0||w>=m.width*m.height||w>=x.width*x.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const x=bf(d)?d:a(d);if(!x)return!1;const k=Xs(x,f);return p&&k>0||k>=f.width*f.height||k>=x.width*x.height},updateNode:u,updateNodeData:(d,f,p={replace:!1})=>{u(d,y=>{const x=typeof f=="function"?f(y):f;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},updateEdge:c,updateEdgeData:(d,f,p={replace:!1})=>{c(d,y=>{const x=typeof f=="function"?f(y):f;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return fN(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??xN();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return b.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const rh=e=>e.selected,u_=typeof window<"u"?window:void 0;function c_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=yi(),o=ni(e,{actInsideInputWithModifier:!1}),i=ni(t,{target:u_});b.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(rh),edges:s.filter(rh)}),n.setState({nodesSelectionActive:!1})}},[o]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function d_(e){const t=ge();b.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=Rc(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Pt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const _l={position:"absolute",width:"100%",height:"100%",top:0,left:0},f_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function h_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=Un.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:y=!0,children:x,noWheelClassName:k,noPanClassName:g,onViewportChange:v,isControlledViewport:m,paneClickDistance:w,selectionOnDrag:_}){const S=ge(),C=b.useRef(null),{userSelectionActive:j,lib:I,connectionInProgress:R}=ae(f_,ke),D=ni(p),W=b.useRef();d_(C);const H=b.useCallback(N=>{v==null||v({x:N[0],y:N[1],zoom:N[2]}),m||S.setState({transform:N})},[v,m]);return b.useEffect(()=>{if(C.current){W.current=nE({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:u,onDraggingChange:A=>S.setState(P=>P.paneDragging===A?P:{paneDragging:A}),onPanZoomStart:(A,P)=>{const{onViewportChangeStart:M,onMoveStart:z}=S.getState();z==null||z(A,P),M==null||M(P)},onPanZoom:(A,P)=>{const{onViewportChange:M,onMove:z}=S.getState();z==null||z(A,P),M==null||M(P)},onPanZoomEnd:(A,P)=>{const{onViewportChangeEnd:M,onMoveEnd:z}=S.getState();z==null||z(A,P),M==null||M(P)}});const{x:N,y:T,zoom:L}=W.current.getViewport();return S.setState({panZoom:W.current,transform:[N,T,L],domNode:C.current.closest(".react-flow")}),()=>{var A;(A=W.current)==null||A.destroy()}}},[]),b.useEffect(()=>{var N;(N=W.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:D,preventScrolling:y,noPanClassName:g,userSelectionActive:j,noWheelClassName:k,lib:I,onTransformChange:H,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:w})},[e,t,n,r,o,i,s,l,a,D,y,g,j,k,I,H,R,_,w]),h.jsx("div",{className:"react-flow__renderer",ref:C,style:_l,children:x})}const p_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function m_(){const{userSelectionActive:e,userSelectionRect:t}=ae(p_,ke);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const pa=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},g_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function y_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Zo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:y,children:x}){const k=b.useRef(0),g=ge(),{userSelectionActive:v,elementsSelectable:m,dragging:w,panBy:_,autoPanSpeed:S}=ae(g_,ke),C=m&&(e||v),j=b.useRef(null),I=b.useRef(),R=b.useRef(new Set),D=b.useRef(new Set),W=b.useRef(!1),H=b.useRef(!1),N=b.useRef({x:0,y:0}),T=b.useRef(!1),L=E=>{if(H.current||W.current||g.getState().connection.inProgress){H.current=!1,W.current=!1;return}u==null||u(E),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},A=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},P=d?E=>d(E):void 0,M=E=>{H.current&&(E.stopPropagation(),H.current=!1)},z=E=>{var ee,se;if(E.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:$,transform:X}=g.getState();if(I.current=$==null?void 0:$.getBoundingClientRect(),!I.current)return;const Q=E.target===j.current;if(!Q&&!!E.target.closest(".nokey")||!e||!(s&&Q||t)||E.button!==0||!E.isPrimary)return;(se=(ee=E.target)==null?void 0:ee.setPointerCapture)==null||se.call(ee,E.pointerId),H.current=!1;const{x:G,y:te}=jt(E.nativeEvent,I.current),V=mi({x:G,y:te},X);g.setState({userSelectionRect:{width:0,height:0,startX:V.x,startY:V.y,x:G,y:te}}),Q||(E.stopPropagation(),E.preventDefault())};function O(E,$){const{userSelectionRect:X}=g.getState();if(!X)return;const{transform:Q,nodeLookup:K,edgeLookup:U,connectionLookup:G,triggerNodeChanges:te,triggerEdgeChanges:V,defaultEdgeOptions:ee}=g.getState(),se={x:X.startX,y:X.startY},{x:ce,y:he}=Yr(se,Q),Ne={startX:se.x,startY:se.y,x:E<ce?E:ce,y:$<he?$:he,width:Math.abs(E-ce),height:Math.abs($-he)},ie=R.current,$e=D.current;R.current=new Set(Lc(K,Ne,Q,n===Zo.Partial,!0).map(Ie=>Ie.id)),D.current=new Set;const nt=(ee==null?void 0:ee.selectable)??!0;for(const Ie of R.current){const Be=G.get(Ie);if(Be)for(const{edgeId:Ve}of Be.values()){const rt=U.get(Ve);rt&&(rt.selectable??nt)&&D.current.add(Ve)}}if(!Pf(ie,R.current)){const Ie=Cr(K,R.current,!0);te(Ie)}if(!Pf($e,D.current)){const Ie=Cr(U,D.current);V(Ie)}g.setState({userSelectionRect:Ne,userSelectionActive:!0,nodesSelectionActive:!1})}function Y(){if(!o||!I.current)return;const[E,$]=zc(N.current,I.current,S);_({x:E,y:$}).then(X=>{if(!H.current||!X){k.current=requestAnimationFrame(Y);return}const{x:Q,y:K}=N.current;O(Q,K),k.current=requestAnimationFrame(Y)})}const ne=()=>{cancelAnimationFrame(k.current),k.current=0,T.current=!1};b.useEffect(()=>()=>ne(),[]);const B=E=>{const{userSelectionRect:$,transform:X,resetSelectedElements:Q}=g.getState();if(!I.current||!$)return;const{x:K,y:U}=jt(E.nativeEvent,I.current);N.current={x:K,y:U};const G=Yr({x:$.startX,y:$.startY},X);if(!H.current){const te=t?0:i;if(Math.hypot(K-G.x,U-G.y)<=te)return;Q(),l==null||l(E)}H.current=!0,T.current||(Y(),T.current=!0),O(K,U)},F=E=>{var $,X;if(!C){E.target===j.current&&g.getState().connection.inProgress&&(W.current=!0);return}E.button===0&&((X=($=E.target)==null?void 0:$.releasePointerCapture)==null||X.call($,E.pointerId),!v&&E.target===j.current&&g.getState().userSelectionRect&&(L==null||L(E)),g.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(a==null||a(E),g.setState({nodesSelectionActive:R.current.size>0})),ne())},Z=E=>{var $,X;(X=($=E.target)==null?void 0:$.releasePointerCapture)==null||X.call($,E.pointerId),ne()},q=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Ce(["react-flow__pane",{draggable:q,dragging:w,selection:e}]),onClick:C?void 0:pa(L,j),onContextMenu:pa(A,j),onWheel:pa(P,j),onPointerEnter:C?void 0:f,onPointerMove:C?B:p,onPointerUp:F,onPointerCancel:C?Z:void 0,onPointerDownCapture:C?z:void 0,onClickCapture:C?M:void 0,onPointerLeave:y,ref:j,style:_l,children:[x,h.jsx(m_,{})]})}function Eu({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",Pt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function h0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=ge(),[a,u]=b.useState(!1),c=b.useRef();return b.useEffect(()=>{if(!t)return c.current=BN({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Eu({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),b.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const v_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function p0(){const e=ge();return b.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=v_(s),p=o?i[0]:5,y=o?i[1]:5,x=n.direction.x*p*n.factor,k=n.direction.y*y*n.factor;for(const[,g]of u){if(!f(g))continue;let v={x:g.internals.positionAbsolute.x+x,y:g.internals.positionAbsolute.y+k};o&&(v=pi(v,i));const{position:m,positionAbsolute:w}=$g({nodeId:g.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});g.position=m,g.internals.positionAbsolute=w,d.set(g.id,g)}a(d)},[])}const Wc=b.createContext(null),x_=Wc.Provider;Wc.Consumer;const m0=()=>b.useContext(Wc),w_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),g0=b.createContext(null);function k_({children:e}){const t=ae(w_,ke);return h.jsx(g0.Provider,{value:t,children:e})}function S_(){const e=b.useContext(g0);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const N_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},E_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return N_;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===Wr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:c&&u}};function __({type:e="source",position:t=oe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},p){var T,L;const y=s||null,x=e==="target",k=ge(),g=m0(),{connectOnClick:v,noPanClassName:m,rfId:w}=S_(),{connectingFrom:_,connectingTo:S,clickConnecting:C,isPossibleEndHandle:j,connectionInProcess:I,clickConnectionInProcess:R,valid:D}=ae(E_(g,y,e),ke);g||(L=(T=k.getState()).onError)==null||L.call(T,"010",Pt.error010());const W=A=>{const{defaultEdgeOptions:P,onConnect:M,hasDefaultEdges:z}=k.getState(),O={...P,...A};if(z){const{edges:Y,setEdges:ne,onError:B}=k.getState();ne(r_(O,Y,{onError:B}))}M==null||M(O),l==null||l(O)},H=A=>{if(!g)return;const P=Og(A.nativeEvent);if(o&&(P&&A.button===0||!P)){const M=k.getState();Nu.onPointerDown(A.nativeEvent,{handleDomNode:A.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:x,handleId:y,nodeId:g,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...z)=>{var O,Y;return(Y=(O=k.getState()).onConnectEnd)==null?void 0:Y.call(O,...z)},updateConnection:M.updateConnection,onConnect:W,isValidConnection:n||((...z)=>{var O,Y;return((Y=(O=k.getState()).isValidConnection)==null?void 0:Y.call(O,...z))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}P?c==null||c(A):d==null||d(A)},N=A=>{const{onClickConnectStart:P,onClickConnectEnd:M,connectionClickStartHandle:z,connectionMode:O,isValidConnection:Y,lib:ne,rfId:B,nodeLookup:F,connection:Z}=k.getState();if(!g||!z&&!o)return;if(!z){P==null||P(A.nativeEvent,{nodeId:g,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:g,type:e,id:y}});return}const q=Rg(A.target),E=n||Y,{connection:$,isValid:X}=Nu.isValid(A.nativeEvent,{handle:{nodeId:g,id:y,type:e},connectionMode:O,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:E,flowId:B,doc:q,lib:ne,nodeLookup:F});X&&$&&W($);const Q=structuredClone(Z);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,M==null||M(A,Q),k.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":y,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${y}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:C,connectingfrom:_,connectingto:S,valid:D,connectionindicator:r&&(!I||j)&&(I||R?i:o)}]),onMouseDown:H,onTouchStart:H,onClick:v?N:void 0,ref:p,...f,children:a})}const Gr=b.memo(c0(__));function C_({data:e,isConnectable:t,sourcePosition:n=oe.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Gr,{type:"source",position:n,isConnectable:t})]})}function j_({data:e,isConnectable:t,targetPosition:n=oe.Top,sourcePosition:r=oe.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Gr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Gr,{type:"source",position:r,isConnectable:t})]})}function M_(){return null}function $_({data:e,isConnectable:t,targetPosition:n=oe.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Gr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Gs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oh={input:C_,default:j_,output:$_,group:M_};function b_(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const P_=e=>{const{width:t,height:n,x:r,y:o}=hi(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ct(t)?t:null,height:Ct(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function I_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:o,height:i,transformString:s,userSelectionActive:l}=ae(P_,ke),a=p0(),u=b.useRef(null);b.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(h0({nodeRef:u,disabled:!c}),!c)return null;const d=e?p=>{const y=r.getState().nodes.filter(x=>x.selected);e(p,y)}:void 0,f=p=>{Object.prototype.hasOwnProperty.call(Gs,p.key)&&(p.preventDefault(),a({direction:Gs[p.key],factor:p.shiftKey?4:1}))};return h.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const ih=typeof window<"u"?window:void 0,T_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function y0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:_,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:j,autoPanOnSelection:I,defaultViewport:R,translateExtent:D,minZoom:W,maxZoom:H,preventScrolling:N,onSelectionContextMenu:T,noWheelClassName:L,noPanClassName:A,disableKeyboardA11y:P,onViewportChange:M,isControlledViewport:z}){const{nodesSelectionActive:O,userSelectionActive:Y}=ae(T_,ke),ne=ni(u,{target:ih}),B=ni(x,{target:ih}),F=B||j,Z=B||w,q=c&&F!==!0,E=ne||Y||q;return c_({deleteKeyCode:a,multiSelectionKeyCode:y}),h.jsx(h_,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:Z,panActivationKeyPressed:B,panOnScrollSpeed:_,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ne&&F,defaultViewport:R,translateExtent:D,minZoom:W,maxZoom:H,zoomActivationKeyCode:k,preventScrolling:N,noWheelClassName:L,noPanClassName:A,onViewportChange:M,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:q,children:h.jsxs(y_,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,autoPanOnSelection:I,isSelecting:!!E,selectionMode:d,selectionKeyPressed:ne,paneClickDistance:l,selectionOnDrag:q,children:[e,O&&h.jsx(I_,{onSelectionContextMenu:T,noPanClassName:A,disableKeyboardA11y:P})]})})}y0.displayName="FlowRenderer";const L_=b.memo(y0),z_=e=>t=>e?Lc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function A_(e){return ae(b.useCallback(z_(e),[e]),ke)}const R_=e=>e.updateNodeInternals;function D_(){const e=ae(R_),[t]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function O_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=ge(),i=b.useRef(null),s=b.useRef(null),l=b.useRef(e.sourcePosition),a=b.useRef(e.targetPosition),u=b.useRef(t),c=n&&!!e.internals.handleBounds;return b.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),b.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),b.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||f||p)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function F_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeClickDistance:g,onError:v}){const{node:m,internals:w,isParent:_}=ae(E=>{const $=E.nodeLookup.get(e),X=E.parentLookup.has(e);return{node:$,internals:$.internals,isParent:X}},ke);let S=m.type||"default",C=(k==null?void 0:k[S])||oh[S];C===void 0&&(v==null||v("003",Pt.error003(S)),S="default",C=(k==null?void 0:k.default)||oh.default);const j=!!(m.draggable||l&&typeof m.draggable>"u"),I=!!(m.selectable||a&&typeof m.selectable>"u"),R=!!(m.connectable||u&&typeof m.connectable>"u"),D=!!(m.focusable||c&&typeof m.focusable>"u"),W=ge(),H=Lg(m),N=O_({node:m,nodeType:S,hasDimensions:H,resizeObserver:d}),T=h0({nodeRef:N,disabled:m.hidden||!j,noDragClassName:f,handleSelector:m.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:g}),L=p0();if(m.hidden)return null;const A=Tt(m),P=b_(m),M=I||j||t||n||r||o,z=n?E=>n(E,{...w.userNode}):void 0,O=r?E=>r(E,{...w.userNode}):void 0,Y=o?E=>o(E,{...w.userNode}):void 0,ne=i?E=>i(E,{...w.userNode}):void 0,B=s?E=>s(E,{...w.userNode}):void 0,F=E=>{const{selectNodesOnDrag:$,nodeDragThreshold:X}=W.getState();I&&(!$||!j||X>0)&&Eu({id:e,store:W,nodeRef:N}),t&&t(E,{...w.userNode})},Z=E=>{if(!(Dg(E.nativeEvent)||y)){if(_g.includes(E.key)&&I){const $=E.key==="Escape";Eu({id:e,store:W,unselect:$,nodeRef:N})}else if(j&&m.selected&&Object.prototype.hasOwnProperty.call(Gs,E.key)){E.preventDefault();const{ariaLabelConfig:$}=W.getState();W.setState({ariaLiveMessage:$["node.a11yDescription.ariaLiveMessage"]({direction:E.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),L({direction:Gs[E.key],factor:E.shiftKey?4:1})}}},q=()=>{var G;if(y||!((G=N.current)!=null&&G.matches(":focus-visible")))return;const{transform:E,width:$,height:X,autoPanOnNodeFocus:Q,setCenter:K}=W.getState();if(!Q)return;Lc(new Map([[e,m]]),{x:0,y:0,width:$,height:X},E,!0).length>0||K(m.position.x+A.width/2,m.position.y+A.height/2,{zoom:E[2]})};return h.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${S}`,{[p]:j},m.className,{selected:m.selected,selectable:I,parent:_,draggable:j,dragging:T}]),ref:N,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:H?"visible":"hidden",...m.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:O,onMouseLeave:Y,onContextMenu:ne,onClick:F,onDoubleClick:B,onKeyDown:D?Z:void 0,tabIndex:D?0:void 0,onFocus:D?q:void 0,role:m.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${s0}-${x}`,"aria-label":m.ariaLabel,...m.domAttributes,children:h.jsx(x_,{value:e,children:h.jsx(C,{id:e,data:m.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:I,draggable:j,deletable:m.deletable??!0,isConnectable:R,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:T,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...A})})})}var H_=b.memo(F_);const B_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function v0(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=ae(B_,ke),i=A_(e.onlyRenderVisibleElements),s=D_();return h.jsx("div",{className:"react-flow__nodes",style:_l,children:i.map(l=>h.jsx(H_,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}v0.displayName="NodeRenderer";const V_=b.memo(v0);function W_(e){return ae(b.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&NN({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ke)}const U_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Y_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},sh={[Jo.Arrow]:U_,[Jo.ArrowClosed]:Y_};function X_(e){const t=ge();return b.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(sh,e)?sh[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Pt.error009(e)),null)},[e])}const K_=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=X_(t);return a?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:h.jsx(a,{color:n,strokeWidth:s})}):null},x0=({defaultColor:e,rfId:t})=>{const n=ae(i=>i.edges),r=ae(i=>i.defaultEdgeOptions),o=b.useMemo(()=>PN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:o.map(i=>h.jsx(K_,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};x0.displayName="MarkerDefinitions";var G_=b.memo(x0);function w0({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,f]=b.useState({x:1,y:0,width:0,height:0}),p=Ce(["react-flow__edge-textwrapper",u]),y=b.useRef(null);return b.useEffect(()=>{if(y.current){const x=y.current.getBBox();f({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...c,children:[o&&h.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}w0.displayName="EdgeText";const Q_=b.memo(w0);function vi({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...c,d:e,fill:"none",className:Ce(["react-flow__edge-path",c.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Ct(t)&&Ct(n)?h.jsx(Q_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function lh({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===oe.Left||e===oe.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function k0({sourceX:e,sourceY:t,sourcePosition:n=oe.Bottom,targetX:r,targetY:o,targetPosition:i=oe.Top}){const[s,l]=lh({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=lh({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,p]=Fg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,p]}function S0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:g})=>{const[v,m,w]=k0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),_=e.isInternal?void 0:t;return h.jsx(vi,{id:_,path:v,labelX:m,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:g})})}const q_=S0({isInternal:!1}),N0=S0({isInternal:!0});q_.displayName="SimpleBezierEdge";N0.displayName="SimpleBezierEdgeInternal";function E0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:p=oe.Bottom,targetPosition:y=oe.Top,markerEnd:x,markerStart:k,pathOptions:g,interactionWidth:v})=>{const[m,w,_]=Ks({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:y,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),S=e.isInternal?void 0:t;return h.jsx(vi,{id:S,path:m,labelX:w,labelY:_,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:k,interactionWidth:v})})}const _0=E0({isInternal:!1}),C0=E0({isInternal:!0});_0.displayName="SmoothStepEdge";C0.displayName="SmoothStepEdgeInternal";function j0(e){return b.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return h.jsx(_0,{...n,id:r,pathOptions:b.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const Z_=j0({isInternal:!1}),M0=j0({isInternal:!0});Z_.displayName="StepEdge";M0.displayName="StepEdgeInternal";function $0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:x})=>{const[k,g,v]=Bg({sourceX:n,sourceY:r,targetX:o,targetY:i}),m=e.isInternal?void 0:t;return h.jsx(vi,{id:m,path:k,labelX:g,labelY:v,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:y,interactionWidth:x})})}const J_=$0({isInternal:!1}),b0=$0({isInternal:!0});J_.displayName="StraightEdge";b0.displayName="StraightEdgeInternal";function P0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=oe.Bottom,targetPosition:l=oe.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,pathOptions:g,interactionWidth:v})=>{const[m,w,_]=Dc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),S=e.isInternal?void 0:t;return h.jsx(vi,{id:S,path:m,labelX:w,labelY:_,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:v})})}const e2=P0({isInternal:!1}),I0=P0({isInternal:!0});e2.displayName="BezierEdge";I0.displayName="BezierEdgeInternal";const ah={default:I0,straight:b0,step:M0,smoothstep:C0,simplebezier:N0},uh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},t2=(e,t,n)=>n===oe.Left?e-t:n===oe.Right?e+t:e,n2=(e,t,n)=>n===oe.Top?e-t:n===oe.Bottom?e+t:e,ch="react-flow__edgeupdater";function dh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return h.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ce([ch,`${ch}-${l}`]),cx:t2(t,r,e),cy:n2(n,r,e),r,stroke:"transparent",fill:"transparent"})}function r2({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const y=ge(),x=(w,_)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:j,connectionRadius:I,lib:R,onConnectStart:D,cancelConnection:W,nodeLookup:H,rfId:N,panBy:T,updateConnection:L}=y.getState(),A=_.type==="target",P=(O,Y)=>{f(!1),d==null||d(O,n,_.type,Y)},M=O=>u==null?void 0:u(n,O),z=(O,Y)=>{f(!0),c==null||c(w,n,_.type),D==null||D(O,Y)};Nu.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:j,connectionRadius:I,domNode:C,handleId:_.id,nodeId:_.nodeId,nodeLookup:H,isTarget:A,edgeUpdaterType:_.type,lib:R,flowId:N,cancelConnection:W,panBy:T,isValidConnection:(...O)=>{var Y,ne;return((ne=(Y=y.getState()).isValidConnection)==null?void 0:ne.call(Y,...O))??!0},onConnect:M,onConnectStart:z,onConnectEnd:(...O)=>{var Y,ne;return(ne=(Y=y.getState()).onConnectEnd)==null?void 0:ne.call(Y,...O)},onReconnectEnd:P,updateConnection:L,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},k=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>p(!0),m=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(dh,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:v,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&h.jsx(dh,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:m,type:"target"})]})}function o2({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:y,edgeTypes:x,noPanClassName:k,onError:g,disableKeyboardA11y:v}){let m=ae(K=>K.edgeLookup.get(e));const w=ae(K=>K.defaultEdgeOptions);m=w?{...w,...m}:m;let _=m.type||"default",S=(x==null?void 0:x[_])||ah[_];S===void 0&&(g==null||g("011",Pt.error011(_)),_="default",S=(x==null?void 0:x.default)||ah.default);const C=!!(m.focusable||t&&typeof m.focusable>"u"),j=typeof d<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),I=!!(m.selectable||r&&typeof m.selectable>"u"),R=b.useRef(null),[D,W]=b.useState(!1),[H,N]=b.useState(!1),T=ge(),{zIndex:L=m.zIndex,sourceX:A,sourceY:P,targetX:M,targetY:z,sourcePosition:O,targetPosition:Y}=ae(b.useCallback(K=>{const U=K.nodeLookup.get(m.source),G=K.nodeLookup.get(m.target);if(!U||!G)return uh;const te=bN({id:e,sourceNode:U,targetNode:G,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:K.connectionMode,onError:g}),V=SN({selected:m.selected,zIndex:m.zIndex,sourceNode:U,targetNode:G,elevateOnSelect:K.elevateEdgesOnSelect,zIndexMode:K.zIndexMode});return{...te||uh,zIndex:V}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex,g]),ke),ne=b.useMemo(()=>m.markerStart?`url('#${ku(m.markerStart,y)}')`:void 0,[m.markerStart,y]),B=b.useMemo(()=>m.markerEnd?`url('#${ku(m.markerEnd,y)}')`:void 0,[m.markerEnd,y]);if(m.hidden||A===null||P===null||M===null||z===null)return null;const F=K=>{var V;const{addSelectedEdges:U,unselectNodesAndEdges:G,multiSelectionActive:te}=T.getState();I&&(T.setState({nodesSelectionActive:!1}),m.selected&&te?(G({nodes:[],edges:[m]}),(V=R.current)==null||V.blur()):U([e])),o&&o(K,m)},Z=i?K=>{i(K,{...m})}:void 0,q=s?K=>{s(K,{...m})}:void 0,E=l?K=>{l(K,{...m})}:void 0,$=a?K=>{a(K,{...m})}:void 0,X=u?K=>{u(K,{...m})}:void 0,Q=K=>{var U;if(!v&&_g.includes(K.key)&&I){const{unselectNodesAndEdges:G,addSelectedEdges:te}=T.getState();K.key==="Escape"?((U=R.current)==null||U.blur(),G({edges:[m]})):te([e])}};return h.jsx("svg",{style:{zIndex:L},children:h.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${_}`,m.className,k,{selected:m.selected,animated:m.animated,inactive:!I&&!o,updating:D,selectable:I}]),onClick:F,onDoubleClick:Z,onContextMenu:q,onMouseEnter:E,onMouseMove:$,onMouseLeave:X,onKeyDown:C?Q:void 0,tabIndex:C?0:void 0,role:m.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":C?`${l0}-${y}`:void 0,ref:R,...m.domAttributes,children:[!H&&h.jsx(S,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:I,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:A,sourceY:P,targetX:M,targetY:z,sourcePosition:O,targetPosition:Y,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:ne,markerEnd:B,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),j&&h.jsx(r2,{edge:m,isReconnectable:j,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:A,sourceY:P,targetX:M,targetY:z,sourcePosition:O,targetPosition:Y,setUpdateHover:W,setReconnecting:N})]})})}var i2=b.memo(o2);const s2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function T0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:g,elementsSelectable:v,onError:m}=ae(s2,ke),w=W_(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(G_,{defaultColor:e,rfId:n}),w.map(_=>h.jsx(i2,{id:_,edgesFocusable:k,edgesReconnectable:g,elementsSelectable:v,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:x},_))]})}T0.displayName="EdgeRenderer";const l2=b.memo(T0),fh=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function a2({children:e}){const t=ge(),n=b.useRef(null),[r]=b.useState(()=>t.getState().transform);return d0(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=fh(s)))};return i(),t.subscribe(i)},[t]),h.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:fh(r)},children:e})}function u2(e){const t=yi(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const c2=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function d2(e){const t=ae(c2),n=ge();return b.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function f2(e){return e.connection.inProgress?{...e.connection,to:mi(e.connection.to,e.transform)}:{...e.connection}}function h2(e){return f2}function p2(e){const t=h2();return ae(t,ke)}const m2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function g2({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=ae(m2,ke);return!(i&&o&&a)?null:h.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Ce(["react-flow__connection",Ag(l)]),children:h.jsx(L0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const L0=({style:e,type:t=vn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:f,pointer:p}=p2();if(!o)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:Ag(r),toNode:c,toHandle:d,pointer:p});let y="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case vn.Bezier:[y]=Dc(x);break;case vn.SimpleBezier:[y]=k0(x);break;case vn.Step:[y]=Ks({...x,borderRadius:0});break;case vn.SmoothStep:[y]=Ks(x);break;default:[y]=Bg(x)}return h.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};L0.displayName="ConnectionLine";const y2={};function hh(e=y2){b.useRef(e),ge(),b.useEffect(()=>{},[e])}function v2(){ge(),b.useRef(!1),b.useEffect(()=>{},[])}function z0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:g,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:_,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:j,onlyRenderVisibleElements:I,elementsSelectable:R,defaultViewport:D,translateExtent:W,minZoom:H,maxZoom:N,preventScrolling:T,defaultMarkerColor:L,zoomOnScroll:A,zoomOnPinch:P,panOnScroll:M,panOnScrollSpeed:z,panOnScrollMode:O,zoomOnDoubleClick:Y,panOnDrag:ne,autoPanOnSelection:B,onPaneClick:F,onPaneMouseEnter:Z,onPaneMouseMove:q,onPaneMouseLeave:E,onPaneScroll:$,onPaneContextMenu:X,paneClickDistance:Q,nodeClickDistance:K,onEdgeContextMenu:U,onEdgeMouseEnter:G,onEdgeMouseMove:te,onEdgeMouseLeave:V,reconnectRadius:ee,onReconnect:se,onReconnectStart:ce,onReconnectEnd:he,noDragClassName:Ne,noWheelClassName:ie,noPanClassName:$e,disableKeyboardA11y:nt,nodeExtent:Ie,rfId:Be,viewport:Ve,onViewportChange:rt,nodesDraggable:Ut}){return hh(e),hh(t),v2(),u2(n),d2(Ve),h.jsx(L_,{onPaneClick:F,onPaneMouseEnter:Z,onPaneMouseMove:q,onPaneMouseLeave:E,onPaneContextMenu:X,onPaneScroll:$,paneClickDistance:Q,deleteKeyCode:j,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:_,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:R,zoomOnScroll:A,zoomOnPinch:P,zoomOnDoubleClick:Y,panOnScroll:M,panOnScrollSpeed:z,panOnScrollMode:O,panOnDrag:ne,autoPanOnSelection:B,defaultViewport:D,translateExtent:W,minZoom:H,maxZoom:N,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:Ne,noWheelClassName:ie,noPanClassName:$e,disableKeyboardA11y:nt,onViewportChange:rt,isControlledViewport:!!Ve,children:h.jsxs(a2,{children:[h.jsx(l2,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:se,onReconnectStart:ce,onReconnectEnd:he,onlyRenderVisibleElements:I,onEdgeContextMenu:U,onEdgeMouseEnter:G,onEdgeMouseMove:te,onEdgeMouseLeave:V,reconnectRadius:ee,defaultMarkerColor:L,noPanClassName:$e,disableKeyboardA11y:nt,rfId:Be}),h.jsx(g2,{style:x,type:y,component:k,containerStyle:g}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(V_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:K,onlyRenderVisibleElements:I,noPanClassName:$e,noDragClassName:Ne,disableKeyboardA11y:nt,nodeExtent:Ie,rfId:Be,nodesDraggable:Ut}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}z0.displayName="GraphView";const x2=b.memo(z0),w2=Tg(),ph=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,y=new Map,x=new Map,k=new Map,g=r??t??[],v=n??e??[],m=c??[0,0],w=d??qo;Ug(x,k,g);const{nodesInitialized:_}=Su(v,p,y,{nodeOrigin:m,nodeExtent:w,zIndexMode:f});let S=[0,0,1];if(s&&o&&i){const C=hi(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:j,y:I,zoom:R}=Ac(C,o,i,a,u,(l==null?void 0:l.padding)??.1);S=[j,I,R]}return{rfId:"1",width:o??0,height:i??0,transform:S,nodes:v,nodesInitialized:_,nodeLookup:p,parentLookup:y,edges:g,edgeLookup:k,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:qo,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Wr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...jg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:w2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Cg,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},k2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>TE((p,y)=>{async function x(){const{nodeLookup:k,panZoom:g,fitViewOptions:v,fitViewResolver:m,width:w,height:_,minZoom:S,maxZoom:C}=y();g&&(await mN({nodes:k,width:w,height:_,panZoom:g,minZoom:S,maxZoom:C},v),m==null||m.resolve(!0),p({fitViewResolver:null}))}return{...ph({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:k=>{const{nodeLookup:g,parentLookup:v,nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:_,fitViewQueued:S,zIndexMode:C,nodesSelectionActive:j}=y(),{nodesInitialized:I,hasSelectedNodes:R}=Su(k,g,v,{nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:C}),D=j&&R;S&&I?(x(),p({nodes:k,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):p({nodes:k,nodesInitialized:I,nodesSelectionActive:D})},setEdges:k=>{const{connectionLookup:g,edgeLookup:v}=y();Ug(g,v,k),p({edges:k})},setDefaultNodesAndEdges:(k,g)=>{if(k){const{setNodes:v}=y();v(k),p({hasDefaultNodes:!0})}if(g){const{setEdges:v}=y();v(g),p({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:g,nodeLookup:v,parentLookup:m,domNode:w,nodeOrigin:_,nodeExtent:S,debug:C,fitViewQueued:j,zIndexMode:I}=y(),{changes:R,updatedInternals:D}=DN(k,v,m,w,_,S,I);D&&(LN(v,m,{nodeOrigin:_,nodeExtent:S,zIndexMode:I}),j?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(R==null?void 0:R.length)>0&&(C&&console.log("React Flow: trigger node changes",R),g==null||g(R)))},updateNodePositions:(k,g=!1)=>{const v=[];let m=[];const{nodeLookup:w,triggerNodeChanges:_,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:j}=y();for(const[I,R]of k){const D=w.get(I),W=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(R!=null&&R.position)),H={id:I,type:"position",position:W?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:g};if(D&&S.inProgress&&S.fromNode.id===D.id){const N=or(D,S.fromHandle,oe.Left,!0);C({...S,from:N})}W&&D.parentId&&v.push({id:I,parentId:D.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),m.push(H)}if(v.length>0){const{parentLookup:I,nodeOrigin:R}=y(),D=Vc(v,w,I,R);m.push(...D)}for(const I of j.values())m=I(m);_(m)},triggerNodeChanges:k=>{const{onNodesChange:g,setNodes:v,nodes:m,hasDefaultNodes:w,debug:_}=y();if(k!=null&&k.length){if(w){const S=e_(k,m);v(S)}_&&console.log("React Flow: trigger node changes",k),g==null||g(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:g,setEdges:v,edges:m,hasDefaultEdges:w,debug:_}=y();if(k!=null&&k.length){if(w){const S=t_(k,m);v(S)}_&&console.log("React Flow: trigger edge changes",k),g==null||g(k)}},addSelectedNodes:k=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:_}=y();if(g){const S=k.map(C=>An(C,!0));w(S);return}w(Cr(m,new Set([...k]),!0)),_(Cr(v))},addSelectedEdges:k=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:_}=y();if(g){const S=k.map(C=>An(C,!0));_(S);return}_(Cr(v,new Set([...k]))),w(Cr(m,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:g}={})=>{const{edges:v,nodes:m,nodeLookup:w,triggerNodeChanges:_,triggerEdgeChanges:S}=y(),C=k||m,j=g||v,I=[];for(const D of C){if(!D.selected)continue;const W=w.get(D.id);W&&(W.selected=!1),I.push(An(D.id,!1))}const R=[];for(const D of j)D.selected&&R.push(An(D.id,!1));_(I),S(R)},setMinZoom:k=>{const{panZoom:g,maxZoom:v}=y();g==null||g.setScaleExtent([k,v]),p({minZoom:k})},setMaxZoom:k=>{const{panZoom:g,minZoom:v}=y();g==null||g.setScaleExtent([v,k]),p({maxZoom:k})},setTranslateExtent:k=>{var g;(g=y().panZoom)==null||g.setTranslateExtent(k),p({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:g,triggerNodeChanges:v,triggerEdgeChanges:m,elementsSelectable:w}=y();if(!w)return;const _=g.reduce((C,j)=>j.selected?[...C,An(j.id,!1)]:C,[]),S=k.reduce((C,j)=>j.selected?[...C,An(j.id,!1)]:C,[]);v(_),m(S)},setNodeExtent:k=>{const{nodes:g,nodeLookup:v,parentLookup:m,nodeOrigin:w,elevateNodesOnSelect:_,nodeExtent:S,zIndexMode:C}=y();k[0][0]===S[0][0]&&k[0][1]===S[0][1]&&k[1][0]===S[1][0]&&k[1][1]===S[1][1]||(Su(g,v,m,{nodeOrigin:w,nodeExtent:k,elevateNodesOnSelect:_,checkEquality:!1,zIndexMode:C}),p({nodeExtent:k}))},panBy:k=>{const{transform:g,width:v,height:m,panZoom:w,translateExtent:_}=y();return ON({delta:k,panZoom:w,transform:g,translateExtent:_,width:v,height:m})},setCenter:async(k,g,v)=>{const{width:m,height:w,maxZoom:_,panZoom:S}=y();if(!S)return!1;const C=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:_;return await S.setViewport({x:m/2-k*C,y:w/2-g*C,zoom:C},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0},cancelConnection:()=>{p({connection:{...jg}})},updateConnection:k=>{p({connection:k})},reset:()=>p({...ph()})}},Object.is);function A0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:p}){const[y]=b.useState(()=>k2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return h.jsx(LE,{value:y,children:h.jsx(s_,{children:h.jsx(k_,{children:p})})})}function S2({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return b.useContext(El)?h.jsx(h.Fragment,{children:e}):h.jsx(A0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}const N2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function E2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:j,onNodeDragStop:I,onNodesDelete:R,onEdgesDelete:D,onDelete:W,onSelectionChange:H,onSelectionDragStart:N,onSelectionDrag:T,onSelectionDragStop:L,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:M,onBeforeDelete:z,connectionMode:O,connectionLineType:Y=vn.Bezier,connectionLineStyle:ne,connectionLineComponent:B,connectionLineContainerStyle:F,deleteKeyCode:Z="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:E=!1,selectionMode:$=Zo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:Q=ti()?"Meta":"Control",zoomActivationKeyCode:K=ti()?"Meta":"Control",snapToGrid:U,snapGrid:G,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:V,nodesDraggable:ee,autoPanOnNodeFocus:se,nodesConnectable:ce,nodesFocusable:he,nodeOrigin:Ne=a0,edgesFocusable:ie,edgesReconnectable:$e,elementsSelectable:nt=!0,defaultViewport:Ie=XE,minZoom:Be=.5,maxZoom:Ve=2,translateExtent:rt=qo,preventScrolling:Ut=!0,nodeExtent:Yt,defaultMarkerColor:lr="#b1b1b7",zoomOnScroll:Il=!0,zoomOnPinch:iy=!0,panOnScroll:sy=!1,panOnScrollSpeed:ly=.5,panOnScrollMode:ay=Un.Free,zoomOnDoubleClick:uy=!0,panOnDrag:cy=!0,onPaneClick:dy,onPaneMouseEnter:fy,onPaneMouseMove:hy,onPaneMouseLeave:py,onPaneScroll:my,onPaneContextMenu:gy,paneClickDistance:yy=1,nodeClickDistance:vy=0,children:xy,onReconnect:wy,onReconnectStart:ky,onReconnectEnd:Sy,onEdgeContextMenu:Ny,onEdgeDoubleClick:Ey,onEdgeMouseEnter:_y,onEdgeMouseMove:Cy,onEdgeMouseLeave:jy,reconnectRadius:My=10,onNodesChange:$y,onEdgesChange:by,noDragClassName:Py="nodrag",noWheelClassName:Iy="nowheel",noPanClassName:Kc="nopan",fitView:Gc,fitViewOptions:Qc,connectOnClick:Ty,attributionPosition:Ly,proOptions:zy,defaultEdgeOptions:Ay,elevateNodesOnSelect:Ry=!0,elevateEdgesOnSelect:Dy=!1,disableKeyboardA11y:qc=!1,autoPanOnConnect:Oy,autoPanOnNodeDrag:Fy,autoPanOnSelection:Hy=!0,autoPanSpeed:By,connectionRadius:Vy,isValidConnection:Wy,onError:Uy,style:Yy,id:Zc,nodeDragThreshold:Xy,connectionDragThreshold:Ky,viewport:Gy,onViewportChange:Qy,width:qy,height:Zy,colorMode:Jy="light",debug:ev,onScroll:ki,ariaLabelConfig:tv,zIndexMode:Jc="basic",...nv},rv){const Tl=Zc||"1",ov=qE(Jy),iv=b.useCallback(ed=>{ed.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ki==null||ki(ed)},[ki]);return h.jsx("div",{"data-testid":"rf__wrapper",...nv,onScroll:iv,style:{...Yy,...N2},ref:rv,className:Ce(["react-flow",o,ov]),id:Zc,role:"application",children:h.jsxs(S2,{nodes:e,edges:t,width:qy,height:Zy,fitView:Gc,fitViewOptions:Qc,minZoom:Be,maxZoom:Ve,nodeOrigin:Ne,nodeExtent:Yt,zIndexMode:Jc,children:[h.jsx(QE,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:g,nodesDraggable:ee,autoPanOnNodeFocus:se,nodesConnectable:ce,nodesFocusable:he,edgesFocusable:ie,edgesReconnectable:$e,elementsSelectable:nt,elevateNodesOnSelect:Ry,elevateEdgesOnSelect:Dy,minZoom:Be,maxZoom:Ve,nodeExtent:Yt,onNodesChange:$y,onEdgesChange:by,snapToGrid:U,snapGrid:G,connectionMode:O,translateExtent:rt,connectOnClick:Ty,defaultEdgeOptions:Ay,fitView:Gc,fitViewOptions:Qc,onNodesDelete:R,onEdgesDelete:D,onDelete:W,onNodeDragStart:C,onNodeDrag:j,onNodeDragStop:I,onSelectionDrag:T,onSelectionDragStart:N,onSelectionDragStop:L,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Kc,nodeOrigin:Ne,rfId:Tl,autoPanOnConnect:Oy,autoPanOnNodeDrag:Fy,autoPanSpeed:By,onError:Uy,connectionRadius:Vy,isValidConnection:Wy,selectNodesOnDrag:V,nodeDragThreshold:Xy,connectionDragThreshold:Ky,onBeforeDelete:z,debug:ev,ariaLabelConfig:tv,zIndexMode:Jc}),h.jsx(x2,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:_,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:Y,connectionLineStyle:ne,connectionLineComponent:B,connectionLineContainerStyle:F,selectionKeyCode:q,selectionOnDrag:E,selectionMode:$,deleteKeyCode:Z,multiSelectionKeyCode:Q,panActivationKeyCode:X,zoomActivationKeyCode:K,onlyRenderVisibleElements:te,defaultViewport:Ie,translateExtent:rt,minZoom:Be,maxZoom:Ve,preventScrolling:Ut,zoomOnScroll:Il,zoomOnPinch:iy,zoomOnDoubleClick:uy,panOnScroll:sy,panOnScrollSpeed:ly,panOnScrollMode:ay,panOnDrag:cy,autoPanOnSelection:Hy,onPaneClick:dy,onPaneMouseEnter:fy,onPaneMouseMove:hy,onPaneMouseLeave:py,onPaneScroll:my,onPaneContextMenu:gy,paneClickDistance:yy,nodeClickDistance:vy,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:M,onReconnect:wy,onReconnectStart:ky,onReconnectEnd:Sy,onEdgeContextMenu:Ny,onEdgeDoubleClick:Ey,onEdgeMouseEnter:_y,onEdgeMouseMove:Cy,onEdgeMouseLeave:jy,reconnectRadius:My,defaultMarkerColor:lr,noDragClassName:Py,noWheelClassName:Iy,noPanClassName:Kc,rfId:Tl,disableKeyboardA11y:qc,nodeExtent:Yt,viewport:Gy,onViewportChange:Qy,nodesDraggable:ee}),h.jsx(YE,{onSelectionChange:H}),xy,h.jsx(HE,{proOptions:zy,position:Ly}),h.jsx(FE,{rfId:Tl,disableKeyboardA11y:qc})]})})}var _2=c0(E2);const C2=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function j2({children:e}){const t=ae(C2);return t?Xm.createPortal(e,t):null}function M2({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,r])})}function $2({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var en;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(en||(en={}));const b2={[en.Dots]:1,[en.Lines]:1,[en.Cross]:6},P2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function R0({id:e,variant:t=en.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=b.useRef(null),{transform:f,patternId:p}=ae(P2,ke),y=r||b2[t],x=t===en.Dots,k=t===en.Cross,g=Array.isArray(n)?n:[n,n],v=[g[0]*f[2]||1,g[1]*f[2]||1],m=y*f[2],w=Array.isArray(i)?i:[i,i],_=k?[m,m]:v,S=[w[0]*f[2]+_[0]/2,w[1]*f[2]+_[1]/2],C=`${p}${e||""}`;return h.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,..._l,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:x?h.jsx($2,{radius:m/2,className:c}):h.jsx(M2,{dimensions:_,lineWidth:o,variant:t,className:c})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}R0.displayName="Background";const I2=b.memo(R0);function T2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function L2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function z2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function A2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function R2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Xi({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const D2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function D0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const y=ge(),{isInteractive:x,minZoomReached:k,maxZoomReached:g,ariaLabelConfig:v}=ae(D2,ke),{zoomIn:m,zoomOut:w,fitView:_}=yi(),S=()=>{m(),i==null||i()},C=()=>{w(),s==null||s()},j=()=>{_(o),l==null||l()},I=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},R=f==="horizontal"?"horizontal":"vertical";return h.jsxs(gi,{className:Ce(["react-flow__controls",R,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??v["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Xi,{onClick:S,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:g,children:h.jsx(T2,{})}),h.jsx(Xi,{onClick:C,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:k,children:h.jsx(L2,{})})]}),n&&h.jsx(Xi,{className:"react-flow__controls-fitview",onClick:j,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:h.jsx(z2,{})}),r&&h.jsx(Xi,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:x?h.jsx(R2,{}):h.jsx(A2,{})}),c]})}D0.displayName="Controls";b.memo(D0);function O2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:p}){const{background:y,backgroundColor:x}=i||{},k=s||y||x;return h.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}const F2=b.memo(O2),H2=e=>e.nodes.map(t=>t.id),ma=e=>e instanceof Function?e:()=>e;function B2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=F2,onClick:s}){const l=ae(H2,ke),a=ma(t),u=ma(e),c=ma(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(f=>h.jsx(W2,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function V2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:f,height:p}=ae(y=>{const x=y.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const k=x.internals.userNode,{x:g,y:v}=x.internals.positionAbsolute,{width:m,height:w}=Tt(k);return{node:k,x:g,y:v,width:m,height:w}},ke);return!u||u.hidden||!Lg(u)?null:h.jsx(l,{x:c,y:d,width:f,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const W2=b.memo(V2);var U2=b.memo(B2);const Y2=200,X2=150,K2=e=>!e.hidden,G2=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Pg(hi(e.nodeLookup,{filter:K2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},mh=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Q2=(e,t)=>mh(e.viewBB,t.viewBB)&&mh(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,q2="react-flow__minimap-desc";function O0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:g,inversePan:v,zoomStep:m=1,offsetScale:w=5}){const _=ge(),S=b.useRef(null),{boundingRect:C,panZoom:j,viewBB:I,rfId:R,translateExtent:D,flowWidth:W,flowHeight:H,ariaLabelConfig:N}=ae(G2,Q2),T=(e==null?void 0:e.width)??Y2,L=(e==null?void 0:e.height)??X2,A=C.width/T,P=C.height/L,M=Math.max(A,P),z=M*T,O=M*L,Y=w*M,ne=C.x-(z-C.width)/2-Y,B=C.y-(O-C.height)/2-Y,F=z+Y*2,Z=O+Y*2,q=`${q2}-${R}`,E=b.useRef(0),$=b.useRef();E.current=M,b.useEffect(()=>{const G=_.getState().panZoom;if(S.current&&G)return $.current=KN({domNode:S.current,panZoom:G,getTransform:()=>_.getState().transform,getViewScale:()=>E.current}),()=>{var te;(te=$.current)==null||te.destroy()}},[j]),b.useEffect(()=>{var G;(G=$.current)==null||G.update({translateExtent:D,width:W,height:H,inversePan:v,pannable:x,zoomStep:m,zoomable:k})},[x,k,v,m,D,W,H]);const X=p?G=>{var ee;const[te,V]=((ee=$.current)==null?void 0:ee.pointer(G))||[0,0];p(G,{x:te,y:V})}:void 0,Q=b.useCallback((G,te)=>{const V=_.getState().nodeLookup.get(te).internals.userNode;y==null||y(G,V)},[y]),K=y?Q:void 0,U=g??N["minimap.ariaLabel"];return h.jsx(gi,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:T,height:L,viewBox:`${ne} ${B} ${F} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:S,onClick:X,children:[U&&h.jsx("title",{id:q,children:U}),h.jsx(U2,{onClick:K,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-Y},${B-Y}h${F+Y*2}v${Z+Y*2}h${-F-Y*2}z
|
|
62
|
+
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}O0.displayName="MiniMap";b.memo(O0);const Z2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,J2={[Xr.Line]:"right",[Xr.Handle]:"bottom-right"};function eC({nodeId:e,position:t,variant:n=Xr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:y,onResizeStart:x,onResize:k,onResizeEnd:g}){const v=m0(),m=typeof e=="string"?e:v,w=ge(),_=b.useRef(null),S=n===Xr.Handle,C=ae(b.useCallback(Z2(S&&p),[S,p]),ke),j=b.useRef(null),I=t??J2[n];b.useEffect(()=>{if(!(!_.current||!m))return j.current||(j.current=lE({domNode:_.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:D,transform:W,snapGrid:H,snapToGrid:N,nodeOrigin:T,domNode:L}=w.getState();return{nodeLookup:D,transform:W,snapGrid:H,snapToGrid:N,nodeOrigin:T,paneDomNode:L}},onChange:(D,W)=>{const{triggerNodeChanges:H,nodeLookup:N,parentLookup:T,nodeOrigin:L}=w.getState(),A=[],P={x:D.x,y:D.y},M=N.get(m);if(M&&M.expandParent&&M.parentId){const z=M.origin??L,O=D.width??M.measured.width??0,Y=D.height??M.measured.height??0,ne={id:M.id,parentId:M.parentId,rect:{width:O,height:Y,...zg({x:D.x??M.position.x,y:D.y??M.position.y},{width:O,height:Y},M.parentId,N,z)}},B=Vc([ne],N,T,L);A.push(...B),P.x=D.x?Math.max(z[0]*O,D.x):void 0,P.y=D.y?Math.max(z[1]*Y,D.y):void 0}if(P.x!==void 0&&P.y!==void 0){const z={id:m,type:"position",position:{...P}};A.push(z)}if(D.width!==void 0&&D.height!==void 0){const O={id:m,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};A.push(O)}for(const z of W){const O={...z,type:"position"};A.push(O)}H(A)},onEnd:({width:D,height:W})=>{const H={id:m,type:"dimensions",resizing:!1,dimensions:{width:D,height:W}};w.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:k,onResizeEnd:g,shouldResize:y}),()=>{var D;(D=j.current)==null||D.destroy()}},[I,l,a,u,c,d,x,k,g,y]);const R=I.split("-");return h.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...R,n,r]),ref:_,style:{...o,scale:C,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}b.memo(eC);function tC(){const e=new URLSearchParams(location.search).get("t");try{return e&&sessionStorage.setItem("illuminate-token",e),e??sessionStorage.getItem("illuminate-token")??""}catch{return e??""}}const Qr=tC(),Dt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Qr)}`,Qs=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Qr)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Qr)}`;class F0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function ft(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Qr,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new F0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const _t={list:()=>ft("GET","/api/maps"),get:e=>ft("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>ft("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>ft("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),selection:(e,t,n)=>ft("PUT",`/api/maps/${encodeURIComponent(e)}/selection`,{selection:t,step:n}),ask:(e,t,n)=>ft("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>ft("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>ft("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>ft("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),code:(e,t,n="now")=>ft("GET",`/api/maps/${encodeURIComponent(e)}/code?item=${encodeURIComponent(t)}${n==="before"?"&when=before":""}`),answerCode:(e,t)=>ft("GET",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/code`),stop:()=>ft("POST","/api/stop")},nC=4e3;function H0(e,t,n,r){let o=null,i=!1,s=null;const l=()=>{o=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?t=${encodeURIComponent(Qr)}${r?`&m=${encodeURIComponent(r)}`:""}`),o.onopen=()=>t(!0),o.onmessage=a=>{try{e(JSON.parse(String(a.data)))}catch{}},o.onclose=a=>{t(!1),a.code===nC?(i=!0,n()):i||(s=setTimeout(l,1e3))}};return l(),()=>{i=!0,s&&clearTimeout(s),o==null||o.close()}}const B0={name:"Claude",asks:"page"},Cl=e=>e.asks==="chat";function rC(e,t,n){return{title:`Ask in the ${e.name} chat beside this page`,detail:t?`${e.name} will see what you selected here.`:n?`${e.name} will know you're on the step “${n}”.`:`${e.name} will see what you select here.`}}function oC(e,t,n){return Cl(e)?{selection:t,step:n}:null}function iC(e,t){var r;if(((r=e.offer)==null?void 0:r.status)==="pending")return!0;const n=e.fix?t[e.fix.id]:void 0;return!!n&&(n.status==="proposed"||n.status==="applying"||n.status==="failed"||n.status==="applied"&&n.undoable)}function sC(e,t,n){return Cl(e)?t.filter(r=>iC(r,n)):t}const Uc=[{id:"vscode",name:"VS Code"},{id:"cursor",name:"Cursor"},{id:"windsurf",name:"Windsurf"},{id:"zed",name:"Zed"}];function lC(e,t,n,r){const o=`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${n}`;return`${e}://file${o.startsWith("/")?"":"/"}${o.split("/").map(encodeURIComponent).join("/").replace(/%3A/g,":")}:${r}`}const _u=(...e)=>e.filter(Boolean).join(" "),ri=e=>{try{return localStorage.getItem(e)}catch{return null}},jl=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};function aC(){const[e,t]=b.useState(()=>{var n;return((n=Uc.find(r=>r.id===ri("illuminate-editor")))==null?void 0:n.id)??"vscode"});return[e,n=>{jl("illuminate-editor",n),t(n)}]}function V0(e,t){const[n,r]=b.useState(void 0);return b.useEffect(()=>{let o=!0;return e().then(i=>o&&r(i),()=>o&&r(null)),()=>{o=!1}},t),n}const uC=(e,t)=>`${e}:${t}`;function cC({block:e,root:t,editor:n,before:r}){const o=b.useRef(null);b.useEffect(()=>{const u=o.current,c=u==null?void 0:u.querySelector(".code-line.cited");u&&c&&c.offsetTop-u.offsetTop+c.offsetHeight>u.clientHeight&&(u.scrollTop=Math.max(0,c.offsetTop-u.offsetTop-48))},[e.file,e.start,e.cited.join(",")]);const i=new Set(e.cited),s=new Map(e.notes.map(u=>[u.line,u.note])),l=e.cited[0]??e.start,a=Uc.find(u=>u.id===n).name;return h.jsxs("figure",{className:"code-block",children:[h.jsxs("figcaption",{className:"code-cap",children:[h.jsxs("span",{className:"code-where",children:[e.name&&h.jsx("strong",{className:"code-name",children:e.name}),h.jsxs("span",{className:"code-file",children:[e.file,!e.whole&&`:${e.start}`]})]}),!r&&h.jsxs("a",{className:"code-open",href:lC(n,t,e.file,l),title:`Open ${e.file} at line ${l} in ${a}`,children:["Open in ",a]})]}),h.jsx("div",{className:"code-lines",ref:o,tabIndex:0,"aria-label":`Code from ${e.file}`,children:h.jsx("div",{className:"code-inner",children:e.lines.map((u,c)=>{const d=e.start+c;return h.jsxs("div",{"data-at":uC(e.file,d),className:_u("code-line",i.has(d)&&"cited",s.has(d)&&"noted"),children:[h.jsx("span",{className:"code-n",children:d}),h.jsx("span",{className:"code-t",children:u||" "}),s.has(d)&&h.jsx("span",{className:"code-note",children:s.get(d)})]},d)})})})]})}function W0({view:e,jump:t,before:n=!1,what:r}){const[o,i]=aC(),s=b.useRef(null);return b.useEffect(()=>{var u;if(!t)return;const l=[...((u=s.current)==null?void 0:u.querySelectorAll(".code-line"))??[]].find(c=>c.dataset.at===t.at);if(!l)return;l.scrollIntoView({block:"center",behavior:"smooth"}),l.classList.add("flash");const a=setTimeout(()=>l.classList.remove("flash"),1200);return()=>clearTimeout(a)},[t==null?void 0:t.at,t==null?void 0:t.n,e]),h.jsxs("div",{className:"code-view",ref:s,children:[e.blocks.map(l=>h.jsx(cC,{block:l,root:e.root,editor:o,before:n},`${l.file}:${l.start}`)),e.missing>0&&h.jsxs("p",{className:"warn small code-missing",children:[e.missing===1?`1 ${r} isn’t`:`${e.missing} ${r}s aren’t`," in ",n?"that version of the code":"the code any more",", so ",e.missing===1?"it isn’t":"they aren’t"," shown."]}),!n&&e.blocks.length>0&&h.jsxs("label",{className:"code-editor",children:["Links open in"," ",h.jsx("select",{value:o,onChange:l=>i(l.target.value),"aria-label":"Which editor code links open in",children:Uc.map(l=>h.jsx("option",{value:l.id,children:l.name},l.id))})]})]})}function dC({mapId:e,itemId:t,change:n,since:r,stamp:o,jump:i}){const[s,l]=b.useState(n==="removed"?"before":"now"),a=V0(()=>_t.code(e,t,s),[e,t,s,o]),u=n==="changed"&&h.jsxs("div",{className:"seg code-when",role:"group","aria-label":"Which version of the code to show",children:[h.jsxs("button",{className:_u("seg-btn",s==="before"&&"on"),"aria-pressed":s==="before",onClick:()=>l("before"),children:["As it was at ",r]}),h.jsx("button",{className:_u("seg-btn",s==="now"&&"on"),"aria-pressed":s==="now",onClick:()=>l("now"),children:"Now"})]});return a===void 0?u||null:!a||!a.blocks.length&&!a.missing?u?h.jsxs(h.Fragment,{children:[u,h.jsx("p",{className:"muted small",children:"No code to show for that version."})]}):null:h.jsxs(h.Fragment,{children:[u,h.jsx(W0,{view:a,jump:i,before:s==="before",what:"cited line"})]})}function fC({mapId:e,answerId:t,stamp:n}){const r=V0(()=>_t.answerCode(e,t),[e,t,n]);return!r||!r.blocks.length&&!r.missing?null:h.jsx(W0,{view:r,what:"note"})}const hC=()=>U0("illuminate-code"),pC=()=>U0("illuminate-diff");function U0(e){const[t,n]=b.useState(()=>ri(e)==="show");return[t,r=>{jl(e,r?"show":"hide"),n(r)}]}const $o=(...e)=>e.filter(Boolean).join(" "),mn=e=>`${Math.max(0,Math.min(1,e))*100}%`;function Cu(e,t){var r;const n=(r=e==null?void 0:e.screens)==null?void 0:r[t];return(n==null?void 0:n.status)==="confirmed"?n.show:null}function Y0({show:e,small:t=!1}){var a;const n=u=>e.page.regions.filter(c=>c.slot===u),r=(a=e.highlight)==null?void 0:a.trim().toLowerCase(),o=u=>{const c=u.id===e.region,d=p=>c&&p.text.trim().toLowerCase()===r,f=t?u.elements.filter(d):u.elements;return h.jsxs("div",{className:$o("wf-region",c&&"wf-on"),children:[h.jsx("span",{className:"wf-label",children:u.label}),h.jsx("span",{className:"wf-els",children:f.map((p,y)=>h.jsx("span",{className:$o("sk",`sk-${p.kind}`,d(p)&&"sk-mark"),title:p.text,children:p.kind==="image"?`▧ ${p.text}`:p.text},y))})]},u.id)},i=u=>n(u).length?h.jsx("div",{className:`wf-slot wf-${u}`,children:n(u).map(o)}):null,s=n("left").length+n("right").length,l=[n("left").length&&"minmax(0, 1fr)",(n("main").length||!s)&&"minmax(0, 2.6fr)",n("right").length&&"minmax(0, 1fr)"].filter(Boolean).join(" ");return h.jsxs("div",{className:$o("wf",t&&"wf-small"),children:[i("top"),(s>0||n("main").length>0)&&h.jsxs("div",{className:"wf-mid",style:{gridTemplateColumns:l},children:[i("left"),i("main"),i("right")]}),i("bottom")]})}function X0({show:e,name:t}){var i;const[n,r]=b.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${mn(s.x+s.w/2)} ${mn(s.y+s.h/2)}`:void 0;return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:h.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[h.jsx("img",{src:Qs(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&h.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:mn(s.x),top:mn(s.y),width:mn(s.w),height:mn(s.h)}})]})}),h.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&h.jsxs(h.Fragment,{children:[" · ",h.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="wireframe")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(gC,{show:e})}),h.jsxs("figcaption",{className:"muted small",children:["Wireframe of ",e.page.name,", from ",e.page.file,". Where things sit is approximate; it isn’t a screenshot."]})]});if(e.kind==="image")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-image",children:h.jsx("img",{src:Qs(e),alt:`Image used at “${t}”`,loading:"lazy"})}),h.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>h.jsxs("span",{className:$o("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),title:s.proposed?"Proposed: not on the screen yet":void 0,children:[s.kind==="image"?`▧ ${s.text}`:s.text,s.proposed&&h.jsx("i",{className:"sk-new",children:"proposed"})]},l))}),h.jsxs("figcaption",{className:"muted small",children:[e.elements.every(s=>s.proposed)?`Rough sketch of a proposed screen (${e.file})`:`Rough sketch from ${e.file}, not a screenshot`,e.elements.some(s=>s.proposed)&&!e.elements.every(s=>s.proposed)&&" · violet parts are proposed"]})]})}function mC({show:e,name:t}){var r;if(e.kind==="sketch"){const o=(r=e.highlight)==null?void 0:r.trim().toLowerCase(),i=e.elements.slice(0,4);return h.jsxs("div",{className:"thumb thumb-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:[i.map((s,l)=>h.jsx("span",{className:$o("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),children:s.kind==="image"?`▧ ${s.text}`:s.text},l)),e.elements.length>i.length&&h.jsxs("span",{className:"thumb-more",children:["+",e.elements.length-i.length," more"]})]})}if(e.kind==="wireframe")return h.jsx("div",{className:"thumb thumb-wire",role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(Y0,{show:e,small:!0})});if(e.kind==="image")return h.jsx("div",{className:"thumb thumb-image",children:h.jsx("img",{src:Qs(e),alt:`Image used at “${t}”`,loading:"lazy"})});const n=e.box;return h.jsx("div",{className:"thumb thumb-shot",children:h.jsx("img",{src:Qs(e),alt:`The screen at “${t}”`,loading:"lazy",style:n?{transform:"scale(1.8)",transformOrigin:`${mn(n.x+n.w/2)} ${mn(n.y+n.h/2)}`}:void 0})})}const gh=560;function gC({show:e}){const t=b.useRef(null),[n,r]=b.useState(1);return b.useLayoutEffect(()=>{const o=t.current;if(!o)return;const i=()=>r(Math.min(1,o.clientWidth/gh));i();const s=new ResizeObserver(i);return s.observe(o),()=>s.disconnect()},[]),h.jsx("div",{ref:t,className:"wf-fit",children:h.jsx("div",{className:"wf-fit-page",style:{width:gh,zoom:n},children:h.jsx(Y0,{show:e})})})}const yh=/^\s*(```|~~~)/,yC=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,vC=/^\s*[-*+•]\s+(.*)$/,xC=/^\s*(\d{1,4})[.)]\s+(.*)$/;function wC(e){const t=e.replace(/\r\n?/g,`
|
|
63
|
+
`).split(`
|
|
64
|
+
`),n=[];let r=[];const o=()=>{r.length&&n.push({kind:"p",text:r.join(`
|
|
65
|
+
`)}),r=[]};for(let i=0;i<t.length;i++){const s=t[i];if(yh.test(s)){o();const d=[];for(i++;i<t.length&&!yh.test(t[i]);i++)d.push(t[i]);n.push({kind:"code",text:d.join(`
|
|
66
|
+
`)});continue}if(!s.trim()){o();continue}const l=yC.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=vC.exec(s),u=a?null:xC.exec(s);if(a||u){o();const d=a?"ul":"ol",f=n[n.length-1],p=a?a[1]:u[2];f&&f.kind===d?f.items.push(p):n.push(d==="ul"?{kind:d,items:[p]}:{kind:d,items:[p],start:Number(u[1])});continue}const c=n[n.length-1];if(!r.length&&c&&(c.kind==="ul"||c.kind==="ol")&&/^\s+\S/.test(s)){c.items[c.items.length-1]+=` ${s.trim()}`;continue}r.push(s)}return o(),n}const kC=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function Hn(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
|
|
67
|
+
`).forEach((l,a)=>{a>0&&n.push(h.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(kC)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(h.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(h.jsx("strong",{children:Hn(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(h.jsx("em",{children:Hn(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?h.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:Hn(s[7],l)},l):h.jsx("span",{children:Hn(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function oi({text:e,className:t}){const n=wC(e);return n.length?h.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return h.jsx("p",{children:Hn(r.text,i)},i);if(r.kind==="h")return h.jsx("p",{className:"md-h",children:Hn(r.text,i)},i);if(r.kind==="code")return h.jsx("pre",{children:h.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>h.jsx("li",{children:Hn(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?h.jsx("ul",{children:s},i):h.jsx("ol",{start:r.start,children:s},i)})}):null}const SC=/^About the walkthrough step “([^”]*)”: /,NC=(e,t)=>`About the walkthrough step “${e}”: ${t}`;function EC(e){const t=SC.exec(e);return t?{question:e.slice(t[0].length),step:t[1]}:{question:e,step:null}}const fr=()=>({nodes:[],edges:[],absences:[]}),yo=e=>e.nodes.length+e.edges.length+e.absences.length,_C=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:fr(),tour:null,peek:!1,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1,agent:B0}),CC=e=>e.views[e.viewIndex]??null;function xi(e){if(!e.map)return[];const t=new Set([...e.map.areas,...e.map.nodes,...e.map.edges,...e.map.absences].map(n=>n.id));return e.answers.flatMap(n=>{const r=n.added.filter(o=>t.has(o));return r.length?[{answerId:n.id,question:n.question,ids:r,visible:!e.hidden.includes(n.id)}]:[]})}const jC=e=>xi(e).flatMap(t=>t.ids);function K0(e){if(!e.map)return null;const t=new Set(xi(e).filter(o=>!o.visible).flatMap(o=>o.ids));if(!t.size)return e.map;const n=e.map.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e.map,areas:e.map.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.map.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.map.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}function MC(e,t){if(!t)return e;const n=(r,o)=>r.filter(i=>o.some(s=>s.id===i));return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges),absences:n(e.absences,t.absences)}}function $C(e,t){var s,l,a;const n=e.tour[t];if(!n)return null;const r=e.nodes.filter(u=>{var c;return(c=n.focus.areas)==null?void 0:c.includes(u.area)}).map(u=>u.id),o=[...n.focus.nodes??[],...n.focus.edges??[],...n.focus.absences??[],...r],i=(n.focus.edges??[]).length||(n.focus.absences??[]).length?[]:G0(e,new Set(o));return{focus:((s=n.focus.nodes)==null?void 0:s[0])??((l=n.focus.edges)==null?void 0:l[0])??((a=n.focus.absences)==null?void 0:a[0])??null,highlight:[...new Set([...o,...i])]}}function G0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function vh(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...G0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function cr(e,t){if(!t)return e;const n=[...e.views.slice(0,e.viewIndex+1),t].slice(-50);return{...e,views:n,viewIndex:n.length-1}}function xh(e,t,n){const r={...t};for(const o of e){if(!o.fix||r[o.fix.id]&&!n)continue;const i=n?n[o.fix.id]:{status:"proposed"};r[o.fix.id]={proposal:o.fix,answerId:o.id,status:(i==null?void 0:i.status)??"rejected",problems:[],edgeId:(i==null?void 0:i.edgeId)??null,closed:(i==null?void 0:i.closed)??[],undoable:(i==null?void 0:i.undoable)??!0}}return r}function bC(e,t){var n;switch(t.type){case"loaded":{const r=t.payload,o=r.map?"ready":r.job?"making":r.failure?"failed":"missing";return{...e,phase:o,meta:r.meta,map:r.map,report:r.report,job:r.job,error:((n=r.failure)==null?void 0:n.error)??null,answers:r.answers,shown:null,fixes:xh(r.answers,e.fixes,r.fixes??{}),agent:r.agent??e.agent}}case"missing":return{...e,phase:"missing"};case"connected":return{...e,connected:t.value};case"event":{const r=t.event;if(r.mapId!==e.mapId)return e;if(r.type==="job")return r.status==="started"?{...e,job:{kind:r.job,question:r.question,progress:[]},error:null,phase:r.job==="make"?"making":e.phase}:r.status==="failed"?{...e,job:null,error:r.error??"Something went wrong.",phase:r.job==="make"&&!e.map?"failed":e.phase}:{...e,job:null};if(r.type==="progress")return e.job?{...e,job:{...e.job,progress:[...e.job.progress,r.text].slice(-200)}}:e;if(r.type==="map"){const o=s=>s.filter(l=>r.map.nodes.some(a=>a.id===l)||r.map.edges.some(a=>a.id===l)||r.map.absences.some(a=>a.id===l)),i={nodes:o(e.selection.nodes),edges:o(e.selection.edges),absences:o(e.selection.absences)};return{...e,phase:"ready",meta:r.meta,map:r.map,report:r.report,selection:i}}if(r.type==="answer"){const o=[...e.answers,r.answer],i={...e,answers:o,shown:r.answer.id,tour:null,peek:!1,fresh:r.answer.added,fixes:xh([r.answer],e.fixes,void 0)};return cr(i,vh(e.map,r.answer))}if(r.type==="answerUpdate")return{...e,answers:e.answers.map(o=>o.id===r.answer.id?r.answer:o)};if(r.type==="fix"){const o=e.fixes[r.fixId];if(!o)return e;const i=r.status,s={...e.fixes,[r.fixId]:{...o,status:i,problems:r.problems??[],edgeId:r.edgeId??o.edgeId,closed:r.closed??o.closed,undoable:r.status==="applied"?!0:o.undoable}},l={...e,fixes:s};if(r.status==="applied"&&r.edgeId){const a=o.proposal.connects;return cr(l,{focus:r.edgeId,highlight:[r.edgeId,...a?[a.from,a.to]:[]]})}return l}return e}case"select":{const r=e.selection[t.kind],o=r.includes(t.id),i=t.additive?{...e.selection,[t.kind]:o?r.filter(s=>s!==t.id):[...r,t.id]}:{...fr(),[t.kind]:o&&yo(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:fr()};case"tour":{if(t.stop===null||!e.map)return{...e,tour:null,peek:!1};const r=Math.max(0,Math.min(t.stop,e.map.tour.length-1));return cr({...e,tour:r,selection:fr()},$C(e.map,r))}case"peek":{if(!t.open)return{...e,peek:!1};const r=e.answers[e.answers.length-1];return r?{...e,peek:!0,shown:e.shown??r.id}:e}case"focus":{if(!e.map)return e;const r=e.map.nodes.some(o=>o.id===t.id)?"nodes":e.map.edges.some(o=>o.id===t.id)?"edges":e.map.absences.some(o=>o.id===t.id)?"absences":null;return r?cr({...e,tour:null,peek:!1,selection:{...fr(),[r]:[t.id]}},{focus:t.id,highlight:[t.id]}):e}case"back":return e.viewIndex>0?{...e,viewIndex:e.viewIndex-1}:e.viewIndex===0?{...e,viewIndex:-1}:e;case"forward":return e.viewIndex<e.views.length-1?{...e,viewIndex:e.viewIndex+1}:e;case"show":{const r=e.answers.find(o=>o.id===t.answerId);return cr({...e,shown:t.answerId,tour:null,peek:!1},r?vh(e.map,r):null)}case"overview":return cr({...e,shown:null,tour:null,peek:!1,selection:fr(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:xi(e).map(s=>s.answerId),o=t.visible?e.hidden.filter(s=>!r.includes(s)):[...new Set([...e.hidden,...r])],i={...e,hidden:o};return{...i,selection:MC(e.selection,K0(i))}}case"fixStatus":{const r=e.fixes[t.fixId];return r?{...e,fixes:{...e.fixes,[t.fixId]:{...r,status:t.status,problems:t.problems??r.problems}}}:e}case"error":return{...e,error:t.message}}}const Yn=(...e)=>e.filter(Boolean).join(" ");function tt(e,t){const n=e.nodes.find(s=>s.id===t);if(n)return n.name;const r=e.edges.find(s=>s.id===t);if(r)return`${tt(e,r.from)} → ${tt(e,r.to)}`;const o=e.absences.find(s=>s.id===t);if(o)return o.claim;const i=e.areas.find(s=>s.id===t);return(i==null?void 0:i.label)??t}const PC={add:{pending:"Proposed: this isn’t in the code yet.",done:"This was proposed, and the code now has it."},change:{pending:"Proposed: this code would change.",done:"This was proposed to change, and the code here has changed since."},remove:{pending:"Proposed: this code would be removed.",done:"This was proposed for removal, and it’s no longer in the code."}},IC={added:"New since",changed:"Changed since",removed:"Removed since"};function ju(e,t){return e?e.nodes[t]??e.edges[t]??(e.absences[t]?{status:e.absences[t].status,reasons:e.absences[t].reasons}:null):null}function Ge({eyebrow:e,title:t,children:n,tone:r,className:o}){return h.jsxs("section",{className:Yn("card",r&&`card-${r}`,o),children:[e&&h.jsx("div",{className:"eyebrow",children:e}),t&&h.jsx("h2",{className:"card-title",children:t}),n]})}function TC({map:e,ids:t,onPick:n}){return t.length?h.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>h.jsxs("button",{className:Yn("chip",o==="proposed"?"chip-proposed":o!=="confirmed"&&"chip-unconfirmed"),onClick:()=>n(r),title:o==="confirmed"?"Confirmed against the code":o==="proposed"?"Part of a proposal, not in the code":"Couldn't confirm against the code",children:[h.jsx("span",{className:o==="confirmed"?"tick":o==="proposed"?"pmark":"qmark",children:o==="confirmed"?"✓":o==="proposed"?"+":"?"}),tt(e,r)]},r))}):null}function wh({lines:e,working:t}){const n=e.slice(-8);return h.jsxs("ul",{className:"progress",children:[n.map((r,o)=>h.jsxs("li",{className:Yn(t&&o===n.length-1&&"running"),children:[h.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&h.jsxs("li",{className:"running",children:[h.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function LC({fix:e,onApprove:t,onReject:n,onUndo:r,map:o}){const i=e.proposal,s=i.files.filter(l=>l.uncommitted);return e.status==="applied"?h.jsxs(Ge,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[h.jsxs("ul",{className:"progress",children:[h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",tt(o,e.edgeId)]}),e.closed.length>0&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):h.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?h.jsxs(Ge,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[h.jsx(oi,{text:i.summary,className:"muted"}),e.status==="undone"&&h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):h.jsxs(Ge,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[h.jsx(oi,{text:i.summary}),i.connects&&h.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),h.jsx("pre",{className:"diff",children:i.diff.split(`
|
|
68
|
+
`).map((l,a)=>h.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
|
|
69
|
+
`]},a))}),s.length>0?h.jsxs("p",{className:"warn small",children:["⚠ ",s.map(l=>l.file).join(", ")," ",s.length===1?"has":"have"," uncommitted changes. They'll be kept; the fix applies on top."]}):null,e.problems.length>0&&h.jsx("ul",{className:"problems",children:e.problems.map(l=>h.jsx("li",{children:l},l))}),h.jsxs("div",{className:"btns",children:[h.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),h.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),h.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function zC({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=b.useRef(null);if(b.useEffect(()=>{const d=a.current;d&&(d.scrollTop=d.scrollHeight)},[e.answers.length,l==null?void 0:l.progress.length,!!l]),e.phase==="loading")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Ge,{children:h.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Ge,{title:"No map here",children:h.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return h.jsx("aside",{className:"panel",children:h.jsxs("div",{className:"panel-scroll",children:[l&&h.jsx(Ge,{eyebrow:"Making your map",title:l.question,tone:"ai",children:h.jsx(wh,{lines:l.progress,working:!0})}),e.phase==="failed"&&h.jsx(Ge,{title:"The map couldn't be made",tone:"dead",children:h.jsx("p",{children:e.error})})]})});[...e.selection.nodes,...e.selection.edges,...e.selection.absences];const u=xi(e),c=u.length>0&&u.every(d=>!d.visible);return h.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[h.jsxs("header",{className:"panel-head",children:[h.jsx("h2",{className:"panel-title",children:"Conversation"}),u.length>0&&h.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:c}),children:c?"Show everything":"Show the original map"}),h.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t(e.tour!==null?{type:"peek",open:!1}:{type:"overview"}),children:"×"})]}),h.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&h.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,h.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(d=>h.jsx(AC,{answer:d,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},d.id)),(l==null?void 0:l.kind)==="ask"&&h.jsxs("article",{className:"turn",children:[h.jsx(Q0,{question:l.question}),h.jsx(Ge,{eyebrow:`${e.agent.name} is working`,tone:"ai",children:h.jsx(wh,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&h.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),h.jsx("footer",{className:"panel-foot",children:i})]})}function Q0({question:e,about:t}){const{question:n,step:r}=EC(e),o=[r&&`the step “${r}”`,t].filter(Boolean);return h.jsxs("div",{className:"you",children:[h.jsx("p",{className:"you-q",children:n}),o.length>0&&h.jsxs("span",{className:"you-about",children:["About ",o.join(", ")]})]})}function AC({answer:e,state:t,dispatch:n,onFix:r,onFocus:o,onOffer:i}){const s=t.map,l=e.fix?t.fixes[e.fix.id]??null:null,a=e.id===t.shown&&t.tour===null,u=[...e.selection.nodes??[],...e.selection.edges??[],...e.selection.absences??[]].map(x=>tt(s,x)).join(", "),c=xi(t).find(x=>x.answerId===e.id),d=e.problems.filter(x=>x.startsWith("The proposed fix")),f=e.problems.filter(x=>!x.startsWith("The proposed fix")),p=e.refs.filter(x=>{var k;return x.status!=="unknown"&&((k=ju(t.report,x.id))==null?void 0:k.status)==="unconfirmed"}).map(x=>x.id),y=e.moves.highlight.length>0||!!e.moves.focus||e.added.length>0||(e.screens??[]).length>0;return h.jsxs("article",{className:"turn",children:[h.jsx(Q0,{question:e.question,about:u||void 0}),e.offer?h.jsx(RC,{answer:e,busy:!!t.job,agentName:t.agent.name,onOffer:i}):h.jsxs("section",{className:Yn("card","reply",a&&"card-focus"),children:[h.jsxs("div",{className:"reply-meta",children:[h.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),y&&(a?h.jsx("span",{className:"reply-lit",children:"Lit on the map"}):h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),h.jsx(oi,{text:e.concept,className:"depth-text"}),(e.notes??[]).length>0&&h.jsx(fC,{mapId:t.mapId,answerId:e.id,stamp:t.report}),(e.screens??[]).map(x=>{const k=Cu(t.report,x);return k?h.jsx(X0,{show:k,name:tt(s,x)},x):null}),p.length>0&&h.jsxs("p",{className:"warn small reply-warn",children:["Relies on ",p.length===1?"1 thing":`${p.length} things`," the checker couldn't confirm:"," ",p.map((x,k)=>h.jsxs("span",{children:[k>0&&", ",h.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(x),children:tt(s,x)})]},x))]}),c&&h.jsxs("div",{className:"reply-added",children:[h.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),f.length>0&&h.jsxs("details",{className:"problems-box",children:[h.jsxs("summary",{children:[f.length," thing",f.length===1?"":"s"," Claude found but couldn't confirm or show"]}),h.jsx("ul",{className:"problems",children:f.map(x=>h.jsx("li",{children:x},x))})]})]}),l&&h.jsx(LC,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),d.length>0&&h.jsxs(Ge,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[h.jsx("ul",{className:"problems",children:d.map(x=>h.jsx("li",{children:x.replace("The proposed fix can't be applied: ","")},x))}),h.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function RC({answer:e,busy:t,agentName:n,onOffer:r}){const o=e.offer;return o.status==="mapped"?h.jsxs(Ge,{eyebrow:"A different part of the app",children:[h.jsx("p",{className:"muted",children:"You made a new map for this."}),o.mapId&&h.jsx("div",{className:"btns",children:h.jsx("a",{className:"btn primary",href:Dt(o.mapId),children:"Open it"})})]}):o.status==="answered"?h.jsx(Ge,{eyebrow:"A different part of the app",children:h.jsx("p",{className:"muted",children:"Answered in words, below."})}):h.jsxs(Ge,{eyebrow:"A different part of the app",tone:"ai",children:[h.jsx("p",{children:"This is about a different part of the app than this map shows."}),o.existing&&h.jsxs("p",{children:["There's already a map for it: “",o.existing.question,"”."]}),h.jsxs("div",{className:"btns",children:[o.existing&&h.jsx("a",{className:"btn primary",href:Dt(o.existing.id),children:"Open that map"}),h.jsx("button",{className:o.existing?"btn":"btn primary",onClick:()=>r(e.id,"map"),children:"Make a new map for this"}),h.jsx("button",{className:"btn",disabled:t,onClick:()=>r(e.id,"words"),title:t?`${n} is still working on this map`:void 0,children:"Just answer in words"})]})]})}function DC({mapId:e,map:t,report:n,ids:r,onClose:o}){var I,R,D,W,H;const[i,s]=hC(),[l,a]=pC(),[u,c]=b.useState(null),d=h.jsx("button",{className:"card-close","aria-label":"Close",title:"Close (Esc)",onClick:o,children:"×"});if(r.length>1)return h.jsxs(Ge,{eyebrow:`Asking about ${r.length} things`,className:"card-selected",children:[d,h.jsx(TC,{map:t,ids:r.map(N=>{var T;return{id:N,status:((T=ju(n,N))==null?void 0:T.status)??"unknown"}}),onPick:()=>{}})]});const f=r[0],p=t.nodes.find(N=>N.id===f),y=t.edges.find(N=>N.id===f),x=t.absences.find(N=>N.id===f),k=ju(n,f),g=(p==null?void 0:p.evidence)??(y==null?void 0:y.evidence)??[],v=k&&"evidence"in k&&k.evidence?k.evidence:[],m=p?"Step":y?"Connection":"Missing connection",w=(k==null?void 0:k.proposal)??null,_=(R=(I=p??y)==null?void 0:I.proposed)==null?void 0:R.note,S=k&&"change"in k?k.change??null:null,C=((W=(D=n==null?void 0:n.since)==null?void 0:D.commit)==null?void 0:W.slice(0,7))??"the commit this map is compared with",j=x?(n==null?void 0:n.absences[x.id])??null:null;return h.jsxs(Ge,{eyebrow:m,title:tt(t,f),tone:x?"dead":void 0,className:"card-selected",children:[d,((H=p==null?void 0:p.explain)==null?void 0:H.concept)&&h.jsx(oi,{text:p.explain.concept,className:"depth-text"}),p&&Cu(n,p.id)&&h.jsx(X0,{show:Cu(n,p.id),name:p.name}),w&&h.jsxs("div",{className:Yn("proposal-note",`proposal-note-${w.state}`),children:[h.jsx("strong",{children:PC[w.kind][w.state]}),_&&h.jsxs(h.Fragment,{children:[" ",_]})]}),S&&h.jsxs("div",{className:Yn("change-note",`change-note-${S.kind}`),children:[h.jsxs("div",{className:"change-head",children:[h.jsxs("span",{children:[h.jsxs("strong",{children:[IC[S.kind]," ",C,"."]}),S.kind==="changed"&&!S.diff&&" A line it cites wasn’t there then.",S.kind==="removed"&&" It was in the code then and is gone now.",S.diff&&h.jsx(OC,{diff:S.diff})]}),S.diff&&h.jsx("button",{className:"link-btn small",onClick:()=>a(!l),children:l?"Hide what changed":"Show what changed"})]}),S.diff&&l&&h.jsx("pre",{className:"diff",children:S.diff.map((N,T)=>h.jsxs("span",{className:N.startsWith("+ ")?"add":N.startsWith("- ")?"del":"",children:[N,`
|
|
70
|
+
`]},T))})]}),x&&j&&h.jsxs("p",{children:[j.found>x.matches?"This may no longer be missing: the search below now finds something.":"Nothing in the code connects these, going by this search."," ","Searched ",j.searched??"?"," ",j.searched===1?"file":"files",x.search.paths?h.jsxs(h.Fragment,{children:[" in ",h.jsx("code",{children:x.search.paths.join(", ")})]}):" (the whole repo)"," for ",h.jsx("code",{children:x.search.pattern}),": ",j.found," ",j.found===1?"match":"matches","."]}),k&&k.status==="unconfirmed"&&h.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",k.reasons.join("; ")]}),g.length>0&&h.jsxs("div",{className:"basis",children:[h.jsx("div",{className:"eyebrow",children:(S==null?void 0:S.kind)==="removed"?`In the code as it was at ${C}`:"In the code"}),h.jsx("div",{className:"chips",children:g.map((N,T)=>{var z,O;const L=((z=v[T])==null?void 0:z.ok)??!1,A=((O=v[T])==null?void 0:O.foundAt)??N.line,P=`${N.file}:${A}`,M=i&&((u==null?void 0:u.at)===P||!u&&g.length===1);return L?h.jsxs("button",{className:Yn("chip cite",M&&"chip-open"),"aria-pressed":M,title:M?"Hide the code":"Show the code at this line",onClick:()=>{if(M){s(!1),c(null);return}s(!0),c(Y=>({at:P,n:((Y==null?void 0:Y.n)??0)+1}))},children:[h.jsx("span",{className:"tick",children:"✓"}),N.file,":",A]},T):h.jsxs("span",{className:"chip static chip-unconfirmed",children:[h.jsx("span",{className:"qmark",children:"?"}),N.file,":",A]},T)})}),i&&(p||y)&&h.jsx(dC,{mapId:e,itemId:f,change:(S==null?void 0:S.kind)??null,since:C,stamp:n,jump:u})]})]})}function OC({diff:e}){const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return h.jsxs("span",{className:"diff-size",children:[t>0&&h.jsxs("span",{className:"add",children:[" +",t]}),n>0&&h.jsxs("span",{className:"del",children:[" −",n]})]})}function FC({map:e,selection:t,draft:n,busy:r,agentName:o="Claude",autoFocus:i,onDraft:s,onRemove:l,step:a,onRemoveStep:u,onSend:c}){const d=b.useRef(null),f=["nodes","edges","absences"].flatMap(p=>t[p].map(y=>({kind:p,id:y})));return b.useEffect(()=>{const p=d.current;p&&(p.style.height="auto",p.style.height=`${Math.min(p.scrollHeight,140)}px`)},[n]),b.useEffect(()=>{var p;n&&((p=d.current)==null||p.focus())},[n===""]),b.useEffect(()=>{var p;i&&((p=d.current)==null||p.focus({preventScroll:!0}))},[]),h.jsxs("form",{className:"composer",onSubmit:p=>{p.preventDefault(),!r&&n.trim()&&c()},children:[a&&h.jsxs("span",{className:"sel-chip sel-step",children:[h.jsxs("span",{className:"sel-text",title:`Walkthrough step: ${a}`,children:["▸ ",a]}),h.jsx("button",{type:"button","aria-label":`Don't ask about the step “${a}”`,onClick:u,children:"×"})]}),f.map(p=>h.jsxs("span",{className:`sel-chip sel-${p.kind}`,children:[h.jsxs("span",{className:"sel-text",title:tt(e,p.id),children:[p.kind==="absences"?"✕ ":"◉ ",tt(e,p.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${tt(e,p.id)}`,onClick:()=>l(p.kind,p.id),children:"×"})]},`${p.kind}:${p.id}`)),h.jsx("textarea",{ref:d,id:"ask",rows:1,value:n,placeholder:r?`${o} is working…`:f.length===1&&f[0].kind==="nodes"?"Ask, or try “what if it fails?”":f.length?"Ask about what you selected…":a?"Ask about this step…":"Ask about this map…",onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),!r&&n.trim()&&c())},"aria-label":"Ask a question about the map"}),h.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function HC({map:e,agent:t,selection:n,step:r,onRemove:o}){const i=["nodes","edges","absences"].flatMap(l=>n[l].map(a=>({kind:l,id:a}))),s=rC(t,i.length,r);return h.jsxs("div",{className:"composer composer-chat",role:"note","aria-label":"Where to ask",children:[i.map(l=>h.jsxs("span",{className:`sel-chip sel-${l.kind}`,children:[h.jsxs("span",{className:"sel-text",title:tt(e,l.id),children:[l.kind==="absences"?"✕ ":"◉ ",tt(e,l.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${tt(e,l.id)}`,onClick:()=>o(l.kind,l.id),children:"×"})]},`${l.kind}:${l.id}`)),h.jsxs("p",{className:"chat-hint",children:[h.jsx("strong",{children:s.title})," ",h.jsx("span",{className:"muted",children:s.detail})]})]})}const ga="illuminate-toured",BC=100;function kh(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function VC(e,t,n=BC){return[...e.filter(r=>r!==t),t].slice(-n)}function WC(e,t){const[n,r]=b.useState(()=>kh(ri(ga)).includes(e));return b.useEffect(()=>{!t||n||!e||(jl(ga,JSON.stringify(VC(kh(ri(ga)),e))),r(!0))},[e,t,n]),n}function UC({map:e,mapId:t,tour:n,onTour:r,selected:o,children:i}){const s=WC(t,n!==null),l=e.tour.length,a=l>0&&n===null;return!a&&!i?null:h.jsxs("div",{className:"dock",children:[a&&h.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[h.jsx("h2",{className:"dock-title",children:"Walkthrough"}),h.jsxs("button",{className:s?"dock-start":"dock-start glow",onClick:()=>r(0),children:["Take the walkthrough ",h.jsxs("span",{className:"muted",children:[l," ",l===1?"stop":"stops"]})]})]}),i&&h.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[h.jsxs("div",{className:"dock-head",children:[h.jsx("h2",{className:"dock-title",children:"Ask about the map"}),h.jsx("span",{className:"dock-hint",children:o?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),i]})]})}function YC({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?h.jsx("div",{className:"history-corner",children:h.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t(e.tour!==null?{type:"peek",open:!0}:{type:"show",answerId:n.id}),title:"Open the conversation about this map",children:[h.jsx("span",{className:"history-arrow",children:"‹"})," Conversation ",h.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const dr=14,Te=12;function XC(e,t){const n=l=>l[l.length-1],r=n(t.nodes),o=n(t.edges),i=n(t.absences),s=r!==void 0?`.react-flow__node[data-id="${CSS.escape(r)}"]`:o!==void 0?`.link-label[data-id="${CSS.escape(`e:${o}`)}"]`:i!==void 0?`.link-label[data-id="${CSS.escape(`a:${i}`)}"]`:null;return s?e.querySelector(s):null}const Mu="illuminate-bubble-size",q0=300,Z0=180;function KC(){try{const e=JSON.parse(ri(Mu)??"null");if(e&&typeof e=="object"&&"w"in e&&"h"in e&&typeof e.w=="number"&&typeof e.h=="number")return{w:Math.max(q0,e.w),h:Math.max(Z0,e.h)}}catch{}return null}function GC({mapId:e,map:t,report:n,selection:r,onClose:o}){const i=[...r.nodes,...r.edges,...r.absences],s=i.join(" "),l=b.useRef(null),[a,u]=b.useState(null),c=b.useRef(null),d=yi(),f=ae(m=>m.transform.join(",")),[p,y]=b.useState(""),[x,k]=b.useState(KC),g=m=>{const w=l.current,_=w==null?void 0:w.querySelector(".card-selected"),S=w==null?void 0:w.parentElement;if(!w||!_||!S||!a)return;m.preventDefault();const C=m.clientX,j=m.clientY,I=w.offsetWidth,R=_.offsetHeight,D=S.clientWidth-2*Te,W=a.side==="right"?1:-1;let H={w:I,h:R};const N=L=>{H={w:Math.round(Math.max(q0,Math.min(D,I+W*(L.clientX-C)))),h:Math.round(Math.max(Z0,R+L.clientY-j))},k(H)},T=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",T),document.body.classList.remove("resizing-bubble"),jl(Mu,JSON.stringify(H))};window.addEventListener("pointermove",N),window.addEventListener("pointerup",T),document.body.classList.add("resizing-bubble")},v=()=>{try{localStorage.removeItem(Mu)}catch{}k(null)};return b.useLayoutEffect(()=>{const m=l.current;if(!m)return;const w=new ResizeObserver(()=>y(`${m.offsetWidth}x${m.offsetHeight}`));return w.observe(m),()=>w.disconnect()},[s]),b.useLayoutEffect(()=>{const m=l.current,w=m==null?void 0:m.parentElement;if(!m||!w)return;const _=XC(w,r);if(!_){u(null);return}const S=w.getBoundingClientRect(),C=_.getBoundingClientRect(),j={left:C.left-S.left,right:C.right-S.left,top:C.top-S.top,bottom:C.bottom-S.top},I=w.querySelector(".dock"),R=I?I.getBoundingClientRect().top-S.top-Te:S.height-Te,D=Math.max(160,R-Te),W=m.offsetWidth,H=Math.min(m.offsetHeight,D),N=S.width-Te-j.right-dr,T=j.left-dr-Te,L=N>=W||N>=T?"right":"left",A=L==="right"?j.right+dr:j.left-dr-W,P=Math.max(Te,Math.min(A,S.width-Te-W)),M=Math.max(Te,Math.min(j.top,R-H)),z=Math.max(16,Math.min((j.top+j.bottom)/2-M,H-16));if(u({left:P,top:M,side:L,pointer:z,maxHeight:D}),c.current===s)return;c.current=s;const O=L==="right"?j.left:j.left-dr-W,Y=L==="right"?j.right+dr+W:j.right,ne=Y-O<=S.width-2*Te,B=ne?O:j.left,F=ne?Y:j.right,Z=B<Te?Te-B:F>S.width-Te?S.width-Te-F:0,q=j.top<Te?Te-j.top:j.bottom>R?Math.max(R-j.bottom,Te-j.top):0;if(Z||q){const E=d.getViewport();d.setViewport({...E,x:E.x+Z,y:E.y+q},{duration:300})}},[s,f,p]),i.length?h.jsxs("div",{ref:l,className:`box-bubble box-bubble-${(a==null?void 0:a.side)??"right"}`,style:{...a?{left:a.left,top:a.top,"--bubble-max":`${a.maxHeight}px`}:{visibility:"hidden",left:0,top:0},...x?{width:x.w,"--bubble-cap":`${x.h}px`}:{}},role:"dialog","aria-label":"What you selected",children:[a&&h.jsx("i",{className:"box-bubble-pointer",style:{top:a.pointer},"aria-hidden":"true"}),h.jsx(DC,{mapId:e,map:t,report:n,ids:i,onClose:o},s),h.jsx("span",{className:"box-bubble-grip",onPointerDown:g,onDoubleClick:v,title:"Drag to resize. Double-click for the usual size.","aria-hidden":"true"})]}):null}const QC=[.5,.42,.58,.34,.66,.26,.74,.2,.8],Ki=4,ya=(e,t)=>e.x<t.x+t.w+Ki&&t.x<e.x+e.w+Ki&&e.y<t.y+t.h+Ki&&t.y<e.y+e.h+Ki,va=(e,t,n)=>({x:e.x-t/2,y:e.y-n/2,w:t,h:n});function qC(e,t,n=[]){const r=[],o={},i=(l,a)=>!t.some(u=>ya(l,u))&&!r.some(u=>ya(l,u))&&(!a||!n.some(u=>ya(l,u))),s=[...e.filter(l=>l.keep),...e.filter(l=>!l.keep)];for(const l of s){const a=va(l.at,l.w,l.h);let u=null;for(const c of[!0,!1]){if(i(a,c)){u=l.at;break}for(const d of QC){const f=l.along(d);if(f&&i(va(f,l.w,l.h),c)){u=f;break}}if(u)break}if(!u&&l.keep&&(u=l.at),!u){o[l.id]="dot";continue}r.push(va(u,l.w,l.h)),u!==l.at&&(o[l.id]=u)}return o}const ZC="modulepreload",JC=function(e){return"/"+e},Sh={},ej=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=JC(a),a in Sh)return;Sh[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":ZC,u||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Vt=232,Ot=96,J0=e=>e.view==="journey"&&[...e.nodes,...e.edges].some(t=>!!t.branch);function qs(e,t){var i;const n=((i=e.nodes[t])==null?void 0:i.y)??0,r=e.rowTops??[];let o=0;for(const[s,l]of r.entries())n>=l-1&&(o=s);return o}const tj=132;function $u(e,t=!1){return e==="choice"?{w:196,h:132}:e==="action"?{w:196,h:60}:t?{w:232,h:64+tj}:{w:196,h:72}}let nj=null;const Yc=()=>nj??(nj=ej(()=>import("./elk.bundled-ClrxtgES.js").then(e=>e.e),[]).then(e=>new e.default)),Xc={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function wi(e,t){const n=new Set(e.nodes.map(r=>r.id));return[...e.edges.map(r=>({id:`e:${r.id}`,from:r.from,to:r.to})),...e.absences.flatMap(r=>r.between?[{id:`a:${r.id}`,from:r.between.from,to:r.between.to}]:[]),...t.map(r=>({id:`x:${r.id}`,from:r.from,to:r.to}))].filter(r=>n.has(r.from)&&n.has(r.to)&&r.from!==r.to)}const Oe={top:52,side:26,bottom:26},hr=64,ps=44,rj=56,oj=140;async function ey(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...Xc,"elk.direction":"DOWN","elk.padding":`[top=${Oe.top},left=${Oe.side},bottom=${Oe.bottom},right=${Oe.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(hr),"elk.spacing.nodeNode":String(ps)},children:n.map(s=>({id:s.id,width:Vt,height:Ot})),edges:r.map(s=>({id:s.id,sources:[s.from],targets:[s.to]}))}),i={};for(const s of o.children??[])i[s.id]={x:s.x??0,y:s.y??0,w:Vt,h:Ot};return{nodes:i,size:{w:o.width??Vt+2*Oe.side,h:o.height??Ot+Oe.top+Oe.bottom}}}function ij(e,t){const n=e.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e,areas:e.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}async function sj(e,t=[],n=new Set,r=new Set){var _;if(e.view==="journey")return J0(e)?uj(e,t,r):ty(e,t,r);if(e.view==="timeline")return dj(e,t);const o=e.nodes.filter(S=>n.has(S.id));if(!o.length)return $h(e,t);const i=ij(e,n),s=new Set(i.nodes.map(S=>S.id)),l=await $h(i,t.filter(S=>s.has(S.from)&&s.has(S.to))),a=await Yc(),u=Object.fromEntries(Object.entries(l.areas).map(([S,C])=>[S,{...C}])),c={...l.nodes},d={},f={};for(const S of o)(f[_=S.area]??(f[_]=[])).push(S);for(const[S,C]of Object.entries(f)){const j=u[S];if(!j)continue;const I=Math.max(1,Math.floor((j.w-2*Oe.side+ps)/(Vt+ps))),R=Math.max(Oe.top-hr,...i.nodes.filter(W=>W.area===S).map(W=>{var H;return(((H=c[W.id])==null?void 0:H.y)??0)+Ot}))+hr;C.forEach((W,H)=>{c[W.id]={x:Oe.side+H%I*(Vt+ps),y:R+Math.floor(H/I)*(Ot+hr),w:Vt,h:Ot}});const D=Math.max(j.h,R+Math.ceil(C.length/I)*(Ot+hr)-hr+Oe.bottom);d[S]=D-j.h,j.h=D}const p=Object.fromEntries(Object.entries(l.areas).map(([S,C])=>[S,C])),y=Object.keys(p).sort((S,C)=>p[S].y-p[C].y),x={};for(const S of y){const C=p[S];x[S]=Math.max(0,...y.filter(j=>j!==S&&x[j]!==void 0).filter(j=>{const I=p[j];return I.y+I.h<=C.y+1&&I.x<C.x+C.w&&C.x<I.x+I.w}).map(j=>x[j]+(d[j]??0))),u[S].y+=x[S]}const k=wi(e,t),g=new Map(e.nodes.map(S=>[S.id,S.area])),v=Math.max(0,...Object.values(u).map(S=>S.x+S.w))+oj;let m=0;for(const S of e.areas){if(u[S.id])continue;const C=e.nodes.filter(R=>R.area===S.id);if(!C.length)continue;const j=k.filter(R=>g.get(R.from)===S.id&&g.get(R.to)===S.id),I=await ey(a,S.id,C,j);Object.assign(c,I.nodes),u[S.id]={x:v,y:m,w:I.size.w,h:I.size.h},m+=I.size.h+rj}const w=Object.values(u);return{areas:u,nodes:c,width:Math.max(0,...w.map(S=>S.x+S.w)),height:Math.max(0,...w.map(S=>S.y+S.h))}}const Nh=1900,bu=130;async function ty(e,t,n){const o=await(await Yc()).layout({id:"root",layoutOptions:{...Xc,"elk.direction":"RIGHT","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.spacing.nodeNodeBetweenLayers":"176","elk.spacing.nodeNode":"56","elk.spacing.componentComponent":"72"},children:e.nodes.map(p=>({id:p.id,width:$u(p.kind,n.has(p.id)).w,height:$u(p.kind,n.has(p.id)).h})),edges:wi(e,t).map(p=>({id:p.id,sources:[p.from],targets:[p.to]}))}),i={};for(const p of o.children??[])i[p.id]={x:p.x??0,y:p.y??0,w:p.width??0,h:p.height??0};const s=o.width??0;if(s<=Nh)return{areas:{},nodes:i,width:s,height:o.height??0,flat:!0};const l=[];for(const[p,y]of Object.entries(i).sort((x,k)=>x[1].x+x[1].w/2-(k[1].x+k[1].w/2))){const x=l[l.length-1];x&&y.x+y.w/2<x.right?(x.ids.push(p),x.left=Math.min(x.left,y.x),x.right=Math.max(x.right,y.x+y.w)):l.push({left:y.x,right:y.x+y.w,ids:[p]})}const a=Math.ceil(s/Nh),u=Math.ceil(l.length/a);let c=0,d=0;const f=[];for(let p=0;p*u<l.length;p++){const y=l.slice(p*u,(p+1)*u),x=y.flatMap(v=>v.ids),k=y[0].left,g=Math.min(...x.map(v=>i[v].y));f.push(c);for(const v of x)i[v]={...i[v],x:i[v].x-k,y:i[v].y-g+c};c=Math.max(...x.map(v=>i[v].y+i[v].h))+bu,d=Math.max(d,y[y.length-1].right-k)}return{areas:{},nodes:i,width:d,height:c-bu,flat:!0,rowTops:f}}const Gi=176,Eh=120,_h=34,lj=14;function aj(e,t){const n=new Map(e.map(i=>[i,0]));for(const i of t)n.set(i.to,(n.get(i.to)??0)+1);const r=new Set(e),o=[];for(;r.size;){const i=e.find(s=>r.has(s)&&!n.get(s))??e.find(s=>r.has(s));r.delete(i),o.push(i);for(const s of t)s.from===i&&r.has(s.to)&&n.set(s.to,n.get(s.to)-1)}return o}async function uj(e,t,n){const r=wi(e,t),o=new Map(e.nodes.map(E=>[E.id,$u(E.kind,n.has(E.id))])),i=new Map(e.nodes.map(E=>[E.id,E.branch??null])),s=aj(e.nodes.map(E=>E.id),r),l=s.filter(E=>!i.get(E));if(!l.length)return ty(e,t,n);const a=E=>o.get(E).w,u=E=>o.get(E).h,c=new Map,d=new Map;let f=0;for(const E of l)c.set(E,f),d.set(E,0),f+=a(E)+Gi;const p=E=>c.get(E)+a(E)/2,y=E=>c.get(E)+a(E),x=[...new Set([...e.nodes,...e.edges].flatMap(E=>E.branch?[E.branch]:[]))],k=new Map;for(const E of s){const $=i.get(E);$&&k.set($,[...k.get($)??[],E])}const g=[],v=new Map,m=new Set(k.keys()),w=(E,$)=>{const X=k.get(E),Q=new Set(X),K=r.filter(ie=>Q.has(ie.to)&&!Q.has(ie.from));if(!$&&K.length&&!K.some(ie=>d.has(ie.from)))return null;const U=K.filter(ie=>d.has(ie.from)).map(ie=>ie.from).sort((ie,$e)=>d.get(ie)-d.get($e)||p(ie)-p($e))[0]??null,G=U&&d.get(U)===0?l[l.indexOf(U)+1]:void 0,te=X[0],V=U?G?(p(U)+p(G))/2:p(U)+(a(U)/2+Gi+a(te)/2)/2:a(te)/2,ee=[];let se=V-a(te)/2;for(const ie of X)ee.push(se),se+=a(ie)+Gi;const ce=r.filter(ie=>Q.has(ie.from)&&!Q.has(ie.to)&&d.has(ie.to)),he=ce.filter(ie=>p(ie.to)>=ee[0]).map(ie=>p(ie.to)),Ne=ce.filter(ie=>p(ie.to)<ee[0]).map(ie=>p(ie.to));return{name:E,ids:X,anchor:U,xs:ee,kind:Ne.length?2:he.length?0:1,reach:Math.max(0,...he),span:[Math.min(U?p(U):ee[0],...Ne)-30,Math.max(se-Gi,...he)+30],verticals:[...U?[{x:p(U),from:d.get(U)}]:[],...ce.map(ie=>({x:p(ie.to),from:d.get(ie.to)}))],minLane:U?d.get(U)+1:1,root:U?d.get(U)===0?l.indexOf(U):v.get(i.get(U))??l.length:l.length}};for(;m.size;){const $=[...m].flatMap(U=>w(U,!1)??[]).sort((U,G)=>(U.anchor?p(U.anchor):1/0)-(G.anchor?p(G.anchor):1/0)||U.kind-G.kind||U.reach-G.reach||x.indexOf(U.name)-x.indexOf(G.name))[0]??w(x.find(U=>m.has(U))??[...m][0],!0);m.delete($.name);const X=U=>!g.some(G=>G.lane===U&&G.span[0]<$.span[1]&&$.span[0]<G.span[1]),Q=U=>$.verticals.every(G=>g.every(te=>!(te.lane>G.from&&te.lane<U)||te.boxes.every(V=>G.x<c.get(V)-12||G.x>y(V)+12)))&&g.every(G=>G.lane<=U||G.verticals.every(te=>te.from>=U||$.xs.every((V,ee)=>te.x<V-12||te.x>V+a($.ids[ee])+12)));let K=$.minLane;for(;K<$.minLane+12&&!(X(K)&&Q(K));)K++;if(K>=$.minLane+12)for(K=$.minLane;!X(K);K++);$.ids.forEach((U,G)=>{c.set(U,$.xs[G]),d.set(U,K)}),g.push({name:$.name,lane:K,span:$.span,verticals:$.verticals,boxes:$.ids,root:$.root}),v.set($.name,$.root)}const _=[...new Set([...d.values()])].sort((E,$)=>E-$),S=new Map,C=new Map;let j=0;for(const E of _){const $=Math.max(...[...d].filter(([,X])=>X===E).map(([X])=>u(X)));S.set(E,j),C.set(E,j+$),j+=$+Eh}const I={};for(const E of e.nodes){const $=d.get(E.id);I[E.id]={x:c.get(E.id),y:S.get($)+(C.get($)-S.get($)-u(E.id))/2,w:a(E.id),h:u(E.id)}}const R=new Map(e.nodes.map(E=>[E.id,E.kind])),D=(E,$,X)=>{const Q=I[E],K=R.get(E)==="choice"?Math.min(Q.h/2,Math.abs($-(Q.x+Q.w/2))*Q.h/Q.w):0;return X==="top"?Q.y+K:Q.y+Q.h-K},W=E=>I[E].y+I[E].h/2,H=E=>d.get(E),N=E=>[...d].filter(([,$])=>$===E).map(([$])=>$).sort(($,X)=>c.get($)-c.get(X)),T=new Map,L=new Map,A=(E,$,X,Q)=>L.set(`${E}:${$}`,[...L.get(`${E}:${$}`)??[],{link:X,key:Q}]);for(const E of r){const $=H(E.from),X=H(E.to);let Q;if($===X){const K=N($);Q=K.indexOf(E.to)===K.indexOf(E.from)+1?"straight":$===0?"arc":"under"}else X>$?Q="down":Q=p(E.to)>y(E.from)+24?"rejoin":p(E.to)<c.get(E.from)-24?"return":"up";T.set(E.id,Q),Q==="arc"&&(A(E.from,"t",E.id,[p(E.to)]),A(E.to,"t",E.id,[p(E.from)])),(Q==="rejoin"||Q==="up")&&A(E.to,"b",E.id,[0,$]),Q==="return"&&A(E.to,"b",E.id,[1,-$]),Q==="down"&&A(E.from,"b",E.id,[2,-X])}const P=new Map;for(const[E,$]of L){const X=E.slice(0,E.lastIndexOf(":"));$.sort((Q,K)=>Q.key.reduce((U,G,te)=>U||G-(K.key[te]??0),0)),$.forEach((Q,K)=>P.set(`${Q.link}:${E}`,p(X)+(K-($.length-1)/2)*lj))}const M=(E,$,X)=>P.get(`${E}:${$}:${X}`)??p($),z=r.filter(E=>T.get(E.id)==="arc").sort((E,$)=>Math.abs(p(E.to)-p(E.from))-Math.abs(p($.to)-p($.from))),O=new Map(z.map((E,$)=>[E.id,$])),Y=new Map,ne={};for(const E of r){const $=I[E.from],X=I[E.to],Q=H(E.from),K=T.get(E.id);let U;if(K==="straight")U={points:[[$.x+$.w,W(E.from)],[X.x,W(E.to)]],label:0};else if(K==="arc"){const G=-58-18*O.get(E.id),te=M(E.id,E.from,"t"),V=M(E.id,E.to,"t");U={points:[[te,D(E.from,te,"top")],[te,G],[V,G],[V,D(E.to,V,"top")]],label:1}}else if(K==="under"||K==="return"){const G=Y.get(Q)??0;Y.set(Q,G+1);const te=C.get(Q)+_h+16*G,V=p(E.from)+(K==="under"?6:0),ee=K==="return"?M(E.id,E.to,"b"):p(E.to)-6;U={points:[[V,$.y+$.h],[V,te],[ee,te],[ee,D(E.to,ee,"bottom")]],label:1}}else if(K==="down"){const G=M(E.id,E.from,"b"),te=p(E.to),V=S.get(H(E.to))-_h;U=Math.abs(te-G)<4?{points:[[G,D(E.from,G,"bottom")],[G,X.y]],label:0}:{points:[[G,D(E.from,G,"bottom")],[G,V],[te,V],[te,X.y]],label:1}}else if(K==="rejoin"){const G=M(E.id,E.to,"b"),te=N(Q).some(ee=>ee!==E.from&&c.get(ee)<G&&y(ee)>$.x+$.w),V=S.get(Q)-Eh/2;U=te?{points:[[p(E.from),$.y],[p(E.from),V],[G,V],[G,D(E.to,G,"bottom")]],label:1}:{points:[[$.x+$.w,W(E.from)],[G,W(E.from)],[G,D(E.to,G,"bottom")]],label:G-($.x+$.w)>=150?0:1}}else{const G=Math.min(Math.max(M(E.id,E.to,"b"),$.x+12),$.x+$.w-12);U={points:[[G,$.y],[G,D(E.to,G,"bottom")]],label:0}}ne[E.id]=U}const F=x.map(E=>{var K;const $=g.find(U=>U.name===E);if($)return{name:E,root:$.root};const X=(K=e.edges.find(U=>U.branch===E))==null?void 0:K.from,Q=X?i.get(X):null;return{name:E,root:X&&d.get(X)===0?l.indexOf(X):Q?v.get(Q)??l.length:l.length}}).sort((E,$)=>E.root-$.root||x.indexOf(E.name)-x.indexOf($.name)).map(E=>E.name),Z=Object.values(I),q=Object.values(ne).flatMap(E=>E.points);return{areas:{},nodes:I,width:Math.max(...Z.map(E=>E.x+E.w),...q.map(E=>E[0])),height:Math.max(...Z.map(E=>E.y+E.h),...q.map(E=>E[1])),flat:!0,routes:ne,branches:F}}const Ch=132,jh=40,Mh=36;function cj(e,t){const n=new Map,r=new Set;for(const c of t)(n.get(c.from)??n.set(c.from,[]).get(c.from)).push(c.to),r.add(c.to);const o=new Map,i=[],s=c=>{o.set(c,"open");for(const d of n.get(c)??[])o.has(d)||s(d);o.set(c,"done"),i.push(c)};for(const c of[...e.filter(d=>!r.has(d)),...e])o.has(c)||s(c);const l=i.reverse(),a=new Map(l.map((c,d)=>[c,d])),u=new Map(e.map(c=>[c,0]));for(const c of l)for(const d of n.get(c)??[])(a.get(d)??0)>(a.get(c)??0)&&u.set(d,Math.max(u.get(d)??0,(u.get(c)??0)+1));return u}async function dj(e,t){const n=cj(e.nodes.map(c=>c.id),wi(e,t)),r=Math.max(0,...n.values())+1,o=2*Oe.side+r*Vt+(r-1)*Ch,i=c=>Math.min(...e.nodes.filter(d=>d.area===c).map(d=>n.get(d.id)??0)),s=e.areas.filter(c=>e.nodes.some(d=>d.area===c.id)).sort((c,d)=>i(c.id)-i(d.id)),l={},a={};let u=0;for(const c of s){const d=new Map;let f=1;for(const y of e.nodes.filter(x=>x.area===c.id)){const x=n.get(y.id)??0,k=d.get(x)??0;d.set(x,k+1),f=Math.max(f,k+1),a[y.id]={x:Oe.side+x*(Vt+Ch),y:Oe.top+k*(Ot+jh),w:Vt,h:Ot}}const p=Oe.top+f*Ot+(f-1)*jh+Oe.bottom;l[c.id]={x:0,y:u,w:o,h:p},u+=p+Mh}return{areas:l,nodes:a,width:o,height:Math.max(0,u-Mh),lanes:!0}}async function $h(e,t){const n=await Yc(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=wi(e,t),i={},s={};for(const c of e.areas){const d=e.nodes.filter(y=>y.area===c.id);if(!d.length)continue;const f=o.filter(y=>r.get(y.from)===c.id&&r.get(y.to)===c.id),p=await ey(n,c.id,d,f);Object.assign(i,p.nodes),s[c.id]=p.size}const l=new Map;for(const c of o){const d=r.get(c.from),f=r.get(c.to);d!==f&&s[d]&&s[f]&&l.set(`${d}>${f}`,{from:d,to:f})}const a=await n.layout({id:"root",layoutOptions:{...Xc,"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.nodeNode":"48","elk.spacing.componentComponent":"64"},children:e.areas.filter(c=>s[c.id]).map(c=>({id:c.id,width:s[c.id].w,height:s[c.id].h})),edges:[...l.values()].map((c,d)=>({id:`p${d}`,sources:[c.from],targets:[c.to]}))}),u={};for(const c of a.children??[])u[c.id]={x:c.x??0,y:c.y??0,w:c.width??0,h:c.height??0};return{areas:u,nodes:i,width:a.width??0,height:a.height??0}}function fj(e,t,n,r){if(t.flat){const c=y=>{const x=t.nodes[y];return x?{x:x.x+x.w/2,y:x.y+x.h/2}:{x:0,y:0}},d=c(r).x-c(n).x,f=c(r).y-c(n).y;if(Math.abs(d)<40)return f>=0?["b","t"]:["t","b"];const p=qs(t,r)-qs(t,n);return p?p>0?["b","t"]:["r","b"]:d>=0?["r","l"]:["l","r"]}const o=c=>{var d;return((d=e.nodes.find(f=>f.id===c))==null?void 0:d.area)??""},i=c=>{const d=t.areas[o(c)],f=t.nodes[c];return d&&f?{x:d.x+f.x+f.w/2,y:d.y+f.y+f.h/2}:{x:0,y:0}},s=i(n),l=i(r),a=l.x-s.x,u=l.y-s.y;return!t.lanes&&o(n)===o(r)||Math.abs(a)<Vt*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function hj(e,t=[],n=[],r=[]){return JSON.stringify([e.view??null,e.view==="journey"?[e.nodes.map(o=>o.kind),[...r].sort(),...J0(e)?[[...e.nodes,...e.edges].map(o=>o.branch??"")]:[]]:null,[...n].sort(),e.areas.map(o=>o.id),e.nodes.map(o=>`${o.id}@${o.area}`),e.edges.map(o=>`${o.from}>${o.to}`),e.absences.map(o=>o.between?`${o.between.from}~${o.between.to}`:""),t.map(o=>`${o.from}+${o.to}`)])}const ln=(...e)=>e.filter(Boolean).join(" "),Xn={add:{pending:"Proposed",done:"Now in the code",mark:"+",title:"Proposed: not in the code yet"},change:{pending:"Would change",done:"Changed",mark:"~",title:"Proposed: this code would change"},remove:{pending:"Would be removed",done:"Removed",mark:"−",title:"Proposed: this code would be removed"}},Ml=e=>e&&`proposal proposal-${e.kind} proposal-${e.state}`,Kn={added:{label:"Added",mark:"+",title:"New since the commit this map is compared with"},changed:{label:"Changed",mark:"~",title:"Different from the commit this map is compared with"},removed:{label:"Removed",mark:"−",title:"Was in the code at the commit this map is compared with, and is gone now"}},$l=e=>e&&`change change-${e}`,Zs={later:{label:"Not there yet",title:"Added after this version of the code"},gone:{label:"Gone",title:"Removed: it was in the code before, and isn’t now"}};function pj(e){if(!(e!=null&&e.length))return null;const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return[t&&`+${t}`,n&&`−${n}`].filter(Boolean).join(" ")||null}const mj=[["before","Before","The code as it was at that commit; what was added since is a shadow"],["after","After","The code as it is now; what was removed is a shadow"],["both","Both","The code as it is now, with what was removed drawn in too"]];function gj({commit:e,when:t,onWhen:n}){return h.jsxs("div",{className:"change-key",children:[h.jsx("div",{className:"seg",role:"group","aria-label":"Which version of the code to show",children:mj.map(([r,o,i])=>h.jsx("button",{className:ln("seg-btn",t===r&&"on"),title:i,"aria-pressed":t===r,onClick:()=>n(r),children:o},r))}),h.jsx("span",{className:"change-key-title",children:t==="before"?`The code at ${e}`:t==="after"?"The code now":`Now, compared with ${e}`}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch"}),"Same as before"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-added"}),"Added"]}),h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:ln("key-swatch key-changed",t!=="both"&&"key-quiet")}),t==="before"?"Changes later":"Changed"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-removed"}),"Removed (only in the before)"]}),t!=="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-ghost"}),t==="before"?"Not there yet":"Gone"]})]})}const yj=5,bl=e=>e&&`branch branch-${e.colour}`;function vj({branches:e}){return h.jsxs("div",{className:"change-key branch-key",children:[h.jsx("span",{className:"change-key-title",children:"Ways through"}),h.jsxs("span",{className:"key-item",title:"What most people do, start to finish",children:[h.jsx("i",{className:"key-swatch"}),"Main path"]}),e.map(t=>h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:ln("key-swatch",bl(t))}),t.name]},t.name))]})}const Qi={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},bh=[["t",oe.Top],["r",oe.Right],["b",oe.Bottom],["l",oe.Left]];function ny(){return h.jsxs(h.Fragment,{children:[bh.map(([e,t])=>h.jsx(Gr,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),bh.map(([e,t])=>h.jsx(Gr,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function xj({data:e}){var t,n,r;return e.journey?h.jsx(wj,{data:e}):h.jsxs("div",{className:ln("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",Ml(e.proposal),$l(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),onClick:o=>{o.stopPropagation(),e.onClick(o.shiftKey||o.metaKey)},children:[h.jsx(ny,{}),(Qi[e.kind]||e.fresh||e.screen||e.proposal||e.change||e.ghost)&&h.jsxs("div",{className:"step-head",children:[e.ghost&&h.jsx("span",{className:"badge-ghost",title:Zs[e.ghost].title,children:Zs[e.ghost].label}),e.proposal&&h.jsx("span",{className:"badge-proposal",children:Xn[e.proposal.kind][e.proposal.state]}),e.change&&h.jsxs("span",{className:"badge-change",title:Kn[e.change].title,children:[e.quiet==="before"?"Changes later":Kn[e.change].label,e.changeSize&&!e.quiet&&h.jsxs("span",{className:"change-size",children:[" ",e.changeSize]})]}),Qi[e.kind]&&!e.proposal&&!e.change&&!e.ghost&&h.jsxs(h.Fragment,{children:[h.jsx("i",{className:"step-mark","aria-hidden":"true",children:Qi[e.kind][1]}),Qi[e.kind][0]]}),e.screen&&h.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),h.jsx("div",{className:"step-name",title:e.name,children:e.name}),h.jsxs("div",{className:"step-code",title:((t=e.proposal)==null?void 0:t.state)==="pending"?Xn[e.proposal.kind].title:e.confirmed?"Confirmed against the code":"The checker couldn't confirm this against the code",children:[((n=e.proposal)==null?void 0:n.state)==="pending"&&e.proposal.kind==="add"?h.jsx("span",{className:"pmark",children:"+"}):((r=e.proposal)==null?void 0:r.state)==="done"&&e.proposal.kind!=="add"?h.jsx("span",{className:"pmark",children:Xn[e.proposal.kind].mark}):e.change&&e.confirmed?h.jsx("span",{className:"cmark",children:Kn[e.change].mark}):h.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),h.jsx("span",{className:"step-sub",children:e.sub})]})]})}function wj({data:e}){const t=e.journey,n=e.proposal;return h.jsxs("div",{className:ln("step","jstep","nopan",`j-${t.shape}`,t.show&&"j-pictured",t.outside&&"j-outside",!e.confirmed&&"unconfirmed",Ml(n),$l(e.change),e.quiet&&"quiet",e.ghost&&"ghost",bl(t.branch),e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),style:{width:t.w,height:t.h},onClick:r=>{r.stopPropagation(),e.onClick(r.shiftKey||r.metaKey)},children:[h.jsx(ny,{}),t.stage&&h.jsx("div",{className:"j-stage",children:t.stage}),t.shape==="choice"&&h.jsx("svg",{className:"j-diamond",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:h.jsx("polygon",{points:"50,1 99,50 50,99 1,50",vectorEffect:"non-scaling-stroke"})}),h.jsxs("div",{className:"j-tags",children:[n&&h.jsx("span",{className:"badge-proposal",children:Xn[n.kind][n.state]}),e.ghost&&h.jsx("span",{className:"badge-ghost",title:Zs[e.ghost].title,children:Zs[e.ghost].label}),e.change&&h.jsx("span",{className:"badge-change",title:Kn[e.change].title,children:e.quiet==="before"?"Changes later":Kn[e.change].label}),!e.confirmed&&h.jsx("span",{className:"j-q",title:"The checker couldn't confirm this against the code",children:"?"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),t.show&&h.jsx(mC,{show:t.show,name:e.name}),h.jsx("div",{className:"j-name",title:e.name,children:e.name}),t.outside&&t.shape!=="choice"&&h.jsx("div",{className:"j-note",children:"Outside the app"})]})}function kj({data:e}){return h.jsx("div",{className:ln("area",e.dim&&"dim"),children:h.jsxs("div",{className:"area-label",children:[e.label,e.note&&h.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function Sj(e,t,n,r,o){const i=Math.hypot(n-e,r-t)||1,s=-(r-t)/i,l=(n-e)/i,a=(e+n)/2+s*o*2,u=(t+r)/2+l*o*2;return[`M ${e} ${t} Q ${a} ${u} ${n} ${r}`,(e+n)/2+s*o,(t+r)/2+l*o]}function Ph(e,t=18,n){let r=`M ${e[0][0]} ${e[0][1]}`;for(let a=1;a<e.length-1;a++){const[u,c]=e[a-1],[d,f]=e[a],[p,y]=e[a+1],x=Math.min(t,Math.hypot(d-u,f-c)/2),k=Math.min(t,Math.hypot(p-d,y-f)/2),g=Math.sign(d-u),v=Math.sign(f-c),m=Math.sign(p-d),w=Math.sign(y-f);r+=` L ${d-g*x} ${f-v*x} Q ${d} ${f} ${d+m*k} ${f+w*k}`}const o=e[e.length-1];r+=` L ${o[0]} ${o[1]}`;const[i,s]=n!==void 0?[e[n],e[n+1]]:[];if(i&&s)return[r,(i[0]+s[0])/2,(i[1]+s[1])/2];let l=[0,e[0][0],e[0][1]];for(let a=1;a<e.length;a++){const[u,c]=e[a-1],[d,f]=e[a];c===f&&Math.abs(d-u)>l[0]&&(l=[Math.abs(d-u),(u+d)/2,f])}return[r,l[1],l[2]]}function Nj({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,d]=a!=null&&a.route?Ph(a.route.points,18,a.route.label):(a==null?void 0:a.wrapY)!==void 0&&i===oe.Right?Ph([[t,n],[t+30,n],[t+30,a.wrapY],[r,a.wrapY],[r,o]]):(a==null?void 0:a.wrapY)!==void 0?Ks({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s,borderRadius:18,centerY:a.wrapY}):a!=null&&a.offset?Sj(t,n,r,o,a.offset):Dc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});if(!a)return null;const f=a.place&&a.place!=="dot"?a.place:null,p=a.place==="dot"&&!a.selected;return h.jsxs(h.Fragment,{children:[a.selected&&h.jsx("path",{d:u,className:"edge-halo"}),h.jsx(vi,{id:e,path:u,markerEnd:l,interactionWidth:18}),h.jsx(j2,{children:h.jsxs("div",{className:ln("link-label",p&&"dot",`link-${a.variant}`,!a.confirmed&&"unconfirmed",Ml(a.proposal),$l(a.change),a.ghost&&"ghost",bl(a.branch),a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),"data-id":e,"data-x":c,"data-y":d,title:p?a.label:void 0,style:{transform:`translate(-50%, -50%) translate(${(f==null?void 0:f.x)??c}px, ${(f==null?void 0:f.y)??d}px)`},onClick:y=>{var x;y.stopPropagation(),(x=a.onClick)==null||x.call(a,y.shiftKey||y.metaKey)},children:[a.variant==="absence"&&h.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),a.proposal&&h.jsx("span",{className:"pmark",title:a.proposal.state==="done"?Xn[a.proposal.kind].done:Xn[a.proposal.kind].title,children:a.proposal.state==="done"&&a.proposal.kind==="add"?"✓":Xn[a.proposal.kind].mark}),a.change&&h.jsx("span",{className:"cmark",title:Kn[a.change].title,children:Kn[a.change].mark}),h.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&h.jsx("span",{className:"q",children:" ?"})]})})]})}const Ej={step:xj,area:kj},_j={link:Nj};function Ih(e,t){const n=new Set;for(const r of t){e.nodes.some(s=>s.id===r)&&n.add(r);const o=e.edges.find(s=>s.id===r);o&&n.add(o.from).add(o.to);const i=e.absences.find(s=>s.id===r);i!=null&&i.between&&n.add(i.between.from).add(i.between.to)}return[...n]}const Cj="440px",jj=e=>e.length>28?`${e.slice(0,26)}…`:e;function Mj(e){var N,T,L,A,P,M,z,O,Y,ne;const t=(N=e.ghost)!=null&&N.connects&&e.map.nodes.some(B=>B.id===e.ghost.connects.from)&&e.map.nodes.some(B=>B.id===e.ghost.connects.to)?e.ghost:null,n=b.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=b.useMemo(()=>e.map.view==="journey"?e.map.nodes.filter(B=>{var F,Z,q;return B.kind!=="action"&&B.kind!=="choice"&&((q=(Z=(F=e.report)==null?void 0:F.screens)==null?void 0:Z[B.id])==null?void 0:q.status)==="confirmed"}).map(B=>B.id):[],[e.map,e.report]),o=hj(e.map,n,e.added,r),[i,s]=b.useState(null),l=yi(),[a,u]=b.useState({key:"",at:{}}),[c,d]=b.useState("both"),p=!!((L=(T=e.report)==null?void 0:T.since)!=null&&L.commit)?c:"both",y=JSON.stringify([(i==null?void 0:i.key)??null,p,(t==null?void 0:t.id)??null]),x=B=>{var F,Z,q,E,$,X;return((q=(Z=(F=e.report)==null?void 0:F.nodes[B])==null?void 0:Z.change)==null?void 0:q.kind)??((X=($=(E=e.report)==null?void 0:E.edges[B])==null?void 0:$.change)==null?void 0:X.kind)??null},k=B=>p==="before"&&x(B)==="added"?"later":p==="after"&&x(B)==="removed"?"gone":null,g=B=>p==="both"||B==="changed"?B:null;b.useEffect(()=>{let B=!0;return sj(e.map,n,new Set(e.added),new Set(r)).then(F=>B&&s({key:o,layout:F}),F=>console.error("illuminate: the map could not be laid out",F)),()=>{B=!1}},[o]);const v=(A=e.view)!=null&&A.highlight.length?new Set(e.view.highlight):null,m=b.useMemo(()=>v?new Set(Ih(e.map,[...v])):null,[v,e.map]),w=e.selection,_=b.useMemo(()=>((i==null?void 0:i.layout.branches)??[]).map((B,F)=>({name:B,colour:F%yj+1})),[i]),S=B=>B?_.find(F=>F.name===B)??null:null,C=(B,F,Z)=>{var $;if(!_.length||!Z)return null;if(B==="node")return S(($=e.map.nodes.find(X=>X.id===F))==null?void 0:$.branch);const q=e.map.edges.find(X=>X.id===F),E=X=>{var Q;return(Q=e.map.nodes.find(K=>K.id===X))==null?void 0:Q.branch};return S((q==null?void 0:q.branch)??E(q==null?void 0:q.to)??E(q==null?void 0:q.from))},j=b.useMemo(()=>{if(!i)return[];const B=i.layout,F=$=>!m||e.map.nodes.some(X=>X.area===$&&m.has(X.id)),Z=e.map.areas.flatMap($=>{const X=B.areas[$.id];return X?[{id:`area:${$.id}`,type:"area",position:{x:X.x,y:X.y},style:{width:X.w,height:X.h},initialWidth:X.w,initialHeight:X.h,data:{label:$.label,note:null,dim:!F($.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),q=new Map;if(B.flat){const $=X=>B.branches&&X.branch?1:0;for(const X of e.map.areas){const Q=e.map.nodes.filter(K=>K.area===X.id&&B.nodes[K.id]).sort((K,U)=>$(K)-$(U)||B.nodes[K.id].x-B.nodes[U.id].x||B.nodes[K.id].y-B.nodes[U.id].y)[0];Q&&q.set(Q.id,X.label)}}const E=e.map.nodes.flatMap($=>{var U,G,te,V,ee,se,ce,he,Ne,ie,$e,nt,Ie,Be,Ve,rt,Ut,Yt,lr;const X=B.nodes[$.id];if(!X)return[];const Q=$.evidence[0],K=$.symbol?$.symbol.slice($.symbol.indexOf("#")+1):Q?`${Q.file.split("/").pop()}:${Q.line}`:"not in the code yet";return[{id:$.id,type:"step",...B.flat?{}:{parentId:`area:${$.area}`,extent:"parent"},position:{x:X.x,y:X.y},initialWidth:X.w,initialHeight:X.h,data:{name:$.name,sub:K,kind:$.kind,confirmed:!!e.report&&((U=e.report.nodes[$.id])==null?void 0:U.status)!=="unconfirmed",proposal:((te=(G=e.report)==null?void 0:G.nodes[$.id])==null?void 0:te.proposal)??null,screen:((se=(ee=(V=e.report)==null?void 0:V.screens)==null?void 0:ee[$.id])==null?void 0:se.status)==="confirmed",selected:w.nodes.includes($.id),hl:!!(m!=null&&m.has($.id)),dim:!!m&&!m.has($.id)&&!w.nodes.includes($.id),fresh:e.fresh.includes($.id),change:g(((Ne=(he=(ce=e.report)==null?void 0:ce.nodes[$.id])==null?void 0:he.change)==null?void 0:Ne.kind)??null),changeSize:pj((nt=($e=(ie=e.report)==null?void 0:ie.nodes[$.id])==null?void 0:$e.change)==null?void 0:nt.diff),ghost:k($.id),quiet:p==="both"?null:p,...B.flat&&{journey:{w:X.w,h:X.h,shape:$.kind==="choice"?"choice":$.kind==="action"?"action":"screen",outside:$.kind==="external",stage:q.get($.id)??null,show:r.includes($.id)?((Ve=(Be=(Ie=e.report)==null?void 0:Ie.screens)==null?void 0:Be[$.id])==null?void 0:Ve.show)??null:null,branch:C("node",$.id,!!e.report&&((rt=e.report.nodes[$.id])==null?void 0:rt.status)!=="unconfirmed"&&!((Ut=e.report.nodes[$.id])!=null&&Ut.proposal)&&!g(((lr=(Yt=e.report.nodes[$.id])==null?void 0:Yt.change)==null?void 0:lr.kind)??null)&&!k($.id))}},onClick:Il=>e.onSelect("nodes",$.id,Il)},draggable:!1,zIndex:3}]});return[...Z,...E]},[i,e.map,e.report,w,m,e.fresh,e.onSelect,r,p,_]),I=b.useMemo(()=>{var K,U,G,te;if(!i)return[];const B=V=>({type:Jo.ArrowClosed,width:16,height:16,color:V}),F=V=>!!(v!=null&&v.has(V)),Z=(V,ee)=>{const[se,ce]=fj(e.map,i.layout,V,ee);return{sourceHandle:`s${se}`,targetHandle:`t${ce}`}},q=new Map,E=(V,ee)=>{const se=i.layout.rowTops,ce=qs(i.layout,V),he=qs(i.layout,ee);if(!se||ce===he)return;const Ne=Math.max(ce,he),ie=q.get(Ne)??0;return q.set(Ne,ie+1),se[Ne]-bu/2+(ie%2?1:-1)*Math.ceil(ie/2)*18},$=e.map.edges.map(V=>{var nt,Ie,Be,Ve,rt,Ut,Yt;const ee=!!e.report&&((nt=e.report.edges[V.id])==null?void 0:nt.status)!=="unconfirmed",se=((Be=(Ie=e.report)==null?void 0:Ie.edges[V.id])==null?void 0:Be.proposal)??null,ce=g(((Ut=(rt=(Ve=e.report)==null?void 0:Ve.edges[V.id])==null?void 0:rt.change)==null?void 0:Ut.kind)??null),he=k(V.id)??k(V.from)??k(V.to),Ne=F(V.id)||!!m&&m.has(V.from)&&m.has(V.to)&&!v,ie="edge",$e=C("edge",V.id,!se&&!ce&&!he);return{id:`e:${V.id}`,source:V.from,target:V.to,...Z(V.from,V.to),type:"link",className:ln("link",`link-${ie}`,!ee&&"unconfirmed",Ml(se),$l(ce),he&&"ghost",bl($e),F(V.id)&&"hl",!!v&&!F(V.id)&&"dim",w.edges.includes(V.id)&&"selected"),markerEnd:B(he?"var(--line)":(se==null?void 0:se.state)==="pending"&&se.kind!=="remove"?"var(--ai)":ce==="added"?"var(--ok)":ce==="removed"?"var(--dead)":$e?`var(--branch-${$e.colour})`:F(V.id)?"var(--path)":"var(--line-strong)"),zIndex:1,data:{label:V.label,wrapY:E(V.from,V.to),route:(Yt=i.layout.routes)==null?void 0:Yt[`e:${V.id}`],branch:$e,variant:ie,proposal:se,change:ce,ghost:he,confirmed:ee,hl:Ne,dim:!!v&&!F(V.id)&&!w.edges.includes(V.id),selected:w.edges.includes(V.id),onClick:lr=>e.onSelect("edges",V.id,lr)}}}),X=V=>{var ee;return((ee=t==null?void 0:t.connects)==null?void 0:ee.from)===V.from&&t.connects.to===V.to};for(const V of e.map.absences){if(!V.between||X(V.between))continue;const ee=((U=(K=e.report)==null?void 0:K.absences[V.id])==null?void 0:U.status)==="confirmed";$.push({id:`a:${V.id}`,hidden:p==="before",source:V.between.from,target:V.between.to,...Z(V.between.from,V.between.to),type:"link",className:ln("link","link-absence",!ee&&"unconfirmed",F(V.id)&&"hl",!!v&&!F(V.id)&&"dim",w.absences.includes(V.id)&&"selected"),markerEnd:B("var(--dead)"),zIndex:1,data:{label:jj(V.claim),route:(G=i.layout.routes)==null?void 0:G[`a:${V.id}`],variant:"absence",confirmed:ee,hl:F(V.id),dim:!!v&&!F(V.id)&&!w.absences.includes(V.id),selected:w.absences.includes(V.id),onClick:se=>e.onSelect("absences",V.id,se)}})}t!=null&&t.connects&&$.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,...Z(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:B("var(--ok)"),zIndex:2,data:{label:`+ ${t.connects.label}`,route:(te=i.layout.routes)==null?void 0:te[`x:${t.id}`],variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const Q=new Map;for(const V of $){const ee=[V.source,V.target].sort().join("|");Q.set(ee,[...Q.get(ee)??[],V])}for(const V of Q.values())V.length<2||V.some(ee=>{var se;return(se=ee.data)==null?void 0:se.route})||V.forEach((ee,se)=>{ee.data&&(ee.data.offset=(se-(V.length-1)/2)*44)});if(a.key===y)for(const V of $)V.data&&a.at[V.id]&&(V.data.place=a.at[V.id]);return $},[i,e.map,e.report,w,v,m,t,e.onSelect,p,_,a,y]);b.useEffect(()=>{if(!i)return;let B=0,F=0;const Z=()=>{const q=[...document.querySelectorAll(".react-flow__edgelabel-renderer .link-label[data-id]")],E=q.length>0&&q.every(K=>K.offsetWidth>0)&&l.getNodes().every(K=>{var U,G;return(G=(U=l.getInternalNode(K.id))==null?void 0:U.measured)==null?void 0:G.width});if(B++<2||!E){B<60&&(F=requestAnimationFrame(Z));return}const $=[],X=[];for(const K of l.getNodes()){const U=l.getInternalNode(K.id);if(!U||K.hidden)continue;const G=U.internals.positionAbsolute,te=U.measured.width??0,V=U.measured.height??0;K.type==="step"?$.push({x:G.x,y:G.y,w:te,h:V}):K.type==="area"&&X.push({x:G.x,y:G.y,w:Math.min(te,280),h:40})}const Q=q.map(K=>{var te;const U=document.getElementById(K.dataset.id),G=((te=U==null?void 0:U.getTotalLength)==null?void 0:te.call(U))??0;return{id:K.dataset.id,w:K.offsetWidth,h:K.offsetHeight,at:{x:Number(K.dataset.x),y:Number(K.dataset.y)},keep:K.dataset.id.startsWith("a:"),along:V=>{if(!U||!G)return null;const ee=U.getPointAtLength(G*V);return{x:ee.x,y:ee.y}}}});u({key:y,at:qC(Q,$,X)})};return F=requestAnimationFrame(Z),()=>cancelAnimationFrame(F)},[y]);const R=ae(B=>B.width),D=b.useRef(0);b.useEffect(()=>{const B=D.current;if(D.current=R,!B||!R||B===R||e.touring)return;const F=l.getViewport();l.setViewport({...F,x:F.x+(R-B)/2})},[R]);const W=JSON.stringify([i==null?void 0:i.key,(P=e.view)==null?void 0:P.focus,(M=e.view)==null?void 0:M.highlight,e.touring,e.touring?R:null]),H=b.useRef(!0);return b.useEffect(()=>{if(!i)return;const B=e.view?Ih(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let F=0,Z=0;const q=()=>{var V;const E=l.getNodes();if(F<2||!E.length||!E.every(ee=>{var se,ce;return(ce=(se=l.getInternalNode(ee.id))==null?void 0:se.measured)==null?void 0:ce.width})){F++<60&&(Z=requestAnimationFrame(q));return}const $=H.current?0:650;H.current=!1;const X=Object.values(i.layout.nodes),Q=Object.values(i.layout.routes??{}).flatMap(ee=>ee.points),K=Math.max(0,Math.min(0,...X.map(ee=>ee.y))-Math.min(0,...Q.map(ee=>ee[1]))),U=Math.max(0,Math.max(0,...Q.map(ee=>ee[1]))-Math.max(0,...X.map(ee=>ee.y+ee.h))+(Q.length?16:0)),G=(V=i.layout.branches)!=null&&V.length?56:0,te=B.length?{top:`${60+G}px`,left:e.touring?Cj:"60px",right:"60px",bottom:"150px"}:{top:`${64+K+G}px`,left:"32px",right:"32px",bottom:`${130+U}px`};l.fitView(B.length?{nodes:B.map(ee=>({id:ee})),duration:$,padding:te,maxZoom:1.15}:{duration:$,padding:te,maxZoom:1.1})};return Z=requestAnimationFrame(q),()=>cancelAnimationFrame(Z)},[W]),h.jsxs(_2,{className:i!=null&&i.layout.flat?"journey":i!=null&&i.layout.lanes?"lanes":void 0,nodes:j,edges:I,zIndexMode:"manual",nodeTypes:Ej,edgeTypes:_j,onNodeClick:()=>{},onEdgeClick:(B,F)=>{F.id.startsWith("e:")&&e.onSelect("edges",F.id.slice(2),B.shiftKey||B.metaKey),F.id.startsWith("a:")&&e.onSelect("absences",F.id.slice(2),B.shiftKey||B.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:[h.jsx(I2,{variant:en.Dots,gap:22,size:1.3}),(((O=(z=e.report)==null?void 0:z.since)==null?void 0:O.commit)||_.length>0)&&h.jsx(gi,{position:"top-left",children:h.jsxs("div",{className:"map-keys",children:[((ne=(Y=e.report)==null?void 0:Y.since)==null?void 0:ne.commit)&&h.jsx(gj,{commit:e.report.since.commit.slice(0,7),when:p,onWhen:d}),_.length>0&&h.jsx(vj,{branches:_})]})})]})}function Pl(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function $j(){const[e,t]=b.useState(location.pathname);return b.useEffect(()=>{const n=()=>t(location.pathname),r=o=>{var s,l;if(o.defaultPrevented||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const i=(l=(s=o.target)==null?void 0:s.closest)==null?void 0:l.call(s,"a[href]");!(i instanceof HTMLAnchorElement)||i.target||i.origin!==location.origin||(o.preventDefault(),Pl(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}const bj=8e3;function ry({busy:e,agentName:t="Claude",onStopped:n,onError:r}){const[o,i]=b.useState(!1);return b.useEffect(()=>{if(!o)return;const s=setTimeout(()=>i(!1),bj),l=a=>{a.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>{clearTimeout(s),window.removeEventListener("keydown",l)}},[o]),o&&!e?h.jsxs("span",{className:"stop-ask",role:"group","aria-label":"Stop illuminate?",children:[h.jsx("span",{className:"stop-ask-text",children:"Stop illuminate? Maps stay saved."}),h.jsx("button",{className:"pill-btn stop-yes",autoFocus:!0,onClick:()=>{i(!1),_t.stop().then(n,s=>r(s.message))},children:"Stop"}),h.jsx("button",{className:"pill-btn",onClick:()=>i(!1),children:"Keep running"})]}):h.jsx("button",{className:"pill-btn",disabled:e,title:e?`${t} is still working`:"Maps stay saved. Undo for applied fixes ends.",onClick:()=>i(!0),children:"Stop illuminate"})}function Pj(){return h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"illuminate has stopped"}),h.jsx("p",{className:"muted lede",children:"You can close this tab."}),h.jsxs("p",{className:"muted lede",children:["Maps are saved in ",h.jsx("code",{children:".illuminate/maps"}),". Run ",h.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function Ij({onStopped:e}){const[t,n]=b.useState(""),[r,o]=b.useState(null),[i,s]=b.useState([]),[l,a]=b.useState(""),[u,c]=b.useState(null),[d,f]=b.useState(!1),[p,y]=b.useState(B0);b.useEffect(()=>H0(()=>{},()=>{},e),[e]),b.useEffect(()=>{_t.list().then(k=>{n(k.repo),o(k.maps),s(k.making),k.agent&&y(k.agent)},k=>c(k.message))},[]);const x=async()=>{if(l.trim()){f(!0);try{const{id:k}=await _t.make(l.trim());Pl(Dt(k))}catch(k){c(k.message),f(!1)}}};return h.jsxs("main",{className:"home",children:[h.jsxs("div",{className:"home-brand",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&h.jsx("span",{className:"muted",children:t})]}),h.jsx("h1",{children:"Ask how your code works"}),h.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),Cl(p)?h.jsxs("p",{className:"home-ask chat-hint",children:[h.jsxs("strong",{children:["Ask for a new map in the ",p.name," chat beside this page"]})," ",h.jsx("span",{className:"muted",children:"for example: “Map what happens when a user signs up.”"})]}):h.jsxs("form",{className:"home-ask",onSubmit:k=>{k.preventDefault(),x()},children:[h.jsx("input",{id:"question",value:l,onChange:k=>a(k.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),h.jsx("button",{className:"btn primary",disabled:d||!l.trim(),children:d?"Starting…":"Map it"})]}),u&&h.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Being made now"}),h.jsx("ul",{className:"maplist",children:i.map(k=>h.jsxs("li",{children:[h.jsx("a",{href:Dt(k.id),children:k.question}),h.jsxs("span",{className:"muted small",children:[p.name," is exploring…"]})]},k.id))})]}),h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?h.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?h.jsx("p",{className:"muted",children:"None yet."}):h.jsx("ul",{className:"maplist",children:r.map(k=>h.jsxs("li",{children:[h.jsx("a",{href:Dt(k.id),children:k.question}),h.jsxs("span",{className:"muted small",children:[new Date(k.updatedAt).toLocaleString(),k.commit?` · ${k.commit.slice(0,7)}`:""]})]},k.id))})]}),h.jsx("footer",{className:"home-foot",children:h.jsx(ry,{busy:i.length>0,agentName:p.name,onStopped:e,onError:c})})]})}const Th="illuminate-panel-width",Pu=300,oy=400,Tj=360,xa=e=>Math.round(Math.max(Pu,Math.min(e,Math.max(Pu,window.innerWidth-Tj))));function Lj(){const[e,t]=b.useState(()=>{const r=Number(localStorage.getItem(Th));return xa(r>0?r:oy)}),n=b.useCallback(r=>{const o=xa(r);t(o),localStorage.setItem(Th,String(o))},[]);return b.useEffect(()=>{const r=()=>t(o=>xa(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function zj({width:e,onWidth:t}){return h.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":Pu,tabIndex:0,title:"Drag to resize the panel",onPointerDown:n=>{n.preventDefault();const r=n.currentTarget;r.setPointerCapture(n.pointerId),document.body.classList.add("resizing");const o=s=>t(window.innerWidth-s.clientX),i=()=>{r.removeEventListener("pointermove",o),r.removeEventListener("pointerup",i),r.removeEventListener("pointercancel",i),document.body.classList.remove("resizing")};r.addEventListener("pointermove",o),r.addEventListener("pointerup",i),r.addEventListener("pointercancel",i)},onDoubleClick:()=>t(oy),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const Aj=(...e)=>e.filter(Boolean).join(" ");function Rj({map:e,stop:t,onTour:n,onAsk:r}){var s;const o=e.tour[t];if(!o)return null;const i=t===e.tour.length-1;return h.jsxs("section",{className:"card card-focus tour-bubble","aria-label":"Walkthrough","aria-live":"polite",children:[h.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>n(null),children:"×"}),h.jsxs("div",{className:"tour-head",children:[h.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",t+1," of ",e.tour.length]}),h.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((l,a)=>h.jsx("i",{className:Aj(a===t&&"on",a<t&&"done")},l.id))})]}),h.jsx("h2",{className:"card-title",children:o.title}),h.jsx(oi,{text:o.text,className:"depth-text"}),(s=o.terms)!=null&&s.length?h.jsxs("p",{className:"muted small",children:["Terms: ",o.terms.join(", ")]}):null,h.jsxs("div",{className:"tour-nav",children:[h.jsx("button",{className:"btn",disabled:t===0,onClick:()=>n(t-1),children:"‹ Back"}),r&&h.jsx("button",{className:"btn",onClick:r,children:"Ask about this step"}),h.jsx("span",{className:"grow"}),i?h.jsx("button",{className:"btn primary",onClick:()=>n(null),children:"Done"}):h.jsx("button",{className:"btn primary",onClick:()=>n(t+1),children:"Next ›"})]}),h.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}function Dj(){return Qr?h.jsx(Oj,{}):h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"Open illuminate from its link"}),h.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",h.jsx("code",{children:"?t=…"}),")."]})]})}function Oj(){const[e,t]=b.useState(!1),n=b.useCallback(()=>{window.close(),t(!0)},[]),r=$j();if(e)return h.jsx(Pj,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?h.jsx(Vj,{mapId:o[1],onStopped:n},o[1]):h.jsx(Ij,{onStopped:n})}function Fj({mapId:e,question:t,making:n}){const[r,o]=b.useState([]);b.useEffect(()=>{_t.list().then(s=>o([...s.making.map(l=>({...l,making:!0})),...s.maps.map(l=>({id:l.id,question:l.question}))]),()=>{})},[e,n]);const i=r.some(s=>s.id===e)?r:[{id:e,question:t},...r];return h.jsx("select",{className:"switcher",value:e,onChange:s=>Pl(Dt(s.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:i.map(s=>h.jsxs("option",{value:s.id,children:[s.question||s.id,s.making?" (being made)":""]},s.id))})}function Hj({report:e}){if(!e)return null;const t=e.summary.unconfirmed,{pending:n,done:r}=e.summary.proposals??{pending:0,done:0},o=n+r,i=o?h.jsx("span",{className:"map-status proposals",title:"Parts of this map are a proposal, drawn in violet: they aren't in the code yet, or would change or go. illuminate checks the code to see which have been done.",children:r===0?`${o} proposed ${o===1?"change":"changes"}`:`${r} of ${o} proposed changes done`}):null,s=h.jsxs(h.Fragment,{children:[i,h.jsx(Bj,{report:e})]});return t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status off",title:"Every time the map is shown, illuminate re-checks it against the code. These parts no longer hold, usually because the code changed after the map was made. They're dashed and marked ? on the map; click one to see why.",children:t===1?"1 part of this map doesn’t match the code":`${t} parts of this map don’t match the code`}),s]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status ok",title:"Every box and arrow on this map was just re-checked and is really in the code, and every gap's search still finds nothing. That shows each part is real; it doesn't show the map covers everything.",children:"✓ Every part is in the code"}),s]})}function Bj({report:e}){const t=e.since;if(!t)return null;if(!t.commit)return h.jsx("span",{className:"map-status off",title:`This map compares the code with "${t.ref}", but that isn't a commit in this repo, so nothing could be compared.`,children:"Can’t find the commit this map compares with"});const{added:n,changed:r,removed:o}=e.summary.changes??{added:0,changed:0,removed:0},i=t.date?new Date(t.date).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null,s=[n&&`${n} added`,r&&`${r} changed`,o&&`${o} removed`].filter(Boolean).join(" · ");return h.jsxs("span",{className:"map-status changes",title:`This map shows the code as it is now, compared with commit ${t.commit.slice(0,7)}${t.subject?` ("${t.subject}")`:""}. illuminate works out from the two versions which boxes and arrows are new, different or gone. It can't tell who made a change.`,children:["Changes since ",t.commit.slice(0,7),i?` (${i})`:"",s?`: ${s}`:": nothing on this map differs"]})}function Vj({mapId:e,onStopped:t}){var A,P,M,z,O,Y,ne,B;const[n,r]=b.useReducer(bC,e,_C),[o,i]=b.useState(""),[s,l]=Lj(),a=b.useRef(!1),u=b.useCallback(()=>{_t.get(e).then(F=>r({type:"loaded",payload:F}),F=>r(F instanceof F0&&/No such map/.test(F.message)?{type:"missing"}:{type:"error",message:F.message}))},[e]);b.useEffect(u,[u]),b.useEffect(()=>H0(F=>r({type:"event",event:F}),F=>{r({type:"connected",value:F}),F&&a.current===!1&&n.phase!=="loading"&&u(),a.current=F},t,e),[]);const c=n.map&&n.tour!==null?((A=n.map.tour[n.tour])==null?void 0:A.title)??null:null;b.useEffect(()=>{const F=n.phase==="ready"?oC(n.agent,n.selection,c):null;if(!F)return;const Z=setTimeout(()=>void _t.selection(e,F.selection,F.step).catch(()=>{}),250);return()=>clearTimeout(Z)},[e,n.phase,n.agent,n.selection,c]);const d=Cl(n.agent),[f,p]=b.useState(null);b.useEffect(()=>p(null),[n.tour]);const y=n.map&&n.tour!==null&&f===n.tour?((P=n.map.tour[n.tour])==null?void 0:P.title)??null:null,x=b.useCallback(F=>{const Z=F.trim();if(!Z||n.job)return;const q=y?NC(y,Z):Z;_t.ask(e,q,n.selection).then(()=>i(""),E=>r({type:"error",message:E.message}))},[e,n.job,n.selection,y]),k=(F,Z)=>{Z==="approve"&&r({type:"fixStatus",fixId:F,status:"applying",problems:[]}),_t[Z](e,F).catch(q=>{r(Z==="approve"?{type:"fixStatus",fixId:F,status:"failed",problems:q.problems.length?q.problems:[q.message]}:{type:"error",message:[q.message,...q.problems].join(" ")})})},g=(F,Z)=>{_t.offer(e,F,Z).then(q=>{q.id&&Pl(Dt(q.id))},q=>r({type:"error",message:q.message}))};b.useEffect(()=>{const F=Z=>{const q=Z.target instanceof HTMLTextAreaElement||Z.target instanceof HTMLInputElement;if(Z.key==="Escape"){yo(n.selection)?r({type:"clearSelection"}):n.tour!==null&&n.peek?r({type:"peek",open:!1}):n.tour!==null?r({type:"tour",stop:null}):r({type:"overview"});return}q||n.tour===null||(Z.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),Z.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[n.tour,n.peek,n.selection]);const v=n.answers.find(F=>F.id===n.shown),m=v!=null&&v.fix&&["proposed","applying","failed"].includes(((M=n.fixes[v.fix.id])==null?void 0:M.status)??"")?v.fix:null,w=b.useCallback((F,Z,q)=>r({type:"select",kind:F,id:Z,additive:q}),[]),_=b.useCallback(()=>r({type:"clearSelection"}),[]),S=K0(n),C=jC(n),j=CC(n),I=!!n.map&&n.tour!==null,R=b.useMemo(()=>({...n,answers:sC(n.agent,n.answers,n.fixes)}),[n]),D=n.shown!==null&&R.answers.some(F=>F.id===n.shown),W=((z=n.job)==null?void 0:z.kind)==="ask"&&!d,N=(!n.map||!!n.error||!!n.job&&(n.job.kind==="make"||W)||D)&&(!I||n.peek||!!n.error||W),T=N&&!!n.map,L=n.map&&d?h.jsx(HC,{map:n.map,agent:n.agent,selection:n.selection,step:c,onRemove:(F,Z)=>r({type:"select",kind:F,id:Z,additive:!0})}):n.map?h.jsx(FC,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,agentName:n.agent.name,autoFocus:T,onDraft:i,onRemove:(F,Z)=>r({type:"select",kind:F,id:Z,additive:!0}),step:y,onRemoveStep:()=>p(null),onSend:()=>x(o)}):null;return h.jsx(A0,{children:h.jsxs("div",{className:"app",children:[h.jsxs("header",{className:"topbar",children:[h.jsxs("a",{className:"brand",href:Dt(),title:"All maps in this repo",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),h.jsxs("div",{className:"topbar-map",children:[((O=n.meta)==null?void 0:O.parent)&&h.jsxs("a",{className:"crumb",href:Dt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),h.jsx(Fj,{mapId:e,question:((Y=n.map)==null?void 0:Y.question)??((ne=n.job)==null?void 0:ne.question)??"",making:((B=n.job)==null?void 0:B.kind)==="make"})]}),h.jsx(Hj,{report:n.report}),h.jsx("a",{className:"pill-btn",href:Dt(),title:"Ask a new question and make a map for it",children:"New map"}),h.jsx(ry,{busy:!!n.job,agentName:n.agent.name,onStopped:t,onError:F=>r({type:"error",message:F})}),h.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),h.jsxs("div",{className:N?"body":"body full",style:{"--panel-w":`${s}px`},children:[h.jsx("div",{className:"canvas",children:n.map&&S?h.jsxs(h.Fragment,{children:[h.jsx(Mj,{map:S,report:n.report,selection:n.selection,view:j,fresh:n.fresh,added:C,ghost:m??null,touring:I,onSelect:w,onClear:_}),!N&&h.jsx(YC,{state:R,dispatch:r}),yo(n.selection)>0&&h.jsx(GC,{mapId:e,map:S,report:n.report,selection:n.selection,onClose:_}),I&&yo(n.selection)===0&&h.jsx(Rj,{map:n.map,stop:n.tour,onTour:F=>r({type:"tour",stop:F}),onAsk:d?void 0:()=>{var F;p(n.tour),(F=document.getElementById("ask"))==null||F.focus()}}),h.jsx(UC,{map:n.map,mapId:e,tour:n.tour,onTour:F=>r({type:"tour",stop:F}),selected:yo(n.selection),children:T?null:L})]}):h.jsx("div",{className:"empty",children:n.phase==="making"?h.jsxs("div",{className:"pulse",children:[n.agent.name," is exploring the code…"]}):null})}),N&&h.jsx(zj,{width:s,onWidth:l}),N&&h.jsx(zC,{state:R,dispatch:r,onFix:k,onFocus:F=>r({type:"focus",id:F}),onOffer:g,composer:T?L:null})]})]})})}Km(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(Dj,{})}));export{Wj as c,Lh as g};
|
|
71
|
+
//# sourceMappingURL=index-DP2A86We.js.map
|