archbyte 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +282 -0
  2. package/bin/archbyte.js +213 -0
  3. package/dist/agents/core/component-detector.d.ts +2 -0
  4. package/dist/agents/core/component-detector.js +57 -0
  5. package/dist/agents/core/connection-mapper.d.ts +2 -0
  6. package/dist/agents/core/connection-mapper.js +77 -0
  7. package/dist/agents/core/doc-parser.d.ts +2 -0
  8. package/dist/agents/core/doc-parser.js +64 -0
  9. package/dist/agents/core/env-detector.d.ts +2 -0
  10. package/dist/agents/core/env-detector.js +51 -0
  11. package/dist/agents/core/event-detector.d.ts +2 -0
  12. package/dist/agents/core/event-detector.js +59 -0
  13. package/dist/agents/core/infra-analyzer.d.ts +2 -0
  14. package/dist/agents/core/infra-analyzer.js +72 -0
  15. package/dist/agents/core/structure-scanner.d.ts +2 -0
  16. package/dist/agents/core/structure-scanner.js +55 -0
  17. package/dist/agents/core/validator.d.ts +2 -0
  18. package/dist/agents/core/validator.js +74 -0
  19. package/dist/agents/index.d.ts +24 -0
  20. package/dist/agents/index.js +73 -0
  21. package/dist/agents/llm/index.d.ts +8 -0
  22. package/dist/agents/llm/index.js +185 -0
  23. package/dist/agents/llm/prompt-builder.d.ts +3 -0
  24. package/dist/agents/llm/prompt-builder.js +251 -0
  25. package/dist/agents/llm/response-parser.d.ts +6 -0
  26. package/dist/agents/llm/response-parser.js +174 -0
  27. package/dist/agents/llm/types.d.ts +31 -0
  28. package/dist/agents/llm/types.js +2 -0
  29. package/dist/agents/pipeline/agents/component-identifier.d.ts +3 -0
  30. package/dist/agents/pipeline/agents/component-identifier.js +102 -0
  31. package/dist/agents/pipeline/agents/connection-mapper.d.ts +3 -0
  32. package/dist/agents/pipeline/agents/connection-mapper.js +126 -0
  33. package/dist/agents/pipeline/agents/flow-detector.d.ts +3 -0
  34. package/dist/agents/pipeline/agents/flow-detector.js +101 -0
  35. package/dist/agents/pipeline/agents/service-describer.d.ts +3 -0
  36. package/dist/agents/pipeline/agents/service-describer.js +100 -0
  37. package/dist/agents/pipeline/agents/validator.d.ts +3 -0
  38. package/dist/agents/pipeline/agents/validator.js +102 -0
  39. package/dist/agents/pipeline/index.d.ts +13 -0
  40. package/dist/agents/pipeline/index.js +128 -0
  41. package/dist/agents/pipeline/merger.d.ts +7 -0
  42. package/dist/agents/pipeline/merger.js +212 -0
  43. package/dist/agents/pipeline/response-parser.d.ts +5 -0
  44. package/dist/agents/pipeline/response-parser.js +43 -0
  45. package/dist/agents/pipeline/types.d.ts +92 -0
  46. package/dist/agents/pipeline/types.js +3 -0
  47. package/dist/agents/prompt-data.d.ts +1 -0
  48. package/dist/agents/prompt-data.js +15 -0
  49. package/dist/agents/prompts-encode.d.ts +9 -0
  50. package/dist/agents/prompts-encode.js +26 -0
  51. package/dist/agents/prompts.d.ts +12 -0
  52. package/dist/agents/prompts.js +30 -0
  53. package/dist/agents/providers/anthropic.d.ts +10 -0
  54. package/dist/agents/providers/anthropic.js +117 -0
  55. package/dist/agents/providers/google.d.ts +10 -0
  56. package/dist/agents/providers/google.js +136 -0
  57. package/dist/agents/providers/ollama.d.ts +9 -0
  58. package/dist/agents/providers/ollama.js +162 -0
  59. package/dist/agents/providers/openai.d.ts +9 -0
  60. package/dist/agents/providers/openai.js +142 -0
  61. package/dist/agents/providers/router.d.ts +7 -0
  62. package/dist/agents/providers/router.js +55 -0
  63. package/dist/agents/runtime/orchestrator.d.ts +34 -0
  64. package/dist/agents/runtime/orchestrator.js +193 -0
  65. package/dist/agents/runtime/registry.d.ts +23 -0
  66. package/dist/agents/runtime/registry.js +56 -0
  67. package/dist/agents/runtime/types.d.ts +117 -0
  68. package/dist/agents/runtime/types.js +29 -0
  69. package/dist/agents/static/code-sampler.d.ts +3 -0
  70. package/dist/agents/static/code-sampler.js +153 -0
  71. package/dist/agents/static/component-detector.d.ts +3 -0
  72. package/dist/agents/static/component-detector.js +404 -0
  73. package/dist/agents/static/connection-mapper.d.ts +3 -0
  74. package/dist/agents/static/connection-mapper.js +280 -0
  75. package/dist/agents/static/doc-parser.d.ts +3 -0
  76. package/dist/agents/static/doc-parser.js +358 -0
  77. package/dist/agents/static/env-detector.d.ts +3 -0
  78. package/dist/agents/static/env-detector.js +73 -0
  79. package/dist/agents/static/event-detector.d.ts +3 -0
  80. package/dist/agents/static/event-detector.js +70 -0
  81. package/dist/agents/static/file-tree-collector.d.ts +3 -0
  82. package/dist/agents/static/file-tree-collector.js +51 -0
  83. package/dist/agents/static/index.d.ts +19 -0
  84. package/dist/agents/static/index.js +307 -0
  85. package/dist/agents/static/infra-analyzer.d.ts +3 -0
  86. package/dist/agents/static/infra-analyzer.js +208 -0
  87. package/dist/agents/static/structure-scanner.d.ts +3 -0
  88. package/dist/agents/static/structure-scanner.js +195 -0
  89. package/dist/agents/static/types.d.ts +165 -0
  90. package/dist/agents/static/types.js +2 -0
  91. package/dist/agents/static/utils.d.ts +21 -0
  92. package/dist/agents/static/utils.js +146 -0
  93. package/dist/agents/static/validator.d.ts +2 -0
  94. package/dist/agents/static/validator.js +75 -0
  95. package/dist/agents/tools/claude-code.d.ts +38 -0
  96. package/dist/agents/tools/claude-code.js +129 -0
  97. package/dist/agents/tools/local-fs.d.ts +12 -0
  98. package/dist/agents/tools/local-fs.js +112 -0
  99. package/dist/agents/tools/tool-definitions.d.ts +6 -0
  100. package/dist/agents/tools/tool-definitions.js +66 -0
  101. package/dist/cli/analyze.d.ts +27 -0
  102. package/dist/cli/analyze.js +586 -0
  103. package/dist/cli/auth.d.ts +46 -0
  104. package/dist/cli/auth.js +397 -0
  105. package/dist/cli/config.d.ts +11 -0
  106. package/dist/cli/config.js +177 -0
  107. package/dist/cli/diff.d.ts +10 -0
  108. package/dist/cli/diff.js +144 -0
  109. package/dist/cli/export.d.ts +10 -0
  110. package/dist/cli/export.js +321 -0
  111. package/dist/cli/gate.d.ts +13 -0
  112. package/dist/cli/gate.js +131 -0
  113. package/dist/cli/generate.d.ts +10 -0
  114. package/dist/cli/generate.js +213 -0
  115. package/dist/cli/license-gate.d.ts +27 -0
  116. package/dist/cli/license-gate.js +121 -0
  117. package/dist/cli/patrol.d.ts +15 -0
  118. package/dist/cli/patrol.js +212 -0
  119. package/dist/cli/run.d.ts +11 -0
  120. package/dist/cli/run.js +24 -0
  121. package/dist/cli/serve.d.ts +9 -0
  122. package/dist/cli/serve.js +65 -0
  123. package/dist/cli/setup.d.ts +1 -0
  124. package/dist/cli/setup.js +233 -0
  125. package/dist/cli/shared.d.ts +68 -0
  126. package/dist/cli/shared.js +275 -0
  127. package/dist/cli/stats.d.ts +9 -0
  128. package/dist/cli/stats.js +158 -0
  129. package/dist/cli/ui.d.ts +18 -0
  130. package/dist/cli/ui.js +144 -0
  131. package/dist/cli/validate.d.ts +54 -0
  132. package/dist/cli/validate.js +315 -0
  133. package/dist/cli/workflow.d.ts +10 -0
  134. package/dist/cli/workflow.js +594 -0
  135. package/dist/server/src/generator/index.d.ts +123 -0
  136. package/dist/server/src/generator/index.js +254 -0
  137. package/dist/server/src/index.d.ts +8 -0
  138. package/dist/server/src/index.js +1311 -0
  139. package/package.json +62 -0
  140. package/ui/dist/assets/index-B66Til39.js +70 -0
  141. package/ui/dist/assets/index-BE2OWbzu.css +1 -0
  142. package/ui/dist/index.html +14 -0
@@ -0,0 +1,70 @@
1
+ (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function o(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=o(a);fetch(a.href,u)}})();function vc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $u={exports:{}},Zi={},Ou={exports:{}},Ae={};/**
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 Jf;function ny(){if(Jf)return Ae;Jf=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function E(M,$,ie){this.props=M,this.context=$,this.refs=N,this.updater=ie||_}E.prototype.isReactComponent={},E.prototype.setState=function(M,$){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,$,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=E.prototype;function I(M,$,ie){this.props=M,this.context=$,this.refs=N,this.updater=ie||_}var C=I.prototype=new k;C.constructor=I,S(C,E.prototype),C.isPureReactComponent=!0;var j=Array.isArray,O=Object.prototype.hasOwnProperty,A={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function q(M,$,ie){var oe,de={},fe=null,me=null;if($!=null)for(oe in $.ref!==void 0&&(me=$.ref),$.key!==void 0&&(fe=""+$.key),$)O.call($,oe)&&!H.hasOwnProperty(oe)&&(de[oe]=$[oe]);var te=arguments.length-2;if(te===1)de.children=ie;else if(1<te){for(var pe=Array(te),Ne=0;Ne<te;Ne++)pe[Ne]=arguments[Ne+2];de.children=pe}if(M&&M.defaultProps)for(oe in te=M.defaultProps,te)de[oe]===void 0&&(de[oe]=te[oe]);return{$$typeof:t,type:M,key:fe,ref:me,props:de,_owner:A.current}}function J(M,$){return{$$typeof:t,type:M.type,key:$,ref:M.ref,props:M.props,_owner:M._owner}}function ee(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function U(M){var $={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ie){return $[ie]})}var X=/\/+/g;function ne(M,$){return typeof M=="object"&&M!==null&&M.key!=null?U(""+M.key):$.toString(36)}function P(M,$,ie,oe,de){var fe=typeof M;(fe==="undefined"||fe==="boolean")&&(M=null);var me=!1;if(M===null)me=!0;else switch(fe){case"string":case"number":me=!0;break;case"object":switch(M.$$typeof){case t:case r:me=!0}}if(me)return me=M,de=de(me),M=oe===""?"."+ne(me,0):oe,j(de)?(ie="",M!=null&&(ie=M.replace(X,"$&/")+"/"),P(de,$,ie,"",function(Ne){return Ne})):de!=null&&(ee(de)&&(de=J(de,ie+(!de.key||me&&me.key===de.key?"":(""+de.key).replace(X,"$&/")+"/")+M)),$.push(de)),1;if(me=0,oe=oe===""?".":oe+":",j(M))for(var te=0;te<M.length;te++){fe=M[te];var pe=oe+ne(fe,te);me+=P(fe,$,ie,pe,de)}else if(pe=v(M),typeof pe=="function")for(M=pe.call(M),te=0;!(fe=M.next()).done;)fe=fe.value,pe=oe+ne(fe,te++),me+=P(fe,$,ie,pe,de);else if(fe==="object")throw $=String(M),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return me}function K(M,$,ie){if(M==null)return M;var oe=[],de=0;return P(M,oe,"","",function(fe){return $.call(ie,fe,de++)}),oe}function V(M){if(M._status===-1){var $=M._result;$=$(),$.then(function(ie){(M._status===0||M._status===-1)&&(M._status=1,M._result=ie)},function(ie){(M._status===0||M._status===-1)&&(M._status=2,M._result=ie)}),M._status===-1&&(M._status=0,M._result=$)}if(M._status===1)return M._result.default;throw M._result}var G={current:null},z={transition:null},R={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:z,ReactCurrentOwner:A};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ae.Children={map:K,forEach:function(M,$,ie){K(M,function(){$.apply(this,arguments)},ie)},count:function(M){var $=0;return K(M,function(){$++}),$},toArray:function(M){return K(M,function($){return $})||[]},only:function(M){if(!ee(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ae.Component=E,Ae.Fragment=o,Ae.Profiler=a,Ae.PureComponent=I,Ae.StrictMode=s,Ae.Suspense=m,Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,Ae.act=B,Ae.cloneElement=function(M,$,ie){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var oe=S({},M.props),de=M.key,fe=M.ref,me=M._owner;if($!=null){if($.ref!==void 0&&(fe=$.ref,me=A.current),$.key!==void 0&&(de=""+$.key),M.type&&M.type.defaultProps)var te=M.type.defaultProps;for(pe in $)O.call($,pe)&&!H.hasOwnProperty(pe)&&(oe[pe]=$[pe]===void 0&&te!==void 0?te[pe]:$[pe])}var pe=arguments.length-2;if(pe===1)oe.children=ie;else if(1<pe){te=Array(pe);for(var Ne=0;Ne<pe;Ne++)te[Ne]=arguments[Ne+2];oe.children=te}return{$$typeof:t,type:M.type,key:de,ref:fe,props:oe,_owner:me}},Ae.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:u,_context:M},M.Consumer=M},Ae.createElement=q,Ae.createFactory=function(M){var $=q.bind(null,M);return $.type=M,$},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(M){return{$$typeof:h,render:M}},Ae.isValidElement=ee,Ae.lazy=function(M){return{$$typeof:x,_payload:{_status:-1,_result:M},_init:V}},Ae.memo=function(M,$){return{$$typeof:g,type:M,compare:$===void 0?null:$}},Ae.startTransition=function(M){var $=z.transition;z.transition={};try{M()}finally{z.transition=$}},Ae.unstable_act=B,Ae.useCallback=function(M,$){return G.current.useCallback(M,$)},Ae.useContext=function(M){return G.current.useContext(M)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(M){return G.current.useDeferredValue(M)},Ae.useEffect=function(M,$){return G.current.useEffect(M,$)},Ae.useId=function(){return G.current.useId()},Ae.useImperativeHandle=function(M,$,ie){return G.current.useImperativeHandle(M,$,ie)},Ae.useInsertionEffect=function(M,$){return G.current.useInsertionEffect(M,$)},Ae.useLayoutEffect=function(M,$){return G.current.useLayoutEffect(M,$)},Ae.useMemo=function(M,$){return G.current.useMemo(M,$)},Ae.useReducer=function(M,$,ie){return G.current.useReducer(M,$,ie)},Ae.useRef=function(M){return G.current.useRef(M)},Ae.useState=function(M){return G.current.useState(M)},Ae.useSyncExternalStore=function(M,$,ie){return G.current.useSyncExternalStore(M,$,ie)},Ae.useTransition=function(){return G.current.useTransition()},Ae.version="18.3.1",Ae}var eh;function ms(){return eh||(eh=1,Ou.exports=ny()),Ou.exports}/**
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 th;function ry(){if(th)return Zi;th=1;var t=ms(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(h,m,g){var x,y={},v=null,_=null;g!==void 0&&(v=""+g),m.key!==void 0&&(v=""+m.key),m.ref!==void 0&&(_=m.ref);for(x in m)s.call(m,x)&&!u.hasOwnProperty(x)&&(y[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)y[x]===void 0&&(y[x]=m[x]);return{$$typeof:r,type:h,key:v,ref:_,props:y,_owner:a.current}}return Zi.Fragment=o,Zi.jsx=c,Zi.jsxs=c,Zi}var nh;function oy(){return nh||(nh=1,$u.exports=ry()),$u.exports}var f=oy(),b=ms();const Np=vc(b);var Cl={},Fu={exports:{}},Ot={},Hu={exports:{}},Vu={};/**
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
+ */var rh;function iy(){return rh||(rh=1,(function(t){function r(z,R){var B=z.length;z.push(R);e:for(;0<B;){var M=B-1>>>1,$=z[M];if(0<a($,R))z[M]=R,z[B]=$,B=M;else break e}}function o(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var R=z[0],B=z.pop();if(B!==R){z[0]=B;e:for(var M=0,$=z.length,ie=$>>>1;M<ie;){var oe=2*(M+1)-1,de=z[oe],fe=oe+1,me=z[fe];if(0>a(de,B))fe<$&&0>a(me,de)?(z[M]=me,z[fe]=B,M=fe):(z[M]=de,z[oe]=B,M=oe);else if(fe<$&&0>a(me,B))z[M]=me,z[fe]=B,M=fe;else break e}}return R}function a(z,R){var B=z.sortIndex-R.sortIndex;return B!==0?B:z.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();t.unstable_now=function(){return c.now()-h}}var m=[],g=[],x=1,y=null,v=3,_=!1,S=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(z){for(var R=o(g);R!==null;){if(R.callback===null)s(g);else if(R.startTime<=z)s(g),R.sortIndex=R.expirationTime,r(m,R);else break;R=o(g)}}function j(z){if(N=!1,C(z),!S)if(o(m)!==null)S=!0,V(O);else{var R=o(g);R!==null&&G(j,R.startTime-z)}}function O(z,R){S=!1,N&&(N=!1,k(q),q=-1),_=!0;var B=v;try{for(C(R),y=o(m);y!==null&&(!(y.expirationTime>R)||z&&!U());){var M=y.callback;if(typeof M=="function"){y.callback=null,v=y.priorityLevel;var $=M(y.expirationTime<=R);R=t.unstable_now(),typeof $=="function"?y.callback=$:y===o(m)&&s(m),C(R)}else s(m);y=o(m)}if(y!==null)var ie=!0;else{var oe=o(g);oe!==null&&G(j,oe.startTime-R),ie=!1}return ie}finally{y=null,v=B,_=!1}}var A=!1,H=null,q=-1,J=5,ee=-1;function U(){return!(t.unstable_now()-ee<J)}function X(){if(H!==null){var z=t.unstable_now();ee=z;var R=!0;try{R=H(!0,z)}finally{R?ne():(A=!1,H=null)}}else A=!1}var ne;if(typeof I=="function")ne=function(){I(X)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,K=P.port2;P.port1.onmessage=X,ne=function(){K.postMessage(null)}}else ne=function(){E(X,0)};function V(z){H=z,A||(A=!0,ne())}function G(z,R){q=E(function(){z(t.unstable_now())},R)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){S||_||(S=!0,V(O))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return o(m)},t.unstable_next=function(z){switch(v){case 1:case 2:case 3:var R=3;break;default:R=v}var B=v;v=R;try{return z()}finally{v=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,R){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=v;v=z;try{return R()}finally{v=B}},t.unstable_scheduleCallback=function(z,R,B){var M=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?M+B:M):B=M,z){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=B+$,z={id:x++,callback:R,priorityLevel:z,startTime:B,expirationTime:$,sortIndex:-1},B>M?(z.sortIndex=B,r(g,z),o(m)===null&&z===o(g)&&(N?(k(q),q=-1):N=!0,G(j,B-M))):(z.sortIndex=$,r(m,z),S||_||(S=!0,V(O))),z},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(z){var R=v;return function(){var B=v;v=R;try{return z.apply(this,arguments)}finally{v=B}}}})(Vu)),Vu}var oh;function sy(){return oh||(oh=1,Hu.exports=iy()),Hu.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 ih;function ly(){if(ih)return Ot;ih=1;var t=ms(),r=sy();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function u(e,n){c(e,n),c(e+"Capture",n)}function c(e,n){for(a[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[: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]*$/,x={},y={};function v(e){return m.call(y,e)?!0:m.call(x,e)?!1:g.test(e)?y[e]=!0:(x[e]=!0,!1)}function _(e,n,i,l){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function S(e,n,i,l){if(n===null||typeof n>"u"||_(e,n,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function N(e,n,i,l,d,p,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=w}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new N(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];E[n]=new N(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new N(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new N(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){E[e]=new N(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new N(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new N(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new N(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new N(e,5,!1,e.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function I(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 n=e.replace(k,I);E[n]=new N(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(k,I);E[n]=new N(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(k,I);E[n]=new N(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new N(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new N(e,1,!1,e.toLowerCase(),null,!0,!0)});function C(e,n,i,l){var d=E.hasOwnProperty(n)?E[n]:null;(d!==null?d.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(S(n,i,d,l)&&(i=null),l||d===null?v(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(n=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(n):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,n,i):e.setAttribute(n,i))))}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),A=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),U=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),z=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,M;function $(e){if(M===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);M=n&&n[1]||""}return`
34
+ `+M+e}var ie=!1;function oe(e,n){if(!e||ie)return"";ie=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(Z){var l=Z}Reflect.construct(e,[],n)}else{try{n.call()}catch(Z){l=Z}e.call(n.prototype)}else{try{throw Error()}catch(Z){l=Z}e()}}catch(Z){if(Z&&l&&typeof Z.stack=="string"){for(var d=Z.stack.split(`
35
+ `),p=l.stack.split(`
36
+ `),w=d.length-1,T=p.length-1;1<=w&&0<=T&&d[w]!==p[T];)T--;for(;1<=w&&0<=T;w--,T--)if(d[w]!==p[T]){if(w!==1||T!==1)do if(w--,T--,0>T||d[w]!==p[T]){var D=`
37
+ `+d[w].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=w&&0<=T);break}}}finally{ie=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?$(e):""}function de(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return""}}function fe(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 H:return"Fragment";case A:return"Portal";case J:return"Profiler";case q:return"StrictMode";case ne:return"Suspense";case P:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case X:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case V:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}function me(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(n);case 8:return n===q?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pe(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ne(e){var n=pe(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(w){l=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function be(e){e._valueTracker||(e._valueTracker=Ne(e))}function Ce(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=pe(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function ke(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 ze(e,n){var i=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function De(e,n){var i=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;i=te(n.value!=null?n.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Te(e,n){n=n.checked,n!=null&&C(e,"checked",n,!1)}function Xe(e,n){Te(e,n);var i=te(n.value),l=n.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?ut(e,n.type,i):n.hasOwnProperty("defaultValue")&&ut(e,n.type,te(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Ct(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function ut(e,n,i){(n!=="number"||ke(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var _t=Array.isArray;function It(e,n,i,l){if(e=e.options,n){n={};for(var d=0;d<i.length;d++)n["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=n.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+te(i),n=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function st(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dn(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(o(92));if(_t(i)){if(1<i.length)throw Error(o(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:te(i)}}function Kn(e,n){var i=te(n.value),l=te(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Qn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function qt(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 Zt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?qt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var In,Jt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(n,i,l,d)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(In=In||document.createElement("div"),In.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=In.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function fn(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var Tt={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},en=["Webkit","ms","Moz","O"];Object.keys(Tt).forEach(function(e){en.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Tt[n]=Tt[e]})});function yr(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Tt.hasOwnProperty(e)&&Tt[e]?(""+n).trim():n+"px"}function Xr(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=yr(i,n[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Tn=B({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 qn(e,n){if(n){if(Tn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function Gr(e,n){if(e.indexOf("-")===-1)return typeof n.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 Kr=null;function Zn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jn=null,xt=null,zn=null;function jt(e){if(e=Di(e)){if(typeof Jn!="function")throw Error(o(280));var n=e.stateNode;n&&(n=Fs(n),Jn(e.stateNode,e.type,n))}}function Qr(e){xt?zn?zn.push(e):zn=[e]:xt=e}function ct(){if(xt){var e=xt,n=zn;if(zn=xt=null,jt(e),n)for(e=0;e<n.length;e++)jt(n[e])}}function _o(e,n){return e(n)}function qr(){}var tn=!1;function Rn(e,n,i){if(tn)return e(n,i);tn=!0;try{return _o(e,n,i)}finally{tn=!1,(xt!==null||zn!==null)&&(qr(),ct())}}function An(e,n){var i=e.stateNode;if(i===null)return null;var l=Fs(i);if(l===null)return null;i=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,n,typeof i));return i}var hn=!1;if(h)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){hn=!0}}),window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch{hn=!1}function yi(e,n,i,l,d,p,w,T,D){var Z=Array.prototype.slice.call(arguments,3);try{n.apply(i,Z)}catch(ae){this.onError(ae)}}var nn=!1,qe=null,vr=!1,mn=null,jo={onError:function(e){nn=!0,qe=e}};function bo(e,n,i,l,d,p,w,T,D){nn=!1,qe=null,yi.apply(jo,arguments)}function rn(e,n,i,l,d,p,w,T,D){if(bo.apply(this,arguments),nn){if(nn){var Z=qe;nn=!1,qe=null}else throw Error(o(198));vr||(vr=!0,mn=Z)}}function wt(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function Zr(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Jr(e){if(wt(e)!==e)throw Error(o(188))}function vi(e){var n=e.alternate;if(!n){if(n=wt(e),n===null)throw Error(o(188));return n!==e?null:e}for(var i=e,l=n;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Jr(d),e;if(p===l)return Jr(d),n;p=p.sibling}throw Error(o(188))}if(i.return!==l.return)i=d,l=p;else{for(var w=!1,T=d.child;T;){if(T===i){w=!0,i=d,l=p;break}if(T===l){w=!0,l=d,i=p;break}T=T.sibling}if(!w){for(T=p.child;T;){if(T===i){w=!0,i=p,l=d;break}if(T===l){w=!0,l=p,i=d;break}T=T.sibling}if(!w)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:n}function Po(e){return e=vi(e),e!==null?Mo(e):null}function Mo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Mo(e);if(n!==null)return n;e=e.sibling}return null}var Io=r.unstable_scheduleCallback,eo=r.unstable_cancelCallback,to=r.unstable_shouldYield,xr=r.unstable_requestPaint,Ge=r.unstable_now,wr=r.unstable_getCurrentPriorityLevel,no=r.unstable_ImmediatePriority,To=r.unstable_UserBlockingPriority,gn=r.unstable_NormalPriority,Ue=r.unstable_LowPriority,zo=r.unstable_IdlePriority,er=null,zt=null;function xi(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(er,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:ki,wi=Math.log,Si=Math.LN2;function ki(e){return e>>>=0,e===0?32:31-(wi(e)/Si|0)|0}var Ln=64,Sr=4194304;function Vt(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 tr(e,n){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,w=i&268435455;if(w!==0){var T=w&~d;T!==0?l=Vt(T):(p&=w,p!==0&&(l=Vt(p)))}else w=i&~d,w!==0?l=Vt(w):p!==0&&(l=Vt(p));if(l===0)return 0;if(n!==0&&n!==l&&(n&d)===0&&(d=l&-l,p=n&-n,d>=p||d===16&&(p&4194240)!==0))return n;if((l&4)!==0&&(l|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)i=31-bt(n),d=1<<i,l|=e[i],n&=~d;return l}function Ro(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 Ao(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var w=31-bt(p),T=1<<w,D=d[w];D===-1?((T&i)===0||(T&l)!==0)&&(d[w]=Ro(T,n)):D<=n&&(e.expiredLanes|=T),p&=~T}}function kr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nr(){var e=Ln;return Ln<<=1,(Ln&4194240)===0&&(Ln=64),e}function yn(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function vn(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-bt(n),e[n]=i}function Lo(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-bt(i),p=1<<d;n[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ei(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-bt(i),d=1<<l;d&n|e[l]&n&&(e[l]|=n),i&=~d}}var Be=0;function Es(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Er,Ni,Ns,Cs,_s,Ci=!1,rr=[],Dn=null,$n=null,On=null,or=new Map,Nr=new Map,xn=[],js="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 L(e,n){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":$n=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":or.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nr.delete(n.pointerId)}}function W(e,n,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},n!==null&&(n=Di(n),n!==null&&Ni(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function re(e,n,i,l,d){switch(n){case"focusin":return Dn=W(Dn,e,n,i,l,d),!0;case"dragenter":return $n=W($n,e,n,i,l,d),!0;case"mouseover":return On=W(On,e,n,i,l,d),!0;case"pointerover":var p=d.pointerId;return or.set(p,W(or.get(p)||null,e,n,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Nr.set(p,W(Nr.get(p)||null,e,n,i,l,d)),!0}return!1}function le(e){var n=ro(e.target);if(n!==null){var i=wt(n);if(i!==null){if(n=i.tag,n===13){if(n=Zr(i),n!==null){e.blockedOn=n,_s(e.priority,function(){Ns(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ue(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Cr(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Kr=l,i.target.dispatchEvent(l),Kr=null}else return n=Di(i),n!==null&&Ni(n),e.blockedOn=i,!1;n.shift()}return!0}function ye(e,n,i){ue(e)&&i.delete(n)}function Re(){Ci=!1,Dn!==null&&ue(Dn)&&(Dn=null),$n!==null&&ue($n)&&($n=null),On!==null&&ue(On)&&(On=null),or.forEach(ye),Nr.forEach(ye)}function Pe(e,n){e.blockedOn===n&&(e.blockedOn=null,Ci||(Ci=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Re)))}function Le(e){function n(d){return Pe(d,e)}if(0<rr.length){Pe(rr[0],e);for(var i=1;i<rr.length;i++){var l=rr[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Dn!==null&&Pe(Dn,e),$n!==null&&Pe($n,e),On!==null&&Pe(On,e),or.forEach(n),Nr.forEach(n),i=0;i<xn.length;i++)l=xn[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<xn.length&&(i=xn[0],i.blockedOn===null);)le(i),i.blockedOn===null&&xn.shift()}var $e=j.ReactCurrentBatchConfig,We=!0;function ht(e,n,i,l){var d=Be,p=$e.transition;$e.transition=null;try{Be=1,rt(e,n,i,l)}finally{Be=d,$e.transition=p}}function Oe(e,n,i,l){var d=Be,p=$e.transition;$e.transition=null;try{Be=4,rt(e,n,i,l)}finally{Be=d,$e.transition=p}}function rt(e,n,i,l){if(We){var d=Cr(e,n,i,l);if(d===null)ba(e,n,l,Bt,i),L(e,l);else if(re(d,e,n,i,l))l.stopPropagation();else if(L(e,l),n&4&&-1<js.indexOf(e)){for(;d!==null;){var p=Di(d);if(p!==null&&Er(p),p=Cr(e,n,i,l),p===null&&ba(e,n,l,Bt,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else ba(e,n,l,null,i)}}var Bt=null;function Cr(e,n,i,l){if(Bt=null,e=Zn(l),e=ro(e),e!==null)if(n=wt(e),n===null)e=null;else if(i=n.tag,i===13){if(e=Zr(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Bt=e,null}function bs(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(wr()){case no:return 1;case To:return 4;case gn:case Ue:return 16;case zo:return 536870912;default:return 16}default:return 16}}var _r=null,fa=null,Ps=null;function Oc(){if(Ps)return Ps;var e,n=fa,i=n.length,l,d="value"in _r?_r.value:_r.textContent,p=d.length;for(e=0;e<i&&n[e]===d[e];e++);var w=i-e;for(l=1;l<=w&&n[i-l]===d[p-l];l++);return Ps=d.slice(e,1<l?1-l:void 0)}function Ms(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Is(){return!0}function Fc(){return!1}function Wt(e){function n(i,l,d,p,w){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(i=e[T],this[T]=i?i(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Is:Fc,this.isPropagationStopped=Fc,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Is)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),n}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ha=Wt(Do),_i=B({},Do,{view:0,detail:0}),Pg=Wt(_i),pa,ma,ji,Ts=B({},_i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ya,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!==ji&&(ji&&e.type==="mousemove"?(pa=e.screenX-ji.screenX,ma=e.screenY-ji.screenY):ma=pa=0,ji=e),pa)},movementY:function(e){return"movementY"in e?e.movementY:ma}}),Hc=Wt(Ts),Mg=B({},Ts,{dataTransfer:0}),Ig=Wt(Mg),Tg=B({},_i,{relatedTarget:0}),ga=Wt(Tg),zg=B({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),Rg=Wt(zg),Ag=B({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lg=Wt(Ag),Dg=B({},Do,{data:0}),Vc=Wt(Dg),$g={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Og={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"},Fg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hg(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Fg[e])?!!n[e]:!1}function ya(){return Hg}var Vg=B({},_i,{key:function(e){if(e.key){var n=$g[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Og[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ya,charCode:function(e){return e.type==="keypress"?Ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bg=Wt(Vg),Wg=B({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bc=Wt(Wg),Ug=B({},_i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ya}),Yg=Wt(Ug),Xg=B({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gg=Wt(Xg),Kg=B({},Ts,{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}),Qg=Wt(Kg),qg=[9,13,27,32],va=h&&"CompositionEvent"in window,bi=null;h&&"documentMode"in document&&(bi=document.documentMode);var Zg=h&&"TextEvent"in window&&!bi,Wc=h&&(!va||bi&&8<bi&&11>=bi),Uc=" ",Yc=!1;function Xc(e,n){switch(e){case"keyup":return qg.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $o=!1;function Jg(e,n){switch(e){case"compositionend":return Gc(n);case"keypress":return n.which!==32?null:(Yc=!0,Uc);case"textInput":return e=n.data,e===Uc&&Yc?null:e;default:return null}}function e0(e,n){if($o)return e==="compositionend"||!va&&Xc(e,n)?(e=Oc(),Ps=fa=_r=null,$o=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Wc&&n.locale!=="ko"?null:n.data;default:return null}}var t0={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 Kc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!t0[e.type]:n==="textarea"}function Qc(e,n,i,l){Qr(l),n=Ds(n,"onChange"),0<n.length&&(i=new ha("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var Pi=null,Mi=null;function n0(e){pd(e,0)}function zs(e){var n=Bo(e);if(Ce(n))return e}function r0(e,n){if(e==="change")return n}var qc=!1;if(h){var xa;if(h){var wa="oninput"in document;if(!wa){var Zc=document.createElement("div");Zc.setAttribute("oninput","return;"),wa=typeof Zc.oninput=="function"}xa=wa}else xa=!1;qc=xa&&(!document.documentMode||9<document.documentMode)}function Jc(){Pi&&(Pi.detachEvent("onpropertychange",ed),Mi=Pi=null)}function ed(e){if(e.propertyName==="value"&&zs(Mi)){var n=[];Qc(n,Mi,e,Zn(e)),Rn(n0,n)}}function o0(e,n,i){e==="focusin"?(Jc(),Pi=n,Mi=i,Pi.attachEvent("onpropertychange",ed)):e==="focusout"&&Jc()}function i0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zs(Mi)}function s0(e,n){if(e==="click")return zs(n)}function l0(e,n){if(e==="input"||e==="change")return zs(n)}function a0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var wn=typeof Object.is=="function"?Object.is:a0;function Ii(e,n){if(wn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(n,d)||!wn(e[d],n[d]))return!1}return!0}function td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nd(e,n){var i=td(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=td(i)}}function rd(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?rd(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function od(){for(var e=window,n=ke();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=ke(e.document)}return n}function Sa(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function u0(e){var n=od(),i=e.focusedElem,l=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&rd(i.ownerDocument.documentElement,i)){if(l!==null&&Sa(i)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=nd(i,p);var w=nd(i,l);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var c0=h&&"documentMode"in document&&11>=document.documentMode,Oo=null,ka=null,Ti=null,Ea=!1;function id(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ea||Oo==null||Oo!==ke(l)||(l=Oo,"selectionStart"in l&&Sa(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ti&&Ii(Ti,l)||(Ti=l,l=Ds(ka,"onSelect"),0<l.length&&(n=new ha("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=Oo)))}function Rs(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Fo={animationend:Rs("Animation","AnimationEnd"),animationiteration:Rs("Animation","AnimationIteration"),animationstart:Rs("Animation","AnimationStart"),transitionend:Rs("Transition","TransitionEnd")},Na={},sd={};h&&(sd=document.createElement("div").style,"AnimationEvent"in window||(delete Fo.animationend.animation,delete Fo.animationiteration.animation,delete Fo.animationstart.animation),"TransitionEvent"in window||delete Fo.transitionend.transition);function As(e){if(Na[e])return Na[e];if(!Fo[e])return e;var n=Fo[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in sd)return Na[e]=n[i];return e}var ld=As("animationend"),ad=As("animationiteration"),ud=As("animationstart"),cd=As("transitionend"),dd=new Map,fd="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 jr(e,n){dd.set(e,n),u(n,[e])}for(var Ca=0;Ca<fd.length;Ca++){var _a=fd[Ca],d0=_a.toLowerCase(),f0=_a[0].toUpperCase()+_a.slice(1);jr(d0,"on"+f0)}jr(ld,"onAnimationEnd"),jr(ad,"onAnimationIteration"),jr(ud,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(cd,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),h0=new Set("cancel close invalid load scroll toggle".split(" ").concat(zi));function hd(e,n,i){var l=e.type||"unknown-event";e.currentTarget=i,rn(l,n,void 0,e),e.currentTarget=null}function pd(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(n)for(var w=l.length-1;0<=w;w--){var T=l[w],D=T.instance,Z=T.currentTarget;if(T=T.listener,D!==p&&d.isPropagationStopped())break e;hd(d,T,Z),p=D}else for(w=0;w<l.length;w++){if(T=l[w],D=T.instance,Z=T.currentTarget,T=T.listener,D!==p&&d.isPropagationStopped())break e;hd(d,T,Z),p=D}}}if(vr)throw e=mn,vr=!1,mn=null,e}function Ke(e,n){var i=n[Ra];i===void 0&&(i=n[Ra]=new Set);var l=e+"__bubble";i.has(l)||(md(n,e,2,!1),i.add(l))}function ja(e,n,i){var l=0;n&&(l|=4),md(i,e,l,n)}var Ls="_reactListening"+Math.random().toString(36).slice(2);function Ri(e){if(!e[Ls]){e[Ls]=!0,s.forEach(function(i){i!=="selectionchange"&&(h0.has(i)||ja(i,!1,e),ja(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ls]||(n[Ls]=!0,ja("selectionchange",!1,n))}}function md(e,n,i,l){switch(bs(n)){case 1:var d=ht;break;case 4:d=Oe;break;default:d=rt}i=d.bind(null,n,i,e),d=void 0,!hn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(n,i,{capture:!0,passive:d}):e.addEventListener(n,i,!0):d!==void 0?e.addEventListener(n,i,{passive:d}):e.addEventListener(n,i,!1)}function ba(e,n,i,l,d){var p=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var T=l.stateNode.containerInfo;if(T===d||T.nodeType===8&&T.parentNode===d)break;if(w===4)for(w=l.return;w!==null;){var D=w.tag;if((D===3||D===4)&&(D=w.stateNode.containerInfo,D===d||D.nodeType===8&&D.parentNode===d))return;w=w.return}for(;T!==null;){if(w=ro(T),w===null)return;if(D=w.tag,D===5||D===6){l=p=w;continue e}T=T.parentNode}}l=l.return}Rn(function(){var Z=p,ae=Zn(i),ce=[];e:{var se=dd.get(e);if(se!==void 0){var ge=ha,xe=e;switch(e){case"keypress":if(Ms(i)===0)break e;case"keydown":case"keyup":ge=Bg;break;case"focusin":xe="focus",ge=ga;break;case"focusout":xe="blur",ge=ga;break;case"beforeblur":case"afterblur":ge=ga;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Ig;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Yg;break;case ld:case ad:case ud:ge=Rg;break;case cd:ge=Gg;break;case"scroll":ge=Pg;break;case"wheel":ge=Qg;break;case"copy":case"cut":case"paste":ge=Lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Bc}var we=(n&4)!==0,it=!we&&e==="scroll",Y=we?se!==null?se+"Capture":null:se;we=[];for(var F=Z,Q;F!==null;){Q=F;var he=Q.stateNode;if(Q.tag===5&&he!==null&&(Q=he,Y!==null&&(he=An(F,Y),he!=null&&we.push(Ai(F,he,Q)))),it)break;F=F.return}0<we.length&&(se=new ge(se,xe,null,i,ae),ce.push({event:se,listeners:we}))}}if((n&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ge=e==="mouseout"||e==="pointerout",se&&i!==Kr&&(xe=i.relatedTarget||i.fromElement)&&(ro(xe)||xe[ir]))break e;if((ge||se)&&(se=ae.window===ae?ae:(se=ae.ownerDocument)?se.defaultView||se.parentWindow:window,ge?(xe=i.relatedTarget||i.toElement,ge=Z,xe=xe?ro(xe):null,xe!==null&&(it=wt(xe),xe!==it||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ge=null,xe=Z),ge!==xe)){if(we=Hc,he="onMouseLeave",Y="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(we=Bc,he="onPointerLeave",Y="onPointerEnter",F="pointer"),it=ge==null?se:Bo(ge),Q=xe==null?se:Bo(xe),se=new we(he,F+"leave",ge,i,ae),se.target=it,se.relatedTarget=Q,he=null,ro(ae)===Z&&(we=new we(Y,F+"enter",xe,i,ae),we.target=Q,we.relatedTarget=it,he=we),it=he,ge&&xe)t:{for(we=ge,Y=xe,F=0,Q=we;Q;Q=Ho(Q))F++;for(Q=0,he=Y;he;he=Ho(he))Q++;for(;0<F-Q;)we=Ho(we),F--;for(;0<Q-F;)Y=Ho(Y),Q--;for(;F--;){if(we===Y||Y!==null&&we===Y.alternate)break t;we=Ho(we),Y=Ho(Y)}we=null}else we=null;ge!==null&&gd(ce,se,ge,we,!1),xe!==null&&it!==null&&gd(ce,it,xe,we,!0)}}e:{if(se=Z?Bo(Z):window,ge=se.nodeName&&se.nodeName.toLowerCase(),ge==="select"||ge==="input"&&se.type==="file")var Se=r0;else if(Kc(se))if(qc)Se=l0;else{Se=i0;var _e=o0}else(ge=se.nodeName)&&ge.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(Se=s0);if(Se&&(Se=Se(e,Z))){Qc(ce,Se,i,ae);break e}_e&&_e(e,se,Z),e==="focusout"&&(_e=se._wrapperState)&&_e.controlled&&se.type==="number"&&ut(se,"number",se.value)}switch(_e=Z?Bo(Z):window,e){case"focusin":(Kc(_e)||_e.contentEditable==="true")&&(Oo=_e,ka=Z,Ti=null);break;case"focusout":Ti=ka=Oo=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,id(ce,i,ae);break;case"selectionchange":if(c0)break;case"keydown":case"keyup":id(ce,i,ae)}var je;if(va)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else $o?Xc(e,i)&&(Ie="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ie="onCompositionStart");Ie&&(Wc&&i.locale!=="ko"&&($o||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&$o&&(je=Oc()):(_r=ae,fa="value"in _r?_r.value:_r.textContent,$o=!0)),_e=Ds(Z,Ie),0<_e.length&&(Ie=new Vc(Ie,e,null,i,ae),ce.push({event:Ie,listeners:_e}),je?Ie.data=je:(je=Gc(i),je!==null&&(Ie.data=je)))),(je=Zg?Jg(e,i):e0(e,i))&&(Z=Ds(Z,"onBeforeInput"),0<Z.length&&(ae=new Vc("onBeforeInput","beforeinput",null,i,ae),ce.push({event:ae,listeners:Z}),ae.data=je))}pd(ce,n)})}function Ai(e,n,i){return{instance:e,listener:n,currentTarget:i}}function Ds(e,n){for(var i=n+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=An(e,i),p!=null&&l.unshift(Ai(e,p,d)),p=An(e,n),p!=null&&l.push(Ai(e,p,d))),e=e.return}return l}function Ho(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gd(e,n,i,l,d){for(var p=n._reactName,w=[];i!==null&&i!==l;){var T=i,D=T.alternate,Z=T.stateNode;if(D!==null&&D===l)break;T.tag===5&&Z!==null&&(T=Z,d?(D=An(i,p),D!=null&&w.unshift(Ai(i,D,T))):d||(D=An(i,p),D!=null&&w.push(Ai(i,D,T)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var p0=/\r\n?/g,m0=/\u0000|\uFFFD/g;function yd(e){return(typeof e=="string"?e:""+e).replace(p0,`
38
+ `).replace(m0,"")}function $s(e,n,i){if(n=yd(n),yd(e)!==n&&i)throw Error(o(425))}function Os(){}var Pa=null,Ma=null;function Ia(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ta=typeof setTimeout=="function"?setTimeout:void 0,g0=typeof clearTimeout=="function"?clearTimeout:void 0,vd=typeof Promise=="function"?Promise:void 0,y0=typeof queueMicrotask=="function"?queueMicrotask:typeof vd<"u"?function(e){return vd.resolve(null).then(e).catch(v0)}:Ta;function v0(e){setTimeout(function(){throw e})}function za(e,n){var i=n,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Le(n);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Le(n)}function br(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function xd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Vo=Math.random().toString(36).slice(2),Fn="__reactFiber$"+Vo,Li="__reactProps$"+Vo,ir="__reactContainer$"+Vo,Ra="__reactEvents$"+Vo,x0="__reactListeners$"+Vo,w0="__reactHandles$"+Vo;function ro(e){var n=e[Fn];if(n)return n;for(var i=e.parentNode;i;){if(n=i[ir]||i[Fn]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=xd(e);e!==null;){if(i=e[Fn])return i;e=xd(e)}return n}e=i,i=e.parentNode}return null}function Di(e){return e=e[Fn]||e[ir],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Fs(e){return e[Li]||null}var Aa=[],Wo=-1;function Pr(e){return{current:e}}function Qe(e){0>Wo||(e.current=Aa[Wo],Aa[Wo]=null,Wo--)}function Ye(e,n){Wo++,Aa[Wo]=e.current,e.current=n}var Mr={},St=Pr(Mr),Rt=Pr(!1),oo=Mr;function Uo(e,n){var i=e.type.contextTypes;if(!i)return Mr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function At(e){return e=e.childContextTypes,e!=null}function Hs(){Qe(Rt),Qe(St)}function wd(e,n,i){if(St.current!==Mr)throw Error(o(168));Ye(St,n),Ye(Rt,i)}function Sd(e,n,i){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in n))throw Error(o(108,me(e)||"Unknown",d));return B({},i,l)}function Vs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mr,oo=St.current,Ye(St,e),Ye(Rt,Rt.current),!0}function kd(e,n,i){var l=e.stateNode;if(!l)throw Error(o(169));i?(e=Sd(e,n,oo),l.__reactInternalMemoizedMergedChildContext=e,Qe(Rt),Qe(St),Ye(St,e)):Qe(Rt),Ye(Rt,i)}var sr=null,Bs=!1,La=!1;function Ed(e){sr===null?sr=[e]:sr.push(e)}function S0(e){Bs=!0,Ed(e)}function Ir(){if(!La&&sr!==null){La=!0;var e=0,n=Be;try{var i=sr;for(Be=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}sr=null,Bs=!1}catch(d){throw sr!==null&&(sr=sr.slice(e+1)),Io(no,Ir),d}finally{Be=n,La=!1}}return null}var Yo=[],Xo=0,Ws=null,Us=0,on=[],sn=0,io=null,lr=1,ar="";function so(e,n){Yo[Xo++]=Us,Yo[Xo++]=Ws,Ws=e,Us=n}function Nd(e,n,i){on[sn++]=lr,on[sn++]=ar,on[sn++]=io,io=e;var l=lr;e=ar;var d=32-bt(l)-1;l&=~(1<<d),i+=1;var p=32-bt(n)+d;if(30<p){var w=d-d%5;p=(l&(1<<w)-1).toString(32),l>>=w,d-=w,lr=1<<32-bt(n)+d|i<<d|l,ar=p+e}else lr=1<<p|i<<d|l,ar=e}function Da(e){e.return!==null&&(so(e,1),Nd(e,1,0))}function $a(e){for(;e===Ws;)Ws=Yo[--Xo],Yo[Xo]=null,Us=Yo[--Xo],Yo[Xo]=null;for(;e===io;)io=on[--sn],on[sn]=null,ar=on[--sn],on[sn]=null,lr=on[--sn],on[sn]=null}var Ut=null,Yt=null,Ze=!1,Sn=null;function Cd(e,n){var i=cn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function _d(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Ut=e,Yt=br(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Ut=e,Yt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=io!==null?{id:lr,overflow:ar}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=cn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Ut=e,Yt=null,!0):!1;default:return!1}}function Oa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fa(e){if(Ze){var n=Yt;if(n){var i=n;if(!_d(e,n)){if(Oa(e))throw Error(o(418));n=br(i.nextSibling);var l=Ut;n&&_d(e,n)?Cd(l,i):(e.flags=e.flags&-4097|2,Ze=!1,Ut=e)}}else{if(Oa(e))throw Error(o(418));e.flags=e.flags&-4097|2,Ze=!1,Ut=e}}}function jd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ut=e}function Ys(e){if(e!==Ut)return!1;if(!Ze)return jd(e),Ze=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ia(e.type,e.memoizedProps)),n&&(n=Yt)){if(Oa(e))throw bd(),Error(o(418));for(;n;)Cd(e,n),n=br(n.nextSibling)}if(jd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){Yt=br(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Yt=null}}else Yt=Ut?br(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=Yt;e;)e=br(e.nextSibling)}function Go(){Yt=Ut=null,Ze=!1}function Ha(e){Sn===null?Sn=[e]:Sn.push(e)}var k0=j.ReactCurrentBatchConfig;function $i(e,n,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(o(309));var l=i.stateNode}if(!l)throw Error(o(147,e));var d=l,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(w){var T=d.refs;w===null?delete T[p]:T[p]=w},n._stringRef=p,n)}if(typeof e!="string")throw Error(o(284));if(!i._owner)throw Error(o(290,e))}return e}function Xs(e,n){throw e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Pd(e){var n=e._init;return n(e._payload)}function Md(e){function n(Y,F){if(e){var Q=Y.deletions;Q===null?(Y.deletions=[F],Y.flags|=16):Q.push(F)}}function i(Y,F){if(!e)return null;for(;F!==null;)n(Y,F),F=F.sibling;return null}function l(Y,F){for(Y=new Map;F!==null;)F.key!==null?Y.set(F.key,F):Y.set(F.index,F),F=F.sibling;return Y}function d(Y,F){return Y=Or(Y,F),Y.index=0,Y.sibling=null,Y}function p(Y,F,Q){return Y.index=Q,e?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<F?(Y.flags|=2,F):Q):(Y.flags|=2,F)):(Y.flags|=1048576,F)}function w(Y){return e&&Y.alternate===null&&(Y.flags|=2),Y}function T(Y,F,Q,he){return F===null||F.tag!==6?(F=Tu(Q,Y.mode,he),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function D(Y,F,Q,he){var Se=Q.type;return Se===H?ae(Y,F,Q.props.children,he,Q.key):F!==null&&(F.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&Pd(Se)===F.type)?(he=d(F,Q.props),he.ref=$i(Y,F,Q),he.return=Y,he):(he=yl(Q.type,Q.key,Q.props,null,Y.mode,he),he.ref=$i(Y,F,Q),he.return=Y,he)}function Z(Y,F,Q,he){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=zu(Q,Y.mode,he),F.return=Y,F):(F=d(F,Q.children||[]),F.return=Y,F)}function ae(Y,F,Q,he,Se){return F===null||F.tag!==7?(F=mo(Q,Y.mode,he,Se),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function ce(Y,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number")return F=Tu(""+F,Y.mode,Q),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case O:return Q=yl(F.type,F.key,F.props,null,Y.mode,Q),Q.ref=$i(Y,null,F),Q.return=Y,Q;case A:return F=zu(F,Y.mode,Q),F.return=Y,F;case V:var he=F._init;return ce(Y,he(F._payload),Q)}if(_t(F)||R(F))return F=mo(F,Y.mode,Q,null),F.return=Y,F;Xs(Y,F)}return null}function se(Y,F,Q,he){var Se=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Se!==null?null:T(Y,F,""+Q,he);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case O:return Q.key===Se?D(Y,F,Q,he):null;case A:return Q.key===Se?Z(Y,F,Q,he):null;case V:return Se=Q._init,se(Y,F,Se(Q._payload),he)}if(_t(Q)||R(Q))return Se!==null?null:ae(Y,F,Q,he,null);Xs(Y,Q)}return null}function ge(Y,F,Q,he,Se){if(typeof he=="string"&&he!==""||typeof he=="number")return Y=Y.get(Q)||null,T(F,Y,""+he,Se);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case O:return Y=Y.get(he.key===null?Q:he.key)||null,D(F,Y,he,Se);case A:return Y=Y.get(he.key===null?Q:he.key)||null,Z(F,Y,he,Se);case V:var _e=he._init;return ge(Y,F,Q,_e(he._payload),Se)}if(_t(he)||R(he))return Y=Y.get(Q)||null,ae(F,Y,he,Se,null);Xs(F,he)}return null}function xe(Y,F,Q,he){for(var Se=null,_e=null,je=F,Ie=F=0,gt=null;je!==null&&Ie<Q.length;Ie++){je.index>Ie?(gt=je,je=null):gt=je.sibling;var Ve=se(Y,je,Q[Ie],he);if(Ve===null){je===null&&(je=gt);break}e&&je&&Ve.alternate===null&&n(Y,je),F=p(Ve,F,Ie),_e===null?Se=Ve:_e.sibling=Ve,_e=Ve,je=gt}if(Ie===Q.length)return i(Y,je),Ze&&so(Y,Ie),Se;if(je===null){for(;Ie<Q.length;Ie++)je=ce(Y,Q[Ie],he),je!==null&&(F=p(je,F,Ie),_e===null?Se=je:_e.sibling=je,_e=je);return Ze&&so(Y,Ie),Se}for(je=l(Y,je);Ie<Q.length;Ie++)gt=ge(je,Y,Ie,Q[Ie],he),gt!==null&&(e&&gt.alternate!==null&&je.delete(gt.key===null?Ie:gt.key),F=p(gt,F,Ie),_e===null?Se=gt:_e.sibling=gt,_e=gt);return e&&je.forEach(function(Fr){return n(Y,Fr)}),Ze&&so(Y,Ie),Se}function we(Y,F,Q,he){var Se=R(Q);if(typeof Se!="function")throw Error(o(150));if(Q=Se.call(Q),Q==null)throw Error(o(151));for(var _e=Se=null,je=F,Ie=F=0,gt=null,Ve=Q.next();je!==null&&!Ve.done;Ie++,Ve=Q.next()){je.index>Ie?(gt=je,je=null):gt=je.sibling;var Fr=se(Y,je,Ve.value,he);if(Fr===null){je===null&&(je=gt);break}e&&je&&Fr.alternate===null&&n(Y,je),F=p(Fr,F,Ie),_e===null?Se=Fr:_e.sibling=Fr,_e=Fr,je=gt}if(Ve.done)return i(Y,je),Ze&&so(Y,Ie),Se;if(je===null){for(;!Ve.done;Ie++,Ve=Q.next())Ve=ce(Y,Ve.value,he),Ve!==null&&(F=p(Ve,F,Ie),_e===null?Se=Ve:_e.sibling=Ve,_e=Ve);return Ze&&so(Y,Ie),Se}for(je=l(Y,je);!Ve.done;Ie++,Ve=Q.next())Ve=ge(je,Y,Ie,Ve.value,he),Ve!==null&&(e&&Ve.alternate!==null&&je.delete(Ve.key===null?Ie:Ve.key),F=p(Ve,F,Ie),_e===null?Se=Ve:_e.sibling=Ve,_e=Ve);return e&&je.forEach(function(ty){return n(Y,ty)}),Ze&&so(Y,Ie),Se}function it(Y,F,Q,he){if(typeof Q=="object"&&Q!==null&&Q.type===H&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case O:e:{for(var Se=Q.key,_e=F;_e!==null;){if(_e.key===Se){if(Se=Q.type,Se===H){if(_e.tag===7){i(Y,_e.sibling),F=d(_e,Q.props.children),F.return=Y,Y=F;break e}}else if(_e.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&Pd(Se)===_e.type){i(Y,_e.sibling),F=d(_e,Q.props),F.ref=$i(Y,_e,Q),F.return=Y,Y=F;break e}i(Y,_e);break}else n(Y,_e);_e=_e.sibling}Q.type===H?(F=mo(Q.props.children,Y.mode,he,Q.key),F.return=Y,Y=F):(he=yl(Q.type,Q.key,Q.props,null,Y.mode,he),he.ref=$i(Y,F,Q),he.return=Y,Y=he)}return w(Y);case A:e:{for(_e=Q.key;F!==null;){if(F.key===_e)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){i(Y,F.sibling),F=d(F,Q.children||[]),F.return=Y,Y=F;break e}else{i(Y,F);break}else n(Y,F);F=F.sibling}F=zu(Q,Y.mode,he),F.return=Y,Y=F}return w(Y);case V:return _e=Q._init,it(Y,F,_e(Q._payload),he)}if(_t(Q))return xe(Y,F,Q,he);if(R(Q))return we(Y,F,Q,he);Xs(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,F!==null&&F.tag===6?(i(Y,F.sibling),F=d(F,Q),F.return=Y,Y=F):(i(Y,F),F=Tu(Q,Y.mode,he),F.return=Y,Y=F),w(Y)):i(Y,F)}return it}var Ko=Md(!0),Id=Md(!1),Gs=Pr(null),Ks=null,Qo=null,Va=null;function Ba(){Va=Qo=Ks=null}function Wa(e){var n=Gs.current;Qe(Gs),e._currentValue=n}function Ua(e,n,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===i)break;e=e.return}}function qo(e,n){Ks=e,Va=Qo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function ln(e){var n=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:n,next:null},Qo===null){if(Ks===null)throw Error(o(308));Qo=e,Ks.dependencies={lanes:0,firstContext:e}}else Qo=Qo.next=e;return n}var lo=null;function Ya(e){lo===null?lo=[e]:lo.push(e)}function Td(e,n,i,l){var d=n.interleaved;return d===null?(i.next=i,Ya(n)):(i.next=d.next,d.next=i),n.interleaved=i,ur(e,l)}function ur(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Tr=!1;function Xa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zd(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cr(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function zr(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var d=l.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),l.pending=n,ur(e,i)}return d=l.interleaved,d===null?(n.next=n,Ya(l)):(n.next=d.next,d.next=n),l.interleaved=n,ur(e,i)}function Qs(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Ei(e,i)}}function Rd(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var w={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=w:p=p.next=w,i=i.next}while(i!==null);p===null?d=p=n:p=p.next=n}else d=p=n;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function qs(e,n,i,l){var d=e.updateQueue;Tr=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var D=T,Z=D.next;D.next=null,w===null?p=Z:w.next=Z,w=D;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==w&&(T===null?ae.firstBaseUpdate=Z:T.next=Z,ae.lastBaseUpdate=D))}if(p!==null){var ce=d.baseState;w=0,ae=Z=D=null,T=p;do{var se=T.lane,ge=T.eventTime;if((l&se)===se){ae!==null&&(ae=ae.next={eventTime:ge,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=e,we=T;switch(se=n,ge=i,we.tag){case 1:if(xe=we.payload,typeof xe=="function"){ce=xe.call(ge,ce,se);break e}ce=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=we.payload,se=typeof xe=="function"?xe.call(ge,ce,se):xe,se==null)break e;ce=B({},ce,se);break e;case 2:Tr=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,se=d.effects,se===null?d.effects=[T]:se.push(T))}else ge={eventTime:ge,lane:se,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(Z=ae=ge,D=ce):ae=ae.next=ge,w|=se;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;se=T,T=se.next,se.next=null,d.lastBaseUpdate=se,d.shared.pending=null}}while(!0);if(ae===null&&(D=ce),d.baseState=D,d.firstBaseUpdate=Z,d.lastBaseUpdate=ae,n=d.shared.interleaved,n!==null){d=n;do w|=d.lane,d=d.next;while(d!==n)}else p===null&&(d.shared.lanes=0);co|=w,e.lanes=w,e.memoizedState=ce}}function Ad(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(o(191,d));d.call(l)}}}var Oi={},Hn=Pr(Oi),Fi=Pr(Oi),Hi=Pr(Oi);function ao(e){if(e===Oi)throw Error(o(174));return e}function Ga(e,n){switch(Ye(Hi,n),Ye(Fi,e),Ye(Hn,Oi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Zt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Zt(n,e)}Qe(Hn),Ye(Hn,n)}function Zo(){Qe(Hn),Qe(Fi),Qe(Hi)}function Ld(e){ao(Hi.current);var n=ao(Hn.current),i=Zt(n,e.type);n!==i&&(Ye(Fi,e),Ye(Hn,i))}function Ka(e){Fi.current===e&&(Qe(Hn),Qe(Fi))}var tt=Pr(0);function Zs(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Qa=[];function qa(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Js=j.ReactCurrentDispatcher,Za=j.ReactCurrentBatchConfig,uo=0,nt=null,dt=null,pt=null,el=!1,Vi=!1,Bi=0,E0=0;function kt(){throw Error(o(321))}function Ja(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!wn(e[i],n[i]))return!1;return!0}function eu(e,n,i,l,d,p){if(uo=p,nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Js.current=e===null||e.memoizedState===null?j0:b0,e=i(l,d),Vi){p=0;do{if(Vi=!1,Bi=0,25<=p)throw Error(o(301));p+=1,pt=dt=null,n.updateQueue=null,Js.current=P0,e=i(l,d)}while(Vi)}if(Js.current=rl,n=dt!==null&&dt.next!==null,uo=0,pt=dt=nt=null,el=!1,n)throw Error(o(300));return e}function tu(){var e=Bi!==0;return Bi=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?nt.memoizedState=pt=e:pt=pt.next=e,pt}function an(){if(dt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=pt===null?nt.memoizedState:pt.next;if(n!==null)pt=n,dt=e;else{if(e===null)throw Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},pt===null?nt.memoizedState=pt=e:pt=pt.next=e}return pt}function Wi(e,n){return typeof n=="function"?n(e):n}function nu(e){var n=an(),i=n.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=dt,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var w=d.next;d.next=p.next,p.next=w}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var T=w=null,D=null,Z=p;do{var ae=Z.lane;if((uo&ae)===ae)D!==null&&(D=D.next={lane:0,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),l=Z.hasEagerState?Z.eagerState:e(l,Z.action);else{var ce={lane:ae,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null};D===null?(T=D=ce,w=l):D=D.next=ce,nt.lanes|=ae,co|=ae}Z=Z.next}while(Z!==null&&Z!==p);D===null?w=l:D.next=T,wn(l,n.memoizedState)||(Lt=!0),n.memoizedState=l,n.baseState=w,n.baseQueue=D,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,nt.lanes|=p,co|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function ru(e){var n=an(),i=n.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=n.memoizedState;if(d!==null){i.pending=null;var w=d=d.next;do p=e(p,w.action),w=w.next;while(w!==d);wn(p,n.memoizedState)||(Lt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),i.lastRenderedState=p}return[p,l]}function Dd(){}function $d(e,n){var i=nt,l=an(),d=n(),p=!wn(l.memoizedState,d);if(p&&(l.memoizedState=d,Lt=!0),l=l.queue,ou(Hd.bind(null,i,l,e),[e]),l.getSnapshot!==n||p||pt!==null&&pt.memoizedState.tag&1){if(i.flags|=2048,Ui(9,Fd.bind(null,i,l,d,n),void 0,null),mt===null)throw Error(o(349));(uo&30)!==0||Od(i,n,d)}return d}function Od(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Fd(e,n,i,l){n.value=i,n.getSnapshot=l,Vd(n)&&Bd(e)}function Hd(e,n,i){return i(function(){Vd(n)&&Bd(e)})}function Vd(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!wn(e,i)}catch{return!0}}function Bd(e){var n=ur(e,1);n!==null&&Cn(n,e,1,-1)}function Wd(e){var n=Vn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:e},n.queue=e,e=e.dispatch=_0.bind(null,nt,e),[n.memoizedState,e]}function Ui(e,n,i,l){return e={tag:e,create:n,destroy:i,deps:l,next:null},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e)),e}function Ud(){return an().memoizedState}function tl(e,n,i,l){var d=Vn();nt.flags|=e,d.memoizedState=Ui(1|n,i,void 0,l===void 0?null:l)}function nl(e,n,i,l){var d=an();l=l===void 0?null:l;var p=void 0;if(dt!==null){var w=dt.memoizedState;if(p=w.destroy,l!==null&&Ja(l,w.deps)){d.memoizedState=Ui(n,i,p,l);return}}nt.flags|=e,d.memoizedState=Ui(1|n,i,p,l)}function Yd(e,n){return tl(8390656,8,e,n)}function ou(e,n){return nl(2048,8,e,n)}function Xd(e,n){return nl(4,2,e,n)}function Gd(e,n){return nl(4,4,e,n)}function Kd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Qd(e,n,i){return i=i!=null?i.concat([e]):null,nl(4,4,Kd.bind(null,n,e),i)}function iu(){}function qd(e,n){var i=an();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function Zd(e,n){var i=an();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(e=e(),i.memoizedState=[e,n],e)}function Jd(e,n,i){return(uo&21)===0?(e.baseState&&(e.baseState=!1,Lt=!0),e.memoizedState=i):(wn(i,n)||(i=nr(),nt.lanes|=i,co|=i,e.baseState=!0),n)}function N0(e,n){var i=Be;Be=i!==0&&4>i?i:4,e(!0);var l=Za.transition;Za.transition={};try{e(!1),n()}finally{Be=i,Za.transition=l}}function ef(){return an().memoizedState}function C0(e,n,i){var l=Dr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},tf(e))nf(n,i);else if(i=Td(e,n,i,l),i!==null){var d=Mt();Cn(i,e,l,d),rf(i,n,l)}}function _0(e,n,i){var l=Dr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(tf(e))nf(n,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,T=p(w,i);if(d.hasEagerState=!0,d.eagerState=T,wn(T,w)){var D=n.interleaved;D===null?(d.next=d,Ya(n)):(d.next=D.next,D.next=d),n.interleaved=d;return}}catch{}finally{}i=Td(e,n,d,l),i!==null&&(d=Mt(),Cn(i,e,l,d),rf(i,n,l))}}function tf(e){var n=e.alternate;return e===nt||n!==null&&n===nt}function nf(e,n){Vi=el=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function rf(e,n,i){if((i&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Ei(e,i)}}var rl={readContext:ln,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},j0={readContext:ln,useCallback:function(e,n){return Vn().memoizedState=[e,n===void 0?null:n],e},useContext:ln,useEffect:Yd,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,tl(4194308,4,Kd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return tl(4194308,4,e,n)},useInsertionEffect:function(e,n){return tl(4,2,e,n)},useMemo:function(e,n){var i=Vn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var l=Vn();return n=i!==void 0?i(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=C0.bind(null,nt,e),[l.memoizedState,e]},useRef:function(e){var n=Vn();return e={current:e},n.memoizedState=e},useState:Wd,useDebugValue:iu,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Wd(!1),n=e[0];return e=N0.bind(null,e[1]),Vn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var l=nt,d=Vn();if(Ze){if(i===void 0)throw Error(o(407));i=i()}else{if(i=n(),mt===null)throw Error(o(349));(uo&30)!==0||Od(l,n,i)}d.memoizedState=i;var p={value:i,getSnapshot:n};return d.queue=p,Yd(Hd.bind(null,l,p,e),[e]),l.flags|=2048,Ui(9,Fd.bind(null,l,p,i,n),void 0,null),i},useId:function(){var e=Vn(),n=mt.identifierPrefix;if(Ze){var i=ar,l=lr;i=(l&~(1<<32-bt(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=Bi++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=E0++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},b0={readContext:ln,useCallback:qd,useContext:ln,useEffect:ou,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:nu,useRef:Ud,useState:function(){return nu(Wi)},useDebugValue:iu,useDeferredValue:function(e){var n=an();return Jd(n,dt.memoizedState,e)},useTransition:function(){var e=nu(Wi)[0],n=an().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1},P0={readContext:ln,useCallback:qd,useContext:ln,useEffect:ou,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:ru,useRef:Ud,useState:function(){return ru(Wi)},useDebugValue:iu,useDeferredValue:function(e){var n=an();return dt===null?n.memoizedState=e:Jd(n,dt.memoizedState,e)},useTransition:function(){var e=ru(Wi)[0],n=an().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1};function kn(e,n){if(e&&e.defaultProps){n=B({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function su(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:B({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ol={isMounted:function(e){return(e=e._reactInternals)?wt(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=Dr(e),p=cr(l,d);p.payload=n,i!=null&&(p.callback=i),n=zr(e,p,d),n!==null&&(Cn(n,e,d,l),Qs(n,e,d))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=Dr(e),p=cr(l,d);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=zr(e,p,d),n!==null&&(Cn(n,e,d,l),Qs(n,e,d))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Mt(),l=Dr(e),d=cr(i,l);d.tag=2,n!=null&&(d.callback=n),n=zr(e,d,l),n!==null&&(Cn(n,e,l,i),Qs(n,e,l))}};function of(e,n,i,l,d,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,w):n.prototype&&n.prototype.isPureReactComponent?!Ii(i,l)||!Ii(d,p):!0}function sf(e,n,i){var l=!1,d=Mr,p=n.contextType;return typeof p=="object"&&p!==null?p=ln(p):(d=At(n)?oo:St.current,l=n.contextTypes,p=(l=l!=null)?Uo(e,d):Mr),n=new n(i,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ol,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),n}function lf(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&ol.enqueueReplaceState(n,n.state,null)}function lu(e,n,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},Xa(e);var p=n.contextType;typeof p=="object"&&p!==null?d.context=ln(p):(p=At(n)?oo:St.current,d.context=Uo(e,p)),d.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(su(e,n,p,i),d.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(n=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),n!==d.state&&ol.enqueueReplaceState(d,d.state,null),qs(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Jo(e,n){try{var i="",l=n;do i+=de(l),l=l.return;while(l);var d=i}catch(p){d=`
39
+ Error generating stack: `+p.message+`
40
+ `+p.stack}return{value:e,source:n,stack:d,digest:null}}function au(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function uu(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var M0=typeof WeakMap=="function"?WeakMap:Map;function af(e,n,i){i=cr(-1,i),i.tag=3,i.payload={element:null};var l=n.value;return i.callback=function(){dl||(dl=!0,Nu=l),uu(e,n)},i}function uf(e,n,i){i=cr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=n.value;i.payload=function(){return l(d)},i.callback=function(){uu(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){uu(e,n),typeof l!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),i}function cf(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new M0;var d=new Set;l.set(n,d)}else d=l.get(n),d===void 0&&(d=new Set,l.set(n,d));d.has(i)||(d.add(i),e=W0.bind(null,e,n,i),n.then(e,e))}function df(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function ff(e,n,i,l,d){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=cr(-1,1),n.tag=2,zr(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var I0=j.ReactCurrentOwner,Lt=!1;function Pt(e,n,i,l){n.child=e===null?Id(n,null,i,l):Ko(n,e.child,i,l)}function hf(e,n,i,l,d){i=i.render;var p=n.ref;return qo(n,d),l=eu(e,n,i,l,p,d),i=tu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,dr(e,n,d)):(Ze&&i&&Da(n),n.flags|=1,Pt(e,n,l,d),n.child)}function pf(e,n,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Iu(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=p,mf(e,n,p,l,d)):(e=yl(i.type,null,l,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&d)===0){var w=p.memoizedProps;if(i=i.compare,i=i!==null?i:Ii,i(w,l)&&e.ref===n.ref)return dr(e,n,d)}return n.flags|=1,e=Or(p,l),e.ref=n.ref,e.return=n,n.child=e}function mf(e,n,i,l,d){if(e!==null){var p=e.memoizedProps;if(Ii(p,l)&&e.ref===n.ref)if(Lt=!1,n.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Lt=!0);else return n.lanes=e.lanes,dr(e,n,d)}return cu(e,n,i,l,d)}function gf(e,n,i){var l=n.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ye(ti,Xt),Xt|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ye(ti,Xt),Xt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,Ye(ti,Xt),Xt|=l}else p!==null?(l=p.baseLanes|i,n.memoizedState=null):l=i,Ye(ti,Xt),Xt|=l;return Pt(e,n,d,i),n.child}function yf(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function cu(e,n,i,l,d){var p=At(i)?oo:St.current;return p=Uo(n,p),qo(n,d),i=eu(e,n,i,l,p,d),l=tu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,dr(e,n,d)):(Ze&&l&&Da(n),n.flags|=1,Pt(e,n,i,d),n.child)}function vf(e,n,i,l,d){if(At(i)){var p=!0;Vs(n)}else p=!1;if(qo(n,d),n.stateNode===null)sl(e,n),sf(n,i,l),lu(n,i,l,d),l=!0;else if(e===null){var w=n.stateNode,T=n.memoizedProps;w.props=T;var D=w.context,Z=i.contextType;typeof Z=="object"&&Z!==null?Z=ln(Z):(Z=At(i)?oo:St.current,Z=Uo(n,Z));var ae=i.getDerivedStateFromProps,ce=typeof ae=="function"||typeof w.getSnapshotBeforeUpdate=="function";ce||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==l||D!==Z)&&lf(n,w,l,Z),Tr=!1;var se=n.memoizedState;w.state=se,qs(n,l,w,d),D=n.memoizedState,T!==l||se!==D||Rt.current||Tr?(typeof ae=="function"&&(su(n,i,ae,l),D=n.memoizedState),(T=Tr||of(n,i,T,l,se,D,Z))?(ce||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=D),w.props=l,w.state=D,w.context=Z,l=T):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,zd(e,n),T=n.memoizedProps,Z=n.type===n.elementType?T:kn(n.type,T),w.props=Z,ce=n.pendingProps,se=w.context,D=i.contextType,typeof D=="object"&&D!==null?D=ln(D):(D=At(i)?oo:St.current,D=Uo(n,D));var ge=i.getDerivedStateFromProps;(ae=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ce||se!==D)&&lf(n,w,l,D),Tr=!1,se=n.memoizedState,w.state=se,qs(n,l,w,d);var xe=n.memoizedState;T!==ce||se!==xe||Rt.current||Tr?(typeof ge=="function"&&(su(n,i,ge,l),xe=n.memoizedState),(Z=Tr||of(n,i,Z,l,se,xe,D)||!1)?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,xe,D),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,xe,D)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&se===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&se===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=xe),w.props=l,w.state=xe,w.context=D,l=Z):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&se===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&se===e.memoizedState||(n.flags|=1024),l=!1)}return du(e,n,i,l,p,d)}function du(e,n,i,l,d,p){yf(e,n);var w=(n.flags&128)!==0;if(!l&&!w)return d&&kd(n,i,!1),dr(e,n,p);l=n.stateNode,I0.current=n;var T=w&&typeof i.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Ko(n,e.child,null,p),n.child=Ko(n,null,T,p)):Pt(e,n,T,p),n.memoizedState=l.state,d&&kd(n,i,!0),n.child}function xf(e){var n=e.stateNode;n.pendingContext?wd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&wd(e,n.context,!1),Ga(e,n.containerInfo)}function wf(e,n,i,l,d){return Go(),Ha(d),n.flags|=256,Pt(e,n,i,l),n.child}var fu={dehydrated:null,treeContext:null,retryLane:0};function hu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sf(e,n,i){var l=n.pendingProps,d=tt.current,p=!1,w=(n.flags&128)!==0,T;if((T=w)||(T=e!==null&&e.memoizedState===null?!1:(d&2)!==0),T?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),Ye(tt,d&1),e===null)return Fa(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=l.children,e=l.fallback,p?(l=n.mode,p=n.child,w={mode:"hidden",children:w},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=w):p=vl(w,l,0,null),e=mo(e,l,i,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=hu(i),n.memoizedState=fu,e):pu(n,w));if(d=e.memoizedState,d!==null&&(T=d.dehydrated,T!==null))return T0(e,n,w,l,T,d,i);if(p){p=l.fallback,w=n.mode,d=e.child,T=d.sibling;var D={mode:"hidden",children:l.children};return(w&1)===0&&n.child!==d?(l=n.child,l.childLanes=0,l.pendingProps=D,n.deletions=null):(l=Or(d,D),l.subtreeFlags=d.subtreeFlags&14680064),T!==null?p=Or(T,p):(p=mo(p,w,i,null),p.flags|=2),p.return=n,l.return=n,l.sibling=p,n.child=l,l=p,p=n.child,w=e.child.memoizedState,w=w===null?hu(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~i,n.memoizedState=fu,l}return p=e.child,e=p.sibling,l=Or(p,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=i),l.return=n,l.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=l,n.memoizedState=null,l}function pu(e,n){return n=vl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function il(e,n,i,l){return l!==null&&Ha(l),Ko(n,e.child,null,i),e=pu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function T0(e,n,i,l,d,p,w){if(i)return n.flags&256?(n.flags&=-257,l=au(Error(o(422))),il(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,d=n.mode,l=vl({mode:"visible",children:l.children},d,0,null),p=mo(p,d,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Ko(n,e.child,null,w),n.child.memoizedState=hu(w),n.memoizedState=fu,p);if((n.mode&1)===0)return il(e,n,w,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var T=l.dgst;return l=T,p=Error(o(419)),l=au(p,l,void 0),il(e,n,w,l)}if(T=(w&e.childLanes)!==0,Lt||T){if(l=mt,l!==null){switch(w&-w){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|w))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,ur(e,d),Cn(l,e,d,-1))}return Mu(),l=au(Error(o(421))),il(e,n,w,l)}return d.data==="$?"?(n.flags|=128,n.child=e.child,n=U0.bind(null,e),d._reactRetry=n,null):(e=p.treeContext,Yt=br(d.nextSibling),Ut=n,Ze=!0,Sn=null,e!==null&&(on[sn++]=lr,on[sn++]=ar,on[sn++]=io,lr=e.id,ar=e.overflow,io=n),n=pu(n,l.children),n.flags|=4096,n)}function kf(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Ua(e.return,n,i)}function mu(e,n,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function Ef(e,n,i){var l=n.pendingProps,d=l.revealOrder,p=l.tail;if(Pt(e,n,l.children,i),l=tt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kf(e,i,n);else if(e.tag===19)kf(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Ye(tt,l),(n.mode&1)===0)n.memoizedState=null;else switch(d){case"forwards":for(i=n.child,d=null;i!==null;)e=i.alternate,e!==null&&Zs(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),mu(n,!1,d,i,p);break;case"backwards":for(i=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Zs(e)===null){n.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}mu(n,!0,i,null,p);break;case"together":mu(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function sl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function dr(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),co|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,i=Or(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=Or(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function z0(e,n,i){switch(n.tag){case 3:xf(n),Go();break;case 5:Ld(n);break;case 1:At(n.type)&&Vs(n);break;case 4:Ga(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,d=n.memoizedProps.value;Ye(Gs,l._currentValue),l._currentValue=d;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Ye(tt,tt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Sf(e,n,i):(Ye(tt,tt.current&1),e=dr(e,n,i),e!==null?e.sibling:null);Ye(tt,tt.current&1);break;case 19:if(l=(i&n.childLanes)!==0,(e.flags&128)!==0){if(l)return Ef(e,n,i);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Ye(tt,tt.current),l)break;return null;case 22:case 23:return n.lanes=0,gf(e,n,i)}return dr(e,n,i)}var Nf,gu,Cf,_f;Nf=function(e,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},gu=function(){},Cf=function(e,n,i,l){var d=e.memoizedProps;if(d!==l){e=n.stateNode,ao(Hn.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=B({},d,{value:void 0}),l=B({},l,{value:void 0}),p=[];break;case"textarea":d=st(e,d),l=st(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Os)}qn(i,l);var w;i=null;for(Z in d)if(!l.hasOwnProperty(Z)&&d.hasOwnProperty(Z)&&d[Z]!=null)if(Z==="style"){var T=d[Z];for(w in T)T.hasOwnProperty(w)&&(i||(i={}),i[w]="")}else Z!=="dangerouslySetInnerHTML"&&Z!=="children"&&Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(a.hasOwnProperty(Z)?p||(p=[]):(p=p||[]).push(Z,null));for(Z in l){var D=l[Z];if(T=d!=null?d[Z]:void 0,l.hasOwnProperty(Z)&&D!==T&&(D!=null||T!=null))if(Z==="style")if(T){for(w in T)!T.hasOwnProperty(w)||D&&D.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in D)D.hasOwnProperty(w)&&T[w]!==D[w]&&(i||(i={}),i[w]=D[w])}else i||(p||(p=[]),p.push(Z,i)),i=D;else Z==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,T=T?T.__html:void 0,D!=null&&T!==D&&(p=p||[]).push(Z,D)):Z==="children"?typeof D!="string"&&typeof D!="number"||(p=p||[]).push(Z,""+D):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&(a.hasOwnProperty(Z)?(D!=null&&Z==="onScroll"&&Ke("scroll",e),p||T===D||(p=[])):(p=p||[]).push(Z,D))}i&&(p=p||[]).push("style",i);var Z=p;(n.updateQueue=Z)&&(n.flags|=4)}},_f=function(e,n,i,l){i!==l&&(n.flags|=4)};function Yi(e,n){if(!Ze)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Et(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(n)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function R0(e,n,i){var l=n.pendingProps;switch($a(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(n),null;case 1:return At(n.type)&&Hs(),Et(n),null;case 3:return l=n.stateNode,Zo(),Qe(Rt),Qe(St),qa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ys(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Sn!==null&&(ju(Sn),Sn=null))),gu(e,n),Et(n),null;case 5:Ka(n);var d=ao(Hi.current);if(i=n.type,e!==null&&n.stateNode!=null)Cf(e,n,i,l,d),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(o(166));return Et(n),null}if(e=ao(Hn.current),Ys(n)){l=n.stateNode,i=n.type;var p=n.memoizedProps;switch(l[Fn]=n,l[Li]=p,e=(n.mode&1)!==0,i){case"dialog":Ke("cancel",l),Ke("close",l);break;case"iframe":case"object":case"embed":Ke("load",l);break;case"video":case"audio":for(d=0;d<zi.length;d++)Ke(zi[d],l);break;case"source":Ke("error",l);break;case"img":case"image":case"link":Ke("error",l),Ke("load",l);break;case"details":Ke("toggle",l);break;case"input":De(l,p),Ke("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Ke("invalid",l);break;case"textarea":dn(l,p),Ke("invalid",l)}qn(i,p),d=null;for(var w in p)if(p.hasOwnProperty(w)){var T=p[w];w==="children"?typeof T=="string"?l.textContent!==T&&(p.suppressHydrationWarning!==!0&&$s(l.textContent,T,e),d=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&$s(l.textContent,T,e),d=["children",""+T]):a.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&Ke("scroll",l)}switch(i){case"input":be(l),Ct(l,p,!0);break;case"textarea":be(l),Qn(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Os)}l=d,n.updateQueue=l,l!==null&&(n.flags|=4)}else{w=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=qt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=w.createElement(i,{is:l.is}):(e=w.createElement(i),i==="select"&&(w=e,l.multiple?w.multiple=!0:l.size&&(w.size=l.size))):e=w.createElementNS(e,i),e[Fn]=n,e[Li]=l,Nf(e,n,!1,!1),n.stateNode=e;e:{switch(w=Gr(i,l),i){case"dialog":Ke("cancel",e),Ke("close",e),d=l;break;case"iframe":case"object":case"embed":Ke("load",e),d=l;break;case"video":case"audio":for(d=0;d<zi.length;d++)Ke(zi[d],e);d=l;break;case"source":Ke("error",e),d=l;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),d=l;break;case"details":Ke("toggle",e),d=l;break;case"input":De(e,l),d=ze(e,l),Ke("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=B({},l,{value:void 0}),Ke("invalid",e);break;case"textarea":dn(e,l),d=st(e,l),Ke("invalid",e);break;default:d=l}qn(i,d),T=d;for(p in T)if(T.hasOwnProperty(p)){var D=T[p];p==="style"?Xr(e,D):p==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&Jt(e,D)):p==="children"?typeof D=="string"?(i!=="textarea"||D!=="")&&fn(e,D):typeof D=="number"&&fn(e,""+D):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?D!=null&&p==="onScroll"&&Ke("scroll",e):D!=null&&C(e,p,D,w))}switch(i){case"input":be(e),Ct(e,l,!1);break;case"textarea":be(e),Qn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+te(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?It(e,!!l.multiple,p,!1):l.defaultValue!=null&&It(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Os)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Et(n),null;case 6:if(e&&n.stateNode!=null)_f(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(i=ao(Hi.current),ao(Hn.current),Ys(n)){if(l=n.stateNode,i=n.memoizedProps,l[Fn]=n,(p=l.nodeValue!==i)&&(e=Ut,e!==null))switch(e.tag){case 3:$s(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$s(l.nodeValue,i,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[Fn]=n,n.stateNode=l}return Et(n),null;case 13:if(Qe(tt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ze&&Yt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bd(),Go(),n.flags|=98560,p=!1;else if(p=Ys(n),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Fn]=n}else Go(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),p=!1}else Sn!==null&&(ju(Sn),Sn=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(tt.current&1)!==0?ft===0&&(ft=3):Mu())),n.updateQueue!==null&&(n.flags|=4),Et(n),null);case 4:return Zo(),gu(e,n),e===null&&Ri(n.stateNode.containerInfo),Et(n),null;case 10:return Wa(n.type._context),Et(n),null;case 17:return At(n.type)&&Hs(),Et(n),null;case 19:if(Qe(tt),p=n.memoizedState,p===null)return Et(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Yi(p,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=Zs(e),w!==null){for(n.flags|=128,Yi(p,!1),l=w.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=i,i=n.child;i!==null;)p=i,e=l,p.flags&=14680066,w=p.alternate,w===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=w.childLanes,p.lanes=w.lanes,p.child=w.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=w.memoizedProps,p.memoizedState=w.memoizedState,p.updateQueue=w.updateQueue,p.type=w.type,e=w.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return Ye(tt,tt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Ge()>ni&&(n.flags|=128,l=!0,Yi(p,!1),n.lanes=4194304)}else{if(!l)if(e=Zs(w),e!==null){if(n.flags|=128,l=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Yi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ze)return Et(n),null}else 2*Ge()-p.renderingStartTime>ni&&i!==1073741824&&(n.flags|=128,l=!0,Yi(p,!1),n.lanes=4194304);p.isBackwards?(w.sibling=n.child,n.child=w):(i=p.last,i!==null?i.sibling=w:n.child=w,p.last=w)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=Ge(),n.sibling=null,i=tt.current,Ye(tt,l?i&1|2:i&1),n):(Et(n),null);case 22:case 23:return Pu(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Xt&1073741824)!==0&&(Et(n),n.subtreeFlags&6&&(n.flags|=8192)):Et(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function A0(e,n){switch($a(n),n.tag){case 1:return At(n.type)&&Hs(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Zo(),Qe(Rt),Qe(St),qa(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ka(n),null;case 13:if(Qe(tt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Go()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Qe(tt),null;case 4:return Zo(),null;case 10:return Wa(n.type._context),null;case 22:case 23:return Pu(),null;case 24:return null;default:return null}}var ll=!1,Nt=!1,L0=typeof WeakSet=="function"?WeakSet:Set,ve=null;function ei(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){ot(e,n,l)}else i.current=null}function yu(e,n,i){try{i()}catch(l){ot(e,n,l)}}var jf=!1;function D0(e,n){if(Pa=We,e=od(),Sa(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var w=0,T=-1,D=-1,Z=0,ae=0,ce=e,se=null;t:for(;;){for(var ge;ce!==i||d!==0&&ce.nodeType!==3||(T=w+d),ce!==p||l!==0&&ce.nodeType!==3||(D=w+l),ce.nodeType===3&&(w+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)se=ce,ce=ge;for(;;){if(ce===e)break t;if(se===i&&++Z===d&&(T=w),se===p&&++ae===l&&(D=w),(ge=ce.nextSibling)!==null)break;ce=se,se=ce.parentNode}ce=ge}i=T===-1||D===-1?null:{start:T,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ma={focusedElem:e,selectionRange:i},We=!1,ve=n;ve!==null;)if(n=ve,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ve=e;else for(;ve!==null;){n=ve;try{var xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var we=xe.memoizedProps,it=xe.memoizedState,Y=n.stateNode,F=Y.getSnapshotBeforeUpdate(n.elementType===n.type?we:kn(n.type,we),it);Y.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var Q=n.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(he){ot(n,n.return,he)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return xe=jf,jf=!1,xe}function Xi(e,n,i){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&yu(n,i,p)}d=d.next}while(d!==l)}}function al(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==n)}}function vu(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function bf(e){var n=e.alternate;n!==null&&(e.alternate=null,bf(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Fn],delete n[Li],delete n[Ra],delete n[x0],delete n[w0])),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 Pf(e){return e.tag===5||e.tag===3||e.tag===4}function Mf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pf(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 xu(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Os));else if(l!==4&&(e=e.child,e!==null))for(xu(e,n,i),e=e.sibling;e!==null;)xu(e,n,i),e=e.sibling}function wu(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(wu(e,n,i),e=e.sibling;e!==null;)wu(e,n,i),e=e.sibling}var yt=null,En=!1;function Rr(e,n,i){for(i=i.child;i!==null;)If(e,n,i),i=i.sibling}function If(e,n,i){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(er,i)}catch{}switch(i.tag){case 5:Nt||ei(i,n);case 6:var l=yt,d=En;yt=null,Rr(e,n,i),yt=l,En=d,yt!==null&&(En?(e=yt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):yt.removeChild(i.stateNode));break;case 18:yt!==null&&(En?(e=yt,i=i.stateNode,e.nodeType===8?za(e.parentNode,i):e.nodeType===1&&za(e,i),Le(e)):za(yt,i.stateNode));break;case 4:l=yt,d=En,yt=i.stateNode.containerInfo,En=!0,Rr(e,n,i),yt=l,En=d;break;case 0:case 11:case 14:case 15:if(!Nt&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&yu(i,n,w),d=d.next}while(d!==l)}Rr(e,n,i);break;case 1:if(!Nt&&(ei(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(T){ot(i,n,T)}Rr(e,n,i);break;case 21:Rr(e,n,i);break;case 22:i.mode&1?(Nt=(l=Nt)||i.memoizedState!==null,Rr(e,n,i),Nt=l):Rr(e,n,i);break;default:Rr(e,n,i)}}function Tf(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new L0),n.forEach(function(l){var d=Y0.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function Nn(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,w=n,T=w;e:for(;T!==null;){switch(T.tag){case 5:yt=T.stateNode,En=!1;break e;case 3:yt=T.stateNode.containerInfo,En=!0;break e;case 4:yt=T.stateNode.containerInfo,En=!0;break e}T=T.return}if(yt===null)throw Error(o(160));If(p,w,d),yt=null,En=!1;var D=d.alternate;D!==null&&(D.return=null),d.return=null}catch(Z){ot(d,n,Z)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)zf(n,e),n=n.sibling}function zf(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nn(n,e),Bn(e),l&4){try{Xi(3,e,e.return),al(3,e)}catch(we){ot(e,e.return,we)}try{Xi(5,e,e.return)}catch(we){ot(e,e.return,we)}}break;case 1:Nn(n,e),Bn(e),l&512&&i!==null&&ei(i,i.return);break;case 5:if(Nn(n,e),Bn(e),l&512&&i!==null&&ei(i,i.return),e.flags&32){var d=e.stateNode;try{fn(d,"")}catch(we){ot(e,e.return,we)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,w=i!==null?i.memoizedProps:p,T=e.type,D=e.updateQueue;if(e.updateQueue=null,D!==null)try{T==="input"&&p.type==="radio"&&p.name!=null&&Te(d,p),Gr(T,w);var Z=Gr(T,p);for(w=0;w<D.length;w+=2){var ae=D[w],ce=D[w+1];ae==="style"?Xr(d,ce):ae==="dangerouslySetInnerHTML"?Jt(d,ce):ae==="children"?fn(d,ce):C(d,ae,ce,Z)}switch(T){case"input":Xe(d,p);break;case"textarea":Kn(d,p);break;case"select":var se=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var ge=p.value;ge!=null?It(d,!!p.multiple,ge,!1):se!==!!p.multiple&&(p.defaultValue!=null?It(d,!!p.multiple,p.defaultValue,!0):It(d,!!p.multiple,p.multiple?[]:"",!1))}d[Li]=p}catch(we){ot(e,e.return,we)}}break;case 6:if(Nn(n,e),Bn(e),l&4){if(e.stateNode===null)throw Error(o(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(we){ot(e,e.return,we)}}break;case 3:if(Nn(n,e),Bn(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Le(n.containerInfo)}catch(we){ot(e,e.return,we)}break;case 4:Nn(n,e),Bn(e);break;case 13:Nn(n,e),Bn(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Eu=Ge())),l&4&&Tf(e);break;case 22:if(ae=i!==null&&i.memoizedState!==null,e.mode&1?(Nt=(Z=Nt)||ae,Nn(n,e),Nt=Z):Nn(n,e),Bn(e),l&8192){if(Z=e.memoizedState!==null,(e.stateNode.isHidden=Z)&&!ae&&(e.mode&1)!==0)for(ve=e,ae=e.child;ae!==null;){for(ce=ve=ae;ve!==null;){switch(se=ve,ge=se.child,se.tag){case 0:case 11:case 14:case 15:Xi(4,se,se.return);break;case 1:ei(se,se.return);var xe=se.stateNode;if(typeof xe.componentWillUnmount=="function"){l=se,i=se.return;try{n=l,xe.props=n.memoizedProps,xe.state=n.memoizedState,xe.componentWillUnmount()}catch(we){ot(l,i,we)}}break;case 5:ei(se,se.return);break;case 22:if(se.memoizedState!==null){Lf(ce);continue}}ge!==null?(ge.return=se,ve=ge):Lf(ce)}ae=ae.sibling}e:for(ae=null,ce=e;;){if(ce.tag===5){if(ae===null){ae=ce;try{d=ce.stateNode,Z?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(T=ce.stateNode,D=ce.memoizedProps.style,w=D!=null&&D.hasOwnProperty("display")?D.display:null,T.style.display=yr("display",w))}catch(we){ot(e,e.return,we)}}}else if(ce.tag===6){if(ae===null)try{ce.stateNode.nodeValue=Z?"":ce.memoizedProps}catch(we){ot(e,e.return,we)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===e)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===e)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===e)break e;ae===ce&&(ae=null),ce=ce.return}ae===ce&&(ae=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:Nn(n,e),Bn(e),l&4&&Tf(e);break;case 21:break;default:Nn(n,e),Bn(e)}}function Bn(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Pf(i)){var l=i;break e}i=i.return}throw Error(o(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(fn(d,""),l.flags&=-33);var p=Mf(e);wu(e,p,d);break;case 3:case 4:var w=l.stateNode.containerInfo,T=Mf(e);xu(e,T,w);break;default:throw Error(o(161))}}catch(D){ot(e,e.return,D)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function $0(e,n,i){ve=e,Rf(e)}function Rf(e,n,i){for(var l=(e.mode&1)!==0;ve!==null;){var d=ve,p=d.child;if(d.tag===22&&l){var w=d.memoizedState!==null||ll;if(!w){var T=d.alternate,D=T!==null&&T.memoizedState!==null||Nt;T=ll;var Z=Nt;if(ll=w,(Nt=D)&&!Z)for(ve=d;ve!==null;)w=ve,D=w.child,w.tag===22&&w.memoizedState!==null?Df(d):D!==null?(D.return=w,ve=D):Df(d);for(;p!==null;)ve=p,Rf(p),p=p.sibling;ve=d,ll=T,Nt=Z}Af(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ve=p):Af(e)}}function Af(e){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Nt||al(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!Nt)if(i===null)l.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:kn(n.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Ad(n,p,l);break;case 3:var w=n.updateQueue;if(w!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Ad(n,w,i)}break;case 5:var T=n.stateNode;if(i===null&&n.flags&4){i=T;var D=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":D.autoFocus&&i.focus();break;case"img":D.src&&(i.src=D.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var Z=n.alternate;if(Z!==null){var ae=Z.memoizedState;if(ae!==null){var ce=ae.dehydrated;ce!==null&&Le(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Nt||n.flags&512&&vu(n)}catch(se){ot(n,n.return,se)}}if(n===e){ve=null;break}if(i=n.sibling,i!==null){i.return=n.return,ve=i;break}ve=n.return}}function Lf(e){for(;ve!==null;){var n=ve;if(n===e){ve=null;break}var i=n.sibling;if(i!==null){i.return=n.return,ve=i;break}ve=n.return}}function Df(e){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{al(4,n)}catch(D){ot(n,i,D)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var d=n.return;try{l.componentDidMount()}catch(D){ot(n,d,D)}}var p=n.return;try{vu(n)}catch(D){ot(n,p,D)}break;case 5:var w=n.return;try{vu(n)}catch(D){ot(n,w,D)}}}catch(D){ot(n,n.return,D)}if(n===e){ve=null;break}var T=n.sibling;if(T!==null){T.return=n.return,ve=T;break}ve=n.return}}var O0=Math.ceil,ul=j.ReactCurrentDispatcher,Su=j.ReactCurrentOwner,un=j.ReactCurrentBatchConfig,He=0,mt=null,lt=null,vt=0,Xt=0,ti=Pr(0),ft=0,Gi=null,co=0,cl=0,ku=0,Ki=null,Dt=null,Eu=0,ni=1/0,fr=null,dl=!1,Nu=null,Ar=null,fl=!1,Lr=null,hl=0,Qi=0,Cu=null,pl=-1,ml=0;function Mt(){return(He&6)!==0?Ge():pl!==-1?pl:pl=Ge()}function Dr(e){return(e.mode&1)===0?1:(He&2)!==0&&vt!==0?vt&-vt:k0.transition!==null?(ml===0&&(ml=nr()),ml):(e=Be,e!==0||(e=window.event,e=e===void 0?16:bs(e.type)),e)}function Cn(e,n,i,l){if(50<Qi)throw Qi=0,Cu=null,Error(o(185));vn(e,i,l),((He&2)===0||e!==mt)&&(e===mt&&((He&2)===0&&(cl|=i),ft===4&&$r(e,vt)),$t(e,l),i===1&&He===0&&(n.mode&1)===0&&(ni=Ge()+500,Bs&&Ir()))}function $t(e,n){var i=e.callbackNode;Ao(e,n);var l=tr(e,e===mt?vt:0);if(l===0)i!==null&&eo(i),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(i!=null&&eo(i),n===1)e.tag===0?S0(Of.bind(null,e)):Ed(Of.bind(null,e)),y0(function(){(He&6)===0&&Ir()}),i=null;else{switch(Es(l)){case 1:i=no;break;case 4:i=To;break;case 16:i=gn;break;case 536870912:i=zo;break;default:i=gn}i=Xf(i,$f.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function $f(e,n){if(pl=-1,ml=0,(He&6)!==0)throw Error(o(327));var i=e.callbackNode;if(ri()&&e.callbackNode!==i)return null;var l=tr(e,e===mt?vt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=gl(e,l);else{n=l;var d=He;He|=2;var p=Hf();(mt!==e||vt!==n)&&(fr=null,ni=Ge()+500,ho(e,n));do try{V0();break}catch(T){Ff(e,T)}while(!0);Ba(),ul.current=p,He=d,lt!==null?n=0:(mt=null,vt=0,n=ft)}if(n!==0){if(n===2&&(d=kr(e),d!==0&&(l=d,n=_u(e,d))),n===1)throw i=Gi,ho(e,0),$r(e,l),$t(e,Ge()),i;if(n===6)$r(e,l);else{if(d=e.current.alternate,(l&30)===0&&!F0(d)&&(n=gl(e,l),n===2&&(p=kr(e),p!==0&&(l=p,n=_u(e,p))),n===1))throw i=Gi,ho(e,0),$r(e,l),$t(e,Ge()),i;switch(e.finishedWork=d,e.finishedLanes=l,n){case 0:case 1:throw Error(o(345));case 2:po(e,Dt,fr);break;case 3:if($r(e,l),(l&130023424)===l&&(n=Eu+500-Ge(),10<n)){if(tr(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){Mt(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ta(po.bind(null,e,Dt,fr),n);break}po(e,Dt,fr);break;case 4:if($r(e,l),(l&4194240)===l)break;for(n=e.eventTimes,d=-1;0<l;){var w=31-bt(l);p=1<<w,w=n[w],w>d&&(d=w),l&=~p}if(l=d,l=Ge()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*O0(l/1960))-l,10<l){e.timeoutHandle=Ta(po.bind(null,e,Dt,fr),l);break}po(e,Dt,fr);break;case 5:po(e,Dt,fr);break;default:throw Error(o(329))}}}return $t(e,Ge()),e.callbackNode===i?$f.bind(null,e):null}function _u(e,n){var i=Ki;return e.current.memoizedState.isDehydrated&&(ho(e,n).flags|=256),e=gl(e,n),e!==2&&(n=Dt,Dt=i,n!==null&&ju(n)),e}function ju(e){Dt===null?Dt=e:Dt.push.apply(Dt,e)}function F0(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!wn(p(),d))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function $r(e,n){for(n&=~ku,n&=~cl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-bt(n),l=1<<i;e[i]=-1,n&=~l}}function Of(e){if((He&6)!==0)throw Error(o(327));ri();var n=tr(e,0);if((n&1)===0)return $t(e,Ge()),null;var i=gl(e,n);if(e.tag!==0&&i===2){var l=kr(e);l!==0&&(n=l,i=_u(e,l))}if(i===1)throw i=Gi,ho(e,0),$r(e,n),$t(e,Ge()),i;if(i===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,po(e,Dt,fr),$t(e,Ge()),null}function bu(e,n){var i=He;He|=1;try{return e(n)}finally{He=i,He===0&&(ni=Ge()+500,Bs&&Ir())}}function fo(e){Lr!==null&&Lr.tag===0&&(He&6)===0&&ri();var n=He;He|=1;var i=un.transition,l=Be;try{if(un.transition=null,Be=1,e)return e()}finally{Be=l,un.transition=i,He=n,(He&6)===0&&Ir()}}function Pu(){Xt=ti.current,Qe(ti)}function ho(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,g0(i)),lt!==null)for(i=lt.return;i!==null;){var l=i;switch($a(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Hs();break;case 3:Zo(),Qe(Rt),Qe(St),qa();break;case 5:Ka(l);break;case 4:Zo();break;case 13:Qe(tt);break;case 19:Qe(tt);break;case 10:Wa(l.type._context);break;case 22:case 23:Pu()}i=i.return}if(mt=e,lt=e=Or(e.current,null),vt=Xt=n,ft=0,Gi=null,ku=cl=co=0,Dt=Ki=null,lo!==null){for(n=0;n<lo.length;n++)if(i=lo[n],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var w=p.next;p.next=d,l.next=w}i.pending=l}lo=null}return e}function Ff(e,n){do{var i=lt;try{if(Ba(),Js.current=rl,el){for(var l=nt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}el=!1}if(uo=0,pt=dt=nt=null,Vi=!1,Bi=0,Su.current=null,i===null||i.return===null){ft=1,Gi=n,lt=null;break}e:{var p=e,w=i.return,T=i,D=n;if(n=vt,T.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var Z=D,ae=T,ce=ae.tag;if((ae.mode&1)===0&&(ce===0||ce===11||ce===15)){var se=ae.alternate;se?(ae.updateQueue=se.updateQueue,ae.memoizedState=se.memoizedState,ae.lanes=se.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var ge=df(w);if(ge!==null){ge.flags&=-257,ff(ge,w,T,p,n),ge.mode&1&&cf(p,Z,n),n=ge,D=Z;var xe=n.updateQueue;if(xe===null){var we=new Set;we.add(D),n.updateQueue=we}else xe.add(D);break e}else{if((n&1)===0){cf(p,Z,n),Mu();break e}D=Error(o(426))}}else if(Ze&&T.mode&1){var it=df(w);if(it!==null){(it.flags&65536)===0&&(it.flags|=256),ff(it,w,T,p,n),Ha(Jo(D,T));break e}}p=D=Jo(D,T),ft!==4&&(ft=2),Ki===null?Ki=[p]:Ki.push(p),p=w;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var Y=af(p,D,n);Rd(p,Y);break e;case 1:T=D;var F=p.type,Q=p.stateNode;if((p.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Ar===null||!Ar.has(Q)))){p.flags|=65536,n&=-n,p.lanes|=n;var he=uf(p,T,n);Rd(p,he);break e}}p=p.return}while(p!==null)}Bf(i)}catch(Se){n=Se,lt===i&&i!==null&&(lt=i=i.return);continue}break}while(!0)}function Hf(){var e=ul.current;return ul.current=rl,e===null?rl:e}function Mu(){(ft===0||ft===3||ft===2)&&(ft=4),mt===null||(co&268435455)===0&&(cl&268435455)===0||$r(mt,vt)}function gl(e,n){var i=He;He|=2;var l=Hf();(mt!==e||vt!==n)&&(fr=null,ho(e,n));do try{H0();break}catch(d){Ff(e,d)}while(!0);if(Ba(),He=i,ul.current=l,lt!==null)throw Error(o(261));return mt=null,vt=0,ft}function H0(){for(;lt!==null;)Vf(lt)}function V0(){for(;lt!==null&&!to();)Vf(lt)}function Vf(e){var n=Yf(e.alternate,e,Xt);e.memoizedProps=e.pendingProps,n===null?Bf(e):lt=n,Su.current=null}function Bf(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=R0(i,n,Xt),i!==null){lt=i;return}}else{if(i=A0(i,n),i!==null){i.flags&=32767,lt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,lt=null;return}}if(n=n.sibling,n!==null){lt=n;return}lt=n=e}while(n!==null);ft===0&&(ft=5)}function po(e,n,i){var l=Be,d=un.transition;try{un.transition=null,Be=1,B0(e,n,i,l)}finally{un.transition=d,Be=l}return null}function B0(e,n,i,l){do ri();while(Lr!==null);if((He&6)!==0)throw Error(o(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Lo(e,p),e===mt&&(lt=mt=null,vt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||fl||(fl=!0,Xf(gn,function(){return ri(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=un.transition,un.transition=null;var w=Be;Be=1;var T=He;He|=4,Su.current=null,D0(e,i),zf(i,e),u0(Ma),We=!!Pa,Ma=Pa=null,e.current=i,$0(i),xr(),He=T,Be=w,un.transition=p}else e.current=i;if(fl&&(fl=!1,Lr=e,hl=d),p=e.pendingLanes,p===0&&(Ar=null),xi(i.stateNode),$t(e,Ge()),n!==null)for(l=e.onRecoverableError,i=0;i<n.length;i++)d=n[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(dl)throw dl=!1,e=Nu,Nu=null,e;return(hl&1)!==0&&e.tag!==0&&ri(),p=e.pendingLanes,(p&1)!==0?e===Cu?Qi++:(Qi=0,Cu=e):Qi=0,Ir(),null}function ri(){if(Lr!==null){var e=Es(hl),n=un.transition,i=Be;try{if(un.transition=null,Be=16>e?16:e,Lr===null)var l=!1;else{if(e=Lr,Lr=null,hl=0,(He&6)!==0)throw Error(o(331));var d=He;for(He|=4,ve=e.current;ve!==null;){var p=ve,w=p.child;if((ve.flags&16)!==0){var T=p.deletions;if(T!==null){for(var D=0;D<T.length;D++){var Z=T[D];for(ve=Z;ve!==null;){var ae=ve;switch(ae.tag){case 0:case 11:case 15:Xi(8,ae,p)}var ce=ae.child;if(ce!==null)ce.return=ae,ve=ce;else for(;ve!==null;){ae=ve;var se=ae.sibling,ge=ae.return;if(bf(ae),ae===Z){ve=null;break}if(se!==null){se.return=ge,ve=se;break}ve=ge}}}var xe=p.alternate;if(xe!==null){var we=xe.child;if(we!==null){xe.child=null;do{var it=we.sibling;we.sibling=null,we=it}while(we!==null)}}ve=p}}if((p.subtreeFlags&2064)!==0&&w!==null)w.return=p,ve=w;else e:for(;ve!==null;){if(p=ve,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Xi(9,p,p.return)}var Y=p.sibling;if(Y!==null){Y.return=p.return,ve=Y;break e}ve=p.return}}var F=e.current;for(ve=F;ve!==null;){w=ve;var Q=w.child;if((w.subtreeFlags&2064)!==0&&Q!==null)Q.return=w,ve=Q;else e:for(w=F;ve!==null;){if(T=ve,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:al(9,T)}}catch(Se){ot(T,T.return,Se)}if(T===w){ve=null;break e}var he=T.sibling;if(he!==null){he.return=T.return,ve=he;break e}ve=T.return}}if(He=d,Ir(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(er,e)}catch{}l=!0}return l}finally{Be=i,un.transition=n}}return!1}function Wf(e,n,i){n=Jo(i,n),n=af(e,n,1),e=zr(e,n,1),n=Mt(),e!==null&&(vn(e,1,n),$t(e,n))}function ot(e,n,i){if(e.tag===3)Wf(e,e,i);else for(;n!==null;){if(n.tag===3){Wf(n,e,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ar===null||!Ar.has(l))){e=Jo(i,e),e=uf(n,e,1),n=zr(n,e,1),e=Mt(),n!==null&&(vn(n,1,e),$t(n,e));break}}n=n.return}}function W0(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),n=Mt(),e.pingedLanes|=e.suspendedLanes&i,mt===e&&(vt&i)===i&&(ft===4||ft===3&&(vt&130023424)===vt&&500>Ge()-Eu?ho(e,0):ku|=i),$t(e,n)}function Uf(e,n){n===0&&((e.mode&1)===0?n=1:(n=Sr,Sr<<=1,(Sr&130023424)===0&&(Sr=4194304)));var i=Mt();e=ur(e,n),e!==null&&(vn(e,n,i),$t(e,i))}function U0(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Uf(e,i)}function Y0(e,n){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(o(314))}l!==null&&l.delete(n),Uf(e,i)}var Yf;Yf=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||Rt.current)Lt=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return Lt=!1,z0(e,n,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ze&&(n.flags&1048576)!==0&&Nd(n,Us,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;sl(e,n),e=n.pendingProps;var d=Uo(n,St.current);qo(n,i),d=eu(null,n,l,e,d,i);var p=tu();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,At(l)?(p=!0,Vs(n)):p=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Xa(n),d.updater=ol,n.stateNode=d,d._reactInternals=n,lu(n,l,e,i),n=du(null,n,l,!0,p,i)):(n.tag=0,Ze&&p&&Da(n),Pt(null,n,d,i),n=n.child),n;case 16:l=n.elementType;e:{switch(sl(e,n),e=n.pendingProps,d=l._init,l=d(l._payload),n.type=l,d=n.tag=G0(l),e=kn(l,e),d){case 0:n=cu(null,n,l,e,i);break e;case 1:n=vf(null,n,l,e,i);break e;case 11:n=hf(null,n,l,e,i);break e;case 14:n=pf(null,n,l,kn(l.type,e),i);break e}throw Error(o(306,l,""))}return n;case 0:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:kn(l,d),cu(e,n,l,d,i);case 1:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:kn(l,d),vf(e,n,l,d,i);case 3:e:{if(xf(n),e===null)throw Error(o(387));l=n.pendingProps,p=n.memoizedState,d=p.element,zd(e,n),qs(n,l,null,i);var w=n.memoizedState;if(l=w.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){d=Jo(Error(o(423)),n),n=wf(e,n,l,i,d);break e}else if(l!==d){d=Jo(Error(o(424)),n),n=wf(e,n,l,i,d);break e}else for(Yt=br(n.stateNode.containerInfo.firstChild),Ut=n,Ze=!0,Sn=null,i=Id(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Go(),l===d){n=dr(e,n,i);break e}Pt(e,n,l,i)}n=n.child}return n;case 5:return Ld(n),e===null&&Fa(n),l=n.type,d=n.pendingProps,p=e!==null?e.memoizedProps:null,w=d.children,Ia(l,d)?w=null:p!==null&&Ia(l,p)&&(n.flags|=32),yf(e,n),Pt(e,n,w,i),n.child;case 6:return e===null&&Fa(n),null;case 13:return Sf(e,n,i);case 4:return Ga(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Ko(n,null,l,i):Pt(e,n,l,i),n.child;case 11:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:kn(l,d),hf(e,n,l,d,i);case 7:return Pt(e,n,n.pendingProps,i),n.child;case 8:return Pt(e,n,n.pendingProps.children,i),n.child;case 12:return Pt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(l=n.type._context,d=n.pendingProps,p=n.memoizedProps,w=d.value,Ye(Gs,l._currentValue),l._currentValue=w,p!==null)if(wn(p.value,w)){if(p.children===d.children&&!Rt.current){n=dr(e,n,i);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var T=p.dependencies;if(T!==null){w=p.child;for(var D=T.firstContext;D!==null;){if(D.context===l){if(p.tag===1){D=cr(-1,i&-i),D.tag=2;var Z=p.updateQueue;if(Z!==null){Z=Z.shared;var ae=Z.pending;ae===null?D.next=D:(D.next=ae.next,ae.next=D),Z.pending=D}}p.lanes|=i,D=p.alternate,D!==null&&(D.lanes|=i),Ua(p.return,i,n),T.lanes|=i;break}D=D.next}}else if(p.tag===10)w=p.type===n.type?null:p.child;else if(p.tag===18){if(w=p.return,w===null)throw Error(o(341));w.lanes|=i,T=w.alternate,T!==null&&(T.lanes|=i),Ua(w,i,n),w=p.sibling}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===n){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}Pt(e,n,d.children,i),n=n.child}return n;case 9:return d=n.type,l=n.pendingProps.children,qo(n,i),d=ln(d),l=l(d),n.flags|=1,Pt(e,n,l,i),n.child;case 14:return l=n.type,d=kn(l,n.pendingProps),d=kn(l.type,d),pf(e,n,l,d,i);case 15:return mf(e,n,n.type,n.pendingProps,i);case 17:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:kn(l,d),sl(e,n),n.tag=1,At(l)?(e=!0,Vs(n)):e=!1,qo(n,i),sf(n,l,d),lu(n,l,d,i),du(null,n,l,!0,e,i);case 19:return Ef(e,n,i);case 22:return gf(e,n,i)}throw Error(o(156,n.tag))};function Xf(e,n){return Io(e,n)}function X0(e,n,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(e,n,i,l){return new X0(e,n,i,l)}function Iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function G0(e){if(typeof e=="function")return Iu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===X)return 11;if(e===K)return 14}return 2}function Or(e,n){var i=e.alternate;return i===null?(i=cn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function yl(e,n,i,l,d,p){var w=2;if(l=e,typeof e=="function")Iu(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case H:return mo(i.children,d,p,n);case q:w=8,d|=8;break;case J:return e=cn(12,i,n,d|2),e.elementType=J,e.lanes=p,e;case ne:return e=cn(13,i,n,d),e.elementType=ne,e.lanes=p,e;case P:return e=cn(19,i,n,d),e.elementType=P,e.lanes=p,e;case G:return vl(i,d,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:w=10;break e;case U:w=9;break e;case X:w=11;break e;case K:w=14;break e;case V:w=16,l=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return n=cn(w,i,n,d),n.elementType=e,n.type=l,n.lanes=p,n}function mo(e,n,i,l){return e=cn(7,e,l,n),e.lanes=i,e}function vl(e,n,i,l){return e=cn(22,e,l,n),e.elementType=G,e.lanes=i,e.stateNode={isHidden:!1},e}function Tu(e,n,i){return e=cn(6,e,null,n),e.lanes=i,e}function zu(e,n,i){return n=cn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function K0(e,n,i,l,d){this.tag=n,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=yn(0),this.expirationTimes=yn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Ru(e,n,i,l,d,p,w,T,D){return e=new K0(e,n,i,T,D),n===1?(n=1,p===!0&&(n|=8)):n=0,p=cn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xa(p),e}function Q0(e,n,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:l==null?null:""+l,children:e,containerInfo:n,implementation:i}}function Gf(e){if(!e)return Mr;e=e._reactInternals;e:{if(wt(e)!==e||e.tag!==1)throw Error(o(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(At(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(e.tag===1){var i=e.type;if(At(i))return Sd(e,i,n)}return n}function Kf(e,n,i,l,d,p,w,T,D){return e=Ru(i,l,!0,e,d,p,w,T,D),e.context=Gf(null),i=e.current,l=Mt(),d=Dr(i),p=cr(l,d),p.callback=n??null,zr(i,p,d),e.current.lanes=d,vn(e,d,l),$t(e,l),e}function xl(e,n,i,l){var d=n.current,p=Mt(),w=Dr(d);return i=Gf(i),n.context===null?n.context=i:n.pendingContext=i,n=cr(p,w),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=zr(d,n,w),e!==null&&(Cn(e,d,w,p),Qs(e,d,w)),w}function wl(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 Qf(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Au(e,n){Qf(e,n),(e=e.alternate)&&Qf(e,n)}function q0(){return null}var qf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lu(e){this._internalRoot=e}Sl.prototype.render=Lu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));xl(e,n,null,null)},Sl.prototype.unmount=Lu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;fo(function(){xl(null,e,null,null)}),n[ir]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Cs();e={blockedOn:null,target:e,priority:n};for(var i=0;i<xn.length&&n!==0&&n<xn[i].priority;i++);xn.splice(i,0,e),i===0&&le(e)}};function Du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zf(){}function Z0(e,n,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var Z=wl(w);p.call(Z)}}var w=Kf(n,l,e,0,null,!1,!1,"",Zf);return e._reactRootContainer=w,e[ir]=w.current,Ri(e.nodeType===8?e.parentNode:e),fo(),w}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var T=l;l=function(){var Z=wl(D);T.call(Z)}}var D=Ru(e,0,!1,null,null,!1,!1,"",Zf);return e._reactRootContainer=D,e[ir]=D.current,Ri(e.nodeType===8?e.parentNode:e),fo(function(){xl(n,D,i,l)}),D}function El(e,n,i,l,d){var p=i._reactRootContainer;if(p){var w=p;if(typeof d=="function"){var T=d;d=function(){var D=wl(w);T.call(D)}}xl(n,w,e,d)}else w=Z0(i,n,e,d,l);return wl(w)}Er=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=Vt(n.pendingLanes);i!==0&&(Ei(n,i|1),$t(n,Ge()),(He&6)===0&&(ni=Ge()+500,Ir()))}break;case 13:fo(function(){var l=ur(e,1);if(l!==null){var d=Mt();Cn(l,e,1,d)}}),Au(e,1)}},Ni=function(e){if(e.tag===13){var n=ur(e,134217728);if(n!==null){var i=Mt();Cn(n,e,134217728,i)}Au(e,134217728)}},Ns=function(e){if(e.tag===13){var n=Dr(e),i=ur(e,n);if(i!==null){var l=Mt();Cn(i,e,n,l)}Au(e,n)}},Cs=function(){return Be},_s=function(e,n){var i=Be;try{return Be=e,n()}finally{Be=i}},Jn=function(e,n,i){switch(n){case"input":if(Xe(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var d=Fs(l);if(!d)throw Error(o(90));Ce(l),Xe(l,d)}}}break;case"textarea":Kn(e,i);break;case"select":n=i.value,n!=null&&It(e,!!i.multiple,n,!1)}},_o=bu,qr=fo;var J0={usingClientEntryPoint:!1,Events:[Di,Bo,Fs,Qr,ct,bu]},qi={findFiberByHostInstance:ro,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ey={bundleType:qi.bundleType,version:qi.version,rendererPackageName:qi.rendererPackageName,rendererConfig:qi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Po(e),e===null?null:e.stateNode},findFiberByHostInstance:qi.findFiberByHostInstance||q0,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 Nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nl.isDisabled&&Nl.supportsFiber)try{er=Nl.inject(ey),zt=Nl}catch{}}return Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J0,Ot.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Du(n))throw Error(o(200));return Q0(e,n,null,i)},Ot.createRoot=function(e,n){if(!Du(e))throw Error(o(299));var i=!1,l="",d=qf;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(d=n.onRecoverableError)),n=Ru(e,1,!1,null,null,i,!1,l,d),e[ir]=n.current,Ri(e.nodeType===8?e.parentNode:e),new Lu(n)},Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Po(n),e=e===null?null:e.stateNode,e},Ot.flushSync=function(e){return fo(e)},Ot.hydrate=function(e,n,i){if(!kl(n))throw Error(o(200));return El(null,e,n,!0,i)},Ot.hydrateRoot=function(e,n,i){if(!Du(e))throw Error(o(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",w=qf;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),n=Kf(n,null,e,1,i??null,d,!1,p,w),e[ir]=n.current,Ri(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,d]:n.mutableSourceEagerHydrationData.push(i,d);return new Sl(n)},Ot.render=function(e,n,i){if(!kl(n))throw Error(o(200));return El(null,e,n,!1,i)},Ot.unmountComponentAtNode=function(e){if(!kl(e))throw Error(o(40));return e._reactRootContainer?(fo(function(){El(null,null,e,!1,function(){e._reactRootContainer=null,e[ir]=null})}),!0):!1},Ot.unstable_batchedUpdates=bu,Ot.unstable_renderSubtreeIntoContainer=function(e,n,i,l){if(!kl(i))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return El(e,n,i,!1,l)},Ot.version="18.3.1-next-f1338f8080-20240426",Ot}var sh;function Cp(){if(sh)return Fu.exports;sh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Fu.exports=ly(),Fu.exports}var lh;function ay(){if(lh)return Cl;lh=1;var t=Cp();return Cl.createRoot=t.createRoot,Cl.hydrateRoot=t.hydrateRoot,Cl}var uy=ay();const cy=vc(uy);function at(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let o=0,s;o<t.length;o++)(s=at(t[o]))!==""&&(r+=(r&&" ")+s);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var dy={value:()=>{}};function Jl(){for(var t=0,r=arguments.length,o={},s;t<r;++t){if(!(s=arguments[t]+"")||s in o||/[\s.]/.test(s))throw new Error("illegal type: "+s);o[s]=[]}return new Ll(o)}function Ll(t){this._=t}function fy(t,r){return t.trim().split(/^|\s+/).map(function(o){var s="",a=o.indexOf(".");if(a>=0&&(s=o.slice(a+1),o=o.slice(0,a)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:s}})}Ll.prototype=Jl.prototype={constructor:Ll,on:function(t,r){var o=this._,s=fy(t+"",o),a,u=-1,c=s.length;if(arguments.length<2){for(;++u<c;)if((a=(t=s[u]).type)&&(a=hy(o[a],t.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<c;)if(a=(t=s[u]).type)o[a]=ah(o[a],t.name,r);else if(r==null)for(a in o)o[a]=ah(o[a],t.name,null);return this},copy:function(){var t={},r=this._;for(var o in r)t[o]=r[o].slice();return new Ll(t)},call:function(t,r){if((a=arguments.length-2)>0)for(var o=new Array(a),s=0,a,u;s<a;++s)o[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],s=0,a=u.length;s<a;++s)u[s].value.apply(r,o)},apply:function(t,r,o){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],a=0,u=s.length;a<u;++a)s[a].value.apply(r,o)}};function hy(t,r){for(var o=0,s=t.length,a;o<s;++o)if((a=t[o]).name===r)return a.value}function ah(t,r,o){for(var s=0,a=t.length;s<a;++s)if(t[s].name===r){t[s]=dy,t=t.slice(0,s).concat(t.slice(s+1));break}return o!=null&&t.push({name:r,value:o}),t}var rc="http://www.w3.org/1999/xhtml";const uh={svg:"http://www.w3.org/2000/svg",xhtml:rc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ea(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),uh.hasOwnProperty(r)?{space:uh[r],local:t}:t}function py(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===rc&&r.documentElement.namespaceURI===rc?r.createElement(t):r.createElementNS(o,t)}}function my(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function _p(t){var r=ea(t);return(r.local?my:py)(r)}function gy(){}function xc(t){return t==null?gy:function(){return this.querySelector(t)}}function yy(t){typeof t!="function"&&(t=xc(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=new Array(c),m,g,x=0;x<c;++x)(m=u[x])&&(g=t.call(m,m.__data__,x,u))&&("__data__"in m&&(g.__data__=m.__data__),h[x]=g);return new Qt(s,this._parents)}function vy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function xy(){return[]}function jp(t){return t==null?xy:function(){return this.querySelectorAll(t)}}function wy(t){return function(){return vy(t.apply(this,arguments))}}function Sy(t){typeof t=="function"?t=wy(t):t=jp(t);for(var r=this._groups,o=r.length,s=[],a=[],u=0;u<o;++u)for(var c=r[u],h=c.length,m,g=0;g<h;++g)(m=c[g])&&(s.push(t.call(m,m.__data__,g,c)),a.push(m));return new Qt(s,a)}function bp(t){return function(){return this.matches(t)}}function Pp(t){return function(r){return r.matches(t)}}var ky=Array.prototype.find;function Ey(t){return function(){return ky.call(this.children,t)}}function Ny(){return this.firstElementChild}function Cy(t){return this.select(t==null?Ny:Ey(typeof t=="function"?t:Pp(t)))}var _y=Array.prototype.filter;function jy(){return Array.from(this.children)}function by(t){return function(){return _y.call(this.children,t)}}function Py(t){return this.selectAll(t==null?jy:by(typeof t=="function"?t:Pp(t)))}function My(t){typeof t!="function"&&(t=bp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=[],m,g=0;g<c;++g)(m=u[g])&&t.call(m,m.__data__,g,u)&&h.push(m);return new Qt(s,this._parents)}function Mp(t){return new Array(t.length)}function Iy(){return new Qt(this._enter||this._groups.map(Mp),this._parents)}function Hl(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Hl.prototype={constructor:Hl,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ty(t){return function(){return t}}function zy(t,r,o,s,a,u){for(var c=0,h,m=r.length,g=u.length;c<g;++c)(h=r[c])?(h.__data__=u[c],s[c]=h):o[c]=new Hl(t,u[c]);for(;c<m;++c)(h=r[c])&&(a[c]=h)}function Ry(t,r,o,s,a,u,c){var h,m,g=new Map,x=r.length,y=u.length,v=new Array(x),_;for(h=0;h<x;++h)(m=r[h])&&(v[h]=_=c.call(m,m.__data__,h,r)+"",g.has(_)?a[h]=m:g.set(_,m));for(h=0;h<y;++h)_=c.call(t,u[h],h,u)+"",(m=g.get(_))?(s[h]=m,m.__data__=u[h],g.delete(_)):o[h]=new Hl(t,u[h]);for(h=0;h<x;++h)(m=r[h])&&g.get(v[h])===m&&(a[h]=m)}function Ay(t){return t.__data__}function Ly(t,r){if(!arguments.length)return Array.from(this,Ay);var o=r?Ry:zy,s=this._parents,a=this._groups;typeof t!="function"&&(t=Ty(t));for(var u=a.length,c=new Array(u),h=new Array(u),m=new Array(u),g=0;g<u;++g){var x=s[g],y=a[g],v=y.length,_=Dy(t.call(x,x&&x.__data__,g,s)),S=_.length,N=h[g]=new Array(S),E=c[g]=new Array(S),k=m[g]=new Array(v);o(x,y,N,E,k,_,r);for(var I=0,C=0,j,O;I<S;++I)if(j=N[I]){for(I>=C&&(C=I+1);!(O=E[C])&&++C<S;);j._next=O||null}}return c=new Qt(c,s),c._enter=h,c._exit=m,c}function Dy(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function $y(){return new Qt(this._exit||this._groups.map(Mp),this._parents)}function Oy(t,r,o){var s=this.enter(),a=this,u=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(a=r(a),a&&(a=a.selection())),o==null?u.remove():o(u),s&&a?s.merge(a).order():a}function Fy(t){for(var r=t.selection?t.selection():t,o=this._groups,s=r._groups,a=o.length,u=s.length,c=Math.min(a,u),h=new Array(a),m=0;m<c;++m)for(var g=o[m],x=s[m],y=g.length,v=h[m]=new Array(y),_,S=0;S<y;++S)(_=g[S]||x[S])&&(v[S]=_);for(;m<a;++m)h[m]=o[m];return new Qt(h,this._parents)}function Hy(){for(var t=this._groups,r=-1,o=t.length;++r<o;)for(var s=t[r],a=s.length-1,u=s[a],c;--a>=0;)(c=s[a])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function Vy(t){t||(t=By);function r(y,v){return y&&v?t(y.__data__,v.__data__):!y-!v}for(var o=this._groups,s=o.length,a=new Array(s),u=0;u<s;++u){for(var c=o[u],h=c.length,m=a[u]=new Array(h),g,x=0;x<h;++x)(g=c[x])&&(m[x]=g);m.sort(r)}return new Qt(a,this._parents).order()}function By(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Wy(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Uy(){return Array.from(this)}function Yy(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],a=0,u=s.length;a<u;++a){var c=s[a];if(c)return c}return null}function Xy(){let t=0;for(const r of this)++t;return t}function Gy(){return!this.node()}function Ky(t){for(var r=this._groups,o=0,s=r.length;o<s;++o)for(var a=r[o],u=0,c=a.length,h;u<c;++u)(h=a[u])&&t.call(h,h.__data__,u,a);return this}function Qy(t){return function(){this.removeAttribute(t)}}function qy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zy(t,r){return function(){this.setAttribute(t,r)}}function Jy(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function ev(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function tv(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function nv(t,r){var o=ea(t);if(arguments.length<2){var s=this.node();return o.local?s.getAttributeNS(o.space,o.local):s.getAttribute(o)}return this.each((r==null?o.local?qy:Qy:typeof r=="function"?o.local?tv:ev:o.local?Jy:Zy)(o,r))}function Ip(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function rv(t){return function(){this.style.removeProperty(t)}}function ov(t,r,o){return function(){this.style.setProperty(t,r,o)}}function iv(t,r,o){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,o)}}function sv(t,r,o){return arguments.length>1?this.each((r==null?rv:typeof r=="function"?iv:ov)(t,r,o??"")):fi(this.node(),t)}function fi(t,r){return t.style.getPropertyValue(r)||Ip(t).getComputedStyle(t,null).getPropertyValue(r)}function lv(t){return function(){delete this[t]}}function av(t,r){return function(){this[t]=r}}function uv(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function cv(t,r){return arguments.length>1?this.each((r==null?lv:typeof r=="function"?uv:av)(t,r)):this.node()[t]}function Tp(t){return t.trim().split(/^|\s+/)}function wc(t){return t.classList||new zp(t)}function zp(t){this._node=t,this._names=Tp(t.getAttribute("class")||"")}zp.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Rp(t,r){for(var o=wc(t),s=-1,a=r.length;++s<a;)o.add(r[s])}function Ap(t,r){for(var o=wc(t),s=-1,a=r.length;++s<a;)o.remove(r[s])}function dv(t){return function(){Rp(this,t)}}function fv(t){return function(){Ap(this,t)}}function hv(t,r){return function(){(r.apply(this,arguments)?Rp:Ap)(this,t)}}function pv(t,r){var o=Tp(t+"");if(arguments.length<2){for(var s=wc(this.node()),a=-1,u=o.length;++a<u;)if(!s.contains(o[a]))return!1;return!0}return this.each((typeof r=="function"?hv:r?dv:fv)(o,r))}function mv(){this.textContent=""}function gv(t){return function(){this.textContent=t}}function yv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function vv(t){return arguments.length?this.each(t==null?mv:(typeof t=="function"?yv:gv)(t)):this.node().textContent}function xv(){this.innerHTML=""}function wv(t){return function(){this.innerHTML=t}}function Sv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function kv(t){return arguments.length?this.each(t==null?xv:(typeof t=="function"?Sv:wv)(t)):this.node().innerHTML}function Ev(){this.nextSibling&&this.parentNode.appendChild(this)}function Nv(){return this.each(Ev)}function Cv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _v(){return this.each(Cv)}function jv(t){var r=typeof t=="function"?t:_p(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function bv(){return null}function Pv(t,r){var o=typeof t=="function"?t:_p(t),s=r==null?bv:typeof r=="function"?r:xc(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function Mv(){var t=this.parentNode;t&&t.removeChild(this)}function Iv(){return this.each(Mv)}function Tv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function zv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Rv(t){return this.select(t?zv:Tv)}function Av(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Lv(t){return function(r){t.call(this,r,this.__data__)}}function Dv(t){return t.trim().split(/^|\s+/).map(function(r){var o="",s=r.indexOf(".");return s>=0&&(o=r.slice(s+1),r=r.slice(0,s)),{type:r,name:o}})}function $v(t){return function(){var r=this.__on;if(r){for(var o=0,s=-1,a=r.length,u;o<a;++o)u=r[o],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):r[++s]=u;++s?r.length=s:delete this.__on}}}function Ov(t,r,o){return function(){var s=this.__on,a,u=Lv(r);if(s){for(var c=0,h=s.length;c<h;++c)if((a=s[c]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=u,a.options=o),a.value=r;return}}this.addEventListener(t.type,u,o),a={type:t.type,name:t.name,value:r,listener:u,options:o},s?s.push(a):this.__on=[a]}}function Fv(t,r,o){var s=Dv(t+""),a,u=s.length,c;if(arguments.length<2){var h=this.node().__on;if(h){for(var m=0,g=h.length,x;m<g;++m)for(a=0,x=h[m];a<u;++a)if((c=s[a]).type===x.type&&c.name===x.name)return x.value}return}for(h=r?Ov:$v,a=0;a<u;++a)this.each(h(s[a],r,o));return this}function Lp(t,r,o){var s=Ip(t),a=s.CustomEvent;typeof a=="function"?a=new a(r,o):(a=s.document.createEvent("Event"),o?(a.initEvent(r,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(r,!1,!1)),t.dispatchEvent(a)}function Hv(t,r){return function(){return Lp(this,t,r)}}function Vv(t,r){return function(){return Lp(this,t,r.apply(this,arguments))}}function Bv(t,r){return this.each((typeof r=="function"?Vv:Hv)(t,r))}function*Wv(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],a=0,u=s.length,c;a<u;++a)(c=s[a])&&(yield c)}var Dp=[null];function Qt(t,r){this._groups=t,this._parents=r}function gs(){return new Qt([[document.documentElement]],Dp)}function Uv(){return this}Qt.prototype=gs.prototype={constructor:Qt,select:yy,selectAll:Sy,selectChild:Cy,selectChildren:Py,filter:My,data:Ly,enter:Iy,exit:$y,join:Oy,merge:Fy,selection:Uv,order:Hy,sort:Vy,call:Wy,nodes:Uy,node:Yy,size:Xy,empty:Gy,each:Ky,attr:nv,style:sv,property:cv,classed:pv,text:vv,html:kv,raise:Nv,lower:_v,append:jv,insert:Pv,remove:Iv,clone:Rv,datum:Av,on:Fv,dispatch:Bv,[Symbol.iterator]:Wv};function Kt(t){return typeof t=="string"?new Qt([[document.querySelector(t)]],[document.documentElement]):new Qt([[t]],Dp)}function Yv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function _n(t,r){if(t=Yv(t),r===void 0&&(r=t.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var s=o.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var a=r.getBoundingClientRect();return[t.clientX-a.left-r.clientLeft,t.clientY-a.top-r.clientTop]}}return[t.pageX,t.pageY]}const Xv={passive:!1},is={capture:!0,passive:!1};function Bu(t){t.stopImmediatePropagation()}function ci(t){t.preventDefault(),t.stopImmediatePropagation()}function $p(t){var r=t.document.documentElement,o=Kt(t).on("dragstart.drag",ci,is);"onselectstart"in r?o.on("selectstart.drag",ci,is):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Op(t,r){var o=t.document.documentElement,s=Kt(t).on("dragstart.drag",null);r&&(s.on("click.drag",ci,is),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in o?s.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const _l=t=>()=>t;function oc(t,{sourceEvent:r,subject:o,target:s,identifier:a,active:u,x:c,y:h,dx:m,dy:g,dispatch:x}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:x}})}oc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Gv(t){return!t.ctrlKey&&!t.button}function Kv(){return this.parentNode}function Qv(t,r){return r??{x:t.x,y:t.y}}function qv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fp(){var t=Gv,r=Kv,o=Qv,s=qv,a={},u=Jl("start","drag","end"),c=0,h,m,g,x,y=0;function v(j){j.on("mousedown.drag",_).filter(s).on("touchstart.drag",E).on("touchmove.drag",k,Xv).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(j,O){if(!(x||!t.call(this,j,O))){var A=C(this,r.call(this,j,O),j,O,"mouse");A&&(Kt(j.view).on("mousemove.drag",S,is).on("mouseup.drag",N,is),$p(j.view),Bu(j),g=!1,h=j.clientX,m=j.clientY,A("start",j))}}function S(j){if(ci(j),!g){var O=j.clientX-h,A=j.clientY-m;g=O*O+A*A>y}a.mouse("drag",j)}function N(j){Kt(j.view).on("mousemove.drag mouseup.drag",null),Op(j.view,g),ci(j),a.mouse("end",j)}function E(j,O){if(t.call(this,j,O)){var A=j.changedTouches,H=r.call(this,j,O),q=A.length,J,ee;for(J=0;J<q;++J)(ee=C(this,H,j,O,A[J].identifier,A[J]))&&(Bu(j),ee("start",j,A[J]))}}function k(j){var O=j.changedTouches,A=O.length,H,q;for(H=0;H<A;++H)(q=a[O[H].identifier])&&(ci(j),q("drag",j,O[H]))}function I(j){var O=j.changedTouches,A=O.length,H,q;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),H=0;H<A;++H)(q=a[O[H].identifier])&&(Bu(j),q("end",j,O[H]))}function C(j,O,A,H,q,J){var ee=u.copy(),U=_n(J||A,O),X,ne,P;if((P=o.call(j,new oc("beforestart",{sourceEvent:A,target:v,identifier:q,active:c,x:U[0],y:U[1],dx:0,dy:0,dispatch:ee}),H))!=null)return X=P.x-U[0]||0,ne=P.y-U[1]||0,function K(V,G,z){var R=U,B;switch(V){case"start":a[q]=K,B=c++;break;case"end":delete a[q],--c;case"drag":U=_n(z||G,O),B=c;break}ee.call(V,j,new oc(V,{sourceEvent:G,subject:P,target:v,identifier:q,active:B,x:U[0]+X,y:U[1]+ne,dx:U[0]-R[0],dy:U[1]-R[1],dispatch:ee}),H)}}return v.filter=function(j){return arguments.length?(t=typeof j=="function"?j:_l(!!j),v):t},v.container=function(j){return arguments.length?(r=typeof j=="function"?j:_l(j),v):r},v.subject=function(j){return arguments.length?(o=typeof j=="function"?j:_l(j),v):o},v.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:_l(!!j),v):s},v.on=function(){var j=u.on.apply(u,arguments);return j===u?v:j},v.clickDistance=function(j){return arguments.length?(y=(j=+j)*j,v):Math.sqrt(y)},v}function Sc(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function Hp(t,r){var o=Object.create(t.prototype);for(var s in r)o[s]=r[s];return o}function ys(){}var ss=.7,Vl=1/ss,di="\\s*([+-]?\\d+)\\s*",ls="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zv=/^#([0-9a-f]{3,8})$/,Jv=new RegExp(`^rgb\\(${di},${di},${di}\\)$`),ex=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),tx=new RegExp(`^rgba\\(${di},${di},${di},${ls}\\)$`),nx=new RegExp(`^rgba\\(${Un},${Un},${Un},${ls}\\)$`),rx=new RegExp(`^hsl\\(${ls},${Un},${Un}\\)$`),ox=new RegExp(`^hsla\\(${ls},${Un},${Un},${ls}\\)$`),ch={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};Sc(ys,wo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dh,formatHex:dh,formatHex8:ix,formatHsl:sx,formatRgb:fh,toString:fh});function dh(){return this.rgb().formatHex()}function ix(){return this.rgb().formatHex8()}function sx(){return Vp(this).formatHsl()}function fh(){return this.rgb().formatRgb()}function wo(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=Zv.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?hh(r):o===3?new Ft(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?jl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?jl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Jv.exec(t))?new Ft(r[1],r[2],r[3],1):(r=ex.exec(t))?new Ft(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=tx.exec(t))?jl(r[1],r[2],r[3],r[4]):(r=nx.exec(t))?jl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=rx.exec(t))?gh(r[1],r[2]/100,r[3]/100,1):(r=ox.exec(t))?gh(r[1],r[2]/100,r[3]/100,r[4]):ch.hasOwnProperty(t)?hh(ch[t]):t==="transparent"?new Ft(NaN,NaN,NaN,0):null}function hh(t){return new Ft(t>>16&255,t>>8&255,t&255,1)}function jl(t,r,o,s){return s<=0&&(t=r=o=NaN),new Ft(t,r,o,s)}function lx(t){return t instanceof ys||(t=wo(t)),t?(t=t.rgb(),new Ft(t.r,t.g,t.b,t.opacity)):new Ft}function ic(t,r,o,s){return arguments.length===1?lx(t):new Ft(t,r,o,s??1)}function Ft(t,r,o,s){this.r=+t,this.g=+r,this.b=+o,this.opacity=+s}Sc(Ft,ic,Hp(ys,{brighter(t){return t=t==null?Vl:Math.pow(Vl,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ss:Math.pow(ss,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ft(vo(this.r),vo(this.g),vo(this.b),Bl(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:ph,formatHex:ph,formatHex8:ax,formatRgb:mh,toString:mh}));function ph(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}`}function ax(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}${yo((isNaN(this.opacity)?1:this.opacity)*255)}`}function mh(){const t=Bl(this.opacity);return`${t===1?"rgb(":"rgba("}${vo(this.r)}, ${vo(this.g)}, ${vo(this.b)}${t===1?")":`, ${t})`}`}function Bl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function yo(t){return t=vo(t),(t<16?"0":"")+t.toString(16)}function gh(t,r,o,s){return s<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new jn(t,r,o,s)}function Vp(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof ys||(t=wo(t)),!t)return new jn;if(t instanceof jn)return t;t=t.rgb();var r=t.r/255,o=t.g/255,s=t.b/255,a=Math.min(r,o,s),u=Math.max(r,o,s),c=NaN,h=u-a,m=(u+a)/2;return h?(r===u?c=(o-s)/h+(o<s)*6:o===u?c=(s-r)/h+2:c=(r-o)/h+4,h/=m<.5?u+a:2-u-a,c*=60):h=m>0&&m<1?0:c,new jn(c,h,m,t.opacity)}function ux(t,r,o,s){return arguments.length===1?Vp(t):new jn(t,r,o,s??1)}function jn(t,r,o,s){this.h=+t,this.s=+r,this.l=+o,this.opacity=+s}Sc(jn,ux,Hp(ys,{brighter(t){return t=t==null?Vl:Math.pow(Vl,t),new jn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ss:Math.pow(ss,t),new jn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,o=this.l,s=o+(o<.5?o:1-o)*r,a=2*o-s;return new Ft(Wu(t>=240?t-240:t+120,a,s),Wu(t,a,s),Wu(t<120?t+240:t-120,a,s),this.opacity)},clamp(){return new jn(yh(this.h),bl(this.s),bl(this.l),Bl(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 t=Bl(this.opacity);return`${t===1?"hsl(":"hsla("}${yh(this.h)}, ${bl(this.s)*100}%, ${bl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yh(t){return t=(t||0)%360,t<0?t+360:t}function bl(t){return Math.max(0,Math.min(1,t||0))}function Wu(t,r,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const kc=t=>()=>t;function cx(t,r){return function(o){return t+o*r}}function dx(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(s){return Math.pow(t+s*r,o)}}function fx(t){return(t=+t)==1?Bp:function(r,o){return o-r?dx(r,o,t):kc(isNaN(r)?o:r)}}function Bp(t,r){var o=r-t;return o?cx(t,o):kc(isNaN(t)?r:t)}const Wl=(function t(r){var o=fx(r);function s(a,u){var c=o((a=ic(a)).r,(u=ic(u)).r),h=o(a.g,u.g),m=o(a.b,u.b),g=Bp(a.opacity,u.opacity);return function(x){return a.r=c(x),a.g=h(x),a.b=m(x),a.opacity=g(x),a+""}}return s.gamma=t,s})(1);function hx(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,s=r.slice(),a;return function(u){for(a=0;a<o;++a)s[a]=t[a]*(1-u)+r[a]*u;return s}}function px(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function mx(t,r){var o=r?r.length:0,s=t?Math.min(o,t.length):0,a=new Array(s),u=new Array(o),c;for(c=0;c<s;++c)a[c]=rs(t[c],r[c]);for(;c<o;++c)u[c]=r[c];return function(h){for(c=0;c<s;++c)u[c]=a[c](h);return u}}function gx(t,r){var o=new Date;return t=+t,r=+r,function(s){return o.setTime(t*(1-s)+r*s),o}}function Wn(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function yx(t,r){var o={},s={},a;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(a in r)a in t?o[a]=rs(t[a],r[a]):s[a]=r[a];return function(u){for(a in o)s[a]=o[a](u);return s}}var sc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uu=new RegExp(sc.source,"g");function vx(t){return function(){return t}}function xx(t){return function(r){return t(r)+""}}function Wp(t,r){var o=sc.lastIndex=Uu.lastIndex=0,s,a,u,c=-1,h=[],m=[];for(t=t+"",r=r+"";(s=sc.exec(t))&&(a=Uu.exec(r));)(u=a.index)>o&&(u=r.slice(o,u),h[c]?h[c]+=u:h[++c]=u),(s=s[0])===(a=a[0])?h[c]?h[c]+=a:h[++c]=a:(h[++c]=null,m.push({i:c,x:Wn(s,a)})),o=Uu.lastIndex;return o<r.length&&(u=r.slice(o),h[c]?h[c]+=u:h[++c]=u),h.length<2?m[0]?xx(m[0].x):vx(r):(r=m.length,function(g){for(var x=0,y;x<r;++x)h[(y=m[x]).i]=y.x(g);return h.join("")})}function rs(t,r){var o=typeof r,s;return r==null||o==="boolean"?kc(r):(o==="number"?Wn:o==="string"?(s=wo(r))?(r=s,Wl):Wp:r instanceof wo?Wl:r instanceof Date?gx:px(r)?hx:Array.isArray(r)?mx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?yx:Wn)(t,r)}var vh=180/Math.PI,lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Up(t,r,o,s,a,u){var c,h,m;return(c=Math.sqrt(t*t+r*r))&&(t/=c,r/=c),(m=t*o+r*s)&&(o-=t*m,s-=r*m),(h=Math.sqrt(o*o+s*s))&&(o/=h,s/=h,m/=h),t*s<r*o&&(t=-t,r=-r,m=-m,c=-c),{translateX:a,translateY:u,rotate:Math.atan2(r,t)*vh,skewX:Math.atan(m)*vh,scaleX:c,scaleY:h}}var Pl;function wx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?lc:Up(r.a,r.b,r.c,r.d,r.e,r.f)}function Sx(t){return t==null||(Pl||(Pl=document.createElementNS("http://www.w3.org/2000/svg","g")),Pl.setAttribute("transform",t),!(t=Pl.transform.baseVal.consolidate()))?lc:(t=t.matrix,Up(t.a,t.b,t.c,t.d,t.e,t.f))}function Yp(t,r,o,s){function a(g){return g.length?g.pop()+" ":""}function u(g,x,y,v,_,S){if(g!==y||x!==v){var N=_.push("translate(",null,r,null,o);S.push({i:N-4,x:Wn(g,y)},{i:N-2,x:Wn(x,v)})}else(y||v)&&_.push("translate("+y+r+v+o)}function c(g,x,y,v){g!==x?(g-x>180?x+=360:x-g>180&&(g+=360),v.push({i:y.push(a(y)+"rotate(",null,s)-2,x:Wn(g,x)})):x&&y.push(a(y)+"rotate("+x+s)}function h(g,x,y,v){g!==x?v.push({i:y.push(a(y)+"skewX(",null,s)-2,x:Wn(g,x)}):x&&y.push(a(y)+"skewX("+x+s)}function m(g,x,y,v,_,S){if(g!==y||x!==v){var N=_.push(a(_)+"scale(",null,",",null,")");S.push({i:N-4,x:Wn(g,y)},{i:N-2,x:Wn(x,v)})}else(y!==1||v!==1)&&_.push(a(_)+"scale("+y+","+v+")")}return function(g,x){var y=[],v=[];return g=t(g),x=t(x),u(g.translateX,g.translateY,x.translateX,x.translateY,y,v),c(g.rotate,x.rotate,y,v),h(g.skewX,x.skewX,y,v),m(g.scaleX,g.scaleY,x.scaleX,x.scaleY,y,v),g=x=null,function(_){for(var S=-1,N=v.length,E;++S<N;)y[(E=v[S]).i]=E.x(_);return y.join("")}}}var kx=Yp(wx,"px, ","px)","deg)"),Ex=Yp(Sx,", ",")",")"),Nx=1e-12;function xh(t){return((t=Math.exp(t))+1/t)/2}function Cx(t){return((t=Math.exp(t))-1/t)/2}function _x(t){return((t=Math.exp(2*t))-1)/(t+1)}const Dl=(function t(r,o,s){function a(u,c){var h=u[0],m=u[1],g=u[2],x=c[0],y=c[1],v=c[2],_=x-h,S=y-m,N=_*_+S*S,E,k;if(N<Nx)k=Math.log(v/g)/r,E=function(H){return[h+H*_,m+H*S,g*Math.exp(r*H*k)]};else{var I=Math.sqrt(N),C=(v*v-g*g+s*N)/(2*g*o*I),j=(v*v-g*g-s*N)/(2*v*o*I),O=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(j*j+1)-j);k=(A-O)/r,E=function(H){var q=H*k,J=xh(O),ee=g/(o*I)*(J*_x(r*q+O)-Cx(O));return[h+ee*_,m+ee*S,g*J/xh(r*q+O)]}}return E.duration=k*1e3*r/Math.SQRT2,E}return a.rho=function(u){var c=Math.max(.001,+u),h=c*c,m=h*h;return t(c,h,m)},a})(Math.SQRT2,2,4);var hi=0,ts=0,Ji=0,Xp=1e3,Ul,ns,Yl=0,So=0,ta=0,as=typeof performance=="object"&&performance.now?performance:Date,Gp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ec(){return So||(Gp(jx),So=as.now()+ta)}function jx(){So=0}function Xl(){this._call=this._time=this._next=null}Xl.prototype=Kp.prototype={constructor:Xl,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?Ec():+o)+(r==null?0:+r),!this._next&&ns!==this&&(ns?ns._next=this:Ul=this,ns=this),this._call=t,this._time=o,ac()},stop:function(){this._call&&(this._call=null,this._time=1/0,ac())}};function Kp(t,r,o){var s=new Xl;return s.restart(t,r,o),s}function bx(){Ec(),++hi;for(var t=Ul,r;t;)(r=So-t._time)>=0&&t._call.call(void 0,r),t=t._next;--hi}function wh(){So=(Yl=as.now())+ta,hi=ts=0;try{bx()}finally{hi=0,Mx(),So=0}}function Px(){var t=as.now(),r=t-Yl;r>Xp&&(ta-=r,Yl=t)}function Mx(){for(var t,r=Ul,o,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(o=r._next,r._next=null,r=t?t._next=o:Ul=o);ns=t,ac(s)}function ac(t){if(!hi){ts&&(ts=clearTimeout(ts));var r=t-So;r>24?(t<1/0&&(ts=setTimeout(wh,t-as.now()-ta)),Ji&&(Ji=clearInterval(Ji))):(Ji||(Yl=as.now(),Ji=setInterval(Px,Xp)),hi=1,Gp(wh))}}function Sh(t,r,o){var s=new Xl;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,o),s}var Ix=Jl("start","end","cancel","interrupt"),Tx=[],Qp=0,kh=1,uc=2,$l=3,Eh=4,cc=5,Ol=6;function na(t,r,o,s,a,u){var c=t.__transition;if(!c)t.__transition={};else if(o in c)return;zx(t,o,{name:r,index:s,group:a,on:Ix,tween:Tx,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:Qp})}function Nc(t,r){var o=Mn(t,r);if(o.state>Qp)throw new Error("too late; already scheduled");return o}function Gn(t,r){var o=Mn(t,r);if(o.state>$l)throw new Error("too late; already running");return o}function Mn(t,r){var o=t.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function zx(t,r,o){var s=t.__transition,a;s[r]=o,o.timer=Kp(u,0,o.time);function u(g){o.state=kh,o.timer.restart(c,o.delay,o.time),o.delay<=g&&c(g-o.delay)}function c(g){var x,y,v,_;if(o.state!==kh)return m();for(x in s)if(_=s[x],_.name===o.name){if(_.state===$l)return Sh(c);_.state===Eh?(_.state=Ol,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete s[x]):+x<r&&(_.state=Ol,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete s[x])}if(Sh(function(){o.state===$l&&(o.state=Eh,o.timer.restart(h,o.delay,o.time),h(g))}),o.state=uc,o.on.call("start",t,t.__data__,o.index,o.group),o.state===uc){for(o.state=$l,a=new Array(v=o.tween.length),x=0,y=-1;x<v;++x)(_=o.tween[x].value.call(t,t.__data__,o.index,o.group))&&(a[++y]=_);a.length=y+1}}function h(g){for(var x=g<o.duration?o.ease.call(null,g/o.duration):(o.timer.restart(m),o.state=cc,1),y=-1,v=a.length;++y<v;)a[y].call(t,x);o.state===cc&&(o.on.call("end",t,t.__data__,o.index,o.group),m())}function m(){o.state=Ol,o.timer.stop(),delete s[r];for(var g in s)return;delete t.__transition}}function Fl(t,r){var o=t.__transition,s,a,u=!0,c;if(o){r=r==null?null:r+"";for(c in o){if((s=o[c]).name!==r){u=!1;continue}a=s.state>uc&&s.state<cc,s.state=Ol,s.timer.stop(),s.on.call(a?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete o[c]}u&&delete t.__transition}}function Rx(t){return this.each(function(){Fl(this,t)})}function Ax(t,r){var o,s;return function(){var a=Gn(this,t),u=a.tween;if(u!==o){s=o=u;for(var c=0,h=s.length;c<h;++c)if(s[c].name===r){s=s.slice(),s.splice(c,1);break}}a.tween=s}}function Lx(t,r,o){var s,a;if(typeof o!="function")throw new Error;return function(){var u=Gn(this,t),c=u.tween;if(c!==s){a=(s=c).slice();for(var h={name:r,value:o},m=0,g=a.length;m<g;++m)if(a[m].name===r){a[m]=h;break}m===g&&a.push(h)}u.tween=a}}function Dx(t,r){var o=this._id;if(t+="",arguments.length<2){for(var s=Mn(this.node(),o).tween,a=0,u=s.length,c;a<u;++a)if((c=s[a]).name===t)return c.value;return null}return this.each((r==null?Ax:Lx)(o,t,r))}function Cc(t,r,o){var s=t._id;return t.each(function(){var a=Gn(this,s);(a.value||(a.value={}))[r]=o.apply(this,arguments)}),function(a){return Mn(a,s).value[r]}}function qp(t,r){var o;return(typeof r=="number"?Wn:r instanceof wo?Wl:(o=wo(r))?(r=o,Wl):Wp)(t,r)}function $x(t){return function(){this.removeAttribute(t)}}function Ox(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fx(t,r,o){var s,a=o+"",u;return function(){var c=this.getAttribute(t);return c===a?null:c===s?u:u=r(s=c,o)}}function Hx(t,r,o){var s,a=o+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===a?null:c===s?u:u=r(s=c,o)}}function Vx(t,r,o){var s,a,u;return function(){var c,h=o(this),m;return h==null?void this.removeAttribute(t):(c=this.getAttribute(t),m=h+"",c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h)))}}function Bx(t,r,o){var s,a,u;return function(){var c,h=o(this),m;return h==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),m=h+"",c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h)))}}function Wx(t,r){var o=ea(t),s=o==="transform"?Ex:qp;return this.attrTween(t,typeof r=="function"?(o.local?Bx:Vx)(o,s,Cc(this,"attr."+t,r)):r==null?(o.local?Ox:$x)(o):(o.local?Hx:Fx)(o,s,r))}function Ux(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function Yx(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function Xx(t,r){var o,s;function a(){var u=r.apply(this,arguments);return u!==s&&(o=(s=u)&&Yx(t,u)),o}return a._value=r,a}function Gx(t,r){var o,s;function a(){var u=r.apply(this,arguments);return u!==s&&(o=(s=u)&&Ux(t,u)),o}return a._value=r,a}function Kx(t,r){var o="attr."+t;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var s=ea(t);return this.tween(o,(s.local?Xx:Gx)(s,r))}function Qx(t,r){return function(){Nc(this,t).delay=+r.apply(this,arguments)}}function qx(t,r){return r=+r,function(){Nc(this,t).delay=r}}function Zx(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Qx:qx)(r,t)):Mn(this.node(),r).delay}function Jx(t,r){return function(){Gn(this,t).duration=+r.apply(this,arguments)}}function ew(t,r){return r=+r,function(){Gn(this,t).duration=r}}function tw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Jx:ew)(r,t)):Mn(this.node(),r).duration}function nw(t,r){if(typeof r!="function")throw new Error;return function(){Gn(this,t).ease=r}}function rw(t){var r=this._id;return arguments.length?this.each(nw(r,t)):Mn(this.node(),r).ease}function ow(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Gn(this,t).ease=o}}function iw(t){if(typeof t!="function")throw new Error;return this.each(ow(this._id,t))}function sw(t){typeof t!="function"&&(t=bp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=[],m,g=0;g<c;++g)(m=u[g])&&t.call(m,m.__data__,g,u)&&h.push(m);return new mr(s,this._parents,this._name,this._id)}function lw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,s=r.length,a=o.length,u=Math.min(s,a),c=new Array(s),h=0;h<u;++h)for(var m=r[h],g=o[h],x=m.length,y=c[h]=new Array(x),v,_=0;_<x;++_)(v=m[_]||g[_])&&(y[_]=v);for(;h<s;++h)c[h]=r[h];return new mr(c,this._parents,this._name,this._id)}function aw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function uw(t,r,o){var s,a,u=aw(r)?Nc:Gn;return function(){var c=u(this,t),h=c.on;h!==s&&(a=(s=h).copy()).on(r,o),c.on=a}}function cw(t,r){var o=this._id;return arguments.length<2?Mn(this.node(),o).on.on(t):this.each(uw(o,t,r))}function dw(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function fw(){return this.on("end.remove",dw(this._id))}function hw(t){var r=this._name,o=this._id;typeof t!="function"&&(t=xc(t));for(var s=this._groups,a=s.length,u=new Array(a),c=0;c<a;++c)for(var h=s[c],m=h.length,g=u[c]=new Array(m),x,y,v=0;v<m;++v)(x=h[v])&&(y=t.call(x,x.__data__,v,h))&&("__data__"in x&&(y.__data__=x.__data__),g[v]=y,na(g[v],r,o,v,g,Mn(x,o)));return new mr(u,this._parents,r,o)}function pw(t){var r=this._name,o=this._id;typeof t!="function"&&(t=jp(t));for(var s=this._groups,a=s.length,u=[],c=[],h=0;h<a;++h)for(var m=s[h],g=m.length,x,y=0;y<g;++y)if(x=m[y]){for(var v=t.call(x,x.__data__,y,m),_,S=Mn(x,o),N=0,E=v.length;N<E;++N)(_=v[N])&&na(_,r,o,N,v,S);u.push(v),c.push(x)}return new mr(u,c,r,o)}var mw=gs.prototype.constructor;function gw(){return new mw(this._groups,this._parents)}function yw(t,r){var o,s,a;return function(){var u=fi(this,t),c=(this.style.removeProperty(t),fi(this,t));return u===c?null:u===o&&c===s?a:a=r(o=u,s=c)}}function Zp(t){return function(){this.style.removeProperty(t)}}function vw(t,r,o){var s,a=o+"",u;return function(){var c=fi(this,t);return c===a?null:c===s?u:u=r(s=c,o)}}function xw(t,r,o){var s,a,u;return function(){var c=fi(this,t),h=o(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),fi(this,t))),c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h))}}function ww(t,r){var o,s,a,u="style."+r,c="end."+u,h;return function(){var m=Gn(this,t),g=m.on,x=m.value[u]==null?h||(h=Zp(r)):void 0;(g!==o||a!==x)&&(s=(o=g).copy()).on(c,a=x),m.on=s}}function Sw(t,r,o){var s=(t+="")=="transform"?kx:qp;return r==null?this.styleTween(t,yw(t,s)).on("end.style."+t,Zp(t)):typeof r=="function"?this.styleTween(t,xw(t,s,Cc(this,"style."+t,r))).each(ww(this._id,t)):this.styleTween(t,vw(t,s,r),o).on("end.style."+t,null)}function kw(t,r,o){return function(s){this.style.setProperty(t,r.call(this,s),o)}}function Ew(t,r,o){var s,a;function u(){var c=r.apply(this,arguments);return c!==a&&(s=(a=c)&&kw(t,c,o)),s}return u._value=r,u}function Nw(t,r,o){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,Ew(t,r,o??""))}function Cw(t){return function(){this.textContent=t}}function _w(t){return function(){var r=t(this);this.textContent=r??""}}function jw(t){return this.tween("text",typeof t=="function"?_w(Cc(this,"text",t)):Cw(t==null?"":t+""))}function bw(t){return function(r){this.textContent=t.call(this,r)}}function Pw(t){var r,o;function s(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&bw(a)),r}return s._value=t,s}function Mw(t){var r="text";if(arguments.length<1)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,Pw(t))}function Iw(){for(var t=this._name,r=this._id,o=Jp(),s=this._groups,a=s.length,u=0;u<a;++u)for(var c=s[u],h=c.length,m,g=0;g<h;++g)if(m=c[g]){var x=Mn(m,r);na(m,t,o,g,c,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new mr(s,this._parents,t,o)}function Tw(){var t,r,o=this,s=o._id,a=o.size();return new Promise(function(u,c){var h={value:c},m={value:function(){--a===0&&u()}};o.each(function(){var g=Gn(this,s),x=g.on;x!==t&&(r=(t=x).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(m)),g.on=r}),a===0&&u()})}var zw=0;function mr(t,r,o,s){this._groups=t,this._parents=r,this._name=o,this._id=s}function Jp(){return++zw}var hr=gs.prototype;mr.prototype={constructor:mr,select:hw,selectAll:pw,selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:sw,merge:lw,selection:gw,transition:Iw,call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:cw,attr:Wx,attrTween:Kx,style:Sw,styleTween:Nw,text:jw,textTween:Mw,remove:fw,tween:Dx,delay:Zx,duration:tw,ease:rw,easeVarying:iw,end:Tw,[Symbol.iterator]:hr[Symbol.iterator]};function Rw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Aw={time:null,delay:0,duration:250,ease:Rw};function Lw(t,r){for(var o;!(o=t.__transition)||!(o=o[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return o}function Dw(t){var r,o;t instanceof mr?(r=t._id,t=t._name):(r=Jp(),(o=Aw).time=Ec(),t=t==null?null:t+"");for(var s=this._groups,a=s.length,u=0;u<a;++u)for(var c=s[u],h=c.length,m,g=0;g<h;++g)(m=c[g])&&na(m,t,r,g,c,o||Lw(m,r));return new mr(s,this._parents,t,r)}gs.prototype.interrupt=Rx;gs.prototype.transition=Dw;const Ml=t=>()=>t;function $w(t,{sourceEvent:r,target:o,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function pr(t,r,o){this.k=t,this.x=r,this.y=o}pr.prototype={constructor:pr,scale:function(t){return t===1?this:new pr(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new pr(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ra=new pr(1,0,0);em.prototype=pr.prototype;function em(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ra;return t.__zoom}function Yu(t){t.stopImmediatePropagation()}function es(t){t.preventDefault(),t.stopImmediatePropagation()}function Ow(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Fw(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Nh(){return this.__zoom||ra}function Hw(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Vw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bw(t,r,o){var s=t.invertX(r[0][0])-o[0][0],a=t.invertX(r[1][0])-o[1][0],u=t.invertY(r[0][1])-o[0][1],c=t.invertY(r[1][1])-o[1][1];return t.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function tm(){var t=Ow,r=Fw,o=Bw,s=Hw,a=Vw,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],h=250,m=Dl,g=Jl("start","zoom","end"),x,y,v,_=500,S=150,N=0,E=10;function k(P){P.property("__zoom",Nh).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",J).on("dblclick.zoom",ee).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",ne).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(P,K,V,G){var z=P.selection?P.selection():P;z.property("__zoom",Nh),P!==z?O(P,K,V,G):z.interrupt().each(function(){A(this,arguments).event(G).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},k.scaleBy=function(P,K,V,G){k.scaleTo(P,function(){var z=this.__zoom.k,R=typeof K=="function"?K.apply(this,arguments):K;return z*R},V,G)},k.scaleTo=function(P,K,V,G){k.transform(P,function(){var z=r.apply(this,arguments),R=this.__zoom,B=V==null?j(z):typeof V=="function"?V.apply(this,arguments):V,M=R.invert(B),$=typeof K=="function"?K.apply(this,arguments):K;return o(C(I(R,$),B,M),z,c)},V,G)},k.translateBy=function(P,K,V,G){k.transform(P,function(){return o(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof V=="function"?V.apply(this,arguments):V),r.apply(this,arguments),c)},null,G)},k.translateTo=function(P,K,V,G,z){k.transform(P,function(){var R=r.apply(this,arguments),B=this.__zoom,M=G==null?j(R):typeof G=="function"?G.apply(this,arguments):G;return o(ra.translate(M[0],M[1]).scale(B.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof V=="function"?-V.apply(this,arguments):-V),R,c)},G,z)};function I(P,K){return K=Math.max(u[0],Math.min(u[1],K)),K===P.k?P:new pr(K,P.x,P.y)}function C(P,K,V){var G=K[0]-V[0]*P.k,z=K[1]-V[1]*P.k;return G===P.x&&z===P.y?P:new pr(P.k,G,z)}function j(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function O(P,K,V,G){P.on("start.zoom",function(){A(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(G).end()}).tween("zoom",function(){var z=this,R=arguments,B=A(z,R).event(G),M=r.apply(z,R),$=V==null?j(M):typeof V=="function"?V.apply(z,R):V,ie=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),oe=z.__zoom,de=typeof K=="function"?K.apply(z,R):K,fe=m(oe.invert($).concat(ie/oe.k),de.invert($).concat(ie/de.k));return function(me){if(me===1)me=de;else{var te=fe(me),pe=ie/te[2];me=new pr(pe,$[0]-te[0]*pe,$[1]-te[1]*pe)}B.zoom(null,me)}})}function A(P,K,V){return!V&&P.__zooming||new H(P,K)}function H(P,K){this.that=P,this.args=K,this.active=0,this.sourceEvent=null,this.extent=r.apply(P,K),this.taps=0}H.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,K){return this.mouse&&P!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var K=Kt(this.that).datum();g.call(P,this.that,new $w(P,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:g}),K)}};function q(P,...K){if(!t.apply(this,arguments))return;var V=A(this,K).event(P),G=this.__zoom,z=Math.max(u[0],Math.min(u[1],G.k*Math.pow(2,s.apply(this,arguments)))),R=_n(P);if(V.wheel)(V.mouse[0][0]!==R[0]||V.mouse[0][1]!==R[1])&&(V.mouse[1]=G.invert(V.mouse[0]=R)),clearTimeout(V.wheel);else{if(G.k===z)return;V.mouse=[R,G.invert(R)],Fl(this),V.start()}es(P),V.wheel=setTimeout(B,S),V.zoom("mouse",o(C(I(G,z),V.mouse[0],V.mouse[1]),V.extent,c));function B(){V.wheel=null,V.end()}}function J(P,...K){if(v||!t.apply(this,arguments))return;var V=P.currentTarget,G=A(this,K,!0).event(P),z=Kt(P.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",ie,!0),R=_n(P,V),B=P.clientX,M=P.clientY;$p(P.view),Yu(P),G.mouse=[R,this.__zoom.invert(R)],Fl(this),G.start();function $(oe){if(es(oe),!G.moved){var de=oe.clientX-B,fe=oe.clientY-M;G.moved=de*de+fe*fe>N}G.event(oe).zoom("mouse",o(C(G.that.__zoom,G.mouse[0]=_n(oe,V),G.mouse[1]),G.extent,c))}function ie(oe){z.on("mousemove.zoom mouseup.zoom",null),Op(oe.view,G.moved),es(oe),G.event(oe).end()}}function ee(P,...K){if(t.apply(this,arguments)){var V=this.__zoom,G=_n(P.changedTouches?P.changedTouches[0]:P,this),z=V.invert(G),R=V.k*(P.shiftKey?.5:2),B=o(C(I(V,R),G,z),r.apply(this,K),c);es(P),h>0?Kt(this).transition().duration(h).call(O,B,G,P):Kt(this).call(k.transform,B,G,P)}}function U(P,...K){if(t.apply(this,arguments)){var V=P.touches,G=V.length,z=A(this,K,P.changedTouches.length===G).event(P),R,B,M,$;for(Yu(P),B=0;B<G;++B)M=V[B],$=_n(M,this),$=[$,this.__zoom.invert($),M.identifier],z.touch0?!z.touch1&&z.touch0[2]!==$[2]&&(z.touch1=$,z.taps=0):(z.touch0=$,R=!0,z.taps=1+!!x);x&&(x=clearTimeout(x)),R&&(z.taps<2&&(y=$[0],x=setTimeout(function(){x=null},_)),Fl(this),z.start())}}function X(P,...K){if(this.__zooming){var V=A(this,K).event(P),G=P.changedTouches,z=G.length,R,B,M,$;for(es(P),R=0;R<z;++R)B=G[R],M=_n(B,this),V.touch0&&V.touch0[2]===B.identifier?V.touch0[0]=M:V.touch1&&V.touch1[2]===B.identifier&&(V.touch1[0]=M);if(B=V.that.__zoom,V.touch1){var ie=V.touch0[0],oe=V.touch0[1],de=V.touch1[0],fe=V.touch1[1],me=(me=de[0]-ie[0])*me+(me=de[1]-ie[1])*me,te=(te=fe[0]-oe[0])*te+(te=fe[1]-oe[1])*te;B=I(B,Math.sqrt(me/te)),M=[(ie[0]+de[0])/2,(ie[1]+de[1])/2],$=[(oe[0]+fe[0])/2,(oe[1]+fe[1])/2]}else if(V.touch0)M=V.touch0[0],$=V.touch0[1];else return;V.zoom("touch",o(C(B,M,$),V.extent,c))}}function ne(P,...K){if(this.__zooming){var V=A(this,K).event(P),G=P.changedTouches,z=G.length,R,B;for(Yu(P),v&&clearTimeout(v),v=setTimeout(function(){v=null},_),R=0;R<z;++R)B=G[R],V.touch0&&V.touch0[2]===B.identifier?delete V.touch0:V.touch1&&V.touch1[2]===B.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(B=_n(B,this),Math.hypot(y[0]-B[0],y[1]-B[1])<E)){var M=Kt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return k.wheelDelta=function(P){return arguments.length?(s=typeof P=="function"?P:Ml(+P),k):s},k.filter=function(P){return arguments.length?(t=typeof P=="function"?P:Ml(!!P),k):t},k.touchable=function(P){return arguments.length?(a=typeof P=="function"?P:Ml(!!P),k):a},k.extent=function(P){return arguments.length?(r=typeof P=="function"?P:Ml([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),k):r},k.scaleExtent=function(P){return arguments.length?(u[0]=+P[0],u[1]=+P[1],k):[u[0],u[1]]},k.translateExtent=function(P){return arguments.length?(c[0][0]=+P[0][0],c[1][0]=+P[1][0],c[0][1]=+P[0][1],c[1][1]=+P[1][1],k):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},k.constrain=function(P){return arguments.length?(o=P,k):o},k.duration=function(P){return arguments.length?(h=+P,k):h},k.interpolate=function(P){return arguments.length?(m=P,k):m},k.on=function(){var P=g.on.apply(g,arguments);return P===g?k:P},k.clickDistance=function(P){return arguments.length?(N=(P=+P)*P,k):Math.sqrt(N)},k.tapDistance=function(P){return arguments.length?(E=+P,k):E},k}const Xn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:o,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?o:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},us=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nm=["Enter"," ","Escape"],rm={"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:t,x:r,y:o})=>`Moved selected node ${t}. New position, x: ${r}, y: ${o}`,"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 ko;(function(t){t.Strict="strict",t.Loose="loose"})(ko||(ko={}));var xo;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(xo||(xo={}));var cs;(function(t){t.Partial="partial",t.Full="full"})(cs||(cs={}));const om={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Br;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Br||(Br={}));var ds;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(ds||(ds={}));var Ee;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ee||(Ee={}));const Ch={[Ee.Left]:Ee.Right,[Ee.Right]:Ee.Left,[Ee.Top]:Ee.Bottom,[Ee.Bottom]:Ee.Top};function im(t){return t===null?null:t?"valid":"invalid"}const sm=t=>"id"in t&&"source"in t&&"target"in t,Ww=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),_c=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),vs=(t,r=[0,0])=>{const{width:o,height:s}=gr(t),a=t.origin??r,u=o*a[0],c=s*a[1];return{x:t.position.x-u,y:t.position.y-c}},Uw=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const o=t.reduce((s,a)=>{const u=typeof a=="string";let c=!r.nodeLookup&&!u?a:void 0;r.nodeLookup&&(c=u?r.nodeLookup.get(a):_c(a)?a:r.nodeLookup.get(a.id));const h=c?Gl(c,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oa(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ia(o)},xs=(t,r={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(a=>{(r.filter===void 0||r.filter(a))&&(o=oa(o,Gl(a)),s=!0)}),s?ia(o):{x:0,y:0,width:0,height:0}},jc=(t,r,[o,s,a]=[0,0,1],u=!1,c=!1)=>{const h={...Ss(r,[o,s,a]),width:r.width/a,height:r.height/a},m=[];for(const g of t.values()){const{measured:x,selectable:y=!0,hidden:v=!1}=g;if(c&&!y||v)continue;const _=x.width??g.width??g.initialWidth??null,S=x.height??g.height??g.initialHeight??null,N=fs(h,mi(g)),E=(_??0)*(S??0),k=u&&N>0;(!g.internals.handleBounds||k||N>=E||g.dragging)&&m.push(g)}return m},Yw=(t,r)=>{const o=new Set;return t.forEach(s=>{o.add(s.id)}),r.filter(s=>o.has(s.source)||o.has(s.target))};function Xw(t,r){const o=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!a.hidden)&&(!s||s.has(a.id))&&o.set(a.id,a)}),o}async function Gw({nodes:t,width:r,height:o,panZoom:s,minZoom:a,maxZoom:u},c){if(t.size===0)return Promise.resolve(!0);const h=Xw(t,c),m=xs(h),g=bc(m,r,o,(c==null?void 0:c.minZoom)??a,(c==null?void 0:c.maxZoom)??u,(c==null?void 0:c.padding)??.1);return await s.setViewport(g,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),Promise.resolve(!0)}function lm({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:s=[0,0],nodeExtent:a,onError:u}){const c=o.get(t),h=c.parentId?o.get(c.parentId):void 0,{x:m,y:g}=h?h.internals.positionAbsolute:{x:0,y:0},x=c.origin??s;let y=c.extent||a;if(c.extent==="parent"&&!c.expandParent)if(!h)u==null||u("005",Xn.error005());else{const _=h.measured.width,S=h.measured.height;_&&S&&(y=[[m,g],[m+_,g+S]])}else h&&gi(c.extent)&&(y=[[c.extent[0][0]+m,c.extent[0][1]+g],[c.extent[1][0]+m,c.extent[1][1]+g]]);const v=gi(y)?Eo(r,y,c.measured):r;return(c.measured.width===void 0||c.measured.height===void 0)&&(u==null||u("015",Xn.error015())),{position:{x:v.x-m+(c.measured.width??0)*x[0],y:v.y-g+(c.measured.height??0)*x[1]},positionAbsolute:v}}async function Kw({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:s,onBeforeDelete:a}){const u=new Set(t.map(v=>v.id)),c=[];for(const v of o){if(v.deletable===!1)continue;const _=u.has(v.id),S=!_&&v.parentId&&c.find(N=>N.id===v.parentId);(_||S)&&c.push(v)}const h=new Set(r.map(v=>v.id)),m=s.filter(v=>v.deletable!==!1),x=Yw(c,m);for(const v of m)h.has(v.id)&&!x.find(S=>S.id===v.id)&&x.push(v);if(!a)return{edges:x,nodes:c};const y=await a({nodes:c,edges:x});return typeof y=="boolean"?y?{edges:x,nodes:c}:{edges:[],nodes:[]}:y}const pi=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),Eo=(t={x:0,y:0},r,o)=>({x:pi(t.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:pi(t.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function am(t,r,o){const{width:s,height:a}=gr(o),{x:u,y:c}=o.internals.positionAbsolute;return Eo(t,[[u,c],[u+s,c+a]],r)}const _h=(t,r,o)=>t<r?pi(Math.abs(t-r),1,r)/r:t>o?-pi(Math.abs(t-o),1,r)/r:0,um=(t,r,o=15,s=40)=>{const a=_h(t.x,s,r.width-s)*o,u=_h(t.y,s,r.height-s)*o;return[a,u]},oa=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),dc=({x:t,y:r,width:o,height:s})=>({x:t,y:r,x2:t+o,y2:r+s}),ia=({x:t,y:r,x2:o,y2:s})=>({x:t,y:r,width:o-t,height:s-r}),mi=(t,r=[0,0])=>{var a,u;const{x:o,y:s}=_c(t)?t.internals.positionAbsolute:vs(t,r);return{x:o,y:s,width:((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0,height:((u=t.measured)==null?void 0:u.height)??t.height??t.initialHeight??0}},Gl=(t,r=[0,0])=>{var a,u;const{x:o,y:s}=_c(t)?t.internals.positionAbsolute:vs(t,r);return{x:o,y:s,x2:o+(((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0),y2:s+(((u=t.measured)==null?void 0:u.height)??t.height??t.initialHeight??0)}},cm=(t,r)=>ia(oa(dc(t),dc(r))),fs=(t,r)=>{const o=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(o*s)},jh=t=>bn(t.width)&&bn(t.height)&&bn(t.x)&&bn(t.y),bn=t=>!isNaN(t)&&isFinite(t),Qw=(t,r)=>{},ws=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Ss=({x:t,y:r},[o,s,a],u=!1,c=[1,1])=>{const h={x:(t-o)/a,y:(r-s)/a};return u?ws(h,c):h},Kl=({x:t,y:r},[o,s,a])=>({x:t*a+o,y:r*a+s});function oi(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(o)}if(typeof t=="string"&&t.endsWith("%")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(r*o*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function qw(t,r,o){if(typeof t=="string"||typeof t=="number"){const s=oi(t,o),a=oi(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=oi(t.top??t.y??0,o),a=oi(t.bottom??t.y??0,o),u=oi(t.left??t.x??0,r),c=oi(t.right??t.x??0,r);return{top:s,right:c,bottom:a,left:u,x:u+c,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zw(t,r,o,s,a,u){const{x:c,y:h}=Kl(t,[r,o,s]),{x:m,y:g}=Kl({x:t.x+t.width,y:t.y+t.height},[r,o,s]),x=a-m,y=u-g;return{left:Math.floor(c),top:Math.floor(h),right:Math.floor(x),bottom:Math.floor(y)}}const bc=(t,r,o,s,a,u)=>{const c=qw(u,r,o),h=(r-c.x)/t.width,m=(o-c.y)/t.height,g=Math.min(h,m),x=pi(g,s,a),y=t.x+t.width/2,v=t.y+t.height/2,_=r/2-y*x,S=o/2-v*x,N=Zw(t,_,S,x,r,o),E={left:Math.min(N.left-c.left,0),top:Math.min(N.top-c.top,0),right:Math.min(N.right-c.right,0),bottom:Math.min(N.bottom-c.bottom,0)};return{x:_-E.left+E.right,y:S-E.top+E.bottom,zoom:x}},hs=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function gi(t){return t!=null&&t!=="parent"}function gr(t){var r,o;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight??0}}function dm(t){var r,o;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight)!==void 0}function fm(t,r={width:0,height:0},o,s,a){const u={...t},c=s.get(o);if(c){const h=c.origin||a;u.x+=c.internals.positionAbsolute.x-(r.width??0)*h[0],u.y+=c.internals.positionAbsolute.y-(r.height??0)*h[1]}return u}function bh(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function Jw(){let t,r;return{promise:new Promise((s,a)=>{t=s,r=a}),resolve:t,reject:r}}function e1(t){return{...rm,...t||{}}}function os(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:s,containerBounds:a}){const{x:u,y:c}=Pn(t),h=Ss({x:u-((a==null?void 0:a.left)??0),y:c-((a==null?void 0:a.top)??0)},s),{x:m,y:g}=o?ws(h,r):h;return{xSnapped:m,ySnapped:g,...h}}const Pc=t=>({width:t.offsetWidth,height:t.offsetHeight}),hm=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},t1=["INPUT","SELECT","TEXTAREA"];function pm(t){var s,a;const r=((a=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:a[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:t1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const mm=t=>"clientX"in t,Pn=(t,r)=>{var u,c;const o=mm(t),s=o?t.clientX:(u=t.touches)==null?void 0:u[0].clientX,a=o?t.clientY:(c=t.touches)==null?void 0:c[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)}},Ph=(t,r,o,s,a)=>{const u=r.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:a,position:c.getAttribute("data-handlepos"),x:(h.left-o.left)/s,y:(h.top-o.top)/s,...Pc(c)}})};function gm({sourceX:t,sourceY:r,targetX:o,targetY:s,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:h}){const m=t*.125+a*.375+c*.375+o*.125,g=r*.125+u*.375+h*.375+s*.125,x=Math.abs(m-t),y=Math.abs(g-r);return[m,g,x,y]}function Il(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Mh({pos:t,x1:r,y1:o,x2:s,y2:a,c:u}){switch(t){case Ee.Left:return[r-Il(r-s,u),o];case Ee.Right:return[r+Il(s-r,u),o];case Ee.Top:return[r,o-Il(o-a,u)];case Ee.Bottom:return[r,o+Il(a-o,u)]}}function ym({sourceX:t,sourceY:r,sourcePosition:o=Ee.Bottom,targetX:s,targetY:a,targetPosition:u=Ee.Top,curvature:c=.25}){const[h,m]=Mh({pos:o,x1:t,y1:r,x2:s,y2:a,c}),[g,x]=Mh({pos:u,x1:s,y1:a,x2:t,y2:r,c}),[y,v,_,S]=gm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:h,sourceControlY:m,targetControlX:g,targetControlY:x});return[`M${t},${r} C${h},${m} ${g},${x} ${s},${a}`,y,v,_,S]}function vm({sourceX:t,sourceY:r,targetX:o,targetY:s}){const a=Math.abs(o-t)/2,u=o<t?o+a:o-a,c=Math.abs(s-r)/2,h=s<r?s+c:s-c;return[u,h,a,c]}function n1({sourceNode:t,targetNode:r,selected:o=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:u="basic"}){if(u==="manual")return s;const c=a&&o?s+1e3:s,h=Math.max(t.parentId||a&&t.selected?t.internals.z:0,r.parentId||a&&r.selected?r.internals.z:0);return c+h}function r1({sourceNode:t,targetNode:r,width:o,height:s,transform:a}){const u=oa(Gl(t),Gl(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-a[0]/a[2],y:-a[1]/a[2],width:o/a[2],height:s/a[2]};return fs(c,ia(u))>0}const xm=({source:t,sourceHandle:r,target:o,targetHandle:s})=>`xy-edge__${t}${r||""}-${o}${s||""}`,o1=(t,r)=>r.some(o=>o.source===t.source&&o.target===t.target&&(o.sourceHandle===t.sourceHandle||!o.sourceHandle&&!t.sourceHandle)&&(o.targetHandle===t.targetHandle||!o.targetHandle&&!t.targetHandle)),wm=(t,r,o={})=>{if(!t.source||!t.target)return r;const s=o.getEdgeId||xm;let a;return sm(t)?a={...t}:a={...t,id:s(t)},o1(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))},i1=(t,r,o,s={shouldReplaceId:!0})=>{const{id:a,...u}=t;if(!r.source||!r.target||!o.find(g=>g.id===t.id))return o;const h=s.getEdgeId||xm,m={...u,id:s.shouldReplaceId?h(r):a,source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle};return o.filter(g=>g.id!==a).concat(m)};function Sm({sourceX:t,sourceY:r,targetX:o,targetY:s}){const[a,u,c,h]=vm({sourceX:t,sourceY:r,targetX:o,targetY:s});return[`M ${t},${r}L ${o},${s}`,a,u,c,h]}const Ih={[Ee.Left]:{x:-1,y:0},[Ee.Right]:{x:1,y:0},[Ee.Top]:{x:0,y:-1},[Ee.Bottom]:{x:0,y:1}},s1=({source:t,sourcePosition:r=Ee.Bottom,target:o})=>r===Ee.Left||r===Ee.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1},Th=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function l1({source:t,sourcePosition:r=Ee.Bottom,target:o,targetPosition:s=Ee.Top,center:a,offset:u,stepPosition:c}){const h=Ih[r],m=Ih[s],g={x:t.x+h.x*u,y:t.y+h.y*u},x={x:o.x+m.x*u,y:o.y+m.y*u},y=s1({source:g,sourcePosition:r,target:x}),v=y.x!==0?"x":"y",_=y[v];let S=[],N,E;const k={x:0,y:0},I={x:0,y:0},[,,C,j]=vm({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(h[v]*m[v]===-1){v==="x"?(N=a.x??g.x+(x.x-g.x)*c,E=a.y??(g.y+x.y)/2):(N=a.x??(g.x+x.x)/2,E=a.y??g.y+(x.y-g.y)*c);const A=[{x:N,y:g.y},{x:N,y:x.y}],H=[{x:g.x,y:E},{x:x.x,y:E}];h[v]===_?S=v==="x"?A:H:S=v==="x"?H:A}else{const A=[{x:g.x,y:x.y}],H=[{x:x.x,y:g.y}];if(v==="x"?S=h.x===_?H:A:S=h.y===_?A:H,r===s){const X=Math.abs(t[v]-o[v]);if(X<=u){const ne=Math.min(u-1,u-X);h[v]===_?k[v]=(g[v]>t[v]?-1:1)*ne:I[v]=(x[v]>o[v]?-1:1)*ne}}if(r!==s){const X=v==="x"?"y":"x",ne=h[v]===m[X],P=g[X]>x[X],K=g[X]<x[X];(h[v]===1&&(!ne&&P||ne&&K)||h[v]!==1&&(!ne&&K||ne&&P))&&(S=v==="x"?A:H)}const q={x:g.x+k.x,y:g.y+k.y},J={x:x.x+I.x,y:x.y+I.y},ee=Math.max(Math.abs(q.x-S[0].x),Math.abs(J.x-S[0].x)),U=Math.max(Math.abs(q.y-S[0].y),Math.abs(J.y-S[0].y));ee>=U?(N=(q.x+J.x)/2,E=S[0].y):(N=S[0].x,E=(q.y+J.y)/2)}return[[t,{x:g.x+k.x,y:g.y+k.y},...S,{x:x.x+I.x,y:x.y+I.y},o],N,E,C,j]}function a1(t,r,o,s){const a=Math.min(Th(t,r)/2,Th(r,o)/2,s),{x:u,y:c}=r;if(t.x===u&&u===o.x||t.y===c&&c===o.y)return`L${u} ${c}`;if(t.y===c){const g=t.x<o.x?-1:1,x=t.y<o.y?1:-1;return`L ${u+a*g},${c}Q ${u},${c} ${u},${c+a*x}`}const h=t.x<o.x?1:-1,m=t.y<o.y?-1:1;return`L ${u},${c+a*m}Q ${u},${c} ${u+a*h},${c}`}function fc({sourceX:t,sourceY:r,sourcePosition:o=Ee.Bottom,targetX:s,targetY:a,targetPosition:u=Ee.Top,borderRadius:c=5,centerX:h,centerY:m,offset:g=20,stepPosition:x=.5}){const[y,v,_,S,N]=l1({source:{x:t,y:r},sourcePosition:o,target:{x:s,y:a},targetPosition:u,center:{x:h,y:m},offset:g,stepPosition:x});return[y.reduce((k,I,C)=>{let j="";return C>0&&C<y.length-1?j=a1(y[C-1],I,y[C+1],c):j=`${C===0?"M":"L"}${I.x} ${I.y}`,k+=j,k},""),v,_,S,N]}function zh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function u1(t){var y;const{sourceNode:r,targetNode:o}=t;if(!zh(r)||!zh(o))return null;const s=r.internals.handleBounds||Rh(r.handles),a=o.internals.handleBounds||Rh(o.handles),u=Ah((s==null?void 0:s.source)??[],t.sourceHandle),c=Ah(t.connectionMode===ko.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),t.targetHandle);if(!u||!c)return(y=t.onError)==null||y.call(t,"008",Xn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(u==null?void 0:u.position)||Ee.Bottom,m=(c==null?void 0:c.position)||Ee.Top,g=No(r,u,h),x=No(o,c,m);return{sourceX:g.x,sourceY:g.y,targetX:x.x,targetY:x.y,sourcePosition:h,targetPosition:m}}function Rh(t){if(!t)return null;const r=[],o=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&o.push(s);return{source:r,target:o}}function No(t,r,o=Ee.Left,s=!1){const a=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,u=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:c,height:h}=r??gr(t);if(s)return{x:a+c/2,y:u+h/2};switch((r==null?void 0:r.position)??o){case Ee.Top:return{x:a+c/2,y:u};case Ee.Right:return{x:a+c,y:u+h/2};case Ee.Bottom:return{x:a+c/2,y:u+h};case Ee.Left:return{x:a,y:u+h/2}}}function Ah(t,r){return t&&(r?t.find(o=>o.id===r):t[0])||null}function hc(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function c1(t,{id:r,defaultColor:o,defaultMarkerStart:s,defaultMarkerEnd:a}){const u=new Set;return t.reduce((c,h)=>([h.markerStart||s,h.markerEnd||a].forEach(m=>{if(m&&typeof m=="object"){const g=hc(m,r);u.has(g)||(c.push({id:g,color:m.color||o,...m}),u.add(g))}}),c),[]).sort((c,h)=>c.id.localeCompare(h.id))}const km=1e3,d1=10,Mc={nodeOrigin:[0,0],nodeExtent:us,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},f1={...Mc,checkEquality:!0};function Ic(t,r){const o={...t};for(const s in r)r[s]!==void 0&&(o[s]=r[s]);return o}function h1(t,r,o){const s=Ic(Mc,o);for(const a of t.values())if(a.parentId)zc(a,t,r,s);else{const u=vs(a,s.nodeOrigin),c=gi(a.extent)?a.extent:s.nodeExtent,h=Eo(u,c,gr(a));a.internals.positionAbsolute=h}}function p1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const o=[],s=[];for(const a of t.handles){const u={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?o.push(u):a.type==="target"&&s.push(u)}return{source:o,target:s}}function Tc(t){return t==="manual"}function pc(t,r,o,s={}){var g,x;const a=Ic(f1,s),u={i:0},c=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!Tc(a.zIndexMode)?km:0;let m=t.length>0;r.clear(),o.clear();for(const y of t){let v=c.get(y.id);if(a.checkEquality&&y===(v==null?void 0:v.internals.userNode))r.set(y.id,v);else{const _=vs(y,a.nodeOrigin),S=gi(y.extent)?y.extent:a.nodeExtent,N=Eo(_,S,gr(y));v={...a.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(x=y.measured)==null?void 0:x.height},internals:{positionAbsolute:N,handleBounds:p1(y,v),z:Em(y,h,a.zIndexMode),userNode:y}},r.set(y.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(m=!1),y.parentId&&zc(v,r,o,s,u)}return m}function m1(t,r){if(!t.parentId)return;const o=r.get(t.parentId);o?o.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function zc(t,r,o,s,a){const{elevateNodesOnSelect:u,nodeOrigin:c,nodeExtent:h,zIndexMode:m}=Ic(Mc,s),g=t.parentId,x=r.get(g);if(!x){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}m1(t,o),a&&!x.parentId&&x.internals.rootParentIndex===void 0&&m==="auto"&&(x.internals.rootParentIndex=++a.i,x.internals.z=x.internals.z+a.i*d1),a&&x.internals.rootParentIndex!==void 0&&(a.i=x.internals.rootParentIndex);const y=u&&!Tc(m)?km:0,{x:v,y:_,z:S}=g1(t,x,c,h,y,m),{positionAbsolute:N}=t.internals,E=v!==N.x||_!==N.y;(E||S!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:E?{x:v,y:_}:N,z:S}})}function Em(t,r,o){const s=bn(t.zIndex)?t.zIndex:0;return Tc(o)?s:s+(t.selected?r:0)}function g1(t,r,o,s,a,u){const{x:c,y:h}=r.internals.positionAbsolute,m=gr(t),g=vs(t,o),x=gi(t.extent)?Eo(g,t.extent,m):g;let y=Eo({x:c+x.x,y:h+x.y},s,m);t.extent==="parent"&&(y=am(y,m,r));const v=Em(t,a,u),_=r.internals.z??0;return{x:y.x,y:y.y,z:_>=v?_+1:v}}function Rc(t,r,o,s=[0,0]){var c;const a=[],u=new Map;for(const h of t){const m=r.get(h.parentId);if(!m)continue;const g=((c=u.get(h.parentId))==null?void 0:c.expandedRect)??mi(m),x=cm(g,h.rect);u.set(h.parentId,{expandedRect:x,parent:m})}return u.size>0&&u.forEach(({expandedRect:h,parent:m},g)=>{var C;const x=m.internals.positionAbsolute,y=gr(m),v=m.origin??s,_=h.x<x.x?Math.round(Math.abs(x.x-h.x)):0,S=h.y<x.y?Math.round(Math.abs(x.y-h.y)):0,N=Math.max(y.width,Math.round(h.width)),E=Math.max(y.height,Math.round(h.height)),k=(N-y.width)*v[0],I=(E-y.height)*v[1];(_>0||S>0||k||I)&&(a.push({id:g,type:"position",position:{x:m.position.x-_+k,y:m.position.y-S+I}}),(C=o.get(g))==null||C.forEach(j=>{t.some(O=>O.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+_,y:j.position.y+S}})})),(y.width<h.width||y.height<h.height||_||S)&&a.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:N+(_?v[0]*_-k:0),height:E+(S?v[1]*S-I:0)}})}),a}function y1(t,r,o,s,a,u,c){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let m=!1;if(!h)return{changes:[],updatedInternals:m};const g=[],x=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(x.transform),v=[];for(const _ of t.values()){const S=r.get(_.id);if(!S)continue;if(S.hidden){r.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),m=!0;continue}const N=Pc(_.nodeElement),E=S.measured.width!==N.width||S.measured.height!==N.height;if(!!(N.width&&N.height&&(E||!S.internals.handleBounds||_.force))){const I=_.nodeElement.getBoundingClientRect(),C=gi(S.extent)?S.extent:u;let{positionAbsolute:j}=S.internals;S.parentId&&S.extent==="parent"?j=am(j,N,r.get(S.parentId)):C&&(j=Eo(j,C,N));const O={...S,measured:N,internals:{...S.internals,positionAbsolute:j,handleBounds:{source:Ph("source",_.nodeElement,I,y,S.id),target:Ph("target",_.nodeElement,I,y,S.id)}}};r.set(S.id,O),S.parentId&&zc(O,r,o,{nodeOrigin:a,zIndexMode:c}),m=!0,E&&(g.push({id:S.id,type:"dimensions",dimensions:N}),S.expandParent&&S.parentId&&v.push({id:S.id,parentId:S.parentId,rect:mi(O,a)}))}}if(v.length>0){const _=Rc(v,r,o,a);g.push(..._)}return{changes:g,updatedInternals:m}}async function v1({delta:t,panZoom:r,transform:o,translateExtent:s,width:a,height:u}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const c=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[a,u]],s),h=!!c&&(c.x!==o[0]||c.y!==o[1]||c.k!==o[2]);return Promise.resolve(h)}function Lh(t,r,o,s,a,u){let c=a;const h=s.get(c)||new Map;s.set(c,h.set(o,r)),c=`${a}-${t}`;const m=s.get(c)||new Map;if(s.set(c,m.set(o,r)),u){c=`${a}-${t}-${u}`;const g=s.get(c)||new Map;s.set(c,g.set(o,r))}}function Nm(t,r,o){t.clear(),r.clear();for(const s of o){const{source:a,target:u,sourceHandle:c=null,targetHandle:h=null}=s,m={edgeId:s.id,source:a,target:u,sourceHandle:c,targetHandle:h},g=`${a}-${c}--${u}-${h}`,x=`${u}-${h}--${a}-${c}`;Lh("source",m,x,t,a,c),Lh("target",m,g,t,u,h),r.set(s.id,s)}}function Cm(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:Cm(o,r):!1}function Dh(t,r,o){var a;let s=t;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,r))return!0;if(s===o)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function x1(t,r,o,s){const a=new Map;for(const[u,c]of t)if((c.selected||c.id===s)&&(!c.parentId||!Cm(c,t))&&(c.draggable||r&&typeof c.draggable>"u")){const h=t.get(u);h&&a.set(u,{id:u,position:h.position||{x:0,y:0},distance:{x:o.x-h.internals.positionAbsolute.x,y:o.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return a}function Xu({nodeId:t,dragItems:r,nodeLookup:o,dragging:s=!0}){var c,h,m;const a=[];for(const[g,x]of r){const y=(c=o.get(g))==null?void 0:c.internals.userNode;y&&a.push({...y,position:x.position,dragging:s})}if(!t)return[a[0],a];const u=(h=o.get(t))==null?void 0:h.internals.userNode;return[u?{...u,position:((m=r.get(t))==null?void 0:m.position)||u.position,dragging:s}:a[0],a]}function w1({dragItems:t,snapGrid:r,x:o,y:s}){const a=t.values().next().value;if(!a)return null;const u={x:o-a.distance.x,y:s-a.distance.y},c=ws(u,r);return{x:c.x-u.x,y:c.y-u.y}}function S1({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,onDrag:s,onDragStop:a}){let u={x:null,y:null},c=0,h=new Map,m=!1,g={x:0,y:0},x=null,y=!1,v=null,_=!1,S=!1,N=null;function E({noDragClassName:I,handleSelector:C,domNode:j,isSelectable:O,nodeId:A,nodeClickDistance:H=0}){v=Kt(j);function q({x:X,y:ne}){const{nodeLookup:P,nodeExtent:K,snapGrid:V,snapToGrid:G,nodeOrigin:z,onNodeDrag:R,onSelectionDrag:B,onError:M,updateNodePositions:$}=r();u={x:X,y:ne};let ie=!1;const oe=h.size>1,de=oe&&K?dc(xs(h)):null,fe=oe&&G?w1({dragItems:h,snapGrid:V,x:X,y:ne}):null;for(const[me,te]of h){if(!P.has(me))continue;let pe={x:X-te.distance.x,y:ne-te.distance.y};G&&(pe=fe?{x:Math.round(pe.x+fe.x),y:Math.round(pe.y+fe.y)}:ws(pe,V));let Ne=null;if(oe&&K&&!te.extent&&de){const{positionAbsolute:ke}=te.internals,ze=ke.x-de.x+K[0][0],De=ke.x+te.measured.width-de.x2+K[1][0],Te=ke.y-de.y+K[0][1],Xe=ke.y+te.measured.height-de.y2+K[1][1];Ne=[[ze,Te],[De,Xe]]}const{position:be,positionAbsolute:Ce}=lm({nodeId:me,nextPosition:pe,nodeLookup:P,nodeExtent:Ne||K,nodeOrigin:z,onError:M});ie=ie||te.position.x!==be.x||te.position.y!==be.y,te.position=be,te.internals.positionAbsolute=Ce}if(S=S||ie,!!ie&&($(h,!0),N&&(s||R||!A&&B))){const[me,te]=Xu({nodeId:A,dragItems:h,nodeLookup:P});s==null||s(N,h,me,te),R==null||R(N,me,te),A||B==null||B(N,te)}}async function J(){if(!x)return;const{transform:X,panBy:ne,autoPanSpeed:P,autoPanOnNodeDrag:K}=r();if(!K){m=!1,cancelAnimationFrame(c);return}const[V,G]=um(g,x,P);(V!==0||G!==0)&&(u.x=(u.x??0)-V/X[2],u.y=(u.y??0)-G/X[2],await ne({x:V,y:G})&&q(u)),c=requestAnimationFrame(J)}function ee(X){var oe;const{nodeLookup:ne,multiSelectionActive:P,nodesDraggable:K,transform:V,snapGrid:G,snapToGrid:z,selectNodesOnDrag:R,onNodeDragStart:B,onSelectionDragStart:M,unselectNodesAndEdges:$}=r();y=!0,(!R||!O)&&!P&&A&&((oe=ne.get(A))!=null&&oe.selected||$()),O&&R&&A&&(t==null||t(A));const ie=os(X.sourceEvent,{transform:V,snapGrid:G,snapToGrid:z,containerBounds:x});if(u=ie,h=x1(ne,K,ie,A),h.size>0&&(o||B||!A&&M)){const[de,fe]=Xu({nodeId:A,dragItems:h,nodeLookup:ne});o==null||o(X.sourceEvent,h,de,fe),B==null||B(X.sourceEvent,de,fe),A||M==null||M(X.sourceEvent,fe)}}const U=Fp().clickDistance(H).on("start",X=>{const{domNode:ne,nodeDragThreshold:P,transform:K,snapGrid:V,snapToGrid:G}=r();x=(ne==null?void 0:ne.getBoundingClientRect())||null,_=!1,S=!1,N=X.sourceEvent,P===0&&ee(X),u=os(X.sourceEvent,{transform:K,snapGrid:V,snapToGrid:G,containerBounds:x}),g=Pn(X.sourceEvent,x)}).on("drag",X=>{const{autoPanOnNodeDrag:ne,transform:P,snapGrid:K,snapToGrid:V,nodeDragThreshold:G,nodeLookup:z}=r(),R=os(X.sourceEvent,{transform:P,snapGrid:K,snapToGrid:V,containerBounds:x});if(N=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||A&&!z.has(A))&&(_=!0),!_){if(!m&&ne&&y&&(m=!0,J()),!y){const B=Pn(X.sourceEvent,x),M=B.x-g.x,$=B.y-g.y;Math.sqrt(M*M+$*$)>G&&ee(X)}(u.x!==R.xSnapped||u.y!==R.ySnapped)&&h&&y&&(g=Pn(X.sourceEvent,x),q(R))}}).on("end",X=>{if(!(!y||_)&&(m=!1,y=!1,cancelAnimationFrame(c),h.size>0)){const{nodeLookup:ne,updateNodePositions:P,onNodeDragStop:K,onSelectionDragStop:V}=r();if(S&&(P(h,!1),S=!1),a||K||!A&&V){const[G,z]=Xu({nodeId:A,dragItems:h,nodeLookup:ne,dragging:!1});a==null||a(X.sourceEvent,h,G,z),K==null||K(X.sourceEvent,G,z),A||V==null||V(X.sourceEvent,z)}}}).filter(X=>{const ne=X.target;return!X.button&&(!I||!Dh(ne,`.${I}`,j))&&(!C||Dh(ne,C,j))});v.call(U)}function k(){v==null||v.on(".drag",null)}return{update:E,destroy:k}}function k1(t,r,o){const s=[],a={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const u of r.values())fs(a,mi(u))>0&&s.push(u);return s}const E1=250;function N1(t,r,o,s){var h,m;let a=[],u=1/0;const c=k1(t,o,r+E1);for(const g of c){const x=[...((h=g.internals.handleBounds)==null?void 0:h.source)??[],...((m=g.internals.handleBounds)==null?void 0:m.target)??[]];for(const y of x){if(s.nodeId===y.nodeId&&s.type===y.type&&s.id===y.id)continue;const{x:v,y:_}=No(g,y,y.position,!0),S=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(_-t.y,2));S>r||(S<u?(a=[{...y,x:v,y:_}],u=S):S===u&&a.push({...y,x:v,y:_}))}}if(!a.length)return null;if(a.length>1){const g=s.type==="source"?"target":"source";return a.find(x=>x.type===g)??a[0]}return a[0]}function _m(t,r,o,s,a,u=!1){var g,x,y;const c=s.get(t);if(!c)return null;const h=a==="strict"?(g=c.internals.handleBounds)==null?void 0:g[r]:[...((x=c.internals.handleBounds)==null?void 0:x.source)??[],...((y=c.internals.handleBounds)==null?void 0:y.target)??[]],m=(o?h==null?void 0:h.find(v=>v.id===o):h==null?void 0:h[0])??null;return m&&u?{...m,...No(c,m,m.position,!0)}:m}function jm(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function C1(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const bm=()=>!0;function _1(t,{connectionMode:r,connectionRadius:o,handleId:s,nodeId:a,edgeUpdaterType:u,isTarget:c,domNode:h,nodeLookup:m,lib:g,autoPanOnConnect:x,flowId:y,panBy:v,cancelConnection:_,onConnectStart:S,onConnect:N,onConnectEnd:E,isValidConnection:k=bm,onReconnectEnd:I,updateConnection:C,getTransform:j,getFromHandle:O,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:q}){const J=hm(t.target);let ee=0,U;const{x:X,y:ne}=Pn(t),P=jm(u,q),K=h==null?void 0:h.getBoundingClientRect();let V=!1;if(!K||!P)return;const G=_m(a,P,s,m,r);if(!G)return;let z=Pn(t,K),R=!1,B=null,M=!1,$=null;function ie(){if(!x||!K)return;const[be,Ce]=um(z,K,A);v({x:be,y:Ce}),ee=requestAnimationFrame(ie)}const oe={...G,nodeId:a,type:P,position:G.position},de=m.get(a);let me={inProgress:!0,isValid:null,from:No(de,oe,Ee.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:de,to:z,toHandle:null,toPosition:Ch[oe.position],toNode:null,pointer:z};function te(){V=!0,C(me),S==null||S(t,{nodeId:a,handleId:s,handleType:P})}H===0&&te();function pe(be){if(!V){const{x:Xe,y:Ct}=Pn(be),ut=Xe-X,_t=Ct-ne;if(!(ut*ut+_t*_t>H*H))return;te()}if(!O()||!oe){Ne(be);return}const Ce=j();z=Pn(be,K),U=N1(Ss(z,Ce,!1,[1,1]),o,m,oe),R||(ie(),R=!0);const ke=Pm(be,{handle:U,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:c?"target":"source",isValidConnection:k,doc:J,lib:g,flowId:y,nodeLookup:m});$=ke.handleDomNode,B=ke.connection,M=C1(!!U,ke.isValid);const ze=m.get(a),De=ze?No(ze,oe,Ee.Left,!0):me.from,Te={...me,from:De,isValid:M,to:ke.toHandle&&M?Kl({x:ke.toHandle.x,y:ke.toHandle.y},Ce):z,toHandle:ke.toHandle,toPosition:M&&ke.toHandle?ke.toHandle.position:Ch[oe.position],toNode:ke.toHandle?m.get(ke.toHandle.nodeId):null,pointer:z};C(Te),me=Te}function Ne(be){if(!("touches"in be&&be.touches.length>0)){if(V){(U||$)&&B&&M&&(N==null||N(B));const{inProgress:Ce,...ke}=me,ze={...ke,toPosition:me.toHandle?me.toPosition:null};E==null||E(be,ze),u&&(I==null||I(be,ze))}_(),cancelAnimationFrame(ee),R=!1,M=!1,B=null,$=null,J.removeEventListener("mousemove",pe),J.removeEventListener("mouseup",Ne),J.removeEventListener("touchmove",pe),J.removeEventListener("touchend",Ne)}}J.addEventListener("mousemove",pe),J.addEventListener("mouseup",Ne),J.addEventListener("touchmove",pe),J.addEventListener("touchend",Ne)}function Pm(t,{handle:r,connectionMode:o,fromNodeId:s,fromHandleId:a,fromType:u,doc:c,lib:h,flowId:m,isValidConnection:g=bm,nodeLookup:x}){const y=u==="target",v=r?c.querySelector(`.${h}-flow__handle[data-id="${m}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:_,y:S}=Pn(t),N=c.elementFromPoint(_,S),E=N!=null&&N.classList.contains(`${h}-flow__handle`)?N:v,k={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const I=jm(void 0,E),C=E.getAttribute("data-nodeid"),j=E.getAttribute("data-handleid"),O=E.classList.contains("connectable"),A=E.classList.contains("connectableend");if(!C||!I)return k;const H={source:y?C:s,sourceHandle:y?j:a,target:y?s:C,targetHandle:y?a:j};k.connection=H;const J=O&&A&&(o===ko.Strict?y&&I==="source"||!y&&I==="target":C!==s||j!==a);k.isValid=J&&g(H),k.toHandle=_m(C,I,j,x,o,!0)}return k}const mc={onPointerDown:_1,isValid:Pm};function j1({domNode:t,panZoom:r,getTransform:o,getViewScale:s}){const a=Kt(t);function u({translateExtent:h,width:m,height:g,zoomStep:x=1,pannable:y=!0,zoomable:v=!0,inversePan:_=!1}){const S=C=>{if(C.sourceEvent.type!=="wheel"||!r)return;const j=o(),O=C.sourceEvent.ctrlKey&&hs()?10:1,A=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*x,H=j[2]*Math.pow(2,A*O);r.scaleTo(H)};let N=[0,0];const E=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(N=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},k=C=>{const j=o();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!r)return;const O=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],A=[O[0]-N[0],O[1]-N[1]];N=O;const H=s()*Math.max(j[2],Math.log(j[2]))*(_?-1:1),q={x:j[0]-A[0]*H,y:j[1]-A[1]*H},J=[[0,0],[m,g]];r.setViewportConstrained({x:q.x,y:q.y,zoom:j[2]},J,h)},I=tm().on("start",E).on("zoom",y?k:null).on("zoom.wheel",v?S:null);a.call(I,{})}function c(){a.on("zoom",null)}return{update:u,destroy:c,pointer:_n}}const sa=t=>({x:t.x,y:t.y,zoom:t.k}),Gu=({x:t,y:r,zoom:o})=>ra.translate(t,r).scale(o),ai=(t,r)=>t.target.closest(`.${r}`),Mm=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),b1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Ku=(t,r=0,o=b1,s=()=>{})=>{const a=typeof r=="number"&&r>0;return a||s(),a?t.transition().duration(r).ease(o).on("end",s):t},Im=t=>{const r=t.ctrlKey&&hs()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function P1({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:g}){return x=>{if(ai(x,r))return x.ctrlKey&&x.preventDefault(),!1;x.preventDefault(),x.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(x.ctrlKey&&c){const E=_n(x),k=Im(x),I=y*Math.pow(2,k);s.scaleTo(o,I,E,x);return}const v=x.deltaMode===1?20:1;let _=a===xo.Vertical?0:x.deltaX*v,S=a===xo.Horizontal?0:x.deltaY*v;!hs()&&x.shiftKey&&a!==xo.Vertical&&(_=x.deltaY*v,S=0),s.translateBy(o,-(_/y)*u,-(S/y)*u,{internal:!0});const N=sa(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(x,N),t.panScrollTimeout=setTimeout(()=>{g==null||g(x,N),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(x,N))}}function M1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(s,a){const u=s.type==="wheel",c=!r&&u&&!s.ctrlKey,h=ai(s,t);if(s.ctrlKey&&u&&h&&s.preventDefault(),c||h)return null;s.preventDefault(),o.call(this,s,a)}}function I1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return s=>{var u,c,h;if((u=s.sourceEvent)!=null&&u.internal)return;const a=sa(s.transform);t.mouseButton=((c=s.sourceEvent)==null?void 0:c.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),o&&(o==null||o(s.sourceEvent,a))}}function T1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:s,onPanZoom:a}){return u=>{var c,h;t.usedRightMouseButton=!!(o&&Mm(r,t.mouseButton??0)),(c=u.sourceEvent)!=null&&c.sync||s([u.transform.x,u.transform.y,u.transform.k]),a&&!((h=u.sourceEvent)!=null&&h.internal)&&(a==null||a(u.sourceEvent,sa(u.transform)))}}function z1({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:u}){return c=>{var h;if(!((h=c.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,u&&Mm(r,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=sa(c.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(c.sourceEvent,m)},o?150:0)}}}function R1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:h,noPanClassName:m,lib:g,connectionInProgress:x}){return y=>{var E;const v=t||r,_=o&&y.ctrlKey,S=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(ai(y,`${g}-flow__node`)||ai(y,`${g}-flow__edge`)))return!0;if(!s&&!v&&!a&&!u&&!o||c||x&&!S||ai(y,h)&&S||ai(y,m)&&(!S||a&&S&&!t)||!o&&y.ctrlKey&&S)return!1;if(!o&&y.type==="touchstart"&&((E=y.touches)==null?void 0:E.length)>1)return y.preventDefault(),!1;if(!v&&!a&&!_&&S||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const N=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||S)&&N}}function A1({domNode:t,minZoom:r,maxZoom:o,translateExtent:s,viewport:a,onPanZoom:u,onPanZoomStart:c,onPanZoomEnd:h,onDraggingChange:m}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=t.getBoundingClientRect(),y=tm().scaleExtent([r,o]).translateExtent(s),v=Kt(t).call(y);I({x:a.x,y:a.y,zoom:pi(a.zoom,r,o)},[[0,0],[x.width,x.height]],s);const _=v.on("wheel.zoom"),S=v.on("dblclick.zoom");y.wheelDelta(Im);function N(U,X){return v?new Promise(ne=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?rs:Dl).transform(Ku(v,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),U)}):Promise.resolve(!1)}function E({noWheelClassName:U,noPanClassName:X,onPaneContextMenu:ne,userSelectionActive:P,panOnScroll:K,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:z,preventScrolling:R,zoomOnPinch:B,zoomOnScroll:M,zoomOnDoubleClick:$,zoomActivationKeyPressed:ie,lib:oe,onTransformChange:de,connectionInProgress:fe,paneClickDistance:me,selectionOnDrag:te}){P&&!g.isZoomingOrPanning&&k();const pe=K&&!ie&&!P;y.clickDistance(te?1/0:!bn(me)||me<0?0:me);const Ne=pe?P1({zoomPanValues:g,noWheelClassName:U,d3Selection:v,d3Zoom:y,panOnScrollMode:G,panOnScrollSpeed:z,zoomOnPinch:B,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:h}):M1({noWheelClassName:U,preventScrolling:R,d3ZoomHandler:_});if(v.on("wheel.zoom",Ne,{passive:!1}),!P){const Ce=I1({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:c});y.on("start",Ce);const ke=T1({zoomPanValues:g,panOnDrag:V,onPaneContextMenu:!!ne,onPanZoom:u,onTransformChange:de});y.on("zoom",ke);const ze=z1({zoomPanValues:g,panOnDrag:V,panOnScroll:K,onPaneContextMenu:ne,onPanZoomEnd:h,onDraggingChange:m});y.on("end",ze)}const be=R1({zoomActivationKeyPressed:ie,panOnDrag:V,zoomOnScroll:M,panOnScroll:K,zoomOnDoubleClick:$,zoomOnPinch:B,userSelectionActive:P,noPanClassName:X,noWheelClassName:U,lib:oe,connectionInProgress:fe});y.filter(be),$?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function k(){y.on("zoom",null)}async function I(U,X,ne){const P=Gu(U),K=y==null?void 0:y.constrain()(P,X,ne);return K&&await N(K),new Promise(V=>V(K))}async function C(U,X){const ne=Gu(U);return await N(ne,X),new Promise(P=>P(ne))}function j(U){if(v){const X=Gu(U),ne=v.property("__zoom");(ne.k!==U.zoom||ne.x!==U.x||ne.y!==U.y)&&(y==null||y.transform(v,X,null,{sync:!0}))}}function O(){const U=v?em(v.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,X){return v?new Promise(ne=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?rs:Dl).scaleTo(Ku(v,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),U)}):Promise.resolve(!1)}function H(U,X){return v?new Promise(ne=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?rs:Dl).scaleBy(Ku(v,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),U)}):Promise.resolve(!1)}function q(U){y==null||y.scaleExtent(U)}function J(U){y==null||y.translateExtent(U)}function ee(U){const X=!bn(U)||U<0?0:U;y==null||y.clickDistance(X)}return{update:E,destroy:k,setViewport:C,setViewportConstrained:I,getViewport:O,scaleTo:A,scaleBy:H,setScaleExtent:q,setTranslateExtent:J,syncViewport:j,setClickDistance:ee}}var Co;(function(t){t.Line="line",t.Handle="handle"})(Co||(Co={}));const L1=["top-left","top-right","bottom-left","bottom-right"],D1=["top","right","bottom","left"];function $1({width:t,prevWidth:r,height:o,prevHeight:s,affectsX:a,affectsY:u}){const c=t-r,h=o-s,m=[c>0?1:c<0?-1:0,h>0?1:h<0?-1:0];return c&&a&&(m[0]=m[0]*-1),h&&u&&(m[1]=m[1]*-1),m}function $h(t){const r=t.includes("right")||t.includes("left"),o=t.includes("bottom")||t.includes("top"),s=t.includes("left"),a=t.includes("top");return{isHorizontal:r,isVertical:o,affectsX:s,affectsY:a}}function Hr(t,r){return Math.max(0,r-t)}function Vr(t,r){return Math.max(0,t-r)}function Tl(t,r,o){return Math.max(0,r-t,t-o)}function Oh(t,r){return t?!r:r}function O1(t,r,o,s,a,u,c,h){let{affectsX:m,affectsY:g}=r;const{isHorizontal:x,isVertical:y}=r,v=x&&y,{xSnapped:_,ySnapped:S}=o,{minWidth:N,maxWidth:E,minHeight:k,maxHeight:I}=s,{x:C,y:j,width:O,height:A,aspectRatio:H}=t;let q=Math.floor(x?_-t.pointerX:0),J=Math.floor(y?S-t.pointerY:0);const ee=O+(m?-q:q),U=A+(g?-J:J),X=-u[0]*O,ne=-u[1]*A;let P=Tl(ee,N,E),K=Tl(U,k,I);if(c){let z=0,R=0;m&&q<0?z=Hr(C+q+X,c[0][0]):!m&&q>0&&(z=Vr(C+ee+X,c[1][0])),g&&J<0?R=Hr(j+J+ne,c[0][1]):!g&&J>0&&(R=Vr(j+U+ne,c[1][1])),P=Math.max(P,z),K=Math.max(K,R)}if(h){let z=0,R=0;m&&q>0?z=Vr(C+q,h[0][0]):!m&&q<0&&(z=Hr(C+ee,h[1][0])),g&&J>0?R=Vr(j+J,h[0][1]):!g&&J<0&&(R=Hr(j+U,h[1][1])),P=Math.max(P,z),K=Math.max(K,R)}if(a){if(x){const z=Tl(ee/H,k,I)*H;if(P=Math.max(P,z),c){let R=0;!m&&!g||m&&!g&&v?R=Vr(j+ne+ee/H,c[1][1])*H:R=Hr(j+ne+(m?q:-q)/H,c[0][1])*H,P=Math.max(P,R)}if(h){let R=0;!m&&!g||m&&!g&&v?R=Hr(j+ee/H,h[1][1])*H:R=Vr(j+(m?q:-q)/H,h[0][1])*H,P=Math.max(P,R)}}if(y){const z=Tl(U*H,N,E)/H;if(K=Math.max(K,z),c){let R=0;!m&&!g||g&&!m&&v?R=Vr(C+U*H+X,c[1][0])/H:R=Hr(C+(g?J:-J)*H+X,c[0][0])/H,K=Math.max(K,R)}if(h){let R=0;!m&&!g||g&&!m&&v?R=Hr(C+U*H,h[1][0])/H:R=Vr(C+(g?J:-J)*H,h[0][0])/H,K=Math.max(K,R)}}}J=J+(J<0?K:-K),q=q+(q<0?P:-P),a&&(v?ee>U*H?J=(Oh(m,g)?-q:q)/H:q=(Oh(m,g)?-J:J)*H:x?(J=q/H,g=m):(q=J*H,m=g));const V=m?C+q:C,G=g?j+J:j;return{width:O+(m?-q:q),height:A+(g?-J:J),x:u[0]*q*(m?-1:1)+V,y:u[1]*J*(g?-1:1)+G}}const Tm={width:0,height:0,x:0,y:0},F1={...Tm,pointerX:0,pointerY:0,aspectRatio:1};function H1(t){return[[0,0],[t.measured.width,t.measured.height]]}function V1(t,r,o){const s=r.position.x+t.position.x,a=r.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,h=o[0]*u,m=o[1]*c;return[[s-h,a-m],[s+u-h,a+c-m]]}function B1({domNode:t,nodeId:r,getStoreItems:o,onChange:s,onEnd:a}){const u=Kt(t);let c={controlDirection:$h("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:g,boundaries:x,keepAspectRatio:y,resizeDirection:v,onResizeStart:_,onResize:S,onResizeEnd:N,shouldResize:E}){let k={...Tm},I={...F1};c={boundaries:x,resizeDirection:v,keepAspectRatio:y,controlDirection:$h(g)};let C,j=null,O=[],A,H,q,J=!1;const ee=Fp().on("start",U=>{const{nodeLookup:X,transform:ne,snapGrid:P,snapToGrid:K,nodeOrigin:V,paneDomNode:G}=o();if(C=X.get(r),!C)return;j=(G==null?void 0:G.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:R}=os(U.sourceEvent,{transform:ne,snapGrid:P,snapToGrid:K,containerBounds:j});k={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},I={...k,pointerX:z,pointerY:R,aspectRatio:k.width/k.height},A=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(A=X.get(C.parentId),H=A&&C.extent==="parent"?H1(A):void 0),O=[],q=void 0;for(const[B,M]of X)if(M.parentId===r&&(O.push({id:B,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const $=V1(M,C,M.origin??V);q?q=[[Math.min($[0][0],q[0][0]),Math.min($[0][1],q[0][1])],[Math.max($[1][0],q[1][0]),Math.max($[1][1],q[1][1])]]:q=$}_==null||_(U,{...k})}).on("drag",U=>{const{transform:X,snapGrid:ne,snapToGrid:P,nodeOrigin:K}=o(),V=os(U.sourceEvent,{transform:X,snapGrid:ne,snapToGrid:P,containerBounds:j}),G=[];if(!C)return;const{x:z,y:R,width:B,height:M}=k,$={},ie=C.origin??K,{width:oe,height:de,x:fe,y:me}=O1(I,c.controlDirection,V,c.boundaries,c.keepAspectRatio,ie,H,q),te=oe!==B,pe=de!==M,Ne=fe!==z&&te,be=me!==R&&pe;if(!Ne&&!be&&!te&&!pe)return;if((Ne||be||ie[0]===1||ie[1]===1)&&($.x=Ne?fe:k.x,$.y=be?me:k.y,k.x=$.x,k.y=$.y,O.length>0)){const De=fe-z,Te=me-R;for(const Xe of O)Xe.position={x:Xe.position.x-De+ie[0]*(oe-B),y:Xe.position.y-Te+ie[1]*(de-M)},G.push(Xe)}if((te||pe)&&($.width=te&&(!c.resizeDirection||c.resizeDirection==="horizontal")?oe:k.width,$.height=pe&&(!c.resizeDirection||c.resizeDirection==="vertical")?de:k.height,k.width=$.width,k.height=$.height),A&&C.expandParent){const De=ie[0]*($.width??0);$.x&&$.x<De&&(k.x=De,I.x=I.x-($.x-De));const Te=ie[1]*($.height??0);$.y&&$.y<Te&&(k.y=Te,I.y=I.y-($.y-Te))}const Ce=$1({width:k.width,prevWidth:B,height:k.height,prevHeight:M,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ke={...k,direction:Ce};(E==null?void 0:E(U,ke))!==!1&&(J=!0,S==null||S(U,ke),s($,G))}).on("end",U=>{J&&(N==null||N(U,{...k}),a==null||a({...k}),J=!1)});u.call(ee)}function m(){u.on(".drag",null)}return{update:h,destroy:m}}var Qu={exports:{}},qu={},Zu={exports:{}},Ju={};/**
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 Fh;function W1(){if(Fh)return Ju;Fh=1;var t=ms();function r(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var o=typeof Object.is=="function"?Object.is:r,s=t.useState,a=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function h(y,v){var _=v(),S=s({inst:{value:_,getSnapshot:v}}),N=S[0].inst,E=S[1];return u(function(){N.value=_,N.getSnapshot=v,m(N)&&E({inst:N})},[y,_,v]),a(function(){return m(N)&&E({inst:N}),y(function(){m(N)&&E({inst:N})})},[y]),c(_),_}function m(y){var v=y.getSnapshot;y=y.value;try{var _=v();return!o(y,_)}catch{return!0}}function g(y,v){return v()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return Ju.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:x,Ju}var Hh;function U1(){return Hh||(Hh=1,Zu.exports=W1()),Zu.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 Vh;function Y1(){if(Vh)return qu;Vh=1;var t=ms(),r=U1();function o(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var s=typeof Object.is=="function"?Object.is:o,a=r.useSyncExternalStore,u=t.useRef,c=t.useEffect,h=t.useMemo,m=t.useDebugValue;return qu.useSyncExternalStoreWithSelector=function(g,x,y,v,_){var S=u(null);if(S.current===null){var N={hasValue:!1,value:null};S.current=N}else N=S.current;S=h(function(){function k(A){if(!I){if(I=!0,C=A,A=v(A),_!==void 0&&N.hasValue){var H=N.value;if(_(H,A))return j=H}return j=A}if(H=j,s(C,A))return H;var q=v(A);return _!==void 0&&_(H,q)?(C=A,H):(C=A,j=q)}var I=!1,C,j,O=y===void 0?null:y;return[function(){return k(x())},O===null?void 0:function(){return k(O())}]},[x,y,v,_]);var E=a(g,S[0],S[1]);return c(function(){N.hasValue=!0,N.value=E},[E]),m(E),E},qu}var Bh;function X1(){return Bh||(Bh=1,Qu.exports=Y1()),Qu.exports}var G1=X1();const K1=vc(G1),Q1={},Wh=t=>{let r;const o=new Set,s=(x,y)=>{const v=typeof x=="function"?x(r):x;if(!Object.is(v,r)){const _=r;r=y??(typeof v!="object"||v===null)?v:Object.assign({},r,v),o.forEach(S=>S(r,_))}},a=()=>r,m={setState:s,getState:a,getInitialState:()=>g,subscribe:x=>(o.add(x),()=>o.delete(x)),destroy:()=>{(Q1?"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."),o.clear()}},g=r=t(s,a,m);return m},q1=t=>t?Wh(t):Wh,{useDebugValue:Z1}=Np,{useSyncExternalStoreWithSelector:J1}=K1,eS=t=>t;function zm(t,r=eS,o){const s=J1(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return Z1(s),s}const Uh=(t,r)=>{const o=q1(t),s=(a,u=r)=>zm(o,a,u);return Object.assign(s,o),s},tS=(t,r)=>t?Uh(t,r):Uh;function Je(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,a]of t)if(!Object.is(a,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;for(const s of o)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}Cp();const la=b.createContext(null),nS=la.Provider,Rm=Xn.error001();function Fe(t,r){const o=b.useContext(la);if(o===null)throw new Error(Rm);return zm(o,t,r)}function et(){const t=b.useContext(la);if(t===null)throw new Error(Rm);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Yh={display:"none"},rS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Am="react-flow__node-desc",Lm="react-flow__edge-desc",oS="react-flow__aria-live",iS=t=>t.ariaLiveMessage,sS=t=>t.ariaLabelConfig;function lS({rfId:t}){const r=Fe(iS);return f.jsx("div",{id:`${oS}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:rS,children:r})}function aS({rfId:t,disableKeyboardA11y:r}){const o=Fe(sS);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${Am}-${t}`,style:Yh,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${Lm}-${t}`,style:Yh,children:o["edge.a11yDescription.default"]}),!r&&f.jsx(lS,{rfId:t})]})}const aa=b.forwardRef(({position:t="top-left",children:r,className:o,style:s,...a},u)=>{const c=`${t}`.split("-");return f.jsx("div",{className:at(["react-flow__panel",o,...c]),style:s,ref:u,...a,children:r})});aa.displayName="Panel";function uS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:f.jsx(aa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const cS=t=>{const r=[],o=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&o.push(s);return{selectedNodes:r,selectedEdges:o}},zl=t=>t.id;function dS(t,r){return Je(t.selectedNodes.map(zl),r.selectedNodes.map(zl))&&Je(t.selectedEdges.map(zl),r.selectedEdges.map(zl))}function fS({onSelectionChange:t}){const r=et(),{selectedNodes:o,selectedEdges:s}=Fe(cS,dS);return b.useEffect(()=>{const a={nodes:o,edges:s};t==null||t(a),r.getState().onSelectionChangeHandlers.forEach(u=>u(a))},[o,s,t]),null}const hS=t=>!!t.onSelectionChangeHandlers;function pS({onSelectionChange:t}){const r=Fe(hS);return t||r?f.jsx(fS,{onSelectionChange:t}):null}const Dm=[0,0],mS={x:0,y:0,zoom:1},gS=["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"],Xh=[...gS,"rfId"],yS=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Gh={translateExtent:us,nodeOrigin:Dm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vS(t){const{setNodes:r,setEdges:o,setMinZoom:s,setMaxZoom:a,setTranslateExtent:u,setNodeExtent:c,reset:h,setDefaultNodesAndEdges:m}=Fe(yS,Je),g=et();b.useEffect(()=>(m(t.defaultNodes,t.defaultEdges),()=>{x.current=Gh,h()}),[]);const x=b.useRef(Gh);return b.useEffect(()=>{for(const y of Xh){const v=t[y],_=x.current[y];v!==_&&(typeof t[y]>"u"||(y==="nodes"?r(v):y==="edges"?o(v):y==="minZoom"?s(v):y==="maxZoom"?a(v):y==="translateExtent"?u(v):y==="nodeExtent"?c(v):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:e1(v)}):y==="fitView"?g.setState({fitViewQueued:v}):y==="fitViewOptions"?g.setState({fitViewOptions:v}):g.setState({[y]:v})))}x.current=t},Xh.map(y=>t[y])),null}function Kh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function xS(t){var s;const[r,o]=b.useState(t==="system"?null:t);return b.useEffect(()=>{if(t!=="system"){o(t);return}const a=Kh(),u=()=>o(a!=null&&a.matches?"dark":"light");return u(),a==null||a.addEventListener("change",u),()=>{a==null||a.removeEventListener("change",u)}},[t]),r!==null?r:(s=Kh())!=null&&s.matches?"dark":"light"}const Qh=typeof document<"u"?document:null;function ps(t=null,r={target:Qh,actInsideInputWithModifier:!0}){const[o,s]=b.useState(!1),a=b.useRef(!1),u=b.useRef(new Set([])),[c,h]=b.useMemo(()=>{if(t!==null){const g=(Array.isArray(t)?t:[t]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),x=g.reduce((y,v)=>y.concat(...v),[]);return[g,x]}return[[],[]]},[t]);return b.useEffect(()=>{const m=(r==null?void 0:r.target)??Qh,g=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const x=_=>{var E,k;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!g)&&pm(_))return!1;const N=Zh(_.code,h);if(u.current.add(_[N]),qh(c,u.current,!1)){const I=((k=(E=_.composedPath)==null?void 0:E.call(_))==null?void 0:k[0])||_.target,C=(I==null?void 0:I.nodeName)==="BUTTON"||(I==null?void 0:I.nodeName)==="A";r.preventDefault!==!1&&(a.current||!C)&&_.preventDefault(),s(!0)}},y=_=>{const S=Zh(_.code,h);qh(c,u.current,!0)?(s(!1),u.current.clear()):u.current.delete(_[S]),_.key==="Meta"&&u.current.clear(),a.current=!1},v=()=>{u.current.clear(),s(!1)};return m==null||m.addEventListener("keydown",x),m==null||m.addEventListener("keyup",y),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{m==null||m.removeEventListener("keydown",x),m==null||m.removeEventListener("keyup",y),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[t,s]),o}function qh(t,r,o){return t.filter(s=>o||s.length===r.size).some(s=>s.every(a=>r.has(a)))}function Zh(t,r){return r.includes(t)?"code":"key"}const wS=()=>{const t=et();return b.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1/1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,{duration:o==null?void 0:o.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,o)=>{const{transform:[s,a,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:r.x??s,y:r.y??a,zoom:r.zoom??u},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,s]=t.getState().transform;return{x:r,y:o,zoom:s}},setCenter:async(r,o,s)=>t.getState().setCenter(r,o,s),fitBounds:async(r,o)=>{const{width:s,height:a,minZoom:u,maxZoom:c,panZoom:h}=t.getState(),m=bc(r,s,a,u,c,(o==null?void 0:o.padding)??.1);return h?(await h.setViewport(m,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:s,snapGrid:a,snapToGrid:u,domNode:c}=t.getState();if(!c)return r;const{x:h,y:m}=c.getBoundingClientRect(),g={x:r.x-h,y:r.y-m},x=o.snapGrid??a,y=o.snapToGrid??u;return Ss(g,s,y,x)},flowToScreenPosition:r=>{const{transform:o,domNode:s}=t.getState();if(!s)return r;const{x:a,y:u}=s.getBoundingClientRect(),c=Kl(r,o);return{x:c.x+a,y:c.y+u}}}),[])};function $m(t,r){const o=[],s=new Map,a=[];for(const u of t)if(u.type==="add"){a.push(u);continue}else if(u.type==="remove"||u.type==="replace")s.set(u.id,[u]);else{const c=s.get(u.id);c?c.push(u):s.set(u.id,[u])}for(const u of r){const c=s.get(u.id);if(!c){o.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){o.push({...c[0].item});continue}const h={...u};for(const m of c)SS(m,h);o.push(h)}return a.length&&a.forEach(u=>{u.index!==void 0?o.splice(u.index,0,{...u.item}):o.push({...u.item})}),o}function SS(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Om(t,r){return $m(t,r)}function Fm(t,r){return $m(t,r)}function go(t,r){return{id:t,type:"select",selected:r}}function ui(t,r=new Set,o=!1){const s=[];for(const[a,u]of t){const c=r.has(a);!(u.selected===void 0&&!c)&&u.selected!==c&&(o&&(u.selected=c),s.push(go(u.id,c)))}return s}function Jh({items:t=[],lookup:r}){var a;const o=[],s=new Map(t.map(u=>[u.id,u]));for(const[u,c]of t.entries()){const h=r.get(c.id),m=((a=h==null?void 0:h.internals)==null?void 0:a.userNode)??h;m!==void 0&&m!==c&&o.push({id:c.id,item:c,type:"replace"}),m===void 0&&o.push({item:c,type:"add",index:u})}for(const[u]of r)s.get(u)===void 0&&o.push({id:u,type:"remove"});return o}function ep(t){return{id:t.id,type:"remove"}}const tp=t=>Ww(t),kS=t=>sm(t);function Hm(t){return b.forwardRef(t)}const ES=typeof window<"u"?b.useLayoutEffect:b.useEffect;function np(t){const[r,o]=b.useState(BigInt(0)),[s]=b.useState(()=>NS(()=>o(a=>a+BigInt(1))));return ES(()=>{const a=s.get();a.length&&(t(a),s.reset())},[r]),s}function NS(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const Vm=b.createContext(null);function CS({children:t}){const r=et(),o=b.useCallback(h=>{const{nodes:m=[],setNodes:g,hasDefaultNodes:x,onNodesChange:y,nodeLookup:v,fitViewQueued:_,onNodesChangeMiddlewareMap:S}=r.getState();let N=m;for(const k of h)N=typeof k=="function"?k(N):k;let E=Jh({items:N,lookup:v});for(const k of S.values())E=k(E);x&&g(N),E.length>0?y==null||y(E):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:I,setNodes:C}=r.getState();k&&C(I)})},[]),s=np(o),a=b.useCallback(h=>{const{edges:m=[],setEdges:g,hasDefaultEdges:x,onEdgesChange:y,edgeLookup:v}=r.getState();let _=m;for(const S of h)_=typeof S=="function"?S(_):S;x?g(_):y&&y(Jh({items:_,lookup:v}))},[]),u=np(a),c=b.useMemo(()=>({nodeQueue:s,edgeQueue:u}),[]);return f.jsx(Vm.Provider,{value:c,children:t})}function _S(){const t=b.useContext(Vm);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const jS=t=>!!t.panZoom;function Ac(){const t=wS(),r=et(),o=_S(),s=Fe(jS),a=b.useMemo(()=>{const u=y=>r.getState().nodeLookup.get(y),c=y=>{o.nodeQueue.push(y)},h=y=>{o.edgeQueue.push(y)},m=y=>{var k,I;const{nodeLookup:v,nodeOrigin:_}=r.getState(),S=tp(y)?y:v.get(y.id),N=S.parentId?fm(S.position,S.measured,S.parentId,v,_):S.position,E={...S,position:N,width:((k=S.measured)==null?void 0:k.width)??S.width,height:((I=S.measured)==null?void 0:I.height)??S.height};return mi(E)},g=(y,v,_={replace:!1})=>{c(S=>S.map(N=>{if(N.id===y){const E=typeof v=="function"?v(N):v;return _.replace&&tp(E)?E:{...N,...E}}return N}))},x=(y,v,_={replace:!1})=>{h(S=>S.map(N=>{if(N.id===y){const E=typeof v=="function"?v(N):v;return _.replace&&kS(E)?E:{...N,...E}}return N}))};return{getNodes:()=>r.getState().nodes.map(y=>({...y})),getNode:y=>{var v;return(v=u(y))==null?void 0:v.internals.userNode},getInternalNode:u,getEdges:()=>{const{edges:y=[]}=r.getState();return y.map(v=>({...v}))},getEdge:y=>r.getState().edgeLookup.get(y),setNodes:c,setEdges:h,addNodes:y=>{const v=Array.isArray(y)?y:[y];o.nodeQueue.push(_=>[..._,...v])},addEdges:y=>{const v=Array.isArray(y)?y:[y];o.edgeQueue.push(_=>[..._,...v])},toObject:()=>{const{nodes:y=[],edges:v=[],transform:_}=r.getState(),[S,N,E]=_;return{nodes:y.map(k=>({...k})),edges:v.map(k=>({...k})),viewport:{x:S,y:N,zoom:E}}},deleteElements:async({nodes:y=[],edges:v=[]})=>{const{nodes:_,edges:S,onNodesDelete:N,onEdgesDelete:E,triggerNodeChanges:k,triggerEdgeChanges:I,onDelete:C,onBeforeDelete:j}=r.getState(),{nodes:O,edges:A}=await Kw({nodesToRemove:y,edgesToRemove:v,nodes:_,edges:S,onBeforeDelete:j}),H=A.length>0,q=O.length>0;if(H){const J=A.map(ep);E==null||E(A),I(J)}if(q){const J=O.map(ep);N==null||N(O),k(J)}return(q||H)&&(C==null||C({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(y,v=!0,_)=>{const S=jh(y),N=S?y:m(y),E=_!==void 0;return N?(_||r.getState().nodes).filter(k=>{const I=r.getState().nodeLookup.get(k.id);if(I&&!S&&(k.id===y.id||!I.internals.positionAbsolute))return!1;const C=mi(E?k:I),j=fs(C,N);return v&&j>0||j>=C.width*C.height||j>=N.width*N.height}):[]},isNodeIntersecting:(y,v,_=!0)=>{const N=jh(y)?y:m(y);if(!N)return!1;const E=fs(N,v);return _&&E>0||E>=v.width*v.height||E>=N.width*N.height},updateNode:g,updateNodeData:(y,v,_={replace:!1})=>{g(y,S=>{const N=typeof v=="function"?v(S):v;return _.replace?{...S,data:N}:{...S,data:{...S.data,...N}}},_)},updateEdge:x,updateEdgeData:(y,v,_={replace:!1})=>{x(y,S=>{const N=typeof v=="function"?v(S):v;return _.replace?{...S,data:N}:{...S,data:{...S.data,...N}}},_)},getNodesBounds:y=>{const{nodeLookup:v,nodeOrigin:_}=r.getState();return Uw(y,{nodeLookup:v,nodeOrigin:_})},getHandleConnections:({type:y,id:v,nodeId:_})=>{var S;return Array.from(((S=r.getState().connectionLookup.get(`${_}-${y}${v?`-${v}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:y,handleId:v,nodeId:_})=>{var S;return Array.from(((S=r.getState().connectionLookup.get(`${_}${y?v?`-${y}-${v}`:`-${y}`:""}`))==null?void 0:S.values())??[])},fitView:async y=>{const v=r.getState().fitViewResolver??Jw();return r.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:v}),o.nodeQueue.push(_=>[..._]),v.promise}}},[]);return b.useMemo(()=>({...a,...t,viewportInitialized:s}),[s])}const rp=t=>t.selected,bS=typeof window<"u"?window:void 0;function PS({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=et(),{deleteElements:s}=Ac(),a=ps(t,{actInsideInputWithModifier:!1}),u=ps(r,{target:bS});b.useEffect(()=>{if(a){const{edges:c,nodes:h}=o.getState();s({nodes:h.filter(rp),edges:c.filter(rp)}),o.setState({nodesSelectionActive:!1})}},[a]),b.useEffect(()=>{o.setState({multiSelectionActive:u})},[u])}function MS(t){const r=et();b.useEffect(()=>{const o=()=>{var a,u,c,h;if(!t.current||!(((u=(a=t.current).checkVisibility)==null?void 0:u.call(a))??!0))return!1;const s=Pc(t.current);(s.height===0||s.width===0)&&((h=(c=r.getState()).onError)==null||h.call(c,"004",Xn.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){o(),window.addEventListener("resize",o);const s=new ResizeObserver(()=>o());return s.observe(t.current),()=>{window.removeEventListener("resize",o),s&&t.current&&s.unobserve(t.current)}}},[])}const ua={position:"absolute",width:"100%",height:"100%",top:0,left:0},IS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function TS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:u=xo.Free,zoomOnDoubleClick:c=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:x,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:_=!0,children:S,noWheelClassName:N,noPanClassName:E,onViewportChange:k,isControlledViewport:I,paneClickDistance:C,selectionOnDrag:j}){const O=et(),A=b.useRef(null),{userSelectionActive:H,lib:q,connectionInProgress:J}=Fe(IS,Je),ee=ps(v),U=b.useRef();MS(A);const X=b.useCallback(ne=>{k==null||k({x:ne[0],y:ne[1],zoom:ne[2]}),I||O.setState({transform:ne})},[k,I]);return b.useEffect(()=>{if(A.current){U.current=A1({domNode:A.current,minZoom:x,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:V=>O.setState({paneDragging:V}),onPanZoomStart:(V,G)=>{const{onViewportChangeStart:z,onMoveStart:R}=O.getState();R==null||R(V,G),z==null||z(G)},onPanZoom:(V,G)=>{const{onViewportChange:z,onMove:R}=O.getState();R==null||R(V,G),z==null||z(G)},onPanZoomEnd:(V,G)=>{const{onViewportChangeEnd:z,onMoveEnd:R}=O.getState();R==null||R(V,G),z==null||z(G)}});const{x:ne,y:P,zoom:K}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[ne,P,K],domNode:A.current.closest(".react-flow")}),()=>{var V;(V=U.current)==null||V.destroy()}}},[]),b.useEffect(()=>{var ne;(ne=U.current)==null||ne.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:h,zoomActivationKeyPressed:ee,preventScrolling:_,noPanClassName:E,userSelectionActive:H,noWheelClassName:N,lib:q,onTransformChange:X,connectionInProgress:J,selectionOnDrag:j,paneClickDistance:C})},[t,r,o,s,a,u,c,h,ee,_,E,H,N,q,X,J,j,C]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:ua,children:S})}const zS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function RS(){const{userSelectionActive:t,userSelectionRect:r}=Fe(zS,Je);return t&&r?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const ec=(t,r)=>o=>{o.target===r.current&&(t==null||t(o))},AS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function LS({isSelecting:t,selectionKeyPressed:r,selectionMode:o=cs.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:u,onSelectionStart:c,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:x,onPaneMouseEnter:y,onPaneMouseMove:v,onPaneMouseLeave:_,children:S}){const N=et(),{userSelectionActive:E,elementsSelectable:k,dragging:I,connectionInProgress:C}=Fe(AS,Je),j=k&&(t||E),O=b.useRef(null),A=b.useRef(),H=b.useRef(new Set),q=b.useRef(new Set),J=b.useRef(!1),ee=z=>{if(J.current||C){J.current=!1;return}m==null||m(z),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},U=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}g==null||g(z)},X=x?z=>x(z):void 0,ne=z=>{J.current&&(z.stopPropagation(),J.current=!1)},P=z=>{var de,fe;const{domNode:R}=N.getState();if(A.current=R==null?void 0:R.getBoundingClientRect(),!A.current)return;const B=z.target===O.current;if(!B&&!!z.target.closest(".nokey")||!t||!(u&&B||r)||z.button!==0||!z.isPrimary)return;(fe=(de=z.target)==null?void 0:de.setPointerCapture)==null||fe.call(de,z.pointerId),J.current=!1;const{x:ie,y:oe}=Pn(z.nativeEvent,A.current);N.setState({userSelectionRect:{width:0,height:0,startX:ie,startY:oe,x:ie,y:oe}}),B||(z.stopPropagation(),z.preventDefault())},K=z=>{const{userSelectionRect:R,transform:B,nodeLookup:M,edgeLookup:$,connectionLookup:ie,triggerNodeChanges:oe,triggerEdgeChanges:de,defaultEdgeOptions:fe,resetSelectedElements:me}=N.getState();if(!A.current||!R)return;const{x:te,y:pe}=Pn(z.nativeEvent,A.current),{startX:Ne,startY:be}=R;if(!J.current){const Te=r?0:a;if(Math.hypot(te-Ne,pe-be)<=Te)return;me(),c==null||c(z)}J.current=!0;const Ce={startX:Ne,startY:be,x:te<Ne?te:Ne,y:pe<be?pe:be,width:Math.abs(te-Ne),height:Math.abs(pe-be)},ke=H.current,ze=q.current;H.current=new Set(jc(M,Ce,B,o===cs.Partial,!0).map(Te=>Te.id)),q.current=new Set;const De=(fe==null?void 0:fe.selectable)??!0;for(const Te of H.current){const Xe=ie.get(Te);if(Xe)for(const{edgeId:Ct}of Xe.values()){const ut=$.get(Ct);ut&&(ut.selectable??De)&&q.current.add(Ct)}}if(!bh(ke,H.current)){const Te=ui(M,H.current,!0);oe(Te)}if(!bh(ze,q.current)){const Te=ui($,q.current);de(Te)}N.setState({userSelectionRect:Ce,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var R,B;z.button===0&&((B=(R=z.target)==null?void 0:R.releasePointerCapture)==null||B.call(R,z.pointerId),!E&&z.target===O.current&&N.getState().userSelectionRect&&(ee==null||ee(z)),N.setState({userSelectionActive:!1,userSelectionRect:null}),J.current&&(h==null||h(z),N.setState({nodesSelectionActive:H.current.size>0})))},G=s===!0||Array.isArray(s)&&s.includes(0);return f.jsxs("div",{className:at(["react-flow__pane",{draggable:G,dragging:I,selection:t}]),onClick:j?void 0:ec(ee,O),onContextMenu:ec(U,O),onWheel:ec(X,O),onPointerEnter:j?void 0:y,onPointerMove:j?K:v,onPointerUp:j?V:void 0,onPointerDownCapture:j?P:void 0,onClickCapture:j?ne:void 0,onPointerLeave:_,ref:O,style:ua,children:[S,f.jsx(RS,{})]})}function gc({id:t,store:r,unselect:o=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:h,onError:m}=r.getState(),g=h.get(t);if(!g){m==null||m("012",Xn.error012(t));return}r.setState({nodesSelectionActive:!1}),g.selected?(o||g.selected&&c)&&(u({nodes:[g],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):a([t])}function Bm({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:s,nodeId:a,isSelectable:u,nodeClickDistance:c}){const h=et(),[m,g]=b.useState(!1),x=b.useRef();return b.useEffect(()=>{x.current=S1({getStoreItems:()=>h.getState(),onNodeMouseDown:y=>{gc({id:y,store:h,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),b.useEffect(()=>{var y,v;if(r)(y=x.current)==null||y.destroy();else if(t.current)return(v=x.current)==null||v.update({noDragClassName:o,handleSelector:s,domNode:t.current,isSelectable:u,nodeId:a,nodeClickDistance:c}),()=>{var _;(_=x.current)==null||_.destroy()}},[o,s,r,u,t,a]),m}const DS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Wm(){const t=et();return b.useCallback(o=>{const{nodeExtent:s,snapToGrid:a,snapGrid:u,nodesDraggable:c,onError:h,updateNodePositions:m,nodeLookup:g,nodeOrigin:x}=t.getState(),y=new Map,v=DS(c),_=a?u[0]:5,S=a?u[1]:5,N=o.direction.x*_*o.factor,E=o.direction.y*S*o.factor;for(const[,k]of g){if(!v(k))continue;let I={x:k.internals.positionAbsolute.x+N,y:k.internals.positionAbsolute.y+E};a&&(I=ws(I,u));const{position:C,positionAbsolute:j}=lm({nodeId:k.id,nextPosition:I,nodeLookup:g,nodeExtent:s,nodeOrigin:x,onError:h});k.position=C,k.internals.positionAbsolute=j,y.set(k.id,k)}m(y)},[])}const Lc=b.createContext(null),$S=Lc.Provider;Lc.Consumer;const Um=()=>b.useContext(Lc),OS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),FS=(t,r,o)=>s=>{const{connectionClickStartHandle:a,connectionMode:u,connection:c}=s,{fromHandle:h,toHandle:m,isValid:g}=c,x=(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===o;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===o,connectingTo:x,clickConnecting:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===o,isPossibleEndHandle:u===ko.Strict?(h==null?void 0:h.type)!==o:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!a,valid:x&&g}};function HS({type:t="source",position:r=Ee.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:u=!0,id:c,onConnect:h,children:m,className:g,onMouseDown:x,onTouchStart:y,...v},_){var K,V;const S=c||null,N=t==="target",E=et(),k=Um(),{connectOnClick:I,noPanClassName:C,rfId:j}=Fe(OS,Je),{connectingFrom:O,connectingTo:A,clickConnecting:H,isPossibleEndHandle:q,connectionInProcess:J,clickConnectionInProcess:ee,valid:U}=Fe(FS(k,S,t),Je);k||(V=(K=E.getState()).onError)==null||V.call(K,"010",Xn.error010());const X=G=>{const{defaultEdgeOptions:z,onConnect:R,hasDefaultEdges:B}=E.getState(),M={...z,...G};if(B){const{edges:$,setEdges:ie}=E.getState();ie(wm(M,$))}R==null||R(M),h==null||h(M)},ne=G=>{if(!k)return;const z=mm(G.nativeEvent);if(a&&(z&&G.button===0||!z)){const R=E.getState();mc.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:N,handleId:S,nodeId:k,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:R.onConnectEnd,updateConnection:R.updateConnection,onConnect:X,isValidConnection:o||R.isValidConnection,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}z?x==null||x(G):y==null||y(G)},P=G=>{const{onClickConnectStart:z,onClickConnectEnd:R,connectionClickStartHandle:B,connectionMode:M,isValidConnection:$,lib:ie,rfId:oe,nodeLookup:de,connection:fe}=E.getState();if(!k||!B&&!a)return;if(!B){z==null||z(G.nativeEvent,{nodeId:k,handleId:S,handleType:t}),E.setState({connectionClickStartHandle:{nodeId:k,type:t,id:S}});return}const me=hm(G.target),te=o||$,{connection:pe,isValid:Ne}=mc.isValid(G.nativeEvent,{handle:{nodeId:k,id:S,type:t},connectionMode:M,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:te,flowId:oe,doc:me,lib:ie,nodeLookup:de});Ne&&pe&&X(pe);const be=structuredClone(fe);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,R==null||R(G,be),E.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":r,"data-id":`${j}-${k}-${S}-${t}`,className:at(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",C,g,{source:!N,target:N,connectable:s,connectablestart:a,connectableend:u,clickconnecting:H,connectingfrom:O,connectingto:A,valid:U,connectionindicator:s&&(!J||q)&&(J||ee?u:a)}]),onMouseDown:ne,onTouchStart:ne,onClick:I?P:void 0,ref:_,...v,children:m})}const Wr=b.memo(Hm(HS));function VS({data:t,isConnectable:r,sourcePosition:o=Ee.Bottom}){return f.jsxs(f.Fragment,{children:[t==null?void 0:t.label,f.jsx(Wr,{type:"source",position:o,isConnectable:r})]})}function BS({data:t,isConnectable:r,targetPosition:o=Ee.Top,sourcePosition:s=Ee.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Wr,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label,f.jsx(Wr,{type:"source",position:s,isConnectable:r})]})}function WS(){return null}function US({data:t,isConnectable:r,targetPosition:o=Ee.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Wr,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label]})}const Ql={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},op={input:VS,default:BS,output:US,group:WS};function YS(t){var r,o,s,a;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((o=t.style)==null?void 0:o.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((a=t.style)==null?void 0:a.height)}}const XS=t=>{const{width:r,height:o,x:s,y:a}=xs(t.nodeLookup,{filter:u=>!!u.selected});return{width:bn(r)?r:null,height:bn(o)?o:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${a}px)`}};function GS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const s=et(),{width:a,height:u,transformString:c,userSelectionActive:h}=Fe(XS,Je),m=Wm(),g=b.useRef(null);if(b.useEffect(()=>{var v;o||(v=g.current)==null||v.focus({preventScroll:!0})},[o]),Bm({nodeRef:g}),h||!a||!u)return null;const x=t?v=>{const _=s.getState().nodes.filter(S=>S.selected);t(v,_)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(Ql,v.key)&&(v.preventDefault(),m({direction:Ql[v.key],factor:v.shiftKey?4:1}))};return f.jsx("div",{className:at(["react-flow__nodesselection","react-flow__container",r]),style:{transform:c},children:f.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:o?void 0:-1,onKeyDown:o?void 0:y,style:{width:a,height:u}})})}const ip=typeof window<"u"?window:void 0,KS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Ym({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:g,selectionOnDrag:x,selectionMode:y,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:N,zoomActivationKeyCode:E,elementsSelectable:k,zoomOnScroll:I,zoomOnPinch:C,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:q,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,preventScrolling:ne,onSelectionContextMenu:P,noWheelClassName:K,noPanClassName:V,disableKeyboardA11y:G,onViewportChange:z,isControlledViewport:R}){const{nodesSelectionActive:B,userSelectionActive:M}=Fe(KS,Je),$=ps(g,{target:ip}),ie=ps(N,{target:ip}),oe=ie||q,de=ie||j,fe=x&&oe!==!0,me=$||M||fe;return PS({deleteKeyCode:m,multiSelectionKeyCode:S}),f.jsx(TS,{onPaneContextMenu:u,elementsSelectable:k,zoomOnScroll:I,zoomOnPinch:C,panOnScroll:de,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&oe,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,zoomActivationKeyCode:E,preventScrolling:ne,noWheelClassName:K,noPanClassName:V,onViewportChange:z,isControlledViewport:R,paneClickDistance:h,selectionOnDrag:fe,children:f.jsxs(LS,{onSelectionStart:v,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:oe,isSelecting:!!me,selectionMode:y,selectionKeyPressed:$,paneClickDistance:h,selectionOnDrag:fe,children:[t,B&&f.jsx(GS,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:G})]})})}Ym.displayName="FlowRenderer";const QS=b.memo(Ym),qS=t=>r=>t?jc(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function ZS(t){return Fe(b.useCallback(qS(t),[t]),Je)}const JS=t=>t.updateNodeInternals;function ek(){const t=Fe(JS),[r]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(a=>{const u=a.target.getAttribute("data-id");s.set(u,{id:u,nodeElement:a.target,force:!0})}),t(s)}));return b.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function tk({node:t,nodeType:r,hasDimensions:o,resizeObserver:s}){const a=et(),u=b.useRef(null),c=b.useRef(null),h=b.useRef(t.sourcePosition),m=b.useRef(t.targetPosition),g=b.useRef(r),x=o&&!!t.internals.handleBounds;return b.useEffect(()=>{u.current&&!t.hidden&&(!x||c.current!==u.current)&&(c.current&&(s==null||s.unobserve(c.current)),s==null||s.observe(u.current),c.current=u.current)},[x,t.hidden]),b.useEffect(()=>()=>{c.current&&(s==null||s.unobserve(c.current),c.current=null)},[]),b.useEffect(()=>{if(u.current){const y=g.current!==r,v=h.current!==t.sourcePosition,_=m.current!==t.targetPosition;(y||v||_)&&(g.current=r,h.current=t.sourcePosition,m.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),u}function nk({id:t,onClick:r,onMouseEnter:o,onMouseMove:s,onMouseLeave:a,onContextMenu:u,onDoubleClick:c,nodesDraggable:h,elementsSelectable:m,nodesConnectable:g,nodesFocusable:x,resizeObserver:y,noDragClassName:v,noPanClassName:_,disableKeyboardA11y:S,rfId:N,nodeTypes:E,nodeClickDistance:k,onError:I}){const{node:C,internals:j,isParent:O}=Fe(te=>{const pe=te.nodeLookup.get(t),Ne=te.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:Ne}},Je);let A=C.type||"default",H=(E==null?void 0:E[A])||op[A];H===void 0&&(I==null||I("003",Xn.error003(A)),A="default",H=(E==null?void 0:E.default)||op.default);const q=!!(C.draggable||h&&typeof C.draggable>"u"),J=!!(C.selectable||m&&typeof C.selectable>"u"),ee=!!(C.connectable||g&&typeof C.connectable>"u"),U=!!(C.focusable||x&&typeof C.focusable>"u"),X=et(),ne=dm(C),P=tk({node:C,nodeType:A,hasDimensions:ne,resizeObserver:y}),K=Bm({nodeRef:P,disabled:C.hidden||!q,noDragClassName:v,handleSelector:C.dragHandle,nodeId:t,isSelectable:J,nodeClickDistance:k}),V=Wm();if(C.hidden)return null;const G=gr(C),z=YS(C),R=J||q||r||o||s||a,B=o?te=>o(te,{...j.userNode}):void 0,M=s?te=>s(te,{...j.userNode}):void 0,$=a?te=>a(te,{...j.userNode}):void 0,ie=u?te=>u(te,{...j.userNode}):void 0,oe=c?te=>c(te,{...j.userNode}):void 0,de=te=>{const{selectNodesOnDrag:pe,nodeDragThreshold:Ne}=X.getState();J&&(!pe||!q||Ne>0)&&gc({id:t,store:X,nodeRef:P}),r&&r(te,{...j.userNode})},fe=te=>{if(!(pm(te.nativeEvent)||S)){if(nm.includes(te.key)&&J){const pe=te.key==="Escape";gc({id:t,store:X,unselect:pe,nodeRef:P})}else if(q&&C.selected&&Object.prototype.hasOwnProperty.call(Ql,te.key)){te.preventDefault();const{ariaLabelConfig:pe}=X.getState();X.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),V({direction:Ql[te.key],factor:te.shiftKey?4:1})}}},me=()=>{var ze;if(S||!((ze=P.current)!=null&&ze.matches(":focus-visible")))return;const{transform:te,width:pe,height:Ne,autoPanOnNodeFocus:be,setCenter:Ce}=X.getState();if(!be)return;jc(new Map([[t,C]]),{x:0,y:0,width:pe,height:Ne},te,!0).length>0||Ce(C.position.x+G.width/2,C.position.y+G.height/2,{zoom:te[2]})};return f.jsx("div",{className:at(["react-flow__node",`react-flow__node-${A}`,{[_]:q},C.className,{selected:C.selected,selectable:J,parent:O,draggable:q,dragging:K}]),ref:P,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:ne?"visible":"hidden",...C.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:B,onMouseMove:M,onMouseLeave:$,onContextMenu:ie,onClick:de,onDoubleClick:oe,onKeyDown:U?fe:void 0,tabIndex:U?0:void 0,onFocus:U?me:void 0,role:C.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${Am}-${N}`,"aria-label":C.ariaLabel,...C.domAttributes,children:f.jsx($S,{value:t,children:f.jsx(H,{id:t,data:C.data,type:A,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:C.selected??!1,selectable:J,draggable:q,deletable:C.deletable??!0,isConnectable:ee,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:K,dragHandle:C.dragHandle,zIndex:j.z,parentId:C.parentId,...G})})})}var rk=b.memo(nk);const ok=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Xm(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:s,elementsSelectable:a,onError:u}=Fe(ok,Je),c=ZS(t.onlyRenderVisibleElements),h=ek();return f.jsx("div",{className:"react-flow__nodes",style:ua,children:c.map(m=>f.jsx(rk,{id:m,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:o,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:u},m))})}Xm.displayName="NodeRenderer";const ik=b.memo(Xm);function sk(t){return Fe(b.useCallback(o=>{if(!t)return o.edges.map(a=>a.id);const s=[];if(o.width&&o.height)for(const a of o.edges){const u=o.nodeLookup.get(a.source),c=o.nodeLookup.get(a.target);u&&c&&r1({sourceNode:u,targetNode:c,width:o.width,height:o.height,transform:o.transform})&&s.push(a.id)}return s},[t]),Je)}const lk=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t}};return f.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ak=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t,fill:t}};return f.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},sp={[ds.Arrow]:lk,[ds.ArrowClosed]:ak};function uk(t){const r=et();return b.useMemo(()=>{var a,u;return Object.prototype.hasOwnProperty.call(sp,t)?sp[t]:((u=(a=r.getState()).onError)==null||u.call(a,"009",Xn.error009(t)),null)},[t])}const ck=({id:t,type:r,color:o,width:s=12.5,height:a=12.5,markerUnits:u="strokeWidth",strokeWidth:c,orient:h="auto-start-reverse"})=>{const m=uk(r);return m?f.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:h,refX:"0",refY:"0",children:f.jsx(m,{color:o,strokeWidth:c})}):null},Gm=({defaultColor:t,rfId:r})=>{const o=Fe(u=>u.edges),s=Fe(u=>u.defaultEdgeOptions),a=b.useMemo(()=>c1(o,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[o,s,r,t]);return a.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:a.map(u=>f.jsx(ck,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};Gm.displayName="MarkerDefinitions";var dk=b.memo(Gm);function Km({x:t,y:r,label:o,labelStyle:s,labelShowBg:a=!0,labelBgStyle:u,labelBgPadding:c=[2,4],labelBgBorderRadius:h=2,children:m,className:g,...x}){const[y,v]=b.useState({x:1,y:0,width:0,height:0}),_=at(["react-flow__edge-textwrapper",g]),S=b.useRef(null);return b.useEffect(()=>{if(S.current){const N=S.current.getBBox();v({x:N.x,y:N.y,width:N.width,height:N.height})}},[o]),o?f.jsxs("g",{transform:`translate(${t-y.width/2} ${r-y.height/2})`,className:_,visibility:y.width?"visible":"hidden",...x,children:[a&&f.jsx("rect",{width:y.width+2*c[0],x:-c[0],y:-c[1],height:y.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:h,ry:h}),f.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:S,style:s,children:o}),m]}):null}Km.displayName="EdgeText";const fk=b.memo(Km);function ca({path:t,labelX:r,labelY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:g=20,...x}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...x,d:t,fill:"none",className:at(["react-flow__edge-path",x.className])}),g?f.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,s&&bn(r)&&bn(o)?f.jsx(fk,{x:r,y:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function lp({pos:t,x1:r,y1:o,x2:s,y2:a}){return t===Ee.Left||t===Ee.Right?[.5*(r+s),o]:[r,.5*(o+a)]}function Qm({sourceX:t,sourceY:r,sourcePosition:o=Ee.Bottom,targetX:s,targetY:a,targetPosition:u=Ee.Top}){const[c,h]=lp({pos:o,x1:t,y1:r,x2:s,y2:a}),[m,g]=lp({pos:u,x1:s,y1:a,x2:t,y2:r}),[x,y,v,_]=gm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:c,sourceControlY:h,targetControlX:m,targetControlY:g});return[`M${t},${r} C${c},${h} ${m},${g} ${s},${a}`,x,y,v,_]}function qm(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,sourcePosition:c,targetPosition:h,label:m,labelStyle:g,labelShowBg:x,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:_,style:S,markerEnd:N,markerStart:E,interactionWidth:k})=>{const[I,C,j]=Qm({sourceX:o,sourceY:s,sourcePosition:c,targetX:a,targetY:u,targetPosition:h}),O=t.isInternal?void 0:r;return f.jsx(ca,{id:O,path:I,labelX:C,labelY:j,label:m,labelStyle:g,labelShowBg:x,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:_,style:S,markerEnd:N,markerStart:E,interactionWidth:k})})}const hk=qm({isInternal:!1}),Zm=qm({isInternal:!0});hk.displayName="SimpleBezierEdge";Zm.displayName="SimpleBezierEdgeInternal";function Jm(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:y,style:v,sourcePosition:_=Ee.Bottom,targetPosition:S=Ee.Top,markerEnd:N,markerStart:E,pathOptions:k,interactionWidth:I})=>{const[C,j,O]=fc({sourceX:o,sourceY:s,sourcePosition:_,targetX:a,targetY:u,targetPosition:S,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),A=t.isInternal?void 0:r;return f.jsx(ca,{id:A,path:C,labelX:j,labelY:O,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:y,style:v,markerEnd:N,markerStart:E,interactionWidth:I})})}const eg=Jm({isInternal:!1}),tg=Jm({isInternal:!0});eg.displayName="SmoothStepEdge";tg.displayName="SmoothStepEdgeInternal";function ng(t){return b.memo(({id:r,...o})=>{var a;const s=t.isInternal?void 0:r;return f.jsx(eg,{...o,id:s,pathOptions:b.useMemo(()=>{var u;return{borderRadius:0,offset:(u=o.pathOptions)==null?void 0:u.offset}},[(a=o.pathOptions)==null?void 0:a.offset])})})}const pk=ng({isInternal:!1}),rg=ng({isInternal:!0});pk.displayName="StepEdge";rg.displayName="StepEdgeInternal";function og(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:y,style:v,markerEnd:_,markerStart:S,interactionWidth:N})=>{const[E,k,I]=Sm({sourceX:o,sourceY:s,targetX:a,targetY:u}),C=t.isInternal?void 0:r;return f.jsx(ca,{id:C,path:E,labelX:k,labelY:I,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:y,style:v,markerEnd:_,markerStart:S,interactionWidth:N})})}const mk=og({isInternal:!1}),ig=og({isInternal:!0});mk.displayName="StraightEdge";ig.displayName="StraightEdgeInternal";function sg(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,sourcePosition:c=Ee.Bottom,targetPosition:h=Ee.Top,label:m,labelStyle:g,labelShowBg:x,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:_,style:S,markerEnd:N,markerStart:E,pathOptions:k,interactionWidth:I})=>{const[C,j,O]=ym({sourceX:o,sourceY:s,sourcePosition:c,targetX:a,targetY:u,targetPosition:h,curvature:k==null?void 0:k.curvature}),A=t.isInternal?void 0:r;return f.jsx(ca,{id:A,path:C,labelX:j,labelY:O,label:m,labelStyle:g,labelShowBg:x,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:_,style:S,markerEnd:N,markerStart:E,interactionWidth:I})})}const gk=sg({isInternal:!1}),lg=sg({isInternal:!0});gk.displayName="BezierEdge";lg.displayName="BezierEdgeInternal";const ap={default:lg,straight:ig,step:rg,smoothstep:tg,simplebezier:Zm},up={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yk=(t,r,o)=>o===Ee.Left?t-r:o===Ee.Right?t+r:t,vk=(t,r,o)=>o===Ee.Top?t-r:o===Ee.Bottom?t+r:t,cp="react-flow__edgeupdater";function dp({position:t,centerX:r,centerY:o,radius:s=10,onMouseDown:a,onMouseEnter:u,onMouseOut:c,type:h}){return f.jsx("circle",{onMouseDown:a,onMouseEnter:u,onMouseOut:c,className:at([cp,`${cp}-${h}`]),cx:yk(r,s,t),cy:vk(o,s,t),r:s,stroke:"transparent",fill:"transparent"})}function xk({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:s,sourceY:a,targetX:u,targetY:c,sourcePosition:h,targetPosition:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,setReconnecting:v,setUpdateHover:_}){const S=et(),N=(j,O)=>{if(j.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:q,connectionMode:J,connectionRadius:ee,lib:U,onConnectStart:X,onConnectEnd:ne,cancelConnection:P,nodeLookup:K,rfId:V,panBy:G,updateConnection:z}=S.getState(),R=O.type==="target",B=(ie,oe)=>{v(!1),y==null||y(ie,o,O.type,oe)},M=ie=>g==null?void 0:g(o,ie),$=(ie,oe)=>{v(!0),x==null||x(j,o,O.type),X==null||X(ie,oe)};mc.onPointerDown(j.nativeEvent,{autoPanOnConnect:A,connectionMode:J,connectionRadius:ee,domNode:H,handleId:O.id,nodeId:O.nodeId,nodeLookup:K,isTarget:R,edgeUpdaterType:O.type,lib:U,flowId:V,cancelConnection:P,panBy:G,isValidConnection:q,onConnect:M,onConnectStart:$,onConnectEnd:ne,onReconnectEnd:B,updateConnection:z,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},E=j=>N(j,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),k=j=>N(j,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),I=()=>_(!0),C=()=>_(!1);return f.jsxs(f.Fragment,{children:[(t===!0||t==="source")&&f.jsx(dp,{position:h,centerX:s,centerY:a,radius:r,onMouseDown:E,onMouseEnter:I,onMouseOut:C,type:"source"}),(t===!0||t==="target")&&f.jsx(dp,{position:m,centerX:u,centerY:c,radius:r,onMouseDown:k,onMouseEnter:I,onMouseOut:C,type:"target"})]})}function wk({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:s,onClick:a,onDoubleClick:u,onContextMenu:c,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,reconnectRadius:x,onReconnect:y,onReconnectStart:v,onReconnectEnd:_,rfId:S,edgeTypes:N,noPanClassName:E,onError:k,disableKeyboardA11y:I}){let C=Fe(Ce=>Ce.edgeLookup.get(t));const j=Fe(Ce=>Ce.defaultEdgeOptions);C=j?{...j,...C}:C;let O=C.type||"default",A=(N==null?void 0:N[O])||ap[O];A===void 0&&(k==null||k("011",Xn.error011(O)),O="default",A=(N==null?void 0:N.default)||ap.default);const H=!!(C.focusable||r&&typeof C.focusable>"u"),q=typeof y<"u"&&(C.reconnectable||o&&typeof C.reconnectable>"u"),J=!!(C.selectable||s&&typeof C.selectable>"u"),ee=b.useRef(null),[U,X]=b.useState(!1),[ne,P]=b.useState(!1),K=et(),{zIndex:V,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$}=Fe(b.useCallback(Ce=>{const ke=Ce.nodeLookup.get(C.source),ze=Ce.nodeLookup.get(C.target);if(!ke||!ze)return{zIndex:C.zIndex,...up};const De=u1({id:t,sourceNode:ke,targetNode:ze,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:Ce.connectionMode,onError:k});return{zIndex:n1({selected:C.selected,zIndex:C.zIndex,sourceNode:ke,targetNode:ze,elevateOnSelect:Ce.elevateEdgesOnSelect,zIndexMode:Ce.zIndexMode}),...De||up}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),Je),ie=b.useMemo(()=>C.markerStart?`url('#${hc(C.markerStart,S)}')`:void 0,[C.markerStart,S]),oe=b.useMemo(()=>C.markerEnd?`url('#${hc(C.markerEnd,S)}')`:void 0,[C.markerEnd,S]);if(C.hidden||G===null||z===null||R===null||B===null)return null;const de=Ce=>{var Te;const{addSelectedEdges:ke,unselectNodesAndEdges:ze,multiSelectionActive:De}=K.getState();J&&(K.setState({nodesSelectionActive:!1}),C.selected&&De?(ze({nodes:[],edges:[C]}),(Te=ee.current)==null||Te.blur()):ke([t])),a&&a(Ce,C)},fe=u?Ce=>{u(Ce,{...C})}:void 0,me=c?Ce=>{c(Ce,{...C})}:void 0,te=h?Ce=>{h(Ce,{...C})}:void 0,pe=m?Ce=>{m(Ce,{...C})}:void 0,Ne=g?Ce=>{g(Ce,{...C})}:void 0,be=Ce=>{var ke;if(!I&&nm.includes(Ce.key)&&J){const{unselectNodesAndEdges:ze,addSelectedEdges:De}=K.getState();Ce.key==="Escape"?((ke=ee.current)==null||ke.blur(),ze({edges:[C]})):De([t])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:at(["react-flow__edge",`react-flow__edge-${O}`,C.className,E,{selected:C.selected,animated:C.animated,inactive:!J&&!a,updating:U,selectable:J}]),onClick:de,onDoubleClick:fe,onContextMenu:me,onMouseEnter:te,onMouseMove:pe,onMouseLeave:Ne,onKeyDown:H?be:void 0,tabIndex:H?0:void 0,role:C.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":H?`${Lm}-${S}`:void 0,ref:ee,...C.domAttributes,children:[!ne&&f.jsx(A,{id:t,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:J,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:ie,markerEnd:oe,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),q&&f.jsx(xk,{edge:C,isReconnectable:q,reconnectRadius:x,onReconnect:y,onReconnectStart:v,onReconnectEnd:_,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$,setUpdateHover:X,setReconnecting:P})]})})}var Sk=b.memo(wk);const kk=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function ag({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:s,noPanClassName:a,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:g,onEdgeClick:x,reconnectRadius:y,onEdgeDoubleClick:v,onReconnectStart:_,onReconnectEnd:S,disableKeyboardA11y:N}){const{edgesFocusable:E,edgesReconnectable:k,elementsSelectable:I,onError:C}=Fe(kk,Je),j=sk(r);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dk,{defaultColor:t,rfId:o}),j.map(O=>f.jsx(Sk,{id:O,edgesFocusable:E,edgesReconnectable:k,elementsSelectable:I,noPanClassName:a,onReconnect:u,onContextMenu:c,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:x,reconnectRadius:y,onDoubleClick:v,onReconnectStart:_,onReconnectEnd:S,rfId:o,onError:C,edgeTypes:s,disableKeyboardA11y:N},O))]})}ag.displayName="EdgeRenderer";const Ek=b.memo(ag),Nk=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function Ck({children:t}){const r=Fe(Nk);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function _k(t){const r=Ac(),o=b.useRef(!1);b.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const jk=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function bk(t){const r=Fe(jk),o=et();return b.useEffect(()=>{t&&(r==null||r(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function Pk(t){return t.connection.inProgress?{...t.connection,to:Ss(t.connection.to,t.transform)}:{...t.connection}}function Mk(t){return Pk}function Ik(t){const r=Mk();return Fe(r,Je)}const Tk=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function zk({containerStyle:t,style:r,type:o,component:s}){const{nodesConnectable:a,width:u,height:c,isValid:h,inProgress:m}=Fe(Tk,Je);return!(u&&a&&m)?null:f.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:at(["react-flow__connection",im(h)]),children:f.jsx(ug,{style:r,type:o,CustomComponent:s,isValid:h})})})}const ug=({style:t,type:r=Br.Bezier,CustomComponent:o,isValid:s})=>{const{inProgress:a,from:u,fromNode:c,fromHandle:h,fromPosition:m,to:g,toNode:x,toHandle:y,toPosition:v,pointer:_}=Ik();if(!a)return;if(o)return f.jsx(o,{connectionLineType:r,connectionLineStyle:t,fromNode:c,fromHandle:h,fromX:u.x,fromY:u.y,toX:g.x,toY:g.y,fromPosition:m,toPosition:v,connectionStatus:im(s),toNode:x,toHandle:y,pointer:_});let S="";const N={sourceX:u.x,sourceY:u.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:v};switch(r){case Br.Bezier:[S]=ym(N);break;case Br.SimpleBezier:[S]=Qm(N);break;case Br.Step:[S]=fc({...N,borderRadius:0});break;case Br.SmoothStep:[S]=fc(N);break;default:[S]=Sm(N)}return f.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:t})};ug.displayName="ConnectionLine";const Rk={};function fp(t=Rk){b.useRef(t),et(),b.useEffect(()=>{},[t])}function Ak(){et(),b.useRef(!1),b.useEffect(()=>{},[])}function cg({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:_,connectionLineType:S,connectionLineStyle:N,connectionLineComponent:E,connectionLineContainerStyle:k,selectionKeyCode:I,selectionOnDrag:C,selectionMode:j,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:q,onlyRenderVisibleElements:J,elementsSelectable:ee,defaultViewport:U,translateExtent:X,minZoom:ne,maxZoom:P,preventScrolling:K,defaultMarkerColor:V,zoomOnScroll:G,zoomOnPinch:z,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:M,zoomOnDoubleClick:$,panOnDrag:ie,onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:me,onPaneScroll:te,onPaneContextMenu:pe,paneClickDistance:Ne,nodeClickDistance:be,onEdgeContextMenu:Ce,onEdgeMouseEnter:ke,onEdgeMouseMove:ze,onEdgeMouseLeave:De,reconnectRadius:Te,onReconnect:Xe,onReconnectStart:Ct,onReconnectEnd:ut,noDragClassName:_t,noWheelClassName:It,noPanClassName:st,disableKeyboardA11y:dn,nodeExtent:Kn,rfId:Qn,viewport:qt,onViewportChange:Zt}){return fp(t),fp(r),Ak(),_k(o),bk(qt),f.jsx(QS,{onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:me,onPaneContextMenu:pe,onPaneScroll:te,paneClickDistance:Ne,deleteKeyCode:q,selectionKeyCode:I,selectionOnDrag:C,selectionMode:j,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:ee,zoomOnScroll:G,zoomOnPinch:z,zoomOnDoubleClick:$,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:M,panOnDrag:ie,defaultViewport:U,translateExtent:X,minZoom:ne,maxZoom:P,onSelectionContextMenu:y,preventScrolling:K,noDragClassName:_t,noWheelClassName:It,noPanClassName:st,disableKeyboardA11y:dn,onViewportChange:Zt,isControlledViewport:!!qt,children:f.jsxs(Ck,{children:[f.jsx(Ek,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Xe,onReconnectStart:Ct,onReconnectEnd:ut,onlyRenderVisibleElements:J,onEdgeContextMenu:Ce,onEdgeMouseEnter:ke,onEdgeMouseMove:ze,onEdgeMouseLeave:De,reconnectRadius:Te,defaultMarkerColor:V,noPanClassName:st,disableKeyboardA11y:dn,rfId:Qn}),f.jsx(zk,{style:N,type:S,component:E,containerStyle:k}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(ik,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,nodeClickDistance:be,onlyRenderVisibleElements:J,noPanClassName:st,noDragClassName:_t,disableKeyboardA11y:dn,nodeExtent:Kn,rfId:Qn}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}cg.displayName="GraphView";const Lk=b.memo(cg),hp=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m=.5,maxZoom:g=2,nodeOrigin:x,nodeExtent:y,zIndexMode:v="basic"}={})=>{const _=new Map,S=new Map,N=new Map,E=new Map,k=s??r??[],I=o??t??[],C=x??[0,0],j=y??us;Nm(N,E,k);const O=pc(I,_,S,{nodeOrigin:C,nodeExtent:j,zIndexMode:v});let A=[0,0,1];if(c&&a&&u){const H=xs(_,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:q,y:J,zoom:ee}=bc(H,a,u,m,g,(h==null?void 0:h.padding)??.1);A=[q,J,ee]}return{rfId:"1",width:a??0,height:u??0,transform:A,nodes:I,nodesInitialized:O,nodeLookup:_,parentLookup:S,edges:k,edgeLookup:E,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:us,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ko.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,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:c??!1,fitViewOptions:h,fitViewResolver:null,connection:{...om},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Qw,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:rm,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Dk=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:x,nodeExtent:y,zIndexMode:v})=>tS((_,S)=>{async function N(){const{nodeLookup:E,panZoom:k,fitViewOptions:I,fitViewResolver:C,width:j,height:O,minZoom:A,maxZoom:H}=S();k&&(await Gw({nodes:E,width:j,height:O,panZoom:k,minZoom:A,maxZoom:H},I),C==null||C.resolve(!0),_({fitViewResolver:null}))}return{...hp({nodes:t,edges:r,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:x,nodeExtent:y,defaultNodes:o,defaultEdges:s,zIndexMode:v}),setNodes:E=>{const{nodeLookup:k,parentLookup:I,nodeOrigin:C,elevateNodesOnSelect:j,fitViewQueued:O,zIndexMode:A}=S(),H=pc(E,k,I,{nodeOrigin:C,nodeExtent:y,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:A});O&&H?(N(),_({nodes:E,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):_({nodes:E,nodesInitialized:H})},setEdges:E=>{const{connectionLookup:k,edgeLookup:I}=S();Nm(k,I,E),_({edges:E})},setDefaultNodesAndEdges:(E,k)=>{if(E){const{setNodes:I}=S();I(E),_({hasDefaultNodes:!0})}if(k){const{setEdges:I}=S();I(k),_({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:k,nodeLookup:I,parentLookup:C,domNode:j,nodeOrigin:O,nodeExtent:A,debug:H,fitViewQueued:q,zIndexMode:J}=S(),{changes:ee,updatedInternals:U}=y1(E,I,C,j,O,A,J);U&&(h1(I,C,{nodeOrigin:O,nodeExtent:A,zIndexMode:J}),q?(N(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(ee==null?void 0:ee.length)>0&&(H&&console.log("React Flow: trigger node changes",ee),k==null||k(ee)))},updateNodePositions:(E,k=!1)=>{const I=[];let C=[];const{nodeLookup:j,triggerNodeChanges:O,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:q}=S();for(const[J,ee]of E){const U=j.get(J),X=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(ee!=null&&ee.position)),ne={id:J,type:"position",position:X?{x:Math.max(0,ee.position.x),y:Math.max(0,ee.position.y)}:ee.position,dragging:k};if(U&&A.inProgress&&A.fromNode.id===U.id){const P=No(U,A.fromHandle,Ee.Left,!0);H({...A,from:P})}X&&U.parentId&&I.push({id:J,parentId:U.parentId,rect:{...ee.internals.positionAbsolute,width:ee.measured.width??0,height:ee.measured.height??0}}),C.push(ne)}if(I.length>0){const{parentLookup:J,nodeOrigin:ee}=S(),U=Rc(I,j,J,ee);C.push(...U)}for(const J of q.values())C=J(C);O(C)},triggerNodeChanges:E=>{const{onNodesChange:k,setNodes:I,nodes:C,hasDefaultNodes:j,debug:O}=S();if(E!=null&&E.length){if(j){const A=Om(E,C);I(A)}O&&console.log("React Flow: trigger node changes",E),k==null||k(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:k,setEdges:I,edges:C,hasDefaultEdges:j,debug:O}=S();if(E!=null&&E.length){if(j){const A=Fm(E,C);I(A)}O&&console.log("React Flow: trigger edge changes",E),k==null||k(E)}},addSelectedNodes:E=>{const{multiSelectionActive:k,edgeLookup:I,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:O}=S();if(k){const A=E.map(H=>go(H,!0));j(A);return}j(ui(C,new Set([...E]),!0)),O(ui(I))},addSelectedEdges:E=>{const{multiSelectionActive:k,edgeLookup:I,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:O}=S();if(k){const A=E.map(H=>go(H,!0));O(A);return}O(ui(I,new Set([...E]))),j(ui(C,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:k}={})=>{const{edges:I,nodes:C,nodeLookup:j,triggerNodeChanges:O,triggerEdgeChanges:A}=S(),H=E||C,q=k||I,J=H.map(U=>{const X=j.get(U.id);return X&&(X.selected=!1),go(U.id,!1)}),ee=q.map(U=>go(U.id,!1));O(J),A(ee)},setMinZoom:E=>{const{panZoom:k,maxZoom:I}=S();k==null||k.setScaleExtent([E,I]),_({minZoom:E})},setMaxZoom:E=>{const{panZoom:k,minZoom:I}=S();k==null||k.setScaleExtent([I,E]),_({maxZoom:E})},setTranslateExtent:E=>{var k;(k=S().panZoom)==null||k.setTranslateExtent(E),_({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:k,triggerNodeChanges:I,triggerEdgeChanges:C,elementsSelectable:j}=S();if(!j)return;const O=k.reduce((H,q)=>q.selected?[...H,go(q.id,!1)]:H,[]),A=E.reduce((H,q)=>q.selected?[...H,go(q.id,!1)]:H,[]);I(O),C(A)},setNodeExtent:E=>{const{nodes:k,nodeLookup:I,parentLookup:C,nodeOrigin:j,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:H}=S();E[0][0]===A[0][0]&&E[0][1]===A[0][1]&&E[1][0]===A[1][0]&&E[1][1]===A[1][1]||(pc(k,I,C,{nodeOrigin:j,nodeExtent:E,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:H}),_({nodeExtent:E}))},panBy:E=>{const{transform:k,width:I,height:C,panZoom:j,translateExtent:O}=S();return v1({delta:E,panZoom:j,transform:k,translateExtent:O,width:I,height:C})},setCenter:async(E,k,I)=>{const{width:C,height:j,maxZoom:O,panZoom:A}=S();if(!A)return Promise.resolve(!1);const H=typeof(I==null?void 0:I.zoom)<"u"?I.zoom:O;return await A.setViewport({x:C/2-E*H,y:j/2-k*H,zoom:H},{duration:I==null?void 0:I.duration,ease:I==null?void 0:I.ease,interpolate:I==null?void 0:I.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{_({connection:{...om}})},updateConnection:E=>{_({connection:E})},reset:()=>_({...hp()})}},Object.is);function dg({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:s,initialWidth:a,initialHeight:u,initialMinZoom:c,initialMaxZoom:h,initialFitViewOptions:m,fitView:g,nodeOrigin:x,nodeExtent:y,zIndexMode:v,children:_}){const[S]=b.useState(()=>Dk({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:g,minZoom:c,maxZoom:h,fitViewOptions:m,nodeOrigin:x,nodeExtent:y,zIndexMode:v}));return f.jsx(nS,{value:S,children:f.jsx(CS,{children:_})})}function $k({children:t,nodes:r,edges:o,defaultNodes:s,defaultEdges:a,width:u,height:c,fitView:h,fitViewOptions:m,minZoom:g,maxZoom:x,nodeOrigin:y,nodeExtent:v,zIndexMode:_}){return b.useContext(la)?f.jsx(f.Fragment,{children:t}):f.jsx(dg,{initialNodes:r,initialEdges:o,defaultNodes:s,defaultEdges:a,initialWidth:u,initialHeight:c,fitView:h,initialFitViewOptions:m,initialMinZoom:g,initialMaxZoom:x,nodeOrigin:y,nodeExtent:v,zIndexMode:_,children:t})}const Ok={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Fk({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,className:a,nodeTypes:u,edgeTypes:c,onNodeClick:h,onEdgeClick:m,onInit:g,onMove:x,onMoveStart:y,onMoveEnd:v,onConnect:_,onConnectStart:S,onConnectEnd:N,onClickConnectStart:E,onClickConnectEnd:k,onNodeMouseEnter:I,onNodeMouseMove:C,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onSelectionChange:ne,onSelectionDragStart:P,onSelectionDrag:K,onSelectionDragStop:V,onSelectionContextMenu:G,onSelectionStart:z,onSelectionEnd:R,onBeforeDelete:B,connectionMode:M,connectionLineType:$=Br.Bezier,connectionLineStyle:ie,connectionLineComponent:oe,connectionLineContainerStyle:de,deleteKeyCode:fe="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:te=!1,selectionMode:pe=cs.Full,panActivationKeyCode:Ne="Space",multiSelectionKeyCode:be=hs()?"Meta":"Control",zoomActivationKeyCode:Ce=hs()?"Meta":"Control",snapToGrid:ke,snapGrid:ze,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Te,nodesDraggable:Xe,autoPanOnNodeFocus:Ct,nodesConnectable:ut,nodesFocusable:_t,nodeOrigin:It=Dm,edgesFocusable:st,edgesReconnectable:dn,elementsSelectable:Kn=!0,defaultViewport:Qn=mS,minZoom:qt=.5,maxZoom:Zt=2,translateExtent:In=us,preventScrolling:Jt=!0,nodeExtent:fn,defaultMarkerColor:Tt="#b1b1b7",zoomOnScroll:en=!0,zoomOnPinch:yr=!0,panOnScroll:Xr=!1,panOnScrollSpeed:Tn=.5,panOnScrollMode:qn=xo.Free,zoomOnDoubleClick:Gr=!0,panOnDrag:Kr=!0,onPaneClick:Zn,onPaneMouseEnter:Jn,onPaneMouseMove:xt,onPaneMouseLeave:zn,onPaneScroll:jt,onPaneContextMenu:Qr,paneClickDistance:ct=1,nodeClickDistance:_o=0,children:qr,onReconnect:tn,onReconnectStart:Rn,onReconnectEnd:An,onEdgeContextMenu:hn,onEdgeDoubleClick:pn,onEdgeMouseEnter:yi,onEdgeMouseMove:nn,onEdgeMouseLeave:qe,reconnectRadius:vr=10,onNodesChange:mn,onEdgesChange:jo,noDragClassName:bo="nodrag",noWheelClassName:rn="nowheel",noPanClassName:wt="nopan",fitView:Zr,fitViewOptions:Jr,connectOnClick:vi,attributionPosition:Po,proOptions:Mo,defaultEdgeOptions:Io,elevateNodesOnSelect:eo=!0,elevateEdgesOnSelect:to=!1,disableKeyboardA11y:xr=!1,autoPanOnConnect:Ge,autoPanOnNodeDrag:wr,autoPanSpeed:no,connectionRadius:To,isValidConnection:gn,onError:Ue,style:zo,id:er,nodeDragThreshold:zt,connectionDragThreshold:xi,viewport:bt,onViewportChange:wi,width:Si,height:ki,colorMode:Ln="light",debug:Sr,onScroll:Vt,ariaLabelConfig:tr,zIndexMode:Ro="basic",...Ao},kr){const nr=er||"1",yn=xS(Ln),vn=b.useCallback(Lo=>{Lo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vt==null||Vt(Lo)},[Vt]);return f.jsx("div",{"data-testid":"rf__wrapper",...Ao,onScroll:vn,style:{...zo,...Ok},ref:kr,className:at(["react-flow",a,yn]),id:er,role:"application",children:f.jsxs($k,{nodes:t,edges:r,width:Si,height:ki,fitView:Zr,fitViewOptions:Jr,minZoom:qt,maxZoom:Zt,nodeOrigin:It,nodeExtent:fn,zIndexMode:Ro,children:[f.jsx(Lk,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:I,onNodeMouseMove:C,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:u,edgeTypes:c,connectionLineType:$,connectionLineStyle:ie,connectionLineComponent:oe,connectionLineContainerStyle:de,selectionKeyCode:me,selectionOnDrag:te,selectionMode:pe,deleteKeyCode:fe,multiSelectionKeyCode:be,panActivationKeyCode:Ne,zoomActivationKeyCode:Ce,onlyRenderVisibleElements:De,defaultViewport:Qn,translateExtent:In,minZoom:qt,maxZoom:Zt,preventScrolling:Jt,zoomOnScroll:en,zoomOnPinch:yr,zoomOnDoubleClick:Gr,panOnScroll:Xr,panOnScrollSpeed:Tn,panOnScrollMode:qn,panOnDrag:Kr,onPaneClick:Zn,onPaneMouseEnter:Jn,onPaneMouseMove:xt,onPaneMouseLeave:zn,onPaneScroll:jt,onPaneContextMenu:Qr,paneClickDistance:ct,nodeClickDistance:_o,onSelectionContextMenu:G,onSelectionStart:z,onSelectionEnd:R,onReconnect:tn,onReconnectStart:Rn,onReconnectEnd:An,onEdgeContextMenu:hn,onEdgeDoubleClick:pn,onEdgeMouseEnter:yi,onEdgeMouseMove:nn,onEdgeMouseLeave:qe,reconnectRadius:vr,defaultMarkerColor:Tt,noDragClassName:bo,noWheelClassName:rn,noPanClassName:wt,rfId:nr,disableKeyboardA11y:xr,nodeExtent:fn,viewport:bt,onViewportChange:wi}),f.jsx(vS,{nodes:t,edges:r,defaultNodes:o,defaultEdges:s,onConnect:_,onConnectStart:S,onConnectEnd:N,onClickConnectStart:E,onClickConnectEnd:k,nodesDraggable:Xe,autoPanOnNodeFocus:Ct,nodesConnectable:ut,nodesFocusable:_t,edgesFocusable:st,edgesReconnectable:dn,elementsSelectable:Kn,elevateNodesOnSelect:eo,elevateEdgesOnSelect:to,minZoom:qt,maxZoom:Zt,nodeExtent:fn,onNodesChange:mn,onEdgesChange:jo,snapToGrid:ke,snapGrid:ze,connectionMode:M,translateExtent:In,connectOnClick:vi,defaultEdgeOptions:Io,fitView:Zr,fitViewOptions:Jr,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onSelectionDrag:K,onSelectionDragStart:P,onSelectionDragStop:V,onMove:x,onMoveStart:y,onMoveEnd:v,noPanClassName:wt,nodeOrigin:It,rfId:nr,autoPanOnConnect:Ge,autoPanOnNodeDrag:wr,autoPanSpeed:no,onError:Ue,connectionRadius:To,isValidConnection:gn,selectNodesOnDrag:Te,nodeDragThreshold:zt,connectionDragThreshold:xi,onBeforeDelete:B,debug:Sr,ariaLabelConfig:tr,zIndexMode:Ro}),f.jsx(pS,{onSelectionChange:ne}),qr,f.jsx(uS,{proOptions:Mo,position:Po}),f.jsx(aS,{rfId:nr,disableKeyboardA11y:xr})]})})}var fg=Hm(Fk);function Hk(t){const[r,o]=b.useState(t),s=b.useCallback(a=>o(u=>Om(a,u)),[]);return[r,o,s]}function Vk(t){const[r,o]=b.useState(t),s=b.useCallback(a=>o(u=>Fm(a,u)),[]);return[r,o,s]}function Bk({dimensions:t,lineWidth:r,variant:o,className:s}){return f.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:at(["react-flow__background-pattern",o,s])})}function Wk({radius:t,className:r}){return f.jsx("circle",{cx:t,cy:t,r:t,className:at(["react-flow__background-pattern","dots",r])})}var Yn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Yn||(Yn={}));const Uk={[Yn.Dots]:1,[Yn.Lines]:1,[Yn.Cross]:6},Yk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function hg({id:t,variant:r=Yn.Dots,gap:o=20,size:s,lineWidth:a=1,offset:u=0,color:c,bgColor:h,style:m,className:g,patternClassName:x}){const y=b.useRef(null),{transform:v,patternId:_}=Fe(Yk,Je),S=s||Uk[r],N=r===Yn.Dots,E=r===Yn.Cross,k=Array.isArray(o)?o:[o,o],I=[k[0]*v[2]||1,k[1]*v[2]||1],C=S*v[2],j=Array.isArray(u)?u:[u,u],O=E?[C,C]:I,A=[j[0]*v[2]||1+O[0]/2,j[1]*v[2]||1+O[1]/2],H=`${_}${t||""}`;return f.jsxs("svg",{className:at(["react-flow__background",g]),style:{...m,...ua,"--xy-background-color-props":h,"--xy-background-pattern-color-props":c},ref:y,"data-testid":"rf__background",children:[f.jsx("pattern",{id:H,x:v[0]%I[0],y:v[1]%I[1],width:I[0],height:I[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:N?f.jsx(Wk,{radius:C/2,className:x}):f.jsx(Bk,{dimensions:O,lineWidth:a,variant:r,className:x})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}hg.displayName="Background";const pg=b.memo(hg);function Xk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Kk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 Qk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 qk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 Rl({children:t,className:r,...o}){return f.jsx("button",{type:"button",className:at(["react-flow__controls-button",r]),...o,children:t})}const Zk=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function mg({style:t,showZoom:r=!0,showFitView:o=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:u,onZoomOut:c,onFitView:h,onInteractiveChange:m,className:g,children:x,position:y="bottom-left",orientation:v="vertical","aria-label":_}){const S=et(),{isInteractive:N,minZoomReached:E,maxZoomReached:k,ariaLabelConfig:I}=Fe(Zk,Je),{zoomIn:C,zoomOut:j,fitView:O}=Ac(),A=()=>{C(),u==null||u()},H=()=>{j(),c==null||c()},q=()=>{O(a),h==null||h()},J=()=>{S.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),m==null||m(!N)},ee=v==="horizontal"?"horizontal":"vertical";return f.jsxs(aa,{className:at(["react-flow__controls",ee,g]),position:y,style:t,"data-testid":"rf__controls","aria-label":_??I["controls.ariaLabel"],children:[r&&f.jsxs(f.Fragment,{children:[f.jsx(Rl,{onClick:A,className:"react-flow__controls-zoomin",title:I["controls.zoomIn.ariaLabel"],"aria-label":I["controls.zoomIn.ariaLabel"],disabled:k,children:f.jsx(Xk,{})}),f.jsx(Rl,{onClick:H,className:"react-flow__controls-zoomout",title:I["controls.zoomOut.ariaLabel"],"aria-label":I["controls.zoomOut.ariaLabel"],disabled:E,children:f.jsx(Gk,{})})]}),o&&f.jsx(Rl,{className:"react-flow__controls-fitview",onClick:q,title:I["controls.fitView.ariaLabel"],"aria-label":I["controls.fitView.ariaLabel"],children:f.jsx(Kk,{})}),s&&f.jsx(Rl,{className:"react-flow__controls-interactive",onClick:J,title:I["controls.interactive.ariaLabel"],"aria-label":I["controls.interactive.ariaLabel"],children:N?f.jsx(qk,{}):f.jsx(Qk,{})}),x]})}mg.displayName="Controls";const gg=b.memo(mg);function Jk({id:t,x:r,y:o,width:s,height:a,style:u,color:c,strokeColor:h,strokeWidth:m,className:g,borderRadius:x,shapeRendering:y,selected:v,onClick:_}){const{background:S,backgroundColor:N}=u||{},E=c||S||N;return f.jsx("rect",{className:at(["react-flow__minimap-node",{selected:v},g]),x:r,y:o,rx:x,ry:x,width:s,height:a,style:{fill:E,stroke:h,strokeWidth:m},shapeRendering:y,onClick:_?k=>_(k,t):void 0})}const eE=b.memo(Jk),tE=t=>t.nodes.map(r=>r.id),tc=t=>t instanceof Function?t:()=>t;function nE({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:u=eE,onClick:c}){const h=Fe(tE,Je),m=tc(r),g=tc(t),x=tc(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:h.map(v=>f.jsx(oE,{id:v,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:u,onClick:c,shapeRendering:y},v))})}function rE({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:h,onClick:m}){const{node:g,x,y,width:v,height:_}=Fe(S=>{const{internals:N}=S.nodeLookup.get(t),E=N.userNode,{x:k,y:I}=N.positionAbsolute,{width:C,height:j}=gr(E);return{node:E,x:k,y:I,width:C,height:j}},Je);return!g||g.hidden||!dm(g)?null:f.jsx(h,{x,y,width:v,height:_,style:g.style,selected:!!g.selected,className:s(g),color:r(g),borderRadius:a,strokeColor:o(g),strokeWidth:u,shapeRendering:c,onClick:m,id:g.id})}const oE=b.memo(rE);var iE=b.memo(nE);const sE=200,lE=150,aE=t=>!t.hidden,uE=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?cm(xs(t.nodeLookup,{filter:aE}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},cE="react-flow__minimap-desc";function yg({style:t,className:r,nodeStrokeColor:o,nodeColor:s,nodeClassName:a="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:h,bgColor:m,maskColor:g,maskStrokeColor:x,maskStrokeWidth:y,position:v="bottom-right",onClick:_,onNodeClick:S,pannable:N=!1,zoomable:E=!1,ariaLabel:k,inversePan:I,zoomStep:C=1,offsetScale:j=5}){const O=et(),A=b.useRef(null),{boundingRect:H,viewBB:q,rfId:J,panZoom:ee,translateExtent:U,flowWidth:X,flowHeight:ne,ariaLabelConfig:P}=Fe(uE,Je),K=(t==null?void 0:t.width)??sE,V=(t==null?void 0:t.height)??lE,G=H.width/K,z=H.height/V,R=Math.max(G,z),B=R*K,M=R*V,$=j*R,ie=H.x-(B-H.width)/2-$,oe=H.y-(M-H.height)/2-$,de=B+$*2,fe=M+$*2,me=`${cE}-${J}`,te=b.useRef(0),pe=b.useRef();te.current=R,b.useEffect(()=>{if(A.current&&ee)return pe.current=j1({domNode:A.current,panZoom:ee,getTransform:()=>O.getState().transform,getViewScale:()=>te.current}),()=>{var ke;(ke=pe.current)==null||ke.destroy()}},[ee]),b.useEffect(()=>{var ke;(ke=pe.current)==null||ke.update({translateExtent:U,width:X,height:ne,inversePan:I,pannable:N,zoomStep:C,zoomable:E})},[N,E,I,C,U,X,ne]);const Ne=_?ke=>{var Te;const[ze,De]=((Te=pe.current)==null?void 0:Te.pointer(ke))||[0,0];_(ke,{x:ze,y:De})}:void 0,be=S?b.useCallback((ke,ze)=>{const De=O.getState().nodeLookup.get(ze).internals.userNode;S(ke,De)},[]):void 0,Ce=k??P["minimap.ariaLabel"];return f.jsx(aa,{position:v,style:{...t,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*R:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:at(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:K,height:V,viewBox:`${ie} ${oe} ${de} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:A,onClick:Ne,children:[Ce&&f.jsx("title",{id:me,children:Ce}),f.jsx(iE,{onClick:be,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:u,nodeClassName:a,nodeStrokeWidth:c,nodeComponent:h}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-$},${oe-$}h${de+$*2}v${fe+$*2}h${-de-$*2}z
62
+ M${q.x},${q.y}h${q.width}v${q.height}h${-q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}yg.displayName="MiniMap";b.memo(yg);const dE=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,fE={[Co.Line]:"right",[Co.Handle]:"bottom-right"};function hE({nodeId:t,position:r,variant:o=Co.Handle,className:s,style:a=void 0,children:u,color:c,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:v,autoScale:_=!0,shouldResize:S,onResizeStart:N,onResize:E,onResizeEnd:k}){const I=Um(),C=typeof t=="string"?t:I,j=et(),O=b.useRef(null),A=o===Co.Handle,H=Fe(b.useCallback(dE(A&&_),[A,_]),Je),q=b.useRef(null),J=r??fE[o];b.useEffect(()=>{if(!(!O.current||!C))return q.current||(q.current=B1({domNode:O.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:U,transform:X,snapGrid:ne,snapToGrid:P,nodeOrigin:K,domNode:V}=j.getState();return{nodeLookup:U,transform:X,snapGrid:ne,snapToGrid:P,nodeOrigin:K,paneDomNode:V}},onChange:(U,X)=>{const{triggerNodeChanges:ne,nodeLookup:P,parentLookup:K,nodeOrigin:V}=j.getState(),G=[],z={x:U.x,y:U.y},R=P.get(C);if(R&&R.expandParent&&R.parentId){const B=R.origin??V,M=U.width??R.measured.width??0,$=U.height??R.measured.height??0,ie={id:R.id,parentId:R.parentId,rect:{width:M,height:$,...fm({x:U.x??R.position.x,y:U.y??R.position.y},{width:M,height:$},R.parentId,P,B)}},oe=Rc([ie],P,K,V);G.push(...oe),z.x=U.x?Math.max(B[0]*M,U.x):void 0,z.y=U.y?Math.max(B[1]*$,U.y):void 0}if(z.x!==void 0&&z.y!==void 0){const B={id:C,type:"position",position:{...z}};G.push(B)}if(U.width!==void 0&&U.height!==void 0){const M={id:C,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};G.push(M)}for(const B of X){const M={...B,type:"position"};G.push(M)}ne(G)},onEnd:({width:U,height:X})=>{const ne={id:C,type:"dimensions",resizing:!1,dimensions:{width:U,height:X}};j.getState().triggerNodeChanges([ne])}})),q.current.update({controlPosition:J,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:x},keepAspectRatio:y,resizeDirection:v,onResizeStart:N,onResize:E,onResizeEnd:k,shouldResize:S}),()=>{var U;(U=q.current)==null||U.destroy()}},[J,h,m,g,x,y,N,E,k,S]);const ee=J.split("-");return f.jsx("div",{className:at(["react-flow__resize-control","nodrag",...ee,o,s]),ref:O,style:{...a,scale:H,...c&&{[A?"backgroundColor":"borderColor"]:c}},children:u})}const pp=b.memo(hE);function pE({nodeId:t,isVisible:r=!0,handleClassName:o,handleStyle:s,lineClassName:a,lineStyle:u,color:c,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:y=!1,autoScale:v=!0,shouldResize:_,onResizeStart:S,onResize:N,onResizeEnd:E}){return r?f.jsxs(f.Fragment,{children:[D1.map(k=>f.jsx(pp,{className:a,style:u,nodeId:t,position:k,variant:Co.Line,color:c,minWidth:h,minHeight:m,maxWidth:g,maxHeight:x,onResizeStart:S,keepAspectRatio:y,autoScale:v,shouldResize:_,onResize:N,onResizeEnd:E},k)),L1.map(k=>f.jsx(pp,{className:o,style:s,nodeId:t,position:k,color:c,minWidth:h,minHeight:m,maxWidth:g,maxHeight:x,onResizeStart:S,keepAspectRatio:y,autoScale:v,shouldResize:_,onResize:N,onResizeEnd:E},k))]}):null}function mE(t,r){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const o=document.implementation.createHTMLDocument(),s=o.createElement("base"),a=o.createElement("a");return o.head.appendChild(s),o.body.appendChild(a),r&&(s.href=r),a.href=t,a.href}const gE=(()=>{let t=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${r()}${t}`)})();function Ur(t){const r=[];for(let o=0,s=t.length;o<s;o++)r.push(t[o]);return r}let ii=null;function vg(t={}){return ii||(t.includeStyleProperties?(ii=t.includeStyleProperties,ii):(ii=Ur(window.getComputedStyle(document.documentElement)),ii))}function ql(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function yE(t){const r=ql(t,"border-left-width"),o=ql(t,"border-right-width");return t.clientWidth+r+o}function vE(t){const r=ql(t,"border-top-width"),o=ql(t,"border-bottom-width");return t.clientHeight+r+o}function xg(t,r={}){const o=r.width||yE(t),s=r.height||vE(t);return{width:o,height:s}}function xE(){let t,r;try{r=process}catch{}const o=r&&r.env?r.env.devicePixelRatio:null;return o&&(t=parseInt(o,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const Gt=16384;function wE(t){(t.width>Gt||t.height>Gt)&&(t.width>Gt&&t.height>Gt?t.width>t.height?(t.height*=Gt/t.width,t.width=Gt):(t.width*=Gt/t.height,t.height=Gt):t.width>Gt?(t.height*=Gt/t.width,t.width=Gt):(t.width*=Gt/t.height,t.height=Gt))}function Zl(t){return new Promise((r,o)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>r(s))})},s.onerror=o,s.crossOrigin="anonymous",s.decoding="async",s.src=t})}async function SE(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function kE(t,r,o){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),u=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${r}`),a.setAttribute("height",`${o}`),a.setAttribute("viewBox",`0 0 ${r} ${o}`),u.setAttribute("width","100%"),u.setAttribute("height","100%"),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("externalResourcesRequired","true"),a.appendChild(u),u.appendChild(t),SE(a)}const Ht=(t,r)=>{if(t instanceof r)return!0;const o=Object.getPrototypeOf(t);return o===null?!1:o.constructor.name===r.name||Ht(o,r)};function EE(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function NE(t,r){return vg(r).map(o=>{const s=t.getPropertyValue(o),a=t.getPropertyPriority(o);return`${o}: ${s}${a?" !important":""};`}).join(" ")}function CE(t,r,o,s){const a=`.${t}:${r}`,u=o.cssText?EE(o):NE(o,s);return document.createTextNode(`${a}{${u}}`)}function mp(t,r,o,s){const a=window.getComputedStyle(t,o),u=a.getPropertyValue("content");if(u===""||u==="none")return;const c=gE();try{r.className=`${r.className} ${c}`}catch{return}const h=document.createElement("style");h.appendChild(CE(c,o,a,s)),r.appendChild(h)}function _E(t,r,o){mp(t,r,":before",o),mp(t,r,":after",o)}const gp="application/font-woff",yp="image/jpeg",jE={woff:gp,woff2:gp,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yp,jpeg:yp,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function bE(t){const r=/\.([^./]*?)$/g.exec(t);return r?r[1]:""}function Dc(t){const r=bE(t).toLowerCase();return jE[r]||""}function PE(t){return t.split(/,/)[1]}function yc(t){return t.search(/^(data:)/)!==-1}function ME(t,r){return`data:${r};base64,${t}`}async function wg(t,r,o){const s=await fetch(t,r);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((u,c)=>{const h=new FileReader;h.onerror=c,h.onloadend=()=>{try{u(o({res:s,result:h.result}))}catch(m){c(m)}},h.readAsDataURL(a)})}const nc={};function IE(t,r,o){let s=t.replace(/\?.*/,"");return o&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),r?`[${r}]${s}`:s}async function $c(t,r,o){const s=IE(t,r,o.includeQueryParams);if(nc[s]!=null)return nc[s];o.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const u=await wg(t,o.fetchRequestInit,({res:c,result:h})=>(r||(r=c.headers.get("Content-Type")||""),PE(h)));a=ME(u,r)}catch(u){a=o.imagePlaceholder||"";let c=`Failed to fetch resource: ${t}`;u&&(c=typeof u=="string"?u:u.message),c&&console.warn(c)}return nc[s]=a,a}async function TE(t){const r=t.toDataURL();return r==="data:,"?t.cloneNode(!1):Zl(r)}async function zE(t,r){if(t.currentSrc){const u=document.createElement("canvas"),c=u.getContext("2d");u.width=t.clientWidth,u.height=t.clientHeight,c==null||c.drawImage(t,0,0,u.width,u.height);const h=u.toDataURL();return Zl(h)}const o=t.poster,s=Dc(o),a=await $c(o,s,r);return Zl(a)}async function RE(t,r){var o;try{if(!((o=t==null?void 0:t.contentDocument)===null||o===void 0)&&o.body)return await da(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function AE(t,r){return Ht(t,HTMLCanvasElement)?TE(t):Ht(t,HTMLVideoElement)?zE(t,r):Ht(t,HTMLIFrameElement)?RE(t,r):t.cloneNode(Sg(t))}const LE=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Sg=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function DE(t,r,o){var s,a;if(Sg(r))return r;let u=[];return LE(t)&&t.assignedNodes?u=Ur(t.assignedNodes()):Ht(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?u=Ur(t.contentDocument.body.childNodes):u=Ur(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),u.length===0||Ht(t,HTMLVideoElement)||await u.reduce((c,h)=>c.then(()=>da(h,o)).then(m=>{m&&r.appendChild(m)}),Promise.resolve()),r}function $E(t,r,o){const s=r.style;if(!s)return;const a=window.getComputedStyle(t);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):vg(o).forEach(u=>{let c=a.getPropertyValue(u);u==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Ht(t,HTMLIFrameElement)&&u==="display"&&c==="inline"&&(c="block"),u==="d"&&r.getAttribute("d")&&(c=`path(${r.getAttribute("d")})`),s.setProperty(u,c,a.getPropertyPriority(u))})}function OE(t,r){Ht(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Ht(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function FE(t,r){if(Ht(t,HTMLSelectElement)){const s=Array.from(r.children).find(a=>t.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function HE(t,r,o){return Ht(r,Element)&&($E(t,r,o),_E(t,r,o),OE(t,r),FE(t,r)),r}async function VE(t,r){const o=t.querySelectorAll?t.querySelectorAll("use"):[];if(o.length===0)return t;const s={};for(let u=0;u<o.length;u++){const h=o[u].getAttribute("xlink:href");if(h){const m=t.querySelector(h),g=document.querySelector(h);!m&&g&&!s[h]&&(s[h]=await da(g,r,!0))}}const a=Object.values(s);if(a.length){const u="http://www.w3.org/1999/xhtml",c=document.createElementNS(u,"svg");c.setAttribute("xmlns",u),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const h=document.createElementNS(u,"defs");c.appendChild(h);for(let m=0;m<a.length;m++)h.appendChild(a[m]);t.appendChild(c)}return t}async function da(t,r,o){return!o&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>AE(s,r)).then(s=>DE(t,s,r)).then(s=>HE(t,s,r)).then(s=>VE(s,r))}const kg=/url\((['"]?)([^'"]+?)\1\)/g,BE=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,WE=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function UE(t){const r=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function YE(t){const r=[];return t.replace(kg,(o,s,a)=>(r.push(a),o)),r.filter(o=>!yc(o))}async function XE(t,r,o,s,a){try{const u=o?mE(r,o):r,c=Dc(r);let h;return a||(h=await $c(u,c,s)),t.replace(UE(r),`$1${h}$3`)}catch{}return t}function GE(t,{preferredFontFormat:r}){return r?t.replace(WE,o=>{for(;;){const[s,,a]=BE.exec(o)||[];if(!a)return"";if(a===r)return`src: ${s};`}}):t}function Eg(t){return t.search(kg)!==-1}async function Ng(t,r,o){if(!Eg(t))return t;const s=GE(t,o);return YE(s).reduce((u,c)=>u.then(h=>XE(h,c,r,o)),Promise.resolve(s))}async function si(t,r,o){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const u=await Ng(a,null,o);return r.style.setProperty(t,u,r.style.getPropertyPriority(t)),!0}return!1}async function KE(t,r){await si("background",t,r)||await si("background-image",t,r),await si("mask",t,r)||await si("-webkit-mask",t,r)||await si("mask-image",t,r)||await si("-webkit-mask-image",t,r)}async function QE(t,r){const o=Ht(t,HTMLImageElement);if(!(o&&!yc(t.src))&&!(Ht(t,SVGImageElement)&&!yc(t.href.baseVal)))return;const s=o?t.src:t.href.baseVal,a=await $c(s,Dc(s),r);await new Promise((u,c)=>{t.onload=u,t.onerror=r.onImageErrorHandler?(...m)=>{try{u(r.onImageErrorHandler(...m))}catch(g){c(g)}}:c;const h=t;h.decode&&(h.decode=u),h.loading==="lazy"&&(h.loading="eager"),o?(t.srcset="",t.src=a):t.href.baseVal=a})}async function qE(t,r){const s=Ur(t.childNodes).map(a=>Cg(a,r));await Promise.all(s).then(()=>t)}async function Cg(t,r){Ht(t,Element)&&(await KE(t,r),await QE(t,r),await qE(t,r))}function ZE(t,r){const{style:o}=t;r.backgroundColor&&(o.backgroundColor=r.backgroundColor),r.width&&(o.width=`${r.width}px`),r.height&&(o.height=`${r.height}px`);const s=r.style;return s!=null&&Object.keys(s).forEach(a=>{o[a]=s[a]}),t}const vp={};async function xp(t){let r=vp[t];if(r!=null)return r;const s=await(await fetch(t)).text();return r={url:t,cssText:s},vp[t]=r,r}async function wp(t,r){let o=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,u=(o.match(/url\([^)]+\)/g)||[]).map(async c=>{let h=c.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,t.url).href),wg(h,r.fetchRequestInit,({result:m})=>(o=o.replace(c,`url(${m})`),[c,m]))});return Promise.all(u).then(()=>o)}function Sp(t){if(t==null)return[];const r=[],o=/(\/\*[\s\S]*?\*\/)/gi;let s=t.replace(o,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=a.exec(s);if(m===null)break;r.push(m[0])}s=s.replace(a,"");const u=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(c,"gi");for(;;){let m=u.exec(s);if(m===null){if(m=h.exec(s),m===null)break;u.lastIndex=h.lastIndex}else h.lastIndex=u.lastIndex;r.push(m[0])}return r}async function JE(t,r){const o=[],s=[];return t.forEach(a=>{if("cssRules"in a)try{Ur(a.cssRules||[]).forEach((u,c)=>{if(u.type===CSSRule.IMPORT_RULE){let h=c+1;const m=u.href,g=xp(m).then(x=>wp(x,r)).then(x=>Sp(x).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?h+=1:a.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:y,error:v})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(g)}})}catch(u){const c=t.find(h=>h.href==null)||document.styleSheets[0];a.href!=null&&s.push(xp(a.href).then(h=>wp(h,r)).then(h=>Sp(h).forEach(m=>{c.insertRule(m,c.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",u)}}),Promise.all(s).then(()=>(t.forEach(a=>{if("cssRules"in a)try{Ur(a.cssRules||[]).forEach(u=>{o.push(u)})}catch(u){console.error(`Error while reading CSS rules from ${a.href}`,u)}}),o))}function eN(t){return t.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Eg(r.style.getPropertyValue("src")))}async function tN(t,r){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const o=Ur(t.ownerDocument.styleSheets),s=await JE(o,r);return eN(s)}function _g(t){return t.trim().replace(/["']/g,"")}function nN(t){const r=new Set;function o(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(u=>{r.add(_g(u))}),Array.from(s.children).forEach(u=>{u instanceof HTMLElement&&o(u)})}return o(t),r}async function rN(t,r){const o=await tN(t,r),s=nN(t);return(await Promise.all(o.filter(u=>s.has(_g(u.style.fontFamily))).map(u=>{const c=u.parentStyleSheet?u.parentStyleSheet.href:null;return Ng(u.cssText,c,r)}))).join(`
63
+ `)}async function oN(t,r){const o=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await rN(t,r);if(o){const s=document.createElement("style"),a=document.createTextNode(o);s.appendChild(a),t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s)}}async function jg(t,r={}){const{width:o,height:s}=xg(t,r),a=await da(t,r,!0);return await oN(a,r),await Cg(a,r),ZE(a,r),await kE(a,o,s)}async function iN(t,r={}){const{width:o,height:s}=xg(t,r),a=await jg(t,r),u=await Zl(a),c=document.createElement("canvas"),h=c.getContext("2d"),m=r.pixelRatio||xE(),g=r.canvasWidth||o,x=r.canvasHeight||s;return c.width=g*m,c.height=x*m,r.skipAutoScale||wE(c),c.style.width=`${g}`,c.style.height=`${x}`,r.backgroundColor&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,c.width,c.height)),h.drawImage(u,0,0,c.width,c.height),c}async function sN(t,r={}){return(await iN(t,r)).toDataURL()}function lN({feature:t,onClose:r}){return f.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:r,children:f.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:o=>o.stopPropagation(),children:[f.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),f.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[t," is a Pro feature"]}),f.jsxs("p",{style:{color:"#aaa",margin:"0 0 24px",fontSize:14,lineHeight:1.5},children:["Upgrade to Pro for ",t.toLowerCase(),", drift detection, premium agents, and more."]}),f.jsx("a",{href:"https://heartbyte.io/archbyte/pricing",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",background:"#7c3aed",color:"#fff",padding:"10px 28px",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:14},children:"Upgrade to Pro"}),f.jsx("button",{onClick:r,style:{display:"block",margin:"16px auto 0",background:"none",border:"none",color:"#888",cursor:"pointer",fontSize:13},children:"Maybe later"})]})})}function Al({trigger:t,triggerClassName:r,contentClassName:o,children:s,disabled:a}){const[u,c]=b.useState(!1),h=b.useRef(null);return b.useEffect(()=>{if(!u)return;const m=g=>{h.current&&!h.current.contains(g.target)&&c(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[u]),f.jsxs("div",{ref:h,className:"dropdown-wrapper",children:[f.jsx("button",{className:r,onClick:()=>!a&&c(!u),disabled:a,children:t}),u&&f.jsx("div",{className:`dropdown-menu ${o||""}`,onClick:()=>c(!1),children:s})]})}const aN={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},kp={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function uN({data:t,selected:r}){const o=t,s=o.label.split(`
64
+ `),a=s[0],u=s.slice(1).join(`
65
+ `),c=["arch-node",o.layer,o.active?"active":"",o.highlighted?"highlighted":"",o.locked?"locked":"",o.isConnected===!0?"connected":"",o.isConnected===!1?"dimmed":"",o.isSearchMatch===!0?"search-match":"",o.isSearchMatch===!1?"search-no-match":""].filter(Boolean).join(" "),h=aN[o.layer]||"#868e96",m=kp[o.nodeType]||kp.component;return f.jsxs(f.Fragment,{children:[f.jsx(pE,{color:h,isVisible:r,minWidth:100,minHeight:60}),f.jsxs("div",{className:c,style:{minWidth:o.width||130,width:"100%",height:"100%"},children:[f.jsx(Wr,{type:"target",position:Ee.Top}),f.jsx(Wr,{type:"target",position:Ee.Left}),f.jsx("div",{className:"node-type-icon",children:m}),f.jsxs("div",{className:"node-content",children:[f.jsx("div",{className:"label",children:a}),u&&f.jsx("div",{className:"sublabel",children:u}),o.description&&f.jsx("div",{className:"node-desc",children:o.description})]}),o.techStack&&o.techStack.length>0&&f.jsx("div",{className:"node-tech-row",children:o.techStack.slice(0,3).map((g,x)=>f.jsx("span",{className:"node-tech-pill",children:g},x))}),f.jsx(Wr,{type:"source",position:Ee.Bottom}),f.jsx(Wr,{type:"source",position:Ee.Right})]})]})}const bg=b.memo(uN),cN={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function dN({selectedEnvironment:t,environments:r,onSelectEnvironment:o}){if(!r||Object.keys(r).length===0)return null;const s=Object.keys(r);return f.jsx("div",{className:"environment-tabs",children:s.map(a=>{var g;const u=t===a,c=r==null?void 0:r[a],h=(c==null?void 0:c.color)||cN[a]||"#6b7280",m=(c==null?void 0:c.label)||a.charAt(0).toUpperCase()+a.slice(1);return f.jsxs("button",{className:`env-tab ${u?"selected":""}`,onClick:()=>o(a),style:{"--env-color":h},children:[f.jsx("span",{className:"env-indicator"}),f.jsx("span",{className:"env-label",children:m}),u&&c&&f.jsx("span",{className:"env-meta",children:[c.deployment,c.scaling,(g=c.urlPatterns||c.urls)==null?void 0:g[0]].filter(Boolean).join(" | ")})]},a)})})}const fN=b.memo(dN);function hN(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function pN(t){return new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function mN({visible:t,onClose:r}){const[o,s]=b.useState(null),a=b.useCallback(async()=>{try{const u=await fetch("http://localhost:3847/api/stats");u.ok&&s(await u.json())}catch{}},[]);return b.useEffect(()=>{t&&a()},[t,a]),!t||!o?null:f.jsxs("div",{className:"stats-overlay",children:[f.jsxs("div",{className:"stats-overlay-header",children:[f.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),(o.durationMs||o.filesScanned||o.analyzedAt)&&f.jsxs("div",{className:"stats-scan-info",children:[o.durationMs!=null&&f.jsx("span",{className:"scan-info-item",children:hN(o.durationMs)}),o.filesScanned!=null&&f.jsxs("span",{className:"scan-info-item",children:[o.filesScanned.toLocaleString()," files"]}),o.tokenUsage&&f.jsxs("span",{className:"scan-info-item",children:[(o.tokenUsage.input+o.tokenUsage.output).toLocaleString()," tokens"]}),o.mode&&f.jsx("span",{className:"scan-info-item",children:o.mode==="pipeline"?"static + model":"static only"}),o.analyzedAt&&f.jsx("span",{className:"scan-info-item",children:pN(o.analyzedAt)})]}),f.jsxs("div",{className:"stats-grid",children:[f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.components}),f.jsx("div",{className:"stat-label",children:"Components"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.totalConnections}),f.jsx("div",{className:"stat-label",children:"Connections"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.databases}),f.jsx("div",{className:"stat-label",children:"Databases"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.externalServices}),f.jsx("div",{className:"stat-label",children:"External"})]}),f.jsxs("div",{className:`stat-card ${o.orphans>0?"highlight":""}`,children:[f.jsx("div",{className:"stat-value",children:o.orphans}),f.jsx("div",{className:"stat-label",children:"Orphans"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.flows}),f.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const gN=b.memo(mN);function yN({visible:t,onClose:r,onHighlightNode:o}){const[s,a]=b.useState(null),[u,c]=b.useState(!1),h=b.useCallback(async()=>{c(!0);try{const m=await fetch("http://localhost:3847/api/validate");m.ok&&a(await m.json())}catch{}c(!1)},[]);return b.useEffect(()=>{t&&h()},[t,h]),!t||!s&&!u?null:f.jsxs("div",{className:"validation-panel",children:[f.jsxs("div",{className:"validation-header",children:[f.jsx("span",{className:"validation-title",children:"Validation"}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:h,disabled:u,children:u?"...":"Re-validate"}),s&&f.jsx("span",{className:`validation-badge ${s.passed?"pass":"fail"}`,children:s.passed?"PASS":"FAIL"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),u&&!s?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Validating..."}):s&&s.violations.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"No violations found"}):s?f.jsx("div",{children:s.violations.map((m,g)=>f.jsxs("div",{className:`violation-item ${m.level}`,onClick:()=>{m.nodeIds&&m.nodeIds.length>0&&o(m.nodeIds[0])},children:[f.jsx("div",{className:"violation-rule",children:m.rule}),f.jsx("div",{className:"violation-message",children:m.message})]},g))}):null,s&&f.jsxs("div",{style:{marginTop:8,fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[s.errors," error",s.errors!==1?"s":"",", ",s.warnings," warning",s.warnings!==1?"s":""]})]})}const vN=b.memo(yN);function xN({visible:t}){const[r,o]=b.useState(null),[s,a]=b.useState([]),[u,c]=b.useState(!0),[h,m]=b.useState(!1),g=b.useCallback(async()=>{try{const[E,k]=await Promise.all([fetch("http://localhost:3847/api/patrol/latest"),fetch("http://localhost:3847/api/patrol/history")]);E.ok&&o(await E.json()),k.ok&&a(await k.json())}catch{}c(!1)},[]),x=b.useCallback(async()=>{try{const E=await fetch("http://localhost:3847/api/patrol/running");if(E.ok){const k=await E.json();m(k.running)}}catch{}},[]);b.useEffect(()=>{if(t){g(),x();const E=setInterval(g,h?5e3:1e4),k=setInterval(x,5e3);return()=>{clearInterval(E),clearInterval(k)}}},[t,g,x,h]);const y=async()=>{try{(await fetch("http://localhost:3847/api/patrol/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interval:30})})).ok&&m(!0)}catch{}},v=async()=>{try{(await fetch("http://localhost:3847/api/patrol/stop",{method:"POST"})).ok&&m(!1)}catch{}};if(!t)return null;if(u)return f.jsx("div",{className:"ops-section",children:f.jsx("div",{className:"ops-empty",children:"Loading..."})});if(!r&&s.length===0)return f.jsxs("div",{className:"ops-section",children:[f.jsxs("div",{className:"ops-empty",children:["No patrol data yet.",f.jsx("span",{className:"ops-hint",children:"Start patrol to begin monitoring"})]}),f.jsx("div",{className:"patrol-actions",children:f.jsx("button",{className:"panel-btn green",onClick:y,disabled:h,children:h?"Running...":"Start Patrol"})})]});const _=s.slice(-20),S=_.filter(E=>E.passed).length,N=_.length>0?Math.round(S/_.length*100):0;return f.jsxs("div",{className:"ops-section",children:[f.jsx("div",{className:"patrol-actions",children:h?f.jsx("button",{className:"panel-btn red",onClick:v,children:"Stop Patrol"}):f.jsx("button",{className:"panel-btn green",onClick:y,children:"Start Patrol"})}),_.length>0&&f.jsxs("div",{className:"patrol-sparkline-row",children:[f.jsx("div",{className:"patrol-sparkline",children:_.map((E,k)=>f.jsx("div",{className:`spark-dot ${E.passed?"healthy":"violation"}`,title:`${new Date(E.timestamp).toLocaleTimeString()} — ${E.passed?"Healthy":"Violation"}`},k))}),f.jsxs("span",{className:"patrol-health-pct",children:[N,"%"]})]}),r&&f.jsxs("div",{className:`patrol-status-card ${r.passed?"healthy":"violation"}`,children:[f.jsxs("div",{className:"patrol-status-row",children:[f.jsx("span",{className:`patrol-badge ${r.passed?"healthy":"violation"}`,children:r.passed?"HEALTHY":"VIOLATION"}),f.jsx("span",{className:"patrol-time",children:new Date(r.timestamp).toLocaleTimeString()})]}),f.jsxs("div",{className:"patrol-counts",children:[r.errors>0&&f.jsxs("span",{className:"patrol-count error",children:[r.errors," err"]}),r.warnings>0&&f.jsxs("span",{className:"patrol-count warn",children:[r.warnings," warn"]}),r.errors===0&&r.warnings===0&&f.jsx("span",{className:"patrol-count ok",children:"All clear"})]})]}),r&&r.newViolations.length>0&&f.jsxs("div",{className:"patrol-violations",children:[f.jsx("div",{className:"patrol-violations-label",children:"New violations"}),r.newViolations.slice(0,5).map((E,k)=>f.jsxs("div",{className:`patrol-violation-item ${E.level}`,children:[f.jsx("span",{className:"patrol-v-rule",children:E.rule}),f.jsx("span",{className:"patrol-v-msg",children:E.message})]},k))]}),r&&r.resolvedViolations.length>0&&f.jsxs("div",{className:"patrol-violations resolved",children:[f.jsx("div",{className:"patrol-violations-label",children:"Resolved"}),r.resolvedViolations.slice(0,3).map((E,k)=>f.jsxs("div",{className:"patrol-violation-item resolved",children:[f.jsx("span",{className:"patrol-v-rule",children:E.rule}),f.jsx("span",{className:"patrol-v-msg",children:E.message})]},k))]}),f.jsxs("div",{className:"patrol-summary",children:[s.length," patrols total"]})]})}const wN=b.memo(xN);function SN({visible:t}){const[r,o]=b.useState([]),[s,a]=b.useState(null),[u,c]=b.useState(null),[h,m]=b.useState(!0),[g,x]=b.useState(null),[y,v]=b.useState(null),_=b.useRef(null),S=b.useCallback(async()=>{try{const I=await fetch("http://localhost:3847/api/workflow/list");I.ok&&o(await I.json())}catch{}m(!1)},[]),N=b.useCallback(async I=>{try{const C=await fetch(`http://localhost:3847/api/workflow/status/${I}`);if(C.ok){const j=await C.json();c(j),j&&g===I&&(j.status==="completed"||j.status==="failed")&&(x(null),S())}}catch{}},[g,S]);b.useEffect(()=>{if(t){S();const I=setInterval(S,g?3e3:1e4);return()=>clearInterval(I)}},[t,S,g]),b.useEffect(()=>(_.current&&clearInterval(_.current),s&&(N(s),_.current=setInterval(()=>N(s),g?3e3:1e4)),()=>{_.current&&clearInterval(_.current)}),[s,N,g]);const E=async I=>{v(null);try{const C=await fetch(`http://localhost:3847/api/workflow/run/${I}`,{method:"POST"});if(C.ok)x(I);else{const j=await C.json();v(j.error||"Failed to start workflow")}}catch{v("Failed to connect to server")}},k=async I=>{v(null);try{(await fetch("http://localhost:3847/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:I})})).ok&&(c(null),S())}catch{}};return t?h?f.jsx("div",{className:"ops-section",children:f.jsx("div",{className:"ops-empty",children:"Loading..."})}):r.length===0?f.jsx("div",{className:"ops-section",children:f.jsxs("div",{className:"ops-empty",children:["No workflows available.",f.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):f.jsxs("div",{className:"ops-section",children:[y&&f.jsx("div",{className:"wf-error",children:y}),r.map(I=>{const C=s===I.id,j=g===I.id;return f.jsxs("div",{className:"wf-item",children:[f.jsxs("div",{className:"wf-header",onClick:()=>a(C?null:I.id),children:[f.jsxs("div",{className:"wf-header-left",children:[f.jsx("span",{className:"wf-expand",children:C?"−":"+"}),f.jsx("span",{className:"wf-name",children:I.name}),I.builtin&&f.jsx("span",{className:"wf-tag",children:"built-in"})]}),(j||I.status)&&f.jsx("span",{className:`wf-status ${j?"running":I.status}`,children:j?"running":I.status==="completed"?"done":I.status})]}),C&&f.jsxs("div",{className:"wf-detail",children:[f.jsx("div",{className:"wf-desc",children:I.description}),u&&u.workflowId===I.id?f.jsxs("div",{className:"wf-steps",children:[Object.entries(u.steps).map(([O,A])=>f.jsxs("div",{className:`wf-step ${A.status}`,children:[f.jsx("span",{className:"wf-step-icon",children:A.status==="completed"?"✓":A.status==="running"?"▶":A.status==="failed"?"✗":"○"}),f.jsx("span",{className:"wf-step-id",children:O})]},O)),(()=>{const O=Object.keys(u.steps).length,A=Object.values(u.steps).filter(q=>q.status==="completed").length,H=O>0?Math.round(A/O*100):0;return f.jsxs("div",{className:"wf-progress",children:[f.jsx("div",{className:"wf-progress-bar",children:f.jsx("div",{className:"wf-progress-fill",style:{width:`${H}%`}})}),f.jsxs("span",{className:"wf-progress-label",children:[H,"%"]})]})})()]}):f.jsx("div",{className:"wf-steps-preview",children:I.steps.length>0?I.steps.join(" → "):"No state yet"}),f.jsxs("div",{className:"wf-actions",children:[f.jsx("button",{className:"panel-btn cyan",disabled:j,onClick:()=>E(I.id),children:j?"Running...":"Run"}),(I.status==="completed"||I.status==="failed")&&!j&&f.jsx("button",{className:"panel-btn amber",onClick:()=>k(I.id),children:"Reset"})]})]})]},I.id)})]}):null}const kN=b.memo(SN);function EN({projectInfo:t}){const[r,o]=b.useState(!1),s=b.useRef(null);return b.useEffect(()=>{if(!r)return;const a=u=>{s.current&&!s.current.contains(u.target)&&o(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]),t?f.jsxs("div",{className:"project-info-wrapper",ref:s,children:[f.jsx("button",{className:"project-info-trigger",onClick:()=>o(!r),children:t.name}),r&&f.jsxs("div",{className:"project-info-popup",children:[f.jsxs("div",{className:"project-info-header",children:[f.jsx("span",{className:"project-info-name",children:t.name}),t.primaryLanguage&&f.jsx("span",{className:"project-info-lang",children:t.primaryLanguage})]}),t.description&&f.jsx("p",{className:"project-info-desc",children:t.description}),t.isMonorepo&&f.jsx("div",{className:"project-info-badge",children:"Monorepo"}),t.workspacePath&&f.jsxs("a",{className:"project-info-vscode",href:`vscode://file${t.workspacePath}`,title:"Open folder in VS Code",children:[f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:f.jsx("path",{d:"M17.583 2.214L12.52 6.768 7.84 3.96 2.4 5.88v12.24l5.44 1.92 4.68-2.808 5.063 4.554L21.6 19.8V4.2l-4.017-1.986zM7.84 15.12V8.88l4.68 3.12-4.68 3.12zm9.743 2.544l-3.96-3.564 3.96-3.564v7.128z"})}),"Open in VS Code"]})]})]}):null}const NN={architecture:bg},CN=1500;function _N({flow:t,architecture:r,onClose:o}){var _;const[s,a]=b.useState(0),[u,c]=b.useState(new Set([(_=t.steps[0])==null?void 0:_.edge])),[h,m]=b.useState(!0),{flowNodeIds:g,flowEdges:x}=b.useMemo(()=>{const S=new Set(t.steps.map(k=>k.edge)),N=r.edges.filter(k=>S.has(k.id)),E=new Set;return N.forEach(k=>{E.add(k.source),E.add(k.target)}),{flowNodeIds:E,flowEdges:N}},[t,r]),y=b.useMemo(()=>{const S=r.nodes.filter(ee=>g.has(ee.id)),N=320,E=140,k=80,I=80,C=new Map,j=new Map;g.forEach(ee=>{C.set(ee,0),j.set(ee,[])}),x.forEach(ee=>{g.has(ee.source)&&g.has(ee.target)&&(j.get(ee.source).push(ee.target),C.set(ee.target,(C.get(ee.target)||0)+1))});const O=new Map,A=[];for(C.forEach((ee,U)=>{ee===0&&(A.push(U),O.set(U,0))});A.length>0;){const ee=A.shift(),U=O.get(ee);for(const X of j.get(ee)||[]){const ne=U+1;(!O.has(X)||O.get(X)<ne)&&O.set(X,ne),C.set(X,C.get(X)-1),C.get(X)===0&&A.push(X)}}S.forEach(ee=>{O.has(ee.id)||O.set(ee.id,0)});const H=new Map;S.forEach(ee=>{const U=O.get(ee.id);H.has(U)||H.set(U,[]),H.get(U).push(ee)});const q=[...H.keys()].sort((ee,U)=>ee-U),J=new Map;return q.forEach((ee,U)=>{H.get(ee).forEach((ne,P)=>{J.set(ne.id,{x:k+U*N,y:I+P*E})})}),S.map(ee=>{const U=J.get(ee.id)||{x:k,y:I};return{id:ee.id,type:"architecture",position:U,data:{label:ee.label,layer:ee.layer,nodeType:ee.type,width:ee.width,height:ee.height,path:ee.path,techStack:ee.techStack,description:ee.description},style:{width:ee.width,zIndex:1}}})},[r,g,x]);b.useEffect(()=>{if(!h)return;const S=setInterval(()=>{a(N=>{const E=N+1;if(E>=t.steps.length)return c(new Set([t.steps[0].edge])),0;const k=new Set;for(let I=0;I<=E;I++)k.add(t.steps[I].edge);return c(k),E})},CN);return()=>clearInterval(S)},[h,t]);const v=b.useMemo(()=>{const S=new Map;return t.steps.forEach((N,E)=>{S.has(N.edge)||S.set(N.edge,E+1)}),x.map(N=>{const E=u.has(N.id),k=S.get(N.id);return{id:N.id,source:N.source,target:N.target,label:E&&k?`${k}`:void 0,labelStyle:E&&k?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:E&&k?{fill:t.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:E?t.color:N.color||"var(--border-color)",strokeWidth:E?5:2,opacity:E?1:.3,filter:E?"brightness(0.85) saturate(1.4)":void 0},animated:E,type:"smoothstep"}})},[x,u,t]);return f.jsx("div",{className:"flow-hud-overlay",children:f.jsxs("div",{className:"flow-hud-panel",children:[f.jsxs("div",{className:"flow-hud-header",children:[f.jsxs("div",{className:"flow-hud-title",children:[f.jsx("span",{className:"flow-hud-dot",style:{background:t.color}}),f.jsx("span",{children:t.name})]}),f.jsxs("div",{className:"flow-hud-controls",children:[h?f.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!1),title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!0),title:"Play",children:"▶"}),f.jsx("button",{className:"flow-hud-close",onClick:o,title:"Close",children:"✕"})]})]}),f.jsx("div",{className:"flow-hud-description",children:t.description}),f.jsx("div",{className:"flow-hud-canvas",children:f.jsxs(fg,{nodes:y,edges:v,nodeTypes:NN,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[f.jsx(pg,{variant:Yn.Dots,gap:20,size:1,color:"var(--grid-color)"}),f.jsx(gg,{showInteractive:!1})]})}),f.jsx("div",{className:"flow-hud-steps",children:t.steps.map((S,N)=>f.jsxs("div",{className:`flow-hud-step ${N<=s?"active":""} ${N===s?"current":""}`,style:{borderColor:N<=s?t.color:void 0},children:[f.jsx("span",{className:"flow-hud-step-num",style:{background:N<=s?t.color:void 0},children:N+1}),S.label]},N))})]})})}function jN(t){return f.jsx(dg,{children:f.jsx(_N,{...t})})}const bN=b.memo(jN),PN=[{key:"anthropic",name:"Anthropic",icon:"A",models:"Claude 3.5 Sonnet, Claude 3 Opus",description:"Advanced reasoning and code analysis",requiresKey:!0},{key:"openai",name:"OpenAI",icon:"O",models:"GPT-4o, GPT-4 Turbo",description:"Versatile general-purpose models",requiresKey:!0},{key:"google",name:"Google",icon:"G",models:"Gemini 1.5 Pro, Gemini 1.5 Flash",description:"Fast multimodal analysis",requiresKey:!0},{key:"ollama",name:"Ollama",icon:"L",models:"Llama 3, CodeLlama, Mistral",description:"Local models, no API key needed",requiresKey:!1}];function MN({onComplete:t}){const[r,o]=b.useState(1),[s,a]=b.useState(null),[u,c]=b.useState(""),[h,m]=b.useState(!1),[g,x]=b.useState(null),y=N=>{a(N),c(""),x(null),N.requiresKey?o(2):o(3)},v=()=>{if(!u.trim()){x("API key is required");return}x(null),o(3)},_=async()=>{if(s){m(!0),x(null);try{const N={provider:s.key};s.requiresKey&&u.trim()&&(N.apiKey=u.trim());const E=await fetch("http://localhost:3847/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!E.ok){const k=await E.json();throw new Error(k.error||"Failed to save configuration")}t()}catch(N){x(N instanceof Error?N.message:"Failed to save configuration"),m(!1)}}},S=()=>{x(null),r===3&&(s!=null&&s.requiresKey)?o(2):r===3&&!(s!=null&&s.requiresKey)?o(1):(o(1),a(null),c(""))};return f.jsx("div",{style:Me.overlay,onClick:N=>N.stopPropagation(),children:f.jsxs("div",{style:Me.modal,children:[f.jsxs("div",{style:Me.header,children:[f.jsx("div",{style:Me.headerIcon,children:"⚙"}),f.jsx("h2",{style:Me.title,children:"Set Up Your AI Provider"}),f.jsx("p",{style:Me.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),f.jsx("div",{style:Me.stepIndicator,children:[1,2,3].map(N=>f.jsxs("div",{style:Me.stepRow,children:[f.jsx("div",{style:{...Me.stepDot,background:N<=r?"#7c3aed":"#3a3a4a",color:N<=r?"#fff":"#888"},children:N}),f.jsx("span",{style:{...Me.stepLabel,color:N<=r?"#ccc":"#666"},children:N===1?"Provider":N===2?"API Key":"Confirm"}),N<3&&f.jsx("div",{style:{...Me.stepLine,background:N<r?"#7c3aed":"#3a3a4a"}})]},N))}),r===1&&f.jsx("div",{style:Me.stepContent,children:f.jsx("div",{style:Me.providerGrid,children:PN.map(N=>f.jsxs("button",{style:{...Me.providerCard,borderColor:(s==null?void 0:s.key)===N.key?"#7c3aed":"#5a5a7a"},onClick:()=>y(N),onMouseEnter:E=>{E.currentTarget.style.borderColor="#7c3aed",E.currentTarget.style.background="#2a2a3e"},onMouseLeave:E=>{(s==null?void 0:s.key)!==N.key&&(E.currentTarget.style.borderColor="#5a5a7a"),E.currentTarget.style.background="#252536"},children:[f.jsx("div",{style:Me.providerIcon,children:N.icon}),f.jsx("div",{style:Me.providerName,children:N.name}),f.jsx("div",{style:Me.providerModels,children:N.models}),f.jsx("div",{style:Me.providerDesc,children:N.description}),!N.requiresKey&&f.jsx("div",{style:Me.noKeyBadge,children:"No API key needed"})]},N.key))})}),r===2&&s&&f.jsx("div",{style:Me.stepContent,children:f.jsxs("div",{style:Me.keySection,children:[f.jsxs("div",{style:Me.selectedProviderBadge,children:[f.jsx("span",{style:Me.providerIconSmall,children:s.icon}),f.jsx("span",{children:s.name})]}),f.jsx("label",{style:Me.label,children:"API Key"}),f.jsx("input",{type:"password",value:u,onChange:N=>{c(N.target.value),x(null)},placeholder:`Enter your ${s.name} API key`,style:Me.input,autoFocus:!0,onKeyDown:N=>{N.key==="Enter"&&v()}}),f.jsxs("p",{style:Me.keyHint,children:["Your key is stored locally in ",f.jsx("code",{style:Me.code,children:".archbyte/config.json"})," and never sent to external servers."]}),g&&f.jsx("div",{style:Me.error,children:g}),f.jsxs("div",{style:Me.buttonRow,children:[f.jsx("button",{style:Me.backBtn,onClick:S,children:"Back"}),f.jsx("button",{style:{...Me.primaryBtn,opacity:u.trim()?1:.5,cursor:u.trim()?"pointer":"not-allowed"},onClick:v,disabled:!u.trim(),children:"Continue"})]})]})}),r===3&&s&&f.jsx("div",{style:Me.stepContent,children:f.jsxs("div",{style:Me.confirmSection,children:[f.jsx("div",{style:Me.confirmIcon,children:"✓"}),f.jsx("h3",{style:Me.confirmTitle,children:"Ready to Analyze"}),f.jsxs("div",{style:Me.confirmDetails,children:[f.jsxs("div",{style:Me.confirmRow,children:[f.jsx("span",{style:Me.confirmLabel,children:"Provider"}),f.jsxs("span",{style:Me.confirmValue,children:[f.jsx("span",{style:Me.providerIconSmall,children:s.icon}),s.name]})]}),f.jsxs("div",{style:Me.confirmRow,children:[f.jsx("span",{style:Me.confirmLabel,children:"Models"}),f.jsx("span",{style:Me.confirmValue,children:s.models})]}),s.requiresKey&&f.jsxs("div",{style:Me.confirmRow,children:[f.jsx("span",{style:Me.confirmLabel,children:"API Key"}),f.jsxs("span",{style:Me.confirmValue,children:["*".repeat(Math.min(u.length,8)),"...",u.slice(-4)]})]})]}),g&&f.jsx("div",{style:Me.error,children:g}),f.jsxs("div",{style:Me.buttonRow,children:[f.jsx("button",{style:Me.backBtn,onClick:S,children:"Back"}),f.jsx("button",{style:{...Me.runBtn,opacity:h?.6:1,cursor:h?"wait":"pointer"},onClick:_,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Me={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},IN={"security-audit":{label:"Security Audit",icon:"⚠",color:"var(--accent-red)"},compliance:{label:"Compliance",icon:"☑",color:"var(--accent-cyan)"},performance:{label:"Performance",icon:"⚡",color:"var(--accent-amber)"},"dependency-risk":{label:"Dependency Risk",icon:"⬢",color:"#c084fc"},migration:{label:"Migration Plan",icon:"→",color:"var(--accent-green)"},"api-contracts":{label:"API Contracts",icon:"↔",color:"#60a5fa"},"drift-detection":{label:"Drift Detection",icon:"◎",color:"#f472b6"}},Yr={critical:0,high:1,medium:2,low:3};function ks({severity:t}){const r={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},o={critical:"hsl(0 90% 55% / 0.15)",high:"hsl(25 95% 53% / 0.15)",medium:"hsl(38 92% 50% / 0.15)",low:"hsl(142 76% 42% / 0.15)"},s={critical:"hsl(0 90% 55% / 0.3)",high:"hsl(25 95% 53% / 0.3)",medium:"hsl(38 92% 50% / 0.3)",low:"hsl(142 76% 42% / 0.3)"};return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r[t],background:o[t],border:`1px solid ${s[t]}`,whiteSpace:"nowrap"},children:t})}function TN({value:t}){const r=Math.round(t*100);return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${r}%`,height:"100%",borderRadius:2,background:r>=80?"var(--accent-green)":r>=50?"var(--accent-amber)":"var(--accent-red)"}})}),f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[r,"%"]})]})}function zN({status:t}){const o={compliant:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},partial:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},"non-compliant":{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"}}[t];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function RN({status:t}){const o={completed:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},"in-progress":{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",border:"var(--border-color)"}}[t];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function AN({driftType:t}){const o={added:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},removed:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},modified:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"}}[t];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function LN({data:t}){const r=[...t.findings].sort((o,s)=>Yr[o.severity]-Yr[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.owaspId}),f.jsx(ks,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.affectedComponent&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",o.affectedComponent]})]},s))})}function DN({data:t}){return t.statuses.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.statuses.map((r,o)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[f.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:r.framework}),f.jsx(zN,{status:r.status})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:r.controls>0?`${Math.round(r.passing/r.controls*100)}%`:"0%",height:"100%",borderRadius:2,background:r.status==="compliant"?"var(--accent-green)":r.status==="partial"?"var(--accent-amber)":"var(--accent-red)",transition:"width 0.3s"}})}),f.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[r.passing,"/",r.controls]})]}),r.findings.length>0&&f.jsx("div",{style:{marginTop:4},children:r.findings.map((s,a)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},a))})]},o))})}function $N({data:t}){const r=[...t.bottlenecks].sort((o,s)=>Yr[o.severity]-Yr[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.component}),f.jsx(ks,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.metric}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.recommendation&&f.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:o.recommendation})]},s))})}function ON({data:t}){const r=[...t.risks].sort((o,s)=>s.riskScore-o.riskScore);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[o.package,f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",o.version]})]}),f.jsx(ks,{severity:o.severity})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${o.riskScore}%`,height:"100%",borderRadius:2,background:o.riskScore>=75?"var(--accent-red)":o.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:o.riskScore})]}),o.reasons.length>0&&f.jsx("div",{style:{marginTop:2},children:o.reasons.map((a,u)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",a]},u))})]},s))})}function FN({data:t}){const r=[...t.steps].sort((o,s)=>o.order-s.order);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.status==="completed"?"var(--accent-green)":o.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:o.status==="completed"?.7:1},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",o.order]}),f.jsx(RN,{status:o.status})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.estimatedEffort&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",o.estimatedEffort]})]},s))})}function HN({data:t}){const r=[...t.mismatches].sort((o,s)=>Yr[o.severity]-Yr[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:o.endpoint}),f.jsx(ks,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:o.field}),f.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),f.jsx("div",{style:{color:"var(--accent-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(142 76% 42% / 0.08)",borderRadius:3},children:o.specValue})]}),f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),f.jsx("div",{style:{color:"var(--accent-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(0 90% 55% / 0.08)",borderRadius:3},children:o.implValue})]})]})]},s))})}function VN({data:t}){const r=[...t.detections].sort((o,s)=>Yr[o.severity]-Yr[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.component}),f.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[f.jsx(AN,{driftType:o.driftType}),f.jsx(ks,{severity:o.severity})]})]}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(o.detectedAt).toLocaleString()})]},s))})}function BN({visible:t,onClose:r,results:o}){const[s,a]=b.useState(new Set),[u,c]=b.useState(!1),[h,m]=b.useState([]),g=b.useCallback(E=>{a(k=>{const I=new Set(k);return I.has(E)?I.delete(E):I.add(E),I})},[]),x=b.useCallback(async()=>{c(!0);try{const E=await fetch("http://localhost:3847/api/premium-agents/results");if(E.ok){const k=await E.json();Array.isArray(k)&&m(k)}}catch{}c(!1)},[]);b.useEffect(()=>{t&&x()},[t,x]);const y=o.length>0?o:h,v=new Map;y.forEach(E=>{v.set(E.agentId,E)});const _=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection"];function S(E){const k=E.data;switch(k.agentId){case"security-audit":return k.findings.length;case"compliance":return k.statuses.length;case"performance":return k.bottlenecks.length;case"dependency-risk":return k.risks.length;case"migration":return k.steps.length;case"api-contracts":return k.mismatches.length;case"drift-detection":return k.detections.length}}function N(E){const k=E.data;switch(k.agentId){case"security-audit":return f.jsx(LN,{data:k});case"compliance":return f.jsx(DN,{data:k});case"performance":return f.jsx($N,{data:k});case"dependency-risk":return f.jsx(ON,{data:k});case"migration":return f.jsx(FN,{data:k});case"api-contracts":return f.jsx(HN,{data:k});case"drift-detection":return f.jsx(VN,{data:k})}}return t?f.jsxs("div",{style:{position:"absolute",top:16,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:x,disabled:u,children:u?"...":"Refresh"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),f.jsx("div",{style:{padding:"8px 10px 12px"},children:u&&y.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):y.length===0?f.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",f.jsx("span",{style:{display:"block",marginTop:6,fontSize:10,color:"var(--accent-cyan)",opacity:.7,fontFamily:"'JetBrains Mono', monospace"},children:"Run agents to see results here"})]}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:_.map(E=>{const k=v.get(E);if(!k)return null;const I=IN[E],C=s.has(E),j=S(k);return f.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[f.jsxs("div",{onClick:()=>g(E),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:C?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:O=>{C||(O.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:O=>{C||(O.currentTarget.style.background="transparent")},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:12},children:I.icon}),f.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:I.label}),j>0&&f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:j})]}),f.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:f.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:C?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),C&&f.jsxs("div",{style:{padding:"6px 10px 10px"},children:[f.jsxs("div",{style:{marginBottom:8},children:[f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),f.jsx(TN,{value:k.confidence})]}),N(k),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(k.timestamp).toLocaleString()})]})]},E)})})}),y.length>0&&f.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[y.length," of ",_.length," agents reporting"]})]}):null}const WN=b.memo(BN);function li(t,r){return!t||t.length===0?!0:t.includes(r)}const UN=1500,YN={architecture:bg};function XN(t,r){const c=new Set(t.map(S=>S.id)),h=new Map,m=new Map;c.forEach(S=>{h.set(S,0),m.set(S,[])}),r.forEach(S=>{c.has(S.source)&&c.has(S.target)&&(m.get(S.source).push(S.target),h.set(S.target,(h.get(S.target)||0)+1))});const g=new Map,x=[];for(h.forEach((S,N)=>{S===0&&(x.push(N),g.set(N,0))});x.length>0;){const S=x.shift(),N=g.get(S);for(const E of m.get(S)||[]){const k=N+1;(!g.has(E)||g.get(E)<k)&&g.set(E,k),h.set(E,h.get(E)-1),h.get(E)===0&&x.push(E)}}t.forEach(S=>{g.has(S.id)||g.set(S.id,0)});const y=new Map;t.forEach(S=>{const N=g.get(S.id);y.has(N)||y.set(N,[]),y.get(N).push(S)});const v=new Map;return[...y.keys()].sort((S,N)=>S-N).forEach((S,N)=>{const E=y.get(S),k=100;E.forEach((I,C)=>{v.set(I.id,{x:100+N*320,y:k+C*160})})}),t.map(S=>{const N=v.get(S.id)||{x:100,y:100};return{id:S.id,type:"architecture",position:N,data:{label:S.label,layer:S.layer,nodeType:S.type,width:S.width,height:S.height,path:S.path,techStack:S.techStack,description:S.description},style:{width:S.width,zIndex:1}}})}function Ep(t,r="#64748b"){return t.map(o=>({id:o.id,source:o.source,target:o.target,label:o.label||void 0,labelStyle:o.label?{fill:"var(--text-secondary)",fontSize:10,fontWeight:500,fontFamily:"'JetBrains Mono', monospace"}:void 0,labelBgStyle:o.label?{fill:"var(--bg-secondary)",fillOpacity:.85,rx:4,ry:4}:void 0,labelBgPadding:[4,3],style:{stroke:o.color||r,strokeWidth:2,...o.style==="dashed"&&{strokeDasharray:"8 4"}},animated:o.animated||!1,type:"smoothstep",markerEnd:{type:ds.ArrowClosed,width:16,height:16,color:o.color||r}}))}function GN(){var Nr,xn,js;const[t,r,o]=Hk([]),[s,a,u]=Vk([]),[c,h]=b.useState(null),[m,g]=b.useState(!1),[x,y]=b.useState(null),[v]=b.useState([]),[_,S]=b.useState(!0),[N,E]=b.useState(null),[k,I]=b.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!1,patrol:!1,workflows:!1,chat:!1,premiumAgents:!1}}),[C,j]=b.useState(!1),[O,A]=b.useState(null),[H,q]=b.useState(!1),[J,ee]=b.useState(null),[,U]=b.useState(null),[X,ne]=b.useState(null),[P,K]=b.useState(null),[V,G]=b.useState(-1),[z,R]=b.useState(!1),[B,M]=b.useState(new Set),[$,ie]=b.useState(!1),[oe,de]=b.useState(new Set),[fe,me]=b.useState(new Set),[te,pe]=b.useState(null),[Ne,be]=b.useState(!1),[Ce,ke]=b.useState(!1),[ze,De]=b.useState(!1),[Te,Xe]=b.useState("patrol"),[Ct,ut]=b.useState(!1),[_t,It]=b.useState([]),[st,dn]=b.useState("develop"),[,Kn]=b.useState([]),[Qn,qt]=b.useState(),[Zt,In]=b.useState(null),[Jt,fn]=b.useState(null),[Tt,en]=b.useState(new Map),[yr,Xr]=b.useState(!1),Tn=b.useRef([]),[qn,Gr]=b.useState([]),Kr=50,[,Zn]=b.useState([]),[,Jn]=b.useState([]),[xt,zn]=b.useState(new Set),[jt,Qr]=b.useState(new Set),[ct,_o]=b.useState(()=>{const L=localStorage.getItem("archbyte-theme");return L==="dark"||L==="light"?L:"dark"});b.useEffect(()=>{document.documentElement.setAttribute("data-theme",ct),localStorage.setItem("archbyte-theme",ct)},[ct]);const[qr,tn]=b.useState(!1),[Rn,An]=b.useState(""),[hn,pn]=b.useState(new Set),[yi,nn]=b.useState(!1),[qe,vr]=b.useState(null),mn=ct==="dark"?"#64748b":"#94a3b8",jo="#fff",bo=20,rn=10,wt=b.useCallback(async()=>{try{await Io()}catch(L){console.error("Failed to load architecture:",L),E("Failed to connect to server"),to()}finally{S(!1)}},[]),Zr=async()=>{try{const L=await fetch("http://localhost:3847/api/tools-git");if(L.ok){const W=await L.json();fn(W)}}catch{}},Jr=async()=>{try{const L=await fetch("http://localhost:3847/api/config");if(L.ok){const W=await L.json();if(U(W),W.environments){qt(W.environments);const re=Object.keys(W.environments);re.length>0&&!re.includes(st)&&dn(re[0])}}}catch{}},vi=async()=>{try{const L=await fetch("http://localhost:3847/api/license");if(L.ok){const W=await L.json();I(W),j(!0)}}catch{j(!0)}},Po=async()=>{try{const L=await fetch("http://localhost:3847/api/project");if(L.ok){const W=await L.json();W&&ne(W)}}catch{}},Mo=async()=>{try{const L=await fetch("http://localhost:3847/api/analysis-status");if(L.ok){const W=await L.json();(W==null?void 0:W.status)==="error"&&W.error?ee(W.error):ee(null)}}catch{}},Io=async()=>{const L="http://localhost:3847/events",W="http://localhost:3847/api/architecture";Zr(),Jr(),Po(),vi(),Mo();try{const re=new EventSource(L);return re.onopen=()=>{console.log("SSE connected"),g(!0),E(null)},re.onmessage=le=>{try{const ue=JSON.parse(le.data);console.log("SSE message:",ue.type),ue.architecture&&xr(ue.architecture),ue.type==="git_update"&&ue.gitInfo&&Kn(ue.gitInfo),ue.type==="premium_agent_result"&&ue.premiumResults&&It(ue.premiumResults)}catch(ue){console.error("Failed to parse SSE message:",ue)}},re.onerror=le=>{console.error("SSE error:",le),re.close(),g(!1),eo(W)},()=>re.close()}catch{eo(W)}},eo=async L=>{try{const W=await fetch(L);if(W.ok){const re=await W.json();xr(re),g(!0)}else to()}catch{to()}},to=()=>{const L={nodes:[{id:"frontend",type:"component",label:`Frontend
66
+ (Web App)`,layer:"presentation",x:150,y:170,width:200,height:100,color:"#d0ebff"},{id:"backend",type:"service",label:`Backend
67
+ (API)`,layer:"application",x:150,y:370,width:200,height:100,color:"#ffe8cc"},{id:"database",type:"database",label:"Database",layer:"data",x:150,y:570,width:200,height:80,color:"#b2f2bb"}],edges:[{id:"e1",source:"frontend",target:"backend",color:"#1971c2"},{id:"e2",source:"backend",target:"database",color:"#2f9e44"}],flows:[],lastUpdated:new Date().toISOString(),version:1};xr(L)},xr=L=>{h(L),y(L.lastUpdated),L.gitInfo&&Kn(L.gitInfo),L.environments&&qt(L.environments)};b.useEffect(()=>{if(!c)return;const L=c.nodes.filter(le=>li(le.environments,st)&&!oe.has(le.id)&&!fe.has(le.layer)),W=new Set(L.map(le=>le.id)),re=c.edges.filter(le=>li(le.environments,st)&&W.has(le.source)&&W.has(le.target));r(XN(L,re)),a(Ep(re,mn))},[c,st,oe,fe,mn]),b.useEffect(()=>{wt()},[wt]),b.useEffect(()=>{if(!z||!P)return;const L=setInterval(()=>{G(W=>{const re=W+1;if(re>=P.steps.length)return M(new Set([P.steps[0].edge])),0;const le=new Set;for(let ue=0;ue<=re;ue++)le.add(P.steps[ue].edge);return M(le),re})},UN);return()=>clearInterval(L)},[z,P]),b.useEffect(()=>{if(!c)return;const L=c.nodes.filter(ye=>li(ye.environments,st)),W=new Set(L.map(ye=>ye.id)),re=c.edges.filter(ye=>li(ye.environments,st)&&W.has(ye.source)&&W.has(ye.target)),le=new Map;P&&P.steps.forEach((ye,Re)=>{le.has(ye.edge)||le.set(ye.edge,Re+1)});const ue=re.map(ye=>{const Re=B.has(ye.id),Pe=P==null?void 0:P.steps.some($e=>$e.edge===ye.id),Le=le.get(ye.id);return{id:ye.id,source:ye.source,target:ye.target,label:Re&&Le?`${Le}`:void 0,labelStyle:Re&&Le?{fill:jo,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:Re&&Le?{fill:(P==null?void 0:P.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:Re?(P==null?void 0:P.color)||ye.color:ye.color||mn,strokeWidth:Re?6:3,opacity:P?Pe?1:.15:1,filter:Re?"brightness(0.85) saturate(1.4)":void 0},animated:Re,type:"smoothstep"}});a(ue)},[B,P,c,st,mn,jo]);const Ge=L=>{K(L),G(0),M(new Set([L.steps[0].edge])),R(!0),ie(!0)},wr=()=>{if(R(!1),K(null),G(-1),M(new Set),ie(!1),c){const L=c.nodes.filter(le=>li(le.environments,st)),W=new Set(L.map(le=>le.id)),re=c.edges.filter(le=>li(le.environments,st)&&W.has(le.source)&&W.has(le.target));a(Ep(re,mn))}},no=()=>{R(!1)},To=()=>{P&&R(!0)},gn=b.useRef(oe);b.useEffect(()=>{gn.current=oe},[oe]);const Ue=b.useCallback(()=>{Zn(L=>{const W={nodes:[...Tn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)},re=[...L,W];return re.length>Kr&&re.shift(),re}),Jn([])},[s]),zo=b.useCallback(L=>{In(L),setTimeout(()=>In(null),3e3)},[]),er=b.useCallback(L=>{Ue(),de(W=>new Set([...W,L])),pe(null)},[Ue]),zt=b.useCallback(L=>{de(W=>{const re=new Set(W);return re.delete(L),re})},[]),xi=b.useCallback(()=>{de(new Set)},[]),bt=b.useCallback(L=>{me(W=>{const re=new Set(W);return re.has(L)?re.delete(L):re.add(L),re})},[]),wi=b.useCallback((L,W)=>{pe(W.id)},[]),Si=b.useCallback(()=>{pe(null)},[]);b.useEffect(()=>{Tn.current=t},[t]);const ki=b.useCallback(L=>{o(L);const W=L.some(le=>le.type==="position"&&le.dragging===!1&&le.position),re=L.some(le=>le.type==="dimensions"&&le.dimensions&&le.resizing===!1);(W||re)&&Ue(),L.forEach(le=>{if(le.type==="position"&&le.dragging===!1&&le.position){const ue=Tn.current.find(ye=>ye.id===le.id);ue&&en(ye=>{var Le,$e,We,ht;const Re=new Map(ye),Pe=Re.get(le.id);return Re.set(le.id,{id:le.id,x:le.position.x,y:le.position.y,width:(Pe==null?void 0:Pe.width)??((Le=ue.style)==null?void 0:Le.width)??(($e=ue.data)==null?void 0:$e.width)??100,height:(Pe==null?void 0:Pe.height)??((We=ue.style)==null?void 0:We.height)??((ht=ue.data)==null?void 0:ht.height)??60}),Re})}if(le.type==="dimensions"&&le.dimensions&&le.resizing===!1){const ue=Tn.current.find(ye=>ye.id===le.id);ue&&en(ye=>{const Re=new Map(ye),Pe=Re.get(le.id);return Re.set(le.id,{id:le.id,x:(Pe==null?void 0:Pe.x)??ue.position.x,y:(Pe==null?void 0:Pe.y)??ue.position.y,width:le.dimensions.width,height:le.dimensions.height}),Re})}})},[o,Ue]),Ln=b.useCallback(async()=>{if(Tt.size!==0){Xr(!0);try{const L=Array.from(Tt.values()),W=await fetch("http://localhost:3847/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:L})});if(W.ok)en(new Map),console.log("Changes saved successfully");else{const re=await W.json();console.error("Failed to save changes:",re)}}catch(L){console.error("Error saving changes:",L)}finally{Xr(!1)}}},[Tt]),Sr=b.useCallback(()=>{en(new Map),wt()},[wt]),Vt=b.useCallback(()=>{Zn(L=>{if(L.length===0)return L;const W=[...L],re=W.pop();if(Jn(le=>[...le,{nodes:[...Tn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)}]),r(re.nodes),a(re.edges),de(re.hiddenNodeIds),c){const le=new Map;re.nodes.forEach(ue=>{var Re,Pe,Le,$e;const ye=c.nodes.find(We=>We.id===ue.id);if(ye){const We=ue.position.x,ht=ue.position.y,Oe=((Re=ue.style)==null?void 0:Re.width)??((Pe=ue.data)==null?void 0:Pe.width)??100,rt=((Le=ue.style)==null?void 0:Le.height)??(($e=ue.data)==null?void 0:$e.height)??60;(We!==ye.x||ht!==ye.y||Oe!==ye.width||rt!==ye.height)&&le.set(ue.id,{id:ue.id,x:We,y:ht,width:Oe,height:rt})}}),en(le)}return W})},[s,r,a,c]),tr=b.useCallback(()=>{Jn(L=>{if(L.length===0)return L;const W=[...L],re=W.pop();if(Zn(le=>[...le,{nodes:[...Tn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)}]),r(re.nodes),a(re.edges),de(re.hiddenNodeIds),c){const le=new Map;re.nodes.forEach(ue=>{var Re,Pe,Le,$e;const ye=c.nodes.find(We=>We.id===ue.id);if(ye){const We=ue.position.x,ht=ue.position.y,Oe=((Re=ue.style)==null?void 0:Re.width)??((Pe=ue.data)==null?void 0:Pe.width)??100,rt=((Le=ue.style)==null?void 0:Le.height)??(($e=ue.data)==null?void 0:$e.height)??60;(We!==ye.x||ht!==ye.y||Oe!==ye.width||rt!==ye.height)&&le.set(ue.id,{id:ue.id,x:We,y:ht,width:Oe,height:rt})}}),en(le)}return W})},[s,r,a,c]),Ro=b.useCallback(({nodes:L})=>{Qr(new Set(L.map(W=>W.id))),L.length===1?pe(L[0].id):L.length===0&&pe(null)},[]),Ao=b.useCallback(()=>{if(jt.size===0&&!te)return;Ue();const L=jt.size>0?jt:new Set([te]);de(W=>new Set([...W,...L])),Qr(new Set),pe(null)},[jt,te,Ue]),kr=b.useCallback(()=>{const L=jt.size>0?jt:te?new Set([te]):new Set;if(L.size===0)return;const W=t.filter(re=>L.has(re.id));Gr(W)},[t,jt,te]),nr=b.useCallback(()=>{if(qn.length===0)return;Ue();const L=50,W=qn.map((re,le)=>{var ue;return{...re,id:`${re.id}-copy-${Date.now()}-${le}`,position:{x:re.position.x+L,y:re.position.y+L},selected:!0,data:{...re.data,label:`${((ue=re.data)==null?void 0:ue.label)||re.id} (copy)`}}});r(re=>[...re.map(le=>({...le,selected:!1})),...W]),W.forEach(re=>{en(le=>{var ye,Re,Pe,Le;const ue=new Map(le);return ue.set(re.id,{id:re.id,x:re.position.x,y:re.position.y,width:((ye=re.style)==null?void 0:ye.width)||((Re=re.data)==null?void 0:Re.width)||100,height:((Pe=re.style)==null?void 0:Pe.height)||((Le=re.data)==null?void 0:Le.height)||60}),ue})})},[qn,r,Ue]),yn=b.useCallback((L,W)=>{const re=jt.size>0?jt:te?new Set([te]):new Set;re.size!==0&&(Ue(),r(le=>le.map(ue=>{if(re.has(ue.id)&&!xt.has(ue.id)){const ye={x:ue.position.x+L,y:ue.position.y+W};return en(Re=>{var Le,$e,We,ht;const Pe=new Map(Re);return Pe.set(ue.id,{id:ue.id,x:ye.x,y:ye.y,width:((Le=ue.style)==null?void 0:Le.width)||(($e=ue.data)==null?void 0:$e.width)||100,height:((We=ue.style)==null?void 0:We.height)||((ht=ue.data)==null?void 0:ht.height)||60}),Pe}),{...ue,position:ye}}return ue})))},[jt,te,xt,r,Ue]),vn=b.useCallback(L=>{zn(W=>{const re=new Set(W);return re.has(L)?re.delete(L):re.add(L),re})},[]),Lo=b.useCallback(L=>{const W={id:`edge-${L.source}-${L.target}-${Date.now()}`,source:L.source,target:L.target,type:"smoothstep",animated:!0,style:{stroke:ct==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(re=>wm(W,re))},[a,ct]),Ei=b.useCallback((L,W)=>{Ue(),a(re=>i1(L,W,re))},[a,Ue]),Be=b.useCallback(async()=>{const L=document.querySelector(".react-flow");if(L){tn(!0);try{const W=await sN(L,{backgroundColor:ct==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,re.href=W,re.click()}catch(W){console.error("Failed to export PNG:",W)}finally{tn(!1)}}},[ct]),Es=b.useCallback(async()=>{const L=document.querySelector(".react-flow");if(L){tn(!0);try{const W=await jg(L,{backgroundColor:ct==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,re.href=W,re.click()}catch(W){console.error("Failed to export SVG:",W)}finally{tn(!1)}}},[ct]),Er=b.useCallback(async L=>{tn(!0);try{const W=await fetch(`http://localhost:3847/api/export?format=${L}`);if(!W.ok)throw new Error("Export failed");const re=await W.blob(),le=L==="mermaid"?"mmd":L==="plantuml"?"puml":L==="markdown"?"md":L,ue=document.createElement("a");ue.download=`architecture.${le}`,ue.href=URL.createObjectURL(re),ue.click(),URL.revokeObjectURL(ue.href)}catch(W){console.error(`Failed to export ${L}:`,W)}finally{tn(!1)}},[]),Ni=b.useCallback(()=>{if(!c)return;Ue();const L=250,W=100,re=100,le=t.map((ue,ye)=>({...ue,position:{x:W+ye*L,y:re}}));r(le)},[c,t,r,Ue]),Ns=b.useCallback(()=>{if(!c)return;Ue();const L=150,W=100,re=100,le=t.map((ue,ye)=>({...ue,position:{x:W,y:re+ye*L}}));r(le)},[c,t,r,Ue]),Cs=b.useCallback(()=>{if(!c)return;Ue();const L=280,W=180,re=100,le=100,ue=Math.ceil(Math.sqrt(t.length)),ye=t.map((Re,Pe)=>({...Re,position:{x:re+Pe%ue*L,y:le+Math.floor(Pe/ue)*W}}));r(ye)},[c,t,r,Ue]),_s=b.useCallback(()=>{if(!c)return;Ue();const L=320,W=160,re=100,le=100,ue=new Set(t.map(Oe=>Oe.id)),ye=new Map,Re=new Map;ue.forEach(Oe=>{ye.set(Oe,0),Re.set(Oe,[])}),s.forEach(Oe=>{ue.has(Oe.source)&&ue.has(Oe.target)&&(Re.get(Oe.source).push(Oe.target),ye.set(Oe.target,(ye.get(Oe.target)||0)+1))});const Pe=new Map,Le=[];for(ye.forEach((Oe,rt)=>{Oe===0&&(Le.push(rt),Pe.set(rt,0))});Le.length>0;){const Oe=Le.shift(),rt=Pe.get(Oe);for(const Bt of Re.get(Oe)||[]){const Cr=rt+1;(!Pe.has(Bt)||Pe.get(Bt)<Cr)&&Pe.set(Bt,Cr),ye.set(Bt,ye.get(Bt)-1),ye.get(Bt)===0&&Le.push(Bt)}}t.forEach(Oe=>{Pe.has(Oe.id)||Pe.set(Oe.id,0)});const $e=new Map;t.forEach(Oe=>{const rt=Pe.get(Oe.id);$e.has(rt)||$e.set(rt,[]),$e.get(rt).push(Oe)});const We=[];[...$e.keys()].sort((Oe,rt)=>Oe-rt).forEach((Oe,rt)=>{$e.get(Oe).forEach((Cr,bs)=>{We.push({...Cr,position:{x:re+rt*L,y:le+bs*W}})})}),r(We)},[c,t,s,r,Ue]),Ci=b.useCallback(()=>{if(!c)return;Ue();const L=250,W=180,re=100,le=100,ue={};t.forEach(Le=>{var We;const $e=((We=Le.data)==null?void 0:We.layer)||"application";ue[$e]||(ue[$e]=[]),ue[$e].push(Le)});const ye=["presentation","application","data","external","deployment"];let Re=le;const Pe=[];ye.forEach(Le=>{const $e=ue[Le]||[];$e.forEach((We,ht)=>{Pe.push({...We,position:{x:re+ht*L,y:Re}})}),$e.length>0&&(Re+=W)}),Object.entries(ue).forEach(([Le,$e])=>{ye.includes(Le)||($e.forEach((We,ht)=>{Pe.push({...We,position:{x:re+ht*L,y:Re}})}),Re+=W)}),r(Pe)},[c,t,r,Ue]),rr=b.useCallback(L=>{if(!L||!c){pn(new Set);return}const W=new Set;W.add(L),c.edges.forEach(re=>{re.source===L&&(W.add(re.target),W.add(re.id)),re.target===L&&(W.add(re.source),W.add(re.id))}),pn(W)},[c]),Dn=b.useMemo(()=>{if(!Rn.trim())return new Set;const L=Rn.toLowerCase(),W=new Set;return t.forEach(re=>{var ue;(((ue=re.data)==null?void 0:ue.label)||"").toLowerCase().includes(L)&&W.add(re.id)}),W},[Rn,t]),$n=b.useCallback(async L=>{try{await fetch("http://localhost:3847/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:L})})}catch(W){console.error("Failed to open file:",W)}},[]),On=b.useCallback((L,W)=>{if(!c)return;const re=c.nodes.find(le=>le.id===W.id);re&&(vr(re),nn(!0))},[c]);b.useEffect(()=>{const L=W=>{if(W.target instanceof HTMLInputElement||W.target instanceof HTMLTextAreaElement)return;const le=navigator.platform.toUpperCase().indexOf("MAC")>=0?W.metaKey:W.ctrlKey;if(W.key==="Backspace"||W.key==="Delete"){W.preventDefault(),Ao();return}if(le&&W.key==="c"){W.preventDefault(),kr();return}if(le&&W.key==="v"){W.preventDefault(),nr();return}if(le&&W.shiftKey&&W.key==="z"){W.preventDefault(),tr();return}if(le&&W.key==="z"){W.preventDefault(),Vt();return}if(le&&W.key==="s"){W.preventDefault(),Ln();return}if(W.key==="Escape"){An(""),pn(new Set),nn(!1);return}if(W.key==="ArrowUp"){W.preventDefault(),yn(0,W.shiftKey?-rn*5:-rn);return}if(W.key==="ArrowDown"){W.preventDefault(),yn(0,W.shiftKey?rn*5:rn);return}if(W.key==="ArrowLeft"){W.preventDefault(),yn(W.shiftKey?-rn*5:-rn,0);return}if(W.key==="ArrowRight"){W.preventDefault(),yn(W.shiftKey?rn*5:rn,0);return}if(le&&W.key==="l"&&te){W.preventDefault(),vn(te);return}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Ao,kr,nr,Ln,yn,vn,te,Vt,tr]);const or=b.useMemo(()=>c?c.nodes.filter(L=>oe.has(L.id)):[],[c,oe]);return b.useEffect(()=>{c&&r(L=>L.map(W=>({...W,data:{...W.data,highlighted:W.id===Zt}})))},[Zt,c]),_?f.jsx("div",{className:"app",children:f.jsxs("div",{className:"loading",children:[f.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):f.jsxs("div",{className:"app",children:[f.jsxs("div",{className:"branding-header",children:[f.jsxs("div",{className:"archbyte-brand",children:[f.jsx("span",{className:"archbyte-name",children:"ArchByte"}),X?f.jsx(EN,{projectInfo:X}):f.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),k.loggedIn&&f.jsx("div",{className:"branding-account",children:k.email&&f.jsxs("span",{className:"account-email",children:[k.email,k.tier==="premium"&&f.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),f.jsxs("div",{className:"toolbar",children:[f.jsxs("div",{className:"toolbar-left",children:[f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"View"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("input",{type:"text",placeholder:"Search nodes...",value:Rn,onChange:L=>An(L.target.value),className:"toolbar-search"}),f.jsxs(Al,{trigger:"→ Layout ▾",triggerClassName:"toolbar-btn",children:[f.jsx("button",{className:"dropdown-item",onClick:_s,children:"→ Flow"}),f.jsx("button",{className:"dropdown-item",onClick:Cs,children:"⊡ Grid"}),f.jsx("button",{className:"dropdown-item",onClick:Ci,children:"⊞ By Layer"}),f.jsx("button",{className:"dropdown-item",onClick:Ni,children:"↔ Horizontal"}),f.jsx("button",{className:"dropdown-item",onClick:Ns,children:"↕ Vertical"})]}),f.jsx(Al,{trigger:fe.size>0?`☰ Layers (${5-fe.size}/5) ▾`:"☰ Layers ▾",triggerClassName:`toolbar-btn ${fe.size>0?"has-hidden":""}`,children:["presentation","application","data","external","deployment"].map(L=>f.jsxs("button",{className:`dropdown-item layer-dropdown-item ${fe.has(L)?"hidden-layer":""}`,onClick:()=>bt(L),children:[f.jsx("div",{className:`legend-color ${L}`}),f.jsx("span",{children:L.charAt(0).toUpperCase()+L.slice(1)}),f.jsx("span",{className:"layer-toggle-indicator",children:fe.has(L)?"○":"●"})]},L))}),f.jsx("button",{className:`toolbar-btn ${Ne?"active":""}`,onClick:()=>be(!Ne),children:"Stats"})]})]}),f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("button",{className:`toolbar-btn premium-btn ${k.features.validate?"":"premium-locked"} ${Ce?"active":""}`,onClick:()=>{if(!k.features.validate){A("Validate");return}ke(!Ce)},children:"Validate"}),f.jsxs(Al,{trigger:P?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"flow-dot-inline",style:{background:P.color}}),P.name]}):"▶ Flows ▾",triggerClassName:`toolbar-btn ${P?"has-active-flow":""}`,children:[P&&f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dropdown-item flow-clear",onClick:wr,children:"⏹ Clear active flow"}),f.jsx("div",{className:"dropdown-separator"})]}),c!=null&&c.flows&&c.flows.length>0?c.flows.map(L=>f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(P==null?void 0:P.id)===L.id?"active":""}`,onClick:()=>{(P==null?void 0:P.id)===L.id?wr():Ge(L)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:L.color}}),f.jsx("span",{className:"flow-dropdown-name",children:L.name}),(P==null?void 0:P.id)===L.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},L.id)):f.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]})]})]}),f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Ops"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("button",{className:`toolbar-btn premium-btn ${k.features.patrol?"":"premium-locked"} ${ze&&Te==="patrol"?"active":""}`,title:k.features.patrol?"":"Available in Pro",onClick:()=>{if(!k.features.patrol){A("Patrol");return}ze&&Te==="patrol"?De(!1):(Xe("patrol"),De(!0),ut(!1))},children:"Patrol"}),f.jsx("button",{className:`toolbar-btn premium-btn ${k.features.patrol?"":"premium-locked"} ${ze&&Te==="workflow"?"active":""}`,title:k.features.patrol?"":"Available in Pro",onClick:()=>{if(!k.features.patrol){A("Workflows");return}ze&&Te==="workflow"?De(!1):(Xe("workflow"),De(!0),ut(!1))},children:"Workflows"}),f.jsx("button",{className:`toolbar-btn premium-btn ${k.features.premiumAgents?"":"premium-locked"} ${Ct?"active":""}`,title:k.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!k.features.premiumAgents){A("Pro Agents");return}Ct?ut(!1):(ut(!0),De(!1))},children:"Agents"})]})]})]}),f.jsxs("div",{className:"toolbar-right",children:[J&&f.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>ee(null),title:J,children:"Analysis failed"}),f.jsxs(Al,{trigger:qr?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:qr,children:[f.jsx("div",{className:"dropdown-label",children:"Image"}),f.jsx("button",{className:"dropdown-item",onClick:Be,children:"PNG — Raster image"}),f.jsx("button",{className:"dropdown-item",onClick:Es,children:"SVG — Vector image"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Diagram"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Er("mermaid"),children:"Mermaid — .mmd"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Er("plantuml"),children:"PlantUML — .puml"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Er("dot"),children:"Graphviz DOT — .dot"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Document"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Er("markdown"),children:"Markdown — .md"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Er("json"),children:"JSON — .json"})]}),f.jsx("button",{className:"toolbar-btn-icon",onClick:()=>_o(ct==="dark"?"light":"dark"),title:`Switch to ${ct==="dark"?"light":"dark"} mode`,children:ct==="dark"?"☀":"☽"})]})]}),f.jsx(fN,{selectedEnvironment:st,environments:Qn,onSelectEnvironment:dn}),f.jsxs("div",{className:"canvas-container",children:[f.jsx("div",{className:"watermark",children:"@diabhey"}),f.jsxs(fg,{nodes:t.map(L=>({...L,draggable:!xt.has(L.id),data:{...L.data,locked:xt.has(L.id),isConnected:hn.size>0?hn.has(L.id):null,isSearchMatch:Rn?Dn.has(L.id):null}})),edges:s.map(L=>{var W;return{...L,style:{...L.style,opacity:hn.size>0?hn.has(L.id)?1:.15:1,strokeWidth:hn.has(L.id)?3:((W=L.style)==null?void 0:W.strokeWidth)||2}}}),onNodesChange:ki,onEdgesChange:u,onNodeClick:(L,W)=>{wi(L,W),rr(W.id)},onNodeDoubleClick:On,onPaneClick:()=>{Si(),rr(null)},onConnect:Lo,onReconnect:Ei,edgesReconnectable:!0,onSelectionChange:Ro,nodeTypes:YN,connectionMode:ko.Loose,snapToGrid:!0,snapGrid:[bo,bo],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[f.jsx(pg,{color:ct==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Yn.Dots}),f.jsx(gg,{})]}),te&&f.jsxs("div",{className:"node-actions-panel",children:[f.jsxs("div",{className:"node-actions-title",children:[xt.has(te)&&f.jsx("span",{className:"lock-icon",children:"🔒"}),((xn=(Nr=t.find(L=>L.id===te))==null?void 0:Nr.data)==null?void 0:xn.label)||te]}),f.jsxs("div",{className:"node-actions-buttons",children:[f.jsx("button",{className:`panel-btn ${xt.has(te)?"amber":"cyan"}`,onClick:()=>vn(te),title:"Lock/Unlock (Cmd+L)",children:xt.has(te)?"🔓 Unlock":"🔒 Lock"}),f.jsx("button",{className:"panel-btn red",onClick:()=>er(te),title:"Hide (Delete key)",children:"Hide"})]}),f.jsx("div",{className:"node-actions-hint",children:"Arrow keys to move • Shift for faster"})]}),yi&&qe&&f.jsxs("div",{className:"node-details-panel",children:[f.jsxs("div",{className:"node-details-header",children:[f.jsxs("div",{children:[f.jsx("div",{className:"node-details-title",children:qe.label.split(`
68
+ `)[0]}),f.jsxs("div",{className:"node-details-type",children:[qe.layer," • ",qe.type]})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>nn(!1),children:"×"})]}),qe.path&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Path"}),f.jsx("div",{className:"node-details-path",children:qe.path})]}),qe.techStack&&qe.techStack.length>0&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),f.jsx("div",{className:"node-details-tech-stack",children:qe.techStack.map((L,W)=>f.jsx("span",{className:"tech-badge",children:L},W))})]}),f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Connections"}),f.jsxs("div",{className:"node-details-connections",children:[c==null?void 0:c.edges.filter(L=>L.source===qe.id||L.target===qe.id).map(L=>{const W=L.source===qe.id,re=W?L.target:L.source,le=c==null?void 0:c.nodes.find(ue=>ue.id===re);return f.jsxs("div",{className:"connection-item-detailed",children:[f.jsxs("div",{className:"connection-header",children:[f.jsx("span",{className:"connection-arrow",children:W?"→":"←"}),f.jsx("span",{className:"connection-target",children:(le==null?void 0:le.label.split(`
69
+ `)[0])||re})]}),L.label&&f.jsx("div",{className:"connection-label",children:L.label})]},L.id)}),(c==null?void 0:c.edges.filter(L=>L.source===qe.id||L.target===qe.id).length)===0&&f.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),f.jsxs("div",{className:"node-details-actions",children:[qe.path&&f.jsx("button",{className:"panel-btn cyan",onClick:()=>$n(qe.path),children:"Open in VS Code"}),f.jsx("button",{className:"panel-btn",onClick:()=>{rr(qe.id),nn(!1)},children:"Highlight Deps"})]})]}),Tt.size>0&&f.jsxs("div",{className:"save-panel",children:[f.jsxs("span",{className:"save-panel-text",children:[Tt.size," unsaved change",Tt.size!==1?"s":""]}),f.jsx("button",{className:"save-btn",onClick:Ln,disabled:yr,children:yr?"Saving...":"Save Changes"}),f.jsx("button",{className:"discard-btn",onClick:Sr,disabled:yr,children:"Discard"})]}),or.length>0&&f.jsxs("div",{className:"hidden-nodes-panel",children:[f.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",or.length,")",f.jsx("button",{className:"panel-btn cyan small",onClick:xi,children:"Show All"})]}),f.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:or.map(L=>f.jsxs("div",{className:"hidden-node-item",children:[f.jsx("span",{className:"hidden-node-name",children:L.label.split(`
70
+ `)[0]}),f.jsx("button",{className:"panel-btn green small",onClick:()=>zt(L.id),children:"Show"})]},L.id))})]}),P&&f.jsxs("div",{className:"flow-progress-bar",children:[f.jsx("span",{className:"flow-progress-dot",style:{background:P.color}}),f.jsx("span",{className:"flow-progress-name",children:P.name}),f.jsx("div",{className:"flow-progress-steps",children:P.steps.map((L,W)=>f.jsx("div",{className:`flow-progress-step ${W<=V?"active":""} ${W===V?"current":""}`,style:{borderColor:W<=V?P.color:void 0},title:L.label,children:L.label},W))}),f.jsxs("div",{className:"flow-progress-controls",children:[z?f.jsx("button",{className:"flow-progress-btn",onClick:no,title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-progress-btn",onClick:To,title:"Resume",children:"▶"}),f.jsx("button",{className:"flow-progress-btn stop",onClick:wr,title:"Stop",children:"⏹"})]})]}),$&&P&&c&&f.jsx(bN,{flow:P,architecture:c,onClose:wr}),f.jsx(gN,{visible:Ne,onClose:()=>be(!1)}),f.jsx(vN,{visible:Ce,onClose:()=>ke(!1),onHighlightNode:L=>{zo(L),rr(L)}}),ze&&f.jsxs("div",{className:"ops-panel",children:[f.jsxs("div",{className:"ops-header",children:[f.jsxs("div",{className:"ops-tabs",children:[f.jsx("button",{className:`ops-tab ${Te==="patrol"?"active":""}`,onClick:()=>Xe("patrol"),children:"Patrol"}),f.jsx("button",{className:`ops-tab ${Te==="workflow"?"active":""}`,onClick:()=>Xe("workflow"),children:"Workflows"})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>De(!1),children:"x"})]}),f.jsx(wN,{visible:Te==="patrol"}),f.jsx(kN,{visible:Te==="workflow"})]}),f.jsx(WN,{visible:Ct,onClose:()=>ut(!1),results:_t}),v.length>0&&f.jsxs("div",{className:"agent-panel",children:[f.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),v.map((L,W)=>f.jsxs("div",{className:"agent-item",children:[f.jsx("div",{className:`agent-dot ${W===0?"active":""}`}),f.jsx("span",{className:"agent-name",children:L.agentName}),f.jsx("span",{className:"agent-target",children:L.targetComponent||L.action})]},W))]})]}),f.jsxs("div",{className:"status-bar",children:[f.jsxs("div",{className:"status-left",children:[f.jsxs("div",{className:"status-indicator",children:[f.jsx("div",{className:`status-dot ${m?"":"disconnected"}`}),f.jsx("span",{children:m?"Live":"Offline"})]}),N&&f.jsx("span",{style:{color:"var(--accent-red)"},children:N})]}),f.jsx("div",{className:"status-center"}),f.jsxs("div",{className:"status-right",children:[f.jsx("span",{children:x?`Updated ${new Date(x).toLocaleTimeString()}`:"Waiting..."}),Jt?f.jsxs("span",{className:"git-status",children:[Jt.repo&&f.jsx("a",{href:((js=Jt.remoteUrl)==null?void 0:js.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Jt.remoteUrl||"",children:Jt.repo}),f.jsx("span",{className:"git-branch",children:Jt.branch}),f.jsx("span",{className:"git-hash",children:Jt.commit})]}):f.jsxs("span",{children:["v",(c==null?void 0:c.version)||1]})]})]}),H&&f.jsx(MN,{onComplete:()=>{q(!1),wt()}}),O&&f.jsx(lN,{feature:O,onClose:()=>A(null)})]})}cy.createRoot(document.getElementById("root")).render(f.jsx(Np.StrictMode,{children:f.jsx(GN,{})}));